5.2.2 Polar coordinates

5.2.2.1 [404] no θ dependency, fixed boundary, general case
5.2.2.2 [405] no θ dependency. Specific example. Both initial conditions not zero
5.2.2.3 [406] no θ dependency. Specific example. Both initial conditions not zero
5.2.2.4 [407] no θ dependency. Using integral transforms. Source present. Specific example
5.2.2.5 [408] no θ dependency. Using integral transforms. Source present. Specific example
5.2.2.6 [409] θ dependency, fixed on edges, general solution
5.2.2.7 [410] θ dependency, fixed on edges, zero initial velocity, general solution
5.2.2.8 [411] θ dependency, fixed on edges, zero initial velocity, specific example
5.2.2.9 [412] θ dependency, fixed on edges, zero initial position, specific example
5.2.2.10 [413] θ dependency, fixed on edges, zero initial position with internal source (Haberman 8.5.5. (b)

5.2.2.1 [404] no θ dependency, fixed boundary, general case

problem number 404

Added January 12, 2020

Circular disk. fixed edge of disk, no θ dependency, with initial position and velocity given

Solve for u(r,t) with 0<r<a and t>0. utt=c2(urr+1rur) With boundary conditions u(a,t)=0

With initial conditions u(r,0)=f(r)ut(r,0)=g(r)

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, t], {t, 2}] == c^2*(D[u[r, t], {r, 2}] + 1/r*D[u[r, t], r]); 
ic  = {u[r, 0] == f[r], Derivative[0, 1][u][r, 0] == g[r]}; 
bc  = u[a, t] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[r, t], {r, t},Assumptions->{t>0,r>0,r<a}], 60*10]]; 
sol =  sol /. K[1] -> n;
 

{{u(r,t)n=12J0(rj0,na)(c2j0,ncos(c2tj0,na)0arJ0(rj0,na)f(r)dr+a(0arJ0(rj0,na)g(r)dr)sin(c2tj0,na))a2c2(J0(j0,n)2+J1(j0,n)2)j0,n if j0,n0}}

Maple

restart; 
pde := diff(u(r, t), t$2) = c^2*( diff(u(r,t), r$2)+ (1/r)* diff(u(r,t),r)  ); 
ic  := u(r,0)=f(r), D[2](u)(r,0)=g(r); 
bc  := u(a,t)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc], u(r, t),HINT = boundedseries(r=0)) assuming t>0,r>0,r<a),output='realtime'));
 

u(r,t)=1c2(invlaplace(BesselK(0,src)BesselK(0,sac)a(f(a)s+g(a))daBesselI(0,sac)(BesselK(0,sac))1,s,t)invlaplace(BesselK(0,src)BesselI(0,sac)a(f(a)s+g(a))da,s,t)invlaplace(BesselK(0,src)(g(r)+sf(r))rdrBesselI(0,src),s,t)+invlaplace(BesselI(0,src)(g(r)+sf(r))rdrBesselK(0,src),s,t)) Has unresolved Invlaplace calls

Hand solution

Assuming u=T(t)R(r). Substituting in the PDE gives1c2TR=RT+1rRT Dividing by RT1c2TT=RR+1rRR Hence1c2TT=λRR+1rRR=λ

The time ODE isT+c2λT=0 And the r ODE is (Sturm-Liouville)

rR+R+λrR=0 Where p=r,q=0,σ=r. This is singular SL.  The solution turns out to be  Rn(r)=AnJ0(λnr)n=1,2,3, Where λn is found from roots of 0=Jn(λna) giving the eigenvalues. Now the time ODE is solvedTn+c2λnTn=0Tn=Bncos(cλnt)+Cnsin(cλnt)n=1,2,3,,

Hence the solution isu(r,t)=n=1TnRn(1)=n=1Ancos(cλnt)J0(λnr)+Bnsin(cλnt)J0(λnr)

Now initial conditions u(r,0)=f(r) is used to find Anusing orthogonality. At t=0 the solution simplifies to u(r,0)=n=1AnJ0(λnr) Hencef(r)=n=1AnJ0(λnr)0af(r)J0(λnr)rdr=An0aJ02(λnr)rdrAn=0af(r)J0(λnr)rdr0aJ02(λnr)rdr

Now we will look at the second initial conditions ut(r,0)=g(r). Taking derivative w.r.t. time t of the solution in (1) givesut(r,t)=n=1cλnAnsin(cλnt)J0(λnr)+Bncλncos(cλnt)J0(λnr) At time t=0 the above becomes g(r)=n=1BncλnJ0(λnr) Now orthogonality is used. The above becomesBn=0ag(r)J0(λnr)rdrcλn0aJ02(λnr)rdr Summary of solutionu(r,t)=n=1Ancos(cλnt)J0(λnr)+Bnsin(cλnt)J0(λnr)An=0af(r)J0(λnr)rdr0aJ02(λnr)rdrBn=0ag(r)J0(λnr)rdrcλn0aJ02(λnr)rdr With λn being the solutions for 0=J0(λna). We have infinite number of zeros. This generates all the needed λn. Hence λna=BesselJZero(0,n), therefore λn=aBesselJZero(0,n)

____________________________________________________________________________________

5.2.2.2 [405] no θ dependency. Specific example. Both initial conditions not zero

problem number 405

Taken from Mathematica helps pages on DSolve

In circular disk. fixed edge of disk, no θ dependency, with initial position and velocity given

Solve for u(r,t) with 0<r<1 and t>0. utt=c2(urr+1rur) With boundary conditions u(1,t)=0

With initial conditions u(r,0)=1ut(r,0)=r3

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, t], {t, 2}] == c^2*(D[u[r, t], {r, 2}] + 1/r*D[u[r, t], r]); 
ic  = {u[r, 0] == 1, Derivative[0, 1][u][r, 0] == r/3}; 
bc  = u[1, t] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[r, t], {r, t}], 60*10]]; 
sol =  sol /. K[1] -> n; 
sol =  FullSimplify[sol];
 

{{u(r,t)n=12J0(rj0,n)(9c2J1(j0,n)cos(ctj0,n)+1F2(32;1,52;14(j0,n)2)sin(c2tj0,n))9c2(J0(j0,n)2+J1(j0,n)2)j0,n}}

Maple

restart; 
pde := diff(u(r, t), t$2) = c^2*( diff(u(r,t), r$2)+ (1/r)* diff(u(r,t),r)  ); 
ic  := u(r,0)=1, eval( diff(u(r,t),t),t=0)=r/3; 
bc  := u(1,t)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc], u(r, t)) assuming t>0,r>0,r<1),output='realtime'));
 

u(r,t)=invlaplace(1sBesselI(0,src)(BesselI(0,sc))1,s,t)1/3invlaplace(1s2BesselI(0,src)(BesselI(0,sc))1,s,t)+1/6π(invlaplace(1s3BesselI(0,src)StruveL(0,sc)(BesselI(0,sc))1,s,t)invlaplace(1s3StruveL(0,src),s,t))c+1+1/3tr Has unresolved Invlaplace calls

____________________________________________________________________________________

5.2.2.3 [406] no θ dependency. Specific example. Both initial conditions not zero

problem number 406

Added January 12, 2020.

In circular disk. fixed edge of disk, no θ dependency, with initial position and velocity given

Solve for u(r,t) with 0<r<a and t>0. utt=c2(urr+1rur) With boundary conditions u(a,t)=0

With initial conditions u(r,0)=f(r)ut(r,0)=g(r)

Using a=1,c=210,g(r)=0,f(r)=r.

Mathematica

ClearAll["Global`*"]; 
c=2/10; a=1; 
g[r_]:=0; 
f[r_]:=r; 
pde =  D[u[r, t], {t, 2}] == c^2*(D[u[r, t], {r, 2}] + 1/r*D[u[r, t], r]); 
ic  = {u[r, 0] == f[r], Derivative[0, 1][u][r, 0] == g[r]}; 
bc  = u[a, t] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[r, t], {r, t},Assumptions->{t>0,r>0}], 60*10]]; 
sol =  sol /. K[1] -> n;
 

{{u(r,t)n=12J0(rj0,n)cos(tj0,n5)1F2(32;1,52;14(j0,n)2)3(J0(j0,n)2+J1(j0,n)2)}}

Maple

restart; 
c:=2/10; 
a:=1; 
g:=r->0; 
f:=r->r; 
pde := diff(u(r, t), t$2) = c^2*( diff(u(r,t), r$2)+ (1/r)* diff(u(r,t),r)  ); 
ic  := u(r,0)=f(r), D[2](u)(r,0)=g(r); 
bc  := u(a,t)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc], u(r, t)) assuming t>0,r>0),output='realtime'));
 

u(r,t)=invlaplace(laplace(1,t,s)BesselI(0,5sr)BesselI(0,5s),s,t)+0r1invlaplace(BesselI(0,5s(rτ))BesselI(0,5s)laplace((τ+1)1,t,s),s,t)dτ+r Has unresolved Invlaplace calls. How to get series solution?

Hand solution

The basic solution for this type of PDE was already given in problem 5.2.2.1 on page 1545 as

u(r,t)=n=1Ancos(cλnt)J0(λnr)+Bnsin(cλnt)J0(λnr)An=0af(r)J0(λnr)rdr0aJ02(λnr)rdrBn=0ag(r)J0(λnr)rdrcλn0aJ02(λnr)rdr With λn being the solutions for 0=J0(λna). We have infinite number of zeros. This generates all the needed λn. Hence λna=BesselJZero(0,n), therefore λn=aBesselJZero(0,n).

In this problem c=210,a=1,g(r)=0 and f(r)=r, hence the solution becomes

u(r,t)=n=1Ancos(210λnt)J0(λnr)

Where λn=1BesselJZero(0,n).

This animation runs for 40 seconds.

Source code for all the above animation

(*By Nasser M Abbasi*) 
SetDirectory[NotebookDirectory[]] 
 
(*Axis symmetric*) 
(*definitions*) 
ClearAll[a,c,n,m,r,theta,f,g,u] 
A0[n_,a_,lam0_]:= Module[{num,den,theta,r,f}, 
   f=r; 
   num=N[(BesselJ[1,lam0] (2 lam0-Pi StruveH[0,lam0])+ 
        Pi BesselJ[0,lam0] StruveH[1,lam0])/(2 lam0^2)]; 
 
    den=0.5 (BesselJ[0,lam0]^2+BesselJ[1,lam0]^2); 
    num/den 
]; 
 
u[r_,theta_,t_]:=Sum[A0tbl[[n]]*Cos[c lamtbl[[n]] t] *BesselJ[0,lamtbl[[n]]*r],{n,1,maxN}]; 
 
maxN=6; 
a=1; 
c=.2; 
 
lam[n_,a_]:=Module[{x}, 
   x=BesselJZero[0,n]; 
   N[(x/a)] 
]; 
 
 
lamtbl=Table[lam[n,a],{n,1,maxN}]; 
A0tbl=Table[A0[n,a,lamtbl[[n]]],{n,1,maxN}]; 
 
 
t=.1 
ParametricPlot3D[{r Cos[theta],r Sin[theta],Evaluate[u[r,theta,t]]},{r,0,1}, 
      {theta,0,2 Pi},AxesLabel->{"r","theta","u"},ImageMargins->5, 
      PerformanceGoal->"Quality",BoxRatios->{1,1,1}, 
      PlotRange->{Automatic,Automatic,{-5,5}},Mesh->10,MaxRecursion->1] 
 
Animate[ParametricPlot3D[{r Cos[theta],r Sin[theta], 
        Evaluate[u[r,theta,t]]},{r,0,1},{theta,0,2 Pi}, 
        AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
        PerformanceGoal->"Speed",BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{-5,5}}, 
        Mesh->10,MaxRecursion->1],{t,0,50,.01}] 
 
r=Table[ 
      Labeled[ParametricPlot3D[{r Cos[theta],r Sin[theta], 
           Evaluate[u[r,theta,t]]},{r,0,1},{theta,0,2 Pi},AxesLabel->{"r","theta","u"}, 
           BaseStyle->15,ImageMargins->5,PerformanceGoal->"Speed",BoxRatios->{1,1,1}, 
           PlotRange->{Automatic,Automatic,{-5,5}},Mesh->10,MaxRecursion->1], 
           Row[{"time (sec)",Round@t}]],{t,0,40,.1}]; 
 
Export["anim_axis.gif",r,"DisplayDurations"->Table[.05,{Length[r]}]]

____________________________________________________________________________________

5.2.2.4 [407] no θ dependency. Using integral transforms. Source present. Specific example

problem number 407

Added Oct 6, 2019.

Taken from https://www.mapleprimes.com/posts/211274-Integral-Transforms-revamped-And-PDE

Solve 2r2u(r,t)+ru(r,t)r+2t2u(r,t)=Q0q(r) With initial conditions u(r,0)=0

Mathematica

ClearAll["Global`*"]; 
pde = D[u[r, t], {r, 2}] + D[u[r, t], r]/r + D[u[r, t], {t, 2}] == -Q0*q[r]; 
ic = u[r, 0] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic}, u[r, t], {r, t}], 60*10]];
 

Failed

Maple

restart; 
pde := diff(u(r, t), r$2) + diff(u(r, t), r)/r + diff(u(r, t), t$2) = -Q__0*q(r); 
iv := u(r, 0) = 0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,iv],u(r,t))),output='realtime')); 
sol:=convert(sol,Int,only = hankel);
 

u(r,t)=Q0(0est0q(r)rBesselJ(0,sr)drBesselJ(0,sr)sds+00q(r)rBesselJ(0,sr)drBesselJ(0,sr)sds)

____________________________________________________________________________________

5.2.2.5 [408] no θ dependency. Using integral transforms. Source present. Specific example

problem number 408

Added Oct 6, 2019.

Taken from https://www.mapleprimes.com/posts/211274-Integral-Transforms-revamped-And-PDE

Solve c2(2r2u(r,t)+ru(r,t)r)=2t2u(r,t) With initial conditions u(r,0)=Aaa2+r2u(r,0)t=0

Mathematica

ClearAll["Global`*"]; 
pde = c^2*(D[u[r, t], {r, 2}] + D[u[r, t], r]/r) == D[u[r, t], {t, 2}]; 
ic = {u[r, 0] == A*a*(a^2 + r^2)^(-1/2), Derivative[0, 1][u][r, 0] == 0}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic}, u[r, t], {r, t}], 60*10]];
 

Failed

Maple

restart; 
pde := c^2*(diff(u(r, t), r, r) + diff(u(r, t), r)/r) = diff(u(r, t), t, t); 
iv := u(r, 0) = A*a*(a^2 + r^2)^(-1/2), D[2](u)(r, 0) = 0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,iv],u(r,t),method = Hankel) assuming (0 < r, 0 < t, 0 < a) ),output='realtime'));
 

u(r,t)=1/2Aa(c2t2+2iact+a2+r2+c2t22iact+a2+r2)c2t22iact+a2+r2c2t2+2iact+a2+r2

____________________________________________________________________________________

5.2.2.6 [409] θ dependency, fixed on edges, general solution

problem number 409

Added January 11, 2020

Solve for u(r,θ,t) with 0<r<a and t>0 and π<θ<π 2ut2=c2(2ur2+1rur+1r22uθ2) With boundary conditions u(a,θ,t)=0|u(0,θ,t)|<u(r,π,t)=u(r,π,t)uθ(r,π,t)=uθ(r,π,t)

With initial conditions u(r,θ,0)=f(r,θ)ut(r,θ,0)=g(r,θ)

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, theta, t], {t, 2}] == c^2*Laplacian[u[r,theta,t],{r,theta},"Polar"]; 
ic  = {u[r, theta, 0] == f[r, theta], Derivative[0, 0, 1][u][r, theta, 0] == g[r,theta]}; 
bc  = {u[a, theta, t] == 0, u[r, -Pi, t] == u[r, Pi, t], Derivative[0, 1, 0][u][r, -Pi, t] == Derivative[0, 1, 0][u][r, Pi, t]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[r, theta, t], {r, theta, t}, Assumptions -> {0 < r < a, a > 0, t > 0, -Pi < theta < Pi}], 60*10]];
 

{{u(r,θ,t){K[3]=12πJ0(rj0,K[3]a)(2πcos(c2tj0,K[3]a)0aππrJ0(rj0,K[3]a)f(r,θ)dθdraJ1(j0,K[3])2π(0aππrJ0(rj0,K[3]a)g(r,θ)dθdr)sin(c2tj0,K[3]a)|c|J1(j0,K[3])j0,K[3])aJ1(j0,K[3])+K[3]=1(K[1]=1(2πJK[1](rjK[1],K[3]a)cos(θK[1])(2πcos(c2tjK[1],K[3]a)0aππrJK[1](rjK[1],K[3]a)cos(θK[1])f(r,θ)dθdraJK[1]1(jK[1],K[3])+2π(0aππrJK[1](rjK[1],K[3]a)cos(θK[1])g(r,θ)dθdr)sin(c2tjK[1],K[3]a)|c|JK[1]1(jK[1],K[3])jK[1],K[3])aJK[1]1(jK[1],K[3])+2πJK[1](rjK[1],K[3]a)(2πcos(c2tjK[1],K[3]a)0aππrJK[1](rjK[1],K[3]a)f(r,θ)sin(θK[1])dθdraJK[1]1(jK[1],K[3])+2π(0aππrJK[1](rjK[1],K[3]a)g(r,θ)sin(θK[1])dθdr)sin(c2tjK[1],K[3]a)|c|JK[1]1(jK[1],K[3])jK[1],K[3])sin(θK[1])aJK[1]1(jK[1],K[3])))(K[1]|K[3])ZK[1]1K[3]1c2(jK[1],K[3])2>0IndeterminateTrue}}

Maple

restart; 
pde := diff(u(r, theta, t), t$2) = c^2*VectorCalculus:-Laplacian(u(r,theta,t),'polar'[r,theta]); 
ic  := u(r, theta, 0) = f(r, theta) , (D[3](u))(r, theta, 0) = g(r,theta); 
bc  := u(a, theta, t) = 0, 
       u(r, -Pi, t) = u(r, Pi, t), 
       (D[2](u))(r, -Pi, t) = (D[2](u))(r, Pi, t); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc], u(r, theta ,t),HINT = boundedseries(r=0))),output='realtime'));
 

sol=()

Hand solution

Assuming u=T(t)R(r)Θ(θ) and substituting in the PDE gives1c2TRΘ=RTΘ+1rRTΘ+1r2ΘRT Dividing by RTΘ1c2TT=RR+1rRR+1r2ΘΘ Hence1c2TT=λRR+1rRR+1r2ΘΘ=λ

The time ODE isT+c2λT=0 Now we separate again the space ODE’s (remember to move the λ with the R and not the Θ)RR+1rRR+λ=1r2ΘΘr2RR+rRR+r2λ=ΘΘ

Let the new separation constant be μ, thereforeΘΘ=μΘ+μΘ=0

With periodic boundary conditions andr2RR+rRR+r2λ=μr2R+rR+λr2RμR=0rR+RμrR=λrR

Now it is in Sturm Liouville form, where p=r,q=μr,σ=r. This is singular SL. Can be written asR+1rR+(λμr2)R=0 Before we solve the above R ODE, we solve the Θ+μΘ=0 to find μ Eigenvalues. The solution isΘ=Acos(μθ)+Bsin(μθ) With B.C Θ(π)=Θ(π) and Θ(π)=Θ(π). From first B.C. we obtainAcos(μπ)Bsin(μπ)=Acos(μπ)+Bsin(μπ)(1)2Bsin(μπ)=0

Looking at second B.C. Θ(π)=Θ(π)Θ(θ)=Aμsin(μθ)+μBcos(μθ) HenceAμsin(μπ)+μBcos(μπ)=Aμsin(μπ)+μBcos(μπ)Aμsin(μπ)=Aμsin(μπ)(2)2Asin(μπ)=0

From (1,2), we see that both are satisfied if μπ=nπn=1,2,3,μ=n2

Hence Θn=Ancos(nθ)+Bnsin(nθ) There is another solution for μ=0 which is constant (that is why one of the sums below starts from n=0). We can combine the zero eigenvalue with the above and writeΘn=Ancos(nθ)+Bnsin(nθ)n=0,1,2,3, Since at n=0 the above reduces to constant A0.

Now that we know μn=n2, from solving the θ part, we go and solve the r ODE. For each n, the solution to the r (Bessel) ode

R+1rR+(λn2r2)R=0 The solution turns out to be  Rnm(r)=Jn(λnmr)m=1,2,3, Where λnm is found from roots of 0=Jn(λnma) giving the eigenvalues. Now the time ODE is solvedTnm+c2λnmTnm=0Tnm=Cnmcos(cλnmt)+Dnmsin(cλnmt)n=0,1,2,3,,m=1,2,3,

Hence the solution isu(r,θ,t)=n=0m=1TnmRnmΘn=n=0m=1(Cnmcos(cλnmt)+Dnmsin(cλnmt))Jn(λnmr)(Ancos(nθ)+Bnsin(nθ))

We now break this sum as followsu(r,θ,t)=n=0m=1(Cnmcos(cλnmt)+Dnmsin(cλnmt))Jn(λnmr)Ancos(nθ)+n=1m=1(Cnmcos(cλnmt)+Dnmsin(cλnmt))Jn(λnmr)Bnsin(nθ)

Oru(r,θ,t)=n=0m=1Cnmcos(cλnmt)Jn(λnmr)Ancos(nθ)+Dnmsin(cλnmt)Jn(λnmr)Ancos(nθ)+n=1m=1Cnmcos(cλnmt)Jn(λnmr)Bnsin(nθ)+Dnmsin(cλnmt)Jn(λnmr)Bnsin(nθ)

Then we break the above into 4 sumsu(r,θ,t)=n=0m=1Cnmcos(cλnmt)Jn(λnmr)Ancos(nθ)+n=0m=1Dnmsin(cλnmt)Jn(λnmr)Ancos(nθ)+n=1m=1Cnmcos(cλnmt)Jn(λnmr)Bnsin(nθ)+n=1m=1Dnmsin(cλnmt)Jn(λnmr)Bnsin(nθ)

Finally, we merge constants in the above as followsAnCnmAnmAnDnmBnmBnCnmCnmBnDnmDnm

Hence the final solution now becomesu(r,θ,t)=n=0m=1Anmcos(cλnmt)Jn(λnmr)cos(nθ)+n=0m=1Bnmsin(cλnmt)Jn(λnmr)cos(nθ)+n=1m=1Cnmcos(cλnmt)Jn(λnmr)sin(nθ)(3)+n=1m=1Dnmsin(cλnmt)Jn(λnmr)sin(nθ)

Now initial conditions u(r,θ,0)=f(r,θ) is used to find Anm,Cnmusing orthogonality. At t=0 the solution simplifies to (all terms with sin(cλnmt) vanish givingu(r,θ,t)=n=0m=1AnmJn(λnmr)cos(nθ)+n=1m=1CnmJn(λnmr)sin(nθ)

Hence(4)f(r,θ)=n=0m=1AnmJn(λnmr)cos(nθ)+n=1m=1CnmJn(λnmr)sin(nθ) When iterating over m index, the terms cos(nθ) and sin(nθ) will be constant. So for each n, we have m=1AnmJn(λnmr) and m=1CnmJn(λnmr). So orthogonality is carried out on the m index on the Bessel functions. Multiplying (4) by Jn(λnkr) and integrating0af(r,θ)Jn(λnkr)rdr=n=0(0am=1AnmJn(λnmr)Jn(λnkr)rdr)cos(nθ)+n=1(0am=1CnmJn(λnmr)Jn(λnkr)rdr)sin(nθ)

Or0af(r,θ)Jn(λnkr)rdr=n=0Ank(0aJn2(λnkr)rdr)cos(nθ)+n=1Cnk(0aJn2(λnkr)rdr)sin(nθ)

Replacing k back with m, the above becomes0af(r,θ)Jn(λnmr)rdr=n=0Anm(0aJn2(λnmr)rdr)cos(nθ)(5)+n=1Cnm(0aJn2(λnmr)rdr)sin(nθ)

We now apply orthogonality on n using the cos(nθ) results inππ(0af(r,θ)Jn(λnmr)r dr)cos(nθ)dθ=Anmππ(0aJn2(λnmr)rdr)cos2(nθ)dθ But 0aJn2(λnmr)rdr does not depend on θ, therefore the above becomesππ(0af(r,θ)Jn(λnmr)r dr)cos(nθ)dθ=Anm(0aJn2(λnmr)rdr)ππcos2(nθ)dθ=Anmπ0aJn2(λnmr)rdr

ThereforeAnm=ππ(0af(r,θ)Jn(λnmr)r dr)cos(nθ)dθπ0aJn2(λnmr)rdr Similarly for sin(nθ), which givesCnm=ππ(0af(r,θ)Jn(λnmr)r dr)sin(nθ)dθπ0aJn2(λnmr)rdr Now we will look at the second initial conditions ut(r,θ,0)=g(r,θ). Taking derivative w.r.t. time t of the solution in (3) givesut(r,θ,t)=n=0m=1cλnmAnmsin(cλnmt)Jn(λnmr)cos(nθ)+n=0m=1cλnmBnmcos(cλnmt)Jn(λnmr)cos(nθ)+n=1m=1cλnmCnmsin(cλnmt)Jn(λnmr)sin(nθ)+n=1m=1cλnmDnmcos(cλnmt)Jn(λnmr)sin(nθ)

At time t=0 the above becomes (all terms with sin(cλnmt) vanish).g(r,θ)=n=0m=1cλnmBnmcos(cλnmt)Jn(λnmr)cos(nθ)+n=1m=1cλnmDnmcos(cλnmt)Jn(λnmr)sin(nθ)

Now orthogonality is used. At t=0 the above becomesg(r,θ)=n=0m=1cλnmBnmJn(λnmr)cos(nθ)+n=0m=1cλnmDnmJn(λnmr)sin(nθ)

Similarly to the above we now find Bnm and Dnm. The only difference, is that now we have extra cλnm terms that show up. The final result will beBnm=ππ0ag(r,θ)Jn(λnmr)cos(nθ)r dθdrcπλnm0aJn2(λnmr)r dr AndDnm=ππ0ag(r,θ)Jn(λnmr)sin(nθ)r dθdrcπλnm0aJn2(λnmr)r dr Summary of solutionu(r,θ,t)=n=0m=1Anmcos(cλnmt)Jn(λnmr)cos(nθ)+n=0m=1Bnmsin(cλnmt)Jn(λnmr)cos(nθ)+n=1m=1Cnmcos(cλnmt)Jn(λnmr)sin(nθ)+n=1m=1Dnmsin(cλnmt)Jn(λnmr)sin(nθ)

Anm=ππ(0af(r,θ)Jn(λnmr)r dr)cos(nθ)dθπ0aJn2(λnmr)rdrCnm=ππ(0af(r,θ)Jn(λnmr)r dr)sin(nθ)dθπ0aJn2(λnmr)rdrBnm=ππ0ag(r,θ)Jn(λnmr)cos(nθ)r dθdrcπλnm0aJn2(λnmr)r drDnm=ππ0ag(r,θ)Jn(λnmr)sin(nθ)r dθdrcπλnm0aJn2(λnmr)r dr With λnm being the solutions for 0=Jn(λnma). For each n, we find λn,1,λn,2,λn,3,, which are the zeros of the Bessel Jn(x) function. So for each n, there are infinite number of zeros. This generates all eigenvalues λnm. Hence λnma=BesselJZero(n,m), therefore λnm=aBesselJZero(n,m)

____________________________________________________________________________________

5.2.2.7 [410] θ dependency, fixed on edges, zero initial velocity, general solution

problem number 410

Solve for u(r,θ,t) with 0<r<a and t>0 and π<θ<π 2ut2=c2(2ur2+1rur+1r22uθ2) With boundary conditions u(a,θ,t)=0|u(0,θ,t)|<u(r,π,t)=u(r,π,t)uθ(r,π,t)=uθ(r,π,t)

With initial conditions u(r,θ,0)=f(r,θ)ut(r,θ,0)=0

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, theta, t], {t, 2}] == c^2*Laplacian[u[r,theta,t],{r,theta},"Polar"]; 
ic  = {u[r, theta, 0] == f[r, theta], Derivative[0, 0, 1][u][r, theta, 0] == 0}; 
bc  = {u[a, theta, t] == 0, u[r, -Pi, t] == u[r, Pi, t], Derivative[0, 1, 0][u][r, -Pi, t] == Derivative[0, 1, 0][u][r, Pi, t]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[r, theta, t], {r, theta, t}, Assumptions -> {0 < r < a, a > 0, t > 0, -Pi < theta < Pi}], 60*10]];
 

{{u(r,θ,t){K[3]=12J0(rj0,K[3]a)cos(c2tj0,K[3]a)0aππrJ0(rj0,K[3]a)f(r,θ)dθdra2πJ1(j0,K[3])2+K[3]=1(K[1]=1(2JK[1](rjK[1],K[3]a)cos(c2tjK[1],K[3]a)cos(θK[1])0aππrJK[1](rjK[1],K[3]a)cos(θK[1])f(r,θ)dθdra2πJK[1]1(jK[1],K[3])2+2JK[1](rjK[1],K[3]a)cos(c2tjK[1],K[3]a)(0aππrJK[1](rjK[1],K[3]a)f(r,θ)sin(θK[1])dθdr)sin(θK[1])a2πJK[1]1(jK[1],K[3])2))(K[1]|K[3])ZK[1]1K[3]1c2(jK[1],K[3])2>0IndeterminateTrue}}

Maple

restart; 
pde := diff(u(r, theta, t), t$2) =c^2*VectorCalculus:-Laplacian(u(r,theta,t),'polar'[r,theta]); 
ic  := u(r, theta, 0) = f(r, theta) , (D[3](u))(r, theta, 0) = 0; 
bc  := u(a, theta, t) = 0, 
       u(r, -Pi, t) = u(r, Pi, t), 
       (D[2](u))(r, -Pi, t) = (D[2](u))(r, Pi, t); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc], u(r, theta ,t),HINT = boundedseries(r=0))),output='realtime'));
 

sol=()

Hand solution

The basic solution for this type of PDE was already given in problem 5.2.2.6 on page 1557 asu(r,θ,t)=n=0m=1Anmcos(cλnmt)Jn(λnmr)cos(nθ)+n=0m=1Bnmsin(cλnmt)Jn(λnmr)cos(nθ)+n=1m=1Cnmcos(cλnmt)Jn(λnmr)sin(nθ)+n=1m=1Dnmsin(cλnmt)Jn(λnmr)sin(nθ)

Anm=ππ(0af(r,θ)Jn(λnmr)r dr)cos(nθ)dθπ0aJn2(λnmr)rdrCnm=ππ(0af(r,θ)Jn(λnmr)r dr)sin(nθ)dθπ0aJn2(λnmr)rdrBnm=ππ0ag(r,θ)Jn(λnmr)cos(nθ)r dθdrcπλnm0aJn2(λnmr)r drDnm=ππ0ag(r,θ)Jn(λnmr)sin(nθ)r dθdrcπλnm0aJn2(λnmr)r dr With λnm being the solutions for 0=Jn(λnma). For each n, we find λn,1,λn,2,λn,3,, which are the zeros of the Bessel Jn(x) function. So for each n, there are infinite number of zeros. This generates all eigenvalues λnm. Hence λnma=BesselJZero(n,m), therefore λnm=aBesselJZero(n,m). Since g(r,θ)=0 in this case, then Bnm=0,Dnm=0 and the solution simplifies to

u(r,θ,t)=n=0m=1Anmcos(cλnmt)Jn(λnmr)cos(nθ)+n=1m=1Cnmcos(cλnmt)Jn(λnmr)sin(nθ)

____________________________________________________________________________________

5.2.2.8 [411] θ dependency, fixed on edges, zero initial velocity, specific example

problem number 411

Added January 11 2020.

Solve for u(r,θ,t) with 0<r<a and t>0 and π<θ<π 2ut2=c2(2ur2+1rur+1r22uθ2) With boundary conditions u(a,θ,t)=0|u(0,θ,t)|<u(r,π,t)=u(r,π,t)uθ(r,π,t)=uθ(r,π,t)

With initial conditions u(r,θ,0)=f(r,θ)ut(r,θ,0)=0

Using a=1,c=0.2,f(r,θ)=rθ.

Mathematica

ClearAll["Global`*"]; 
f[r_,theta_]:=r*theta; 
c=2/10; a=1; 
pde =  D[u[r, theta, t], {t, 2}] == c^2*Laplacian[u[r,theta,t],{r,theta},"Polar"]; 
ic  = {u[r, theta, 0] == f[r, theta], Derivative[0, 0, 1][u][r, theta, 0] == 0}; 
bc  = {u[a, theta, t] == 0, u[r, -Pi, t] == u[r, Pi, t], Derivative[0, 1, 0][u][r, -Pi, t] == Derivative[0, 1, 0][u][r, Pi, t]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[r, theta, t], {r, theta, t}, Assumptions -> {0 < r < a,t > 0, -Pi < theta < Pi}], 60*10]];
 

{{u(r,θ,t){K[3]=1(K[1]=1(1)K[1]+1JK[1](rjK[1],K[3])jK[1],K[3]cos(15tjK[1],K[3])Gamma(12(K[1]+3))1F~2(12(K[1]+3);12(K[1]+5),K[1]+1;14(jK[1],K[3])2)sin(θK[1])JK[1]1(jK[1],K[3])0F~1(;K[1];14(jK[1],K[3])2)K[1])(K[1]|K[3])ZK[1]1K[3]1IndeterminateTrue}}

Maple

restart; 
f:=(r,theta)->r*theta; 
c:=2/10; 
a:=1; 
pde := diff(u(r, theta, t), t$2) = c^2*VectorCalculus:-Laplacian(u(r,theta,t),'polar'[r,theta]); 
ic  := u(r, theta, 0) = f(r, theta) , (D[3](u))(r, theta, 0) = 0; 
bc  := u(a, theta, t) = 0, 
       u(r, -Pi, t) = u(r, Pi, t), 
       (D[2](u))(r, -Pi, t) = (D[2](u))(r, Pi, t); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc], u(r, theta ,t),HINT = boundedseries(r=0))),output='realtime'));
 

sol=()

Hand solution

The basic solution for this type of PDE was already given in problem 5.2.2.6 on page 1557 asu(r,θ,t)=n=0m=1Anmcos(cλnmt)Jn(λnmr)cos(nθ)+n=0m=1Bnmsin(cλnmt)Jn(λnmr)cos(nθ)+n=1m=1Cnmcos(cλnmt)Jn(λnmr)sin(nθ)+n=1m=1Dnmsin(cλnmt)Jn(λnmr)sin(nθ)

Anm=ππ(0af(r,θ)Jn(λnmr)r dr)cos(nθ)dθπ0aJn2(λnmr)rdrCnm=ππ(0af(r,θ)Jn(λnmr)r dr)sin(nθ)dθπ0aJn2(λnmr)rdrBnm=ππ0ag(r,θ)Jn(λnmr)cos(nθ)r dθdrcπλnm0aJn2(λnmr)r drDnm=ππ0ag(r,θ)Jn(λnmr)sin(nθ)r dθdrcπλnm0aJn2(λnmr)r dr With λnm being the solutions for 0=Jn(λnma). For each n, we find λn,1,λn,2,λn,3,, which are the zeros of the Bessel Jn(x) function. So for each n, there are infinite number of zeros. This generates all eigenvalues λnm. Hence λnma=BesselJZero(n,m), therefore λnm=aBesselJZero(n,m).

In this problem g(r,θ)=0,f(r,θ)=rθ,a=1,c=210, then Bnm=0,Dnm=0 and the solution simplifies to

u(r,θ,t)=n=0m=1Anmcos(210λnmt)Jn(λnmr)cos(nθ)+n=1m=1Cnmcos(210λnmt)Jn(λnmr)sin(nθ)

Where

Anm=ππ(0arθJn(λnmr)r dr)cos(nθ)dθπ0aJn2(λnmr)rdrCnm=ππ(0arθJn(λnmr)r dr)sin(nθ)dθπ0aJn2(λnmr)rdr

The following animations run for 80 seconds. They are for different n,m modes. (This only show in the HTML version)

5.2.2.8.1 Cases for n=0

5.2.2.8.2 Cases for n=1

5.2.2.8.3 Cases for n=2

5.2.2.8.4 Cases for n=3

Source code for all the above animations

(*By Nasser M. Abbasi*) 
SetDirectory[NotebookDirectory[]] 
 X:\data\public_html\my_notes\PDE_animations\problems\4 
 
(*definitions*) 
ClearAll[a,c,n,m,r,theta,f,g,u,maxM,maxN,t] 
maxN=4; 
maxM=4; 
a=1; 
c=.2; 
minZ=-8; 
maxZ=10; 
A0[n_,m_]:= Module[{num,den,r,theta,f}, 
f=r*theta; 
num=Integrate[f* BesselJ[n,lamtbl[[n+1,m]]  r] Cos[n theta] r,{r,0,a},{theta,0,2Pi}]; 
den=Integrate[(BesselJ[n,lamtbl[[n+1,m]] r])^2  (Cos[n theta])^2 r,{r,0,a},{theta,0,2Pi}]; 
num/den 
]; 
 
C0[n_,m_]:= Module[{num,den,f,r,theta}, 
   f=r*theta; 
   num=Integrate[f* BesselJ[n,lamtbl[[n+1,m]]  r] Sin[n theta] r,{r,0,a},{theta,0,2Pi}]; 
   den=Integrate[(BesselJ[n,lamtbl[[n+1,m]] r])^2  (Sin[n theta])^2 r,{r,0,a},{theta,0,2Pi}]; 
   num/den 
   ]; 
 
lam[n_,m_]:=Module[{x}, 
    x=BesselJZero[n,m]; 
    N[(x/a)] 
   ]; 
 
u[r_,theta_,t_,maxN_,maxM_]:=Module[{tmp,n,m}, 
     tmp=Sum[A0tbl[[n+1,m]]*Cos[c lamtbl[[n+1,m]] t] *BesselJ[n,lamtbl[[n+1,m]]*r]* 
         Cos[n*theta],{n,0,maxN},{m,1,maxM}]; 
 
     tmp=tmp+Sum[C0tbl[[n+1,m]]*Cos[c lamtbl[[n+1,m]] t] *BesselJ[n,lamtbl[[n+1,m]]*r]* 
        Sin[n*theta],{n,1,maxN},{m,1,maxM}] 
   ]; 
 
lamtbl=Table[lam[n,m],{n,0,maxN},{m,1,maxN}]; 
 
A0tbl=Table[A0[n,m],{n,0,maxN},{m,1,maxM}] 
C0tbl=Table[C0[n,m],{n,1,maxN},{m,1,maxM}] 
 
(*n=0,m=1*) 
ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0],Evaluate[u[r0,theta0,12,0,1]]}, 
   {r0,0,1},{theta0,0,2 Pi},AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
   PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
   PlotRange->{Automatic,Automatic,{minZ,maxZ}}] 
 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
     Evaluate[u[r0,theta0,t,0,1]]},{r0,0,1},{theta0,0,2 Pi},AxesLabel->{"r","theta","u"}, 
     BaseStyle->15,ImageMargins->5,PerformanceGoal->"Quality",Mesh->10, 
     MaxRecursion->1, BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
     Row[{"time (sec)",Round@t,", N = ", 0, ", M = ",1}]],{t,0,80,.5}]; 
 
Export["anim_n_0_m_1.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
 
(*n=0,m=2*) 
ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0],Evaluate[u[r0,theta0,0,0,2]]},{r0,0,1}, 
   {theta0,0,2 Pi},AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
   PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
   PlotRange->{Automatic,Automatic,{minZ,maxZ}}] 
 
(*to speed it up, make Z in {t,0,100,Z} larger, and then make Z in Table[Z,{Length[r]}] smaller.*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
     Evaluate[u[r0,theta0,t,0,2]]},{r0,0,1},{theta0,0,2 Pi},AxesLabel->{"r","theta","u"}, 
     BaseStyle->15,ImageMargins->5,PerformanceGoal->"Quality",Mesh->10, 
     MaxRecursion->1, BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
     Row[{"time (sec)",Round@t,", N = ", 0, ", M = ",2}]],{t,0,80,.5}]; 
 
Export["anim_n_0_m_2.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=0,m=3*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
          Evaluate[u[r0,theta0,t,0,3]]},{r0,0,1},{theta0,0,2 Pi}, 
          AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
          PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
          PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
          Row[{"time (sec)",Round@t,", N = ", 0, ", M = ",3}]],{t,0,80,.5}]; 
 
Export["anim_n_0_m_3.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
 
(*n=0,m=4*) 
t=1; 
ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0],Evaluate[u[r0,theta0,t,0,4]]}, 
        {r0,0,1},{theta0,0,2 Pi},AxesLabel->{"r","theta","u"},BaseStyle->15, 
        ImageMargins->5,PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, 
        BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{minZ,maxZ}}] 
 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
          Evaluate[u[r0,theta0,t,0,4]]},{r0,0,1},{theta0,0,2 Pi},AxesLabel->{"r","theta","u"}, 
          BaseStyle->15,ImageMargins->5,PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, 
          BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
          Row[{"time (sec)",Round@t,", N = ", 0, ", M = ",4}]],{t,0,80,.5}]; 
 
Export["anim_n_0_m_4.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=1,m=1*) 
t=1; 
ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
       Evaluate[u[r0,theta0,t,1,1]]},{r0,0,1},{theta0,0,2 Pi}, 
       AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
       PerformanceGoal->"Speed",Mesh->10, BoxRatios->{1,1,1}, 
       PlotRange->{Automatic,Automatic,{minZ,maxZ}}] 
 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
            Evaluate[u[r0,theta0,t,1,1]]},{r0,0,1},{theta0,0,2 Pi}, 
            AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
            PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, 
            BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
            Row[{"time (sec)",Round@t,", N = ", 1, ", M = ",1}]],{t,0,80,.5}]; 
 
Export["anim_n_1_m_1.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=1,m=2*) 
 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
         Evaluate[u[r0,theta0,t,1,2]]},{r0,0,1},{theta0,0,2 Pi}, 
         AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
         PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, 
         BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
         Row[{"time (sec)",Round@t,", N = ", 1, ", M = ",2}]],{t,0,80,.5}]; 
 
Export["anim_n_1_m_2.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=1,m=3*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
    Evaluate[u[r0,theta0,t,1,3]]},{r0,0,1},{theta0,0,2 Pi}, 
    AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
    PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
    PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
    Row[{"time (sec)",Round@t,", N = ", 1, ", M = ",3}]],{t,0,80,.5}]; 
 
Export["anim_n_1_m_3.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=1,m=4*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
           Evaluate[u[r0,theta0,t,1,4]]},{r0,0,1},{theta0,0,2 Pi}, 
           AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
           PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, 
           BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
           Row[{"time (sec)",Round@t,", N = ", 1, ", M = ",4}]],{t,0,80,.5}]; 
 
Export["anim_n_1_m_4.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=2,m=1*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
          Evaluate[u[r0,theta0,t,2,1]]},{r0,0,1},{theta0,0,2 Pi}, 
          AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
          PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
          PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
          Row[{"time (sec)",Round@t,", N = ", 2 ", M = ",1}]] 
          ,{t,0,80,.5}]; 
 
Export["anim_n_2_m_1.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=2,m=2*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
         Evaluate[u[r0,theta0,t,2,2]]},{r0,0,1},{theta0,0,2 Pi}, 
         AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
         PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
         PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
         Row[{"time (sec)",Round@t,", N = ", 2 ", M = ",2}]],{t,0,80,.5}]; 
 
Export["anim_n_2_m_2.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=2,m=3*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
       Evaluate[u[r0,theta0,t,2,3]]},{r0,0,1},{theta0,0,2 Pi},AxesLabel->{"r","theta","u"}, 
       BaseStyle->15,ImageMargins->5,PerformanceGoal->"Quality",Mesh->10, 
       MaxRecursion->1, BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
       Row[{"time (sec)",Round@t,", N = ", 2 ", M = ",3}]],{t,0,80,.5}]; 
 
Export["anim_n_2_m_3.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=2,m=4*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
         Evaluate[u[r0,theta0,t,2,4]]},{r0,0,1},{theta0,0,2 Pi}, 
         AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
         PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
         PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
         Row[{"time (sec)",Round@t,", N = ", 2 ", M = ",4}]],{t,0,80,.5}]; 
 
Export["anim_n_2_m_4.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=3,m=1*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
      Evaluate[u[r0,theta0,t,3,1]]},{r0,0,1},{theta0,0,2 Pi}, 
      AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
      PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
      PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
      Row[{"time (sec)",Round@t,", N = ", 3 ", M = ",1}]],{t,0,80,.5}]; 
 
Export["anim_n_3_m_1.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=3,m=2*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
            Evaluate[u[r0,theta0,t,3,2]]},{r0,0,1},{theta0,0,2 Pi}, 
            AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
            PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, 
            BoxRatios->{1,1,1},PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
            Row[{"time (sec)",Round@t,", N = ", 3 ", M = ",2}]],{t,0,80,.5}]; 
 
Export["anim_n_3_m_2.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=3,m=3*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
           Evaluate[u[r0,theta0,t,3,3]]},{r0,0,1},{theta0,0,2 Pi}, 
           AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
           PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
           PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
           Row[{"time (sec)",Round@t,", N = ", 3 ", M = ",3}]],{t,0,80,.5}]; 
Export["anim_n_3_m_3.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]] 
 
(*n=3,m=4*) 
r=Table[Labeled[ParametricPlot3D[{r0 Cos[theta0],r0 Sin[theta0], 
           Evaluate[u[r0,theta0,t,3,4]]},{r0,0,1},{theta0,0,2 Pi}, 
           AxesLabel->{"r","theta","u"},BaseStyle->15,ImageMargins->5, 
           PerformanceGoal->"Quality",Mesh->10,MaxRecursion->1, BoxRatios->{1,1,1}, 
           PlotRange->{Automatic,Automatic,{minZ,maxZ}}], 
           Row[{"time (sec)",Round@t,", N = ", 3 ", M = ",4}]],{t,0,80,.5}]; 
 
Export["anim_n_3_m_4.gif",r,"DisplayDurations"->Table[.25,{Length[r]}]]

____________________________________________________________________________________

5.2.2.9 [412] θ dependency, fixed on edges, zero initial position, specific example

problem number 412

Added January 11, 2020

Math 322 UW exam problem. 2018.

Solve for u(r,θ,t) with 0<r<a and t>0 and π<θ<π 2ut2=c2(2ur2+1rur+1r22uθ2) With boundary conditions u(a,θ,t)=0|u(0,θ,t)|<u(r,π,t)=u(r,π,t)uθ(r,π,t)=uθ(r,π,t)

With initial conditions u(r,θ,0)=0ut(r,θ,0)={1πϵ2if rϵ0otherwise

Where 0<ϵ<1

Using a=1,c=1,ϵ=12.

Mathematica

ClearAll["Global`*"]; 
a=1; c=1; epsilon=1/2; 
f[r_,theta_]:=0; 
g[r_,theta_]:=Piecewise[{{1/(Pi*epsilon^2),r<epsilon},{0,True}}]; 
c=1; a=1; 
pde =  D[u[r, theta, t], {t, 2}] == c^2*Laplacian[u[r,theta,t],{r,theta},"Polar"]; 
ic  = {u[r, theta, 0] == f[r, theta], Derivative[0, 0, 1][u][r, theta, 0] == g[r,theta]}; 
bc  = {u[a, theta, t] == 0, u[r, -Pi, t] == u[r, Pi, t], Derivative[0, 1, 0][u][r, -Pi, t] == Derivative[0, 1, 0][u][r, Pi, t]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[r, theta, t], {r, theta, t}, Assumptions -> {0 < r < a,t > 0, -Pi < theta < Pi}], 60*10]];
 

{{u(r,θ,t){K[3]=12J0(rj0,K[3])0F~1(;2;116(j0,K[3])2)sin(tj0,K[3])πJ1(j0,K[3])2j0,K[3](K[1]|K[3])ZK[1]1K[3]1IndeterminateTrue}}

Maple

restart; 
c:=1; 
a:=1; 
epsilon:=1/2; 
f:=(r,theta)->r*theta; 
g:=(r,theta)->piecewise(r<epsilon,1/(Pi*epsilon^2),true,0); 
pde := diff(u(r, theta, t), t$2) = c^2*VectorCalculus:-Laplacian(u(r,theta,t),'polar'[r,theta]); 
ic  := u(r, theta, 0) = f(r, theta) , (D[3](u))(r, theta, 0) = g(r,theta); 
bc  := u(a, theta, t) = 0, 
       u(r, -Pi, t) = u(r, Pi, t), 
       (D[2](u))(r, -Pi, t) = (D[2](u))(r, Pi, t); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc], u(r, theta ,t),HINT = boundedseries(r=0))),output='realtime'));
 

sol=()

Hand solution

The basic solution for this type of PDE was already given in problem 5.2.2.6 on page 1557 as

u(r,θ,t)=n=0m=1Anmcos(cλnmt)Jn(λnmr)cos(nθ)+n=0m=1Bnmsin(cλnmt)Jn(λnmr)cos(nθ)+n=1m=1Cnmcos(cλnmt)Jn(λnmr)sin(nθ)+n=1m=1Dnmsin(cλnmt)Jn(λnmr)sin(nθ)

Anm=ππ(0af(r,θ)Jn(λnmr)r dr)cos(nθ)dθπ0aJn2(λnmr)rdrCnm=ππ(0af(r,θ)Jn(λnmr)r dr)sin(nθ)dθπ0aJn2(λnmr)rdrBnm=ππ0ag(r,θ)Jn(λnmr)cos(nθ)r dθdrcπλnm0aJn2(λnmr)r drDnm=ππ0ag(r,θ)Jn(λnmr)sin(nθ)r dθdrcπλnm0aJn2(λnmr)r dr With λnm being the solutions for 0=Jn(λnma). For each n, we find λn,1,λn,2,λn,3,, which are the zeros of the Bessel Jn(x) function. So for each n, there are infinite number of zeros. This generates all eigenvalues λnm. Hence λnma=BesselJZero(n,m), therefore λnm=aBesselJZero(n,m).

In this problem f(r,θ)=0,a=1,c=1, then Anm=0,Cnm=0 and the solution simplifies to

u(r,θ,t)=n=0m=1Bnmsin(cλnmt)Jn(λnmr)cos(nθ)+n=1m=1Dnmsin(cλnmt)Jn(λnmr)sin(nθ) Taking time derivative givesut(r,θ,t)=n=0m=1Bnmcos(nθ)λnmcos(λnmt)Jn(λnmr)+n=1m=1Dnmsin(nθ)λnmcos(λnmt)Jn(λnmr) Applying the second initial condition at t=0 gives(9)n=0m=1Bnmcos(nθ)λnmJn(λnmr)+n=1m=1Dnmsin(nθ)λnmJn(λnmr)={1πϵ2if rϵ0otherwise Case n=0 (9) becomesm=1B0mλ0mJ0(λ0mr)={1πϵ2if rϵ0otherwise Applying orthogonality on J0(λ0mr) results inB0mλ0m01rJ02(λ0mr)dr=1πϵ20ϵrJ0(λ0mr)dr(9A)B0m=1πϵ2λ0m0ϵrJ0(λ0mr)dr01rJ02(λ0mr)dr

Case n>1 Applying orthogonality on cos(nθ), equation (9) becomesm=1Bnm(ππcos2(nθ)dθ)λnmJn(λnmr)={1πϵ2ππcos(nθ)dθif r2ϵ0otherwisem=1πBnmλnmJn(λnmr)={0if r2ϵ0otherwise

Hence Bnm=0 for all n>0.

The same is now done to find D¯nm. Applying orthogonality on sin(nθ), equation (9) becomesm=1Dnm(ππsin2(nθ)dθ)λnmJn(λnmr)={1πϵ2ππsin(nθ)dθif r2ϵ0otherwisem=1Dnm(ππsin2(nθ)dθ)λnmJn(λnmr)={0if r2ϵ0otherwise

Hence all Dnm=0 for all n>0.

Therefore the solution (8) reduces to only using n=0,m=1,2,3,. The solution can now be written as(10)u(r,θ,t)=m=1B0msin(λ0mt)J0(λ0mr) Where B0m=1πϵ2λ0m0ϵrJ0(λ0mr)dr01rJ02(λ0mr)dr And λ0m are all the positive zeros of J0(z), m=1,2,3,.

B0m is now simplified more. Considering first the numerator of B0m which is 0ϵrJ0(λ0mr)dr. The hint given says thatddr(rJ1(r))=rJ0(r) This is the same as saying(10A)rJ1(r)=rJ0(r)dr However the integral in B0m is rJ0(λ0mr)dr and not rJ0(r)dr. To transform it so that the hint can be used, let λ0mr=r¯, then drdr¯=1λ0m or dr=dr¯λ0m. Now rJ0(λ0mr)dr becomes r¯λ0mJ0(r¯)dr¯λ0m or 1λ0m2r¯J0(r¯)dr¯ and now the hint (10A) can be used on this integral giving1λ0m2(r¯J0(r¯)dr¯)=1λ0m2(r¯J1(r¯)) Replacing r¯ back by λ0mr, gives the result needed1λ0m2(r¯J1(r¯))=1λ0m2(λ0mrJ1(λ0mr))=1λ0mrJ1(λ0mr)

Now the limits are applied, using the fundamental theory of calculus0ϵrJ0(λ0mr)dr=1λ0m[rJ1(λ0mr)]0ϵ(10B)=ϵλ0mJ1(λ0mϵ)

This completes finding the numerator integral in B0m. The denominator integral in B0m is 01rJ02(λ0mr)dr. This was found before which is 01rJ02(λ0mr)dr=12[J0(λ0m)]2 But J0(λ0m)=J1(λ0m), hence the above becomes(10C)01rJ02(λ0mr)dr=12J12(λ0m) Applying (10B) and (10C), B0m simplifies to the following expressionB0m=1πϵ2λ0mϵλ0mJ1(λ0mϵ)12J12(λ0m)=2πϵλ0m2J1(λ0mϵ)J12(λ0m)

Therefore the final solution becomesu(r,θ,t)=m=1B0msin(λ0mt)J0(λ0mr)(11)u(r,θ,t)=2πϵm=11λ0m2J1(λ0mϵ)J12(λ0m)J0(λ0mr)sin(λ0mt)

When ϵ=12, the above solution (11) becomes(11A)u(r,θ,t)=4πm=11λ0m2J1(12λ0m)J12(λ0m)J0(λ0mr)sin(λ0mt) Here is animation for 5 seconds made in Mathematica

Mathematica Source code for all the above animations

(*By Nasser M. Abbasi. Animation of problem 4 solution*) 
 
ClearAll[t,r,m]; 
padIt2[v_,f_List]:=AccountingForm[v,f,NumberSigns->{"",""}, 
                          NumberPadding->{"0","0"},SignPadding->True]; 
nTerms=40; 
lam = Table[ BesselJZero[0,m],{m,1,nTerms}]//N; 
c   = Table[1/lam[[m]]^2 BesselJ[1,lam[[m]]/2]/BesselJ[1,lam[[m]] ]^2,{m,1,nTerms}]; 
mySol[r_,t_]:=4/Pi   Sum[c[[m]]BesselJ[0,lam[[m]] r] Sin[lam[[m]] t],{m,1,nTerms}]; 
 
frames=Table[ 
  Print["t=",t]; 
  Grid[{ 
   {Row[{"time = ",padIt2[t,{3,2}]}]}, 
   {ParametricPlot3D[{r Cos[theta],r Sin[theta],mySol[r,t]},{r,0,1},{theta,0,2 Pi}, 
    PlotRange->{Automatic,Automatic,{-0.6,0.6}}, 
    PerformanceGoal->"Speed",Boxed->True, 
    Axes->True,Mesh->20, 
    ViewPoint->{2.17,-2.4,1}, 
    ImageSize->400, 
    BoxRatios->{1, 1, 1}] 
  }}], 
    {t,0,5,0.05} 
]; 
 
Manipulate[ 
  frames[[i]], 
  {{i,1,"time"},1,Length@frames,1,Appearance->"Labeled"} 
] 
 
Export["anim.gif",frames,"DisplayDurations"->Table[.2,{Length@frames}]]

Here is the same animation made in Maple 2018

Maple source code for all the above animations

#by Nasser M. Abbasi, May 23,2018 
 
restart; 
currentdir("X:/data/public_html/my_notes/PDE_animations/problems/wave_disk_exam_problem_4"); 
nTerms := 20: 
lam    := evalf([BesselJZeros(0,1..nTerms)]): 
c      := seq(1/lam[n]^2*BesselJ(1,lam[n]/2)/BesselJ(1,lam[n])^2,n=1..nTerms): 
mySol  := proc(r,t) 
  local n; 
  4/Pi*sum(c[n]*BesselJ(0,lam[n]*r)*sin(lam[n]*t),n=1..nTerms); 
end proc: 
 
maxTime := 5: (*seconds*) 
delay   := 0.05: 
nFrames := round(maxTime/delay): 
 
frames  := [seq( plot3d([ r, theta, mySol(r,(i*delay)) ], 
                   r      = 0..1, 
                   theta  = 0..2*Pi, 
                   coords = cylindrical, 
                   axes   = none, 
                   title  = sprintf("%s %3.2f %s","time ",(i*delay),"seconds") 
                ), 
             i=0..nFrames-1) 
           ]: 
plots:-display(convert(frames,list),insequence=true);

Here is the same animation made in Matlab 2016a

Matlab source code for all the above animations

function nma_HW4_math_322 
%By Nasser M. Abbasi, May 23, 2018 
 
close all; 
 
GENERATE_GIF=true; %turn to false to not generate animated gif 
 
lam = zeros(80,1); %eigenvalues 
for i = 1:80 
  lam(i) = fzero(@(x)besselj(0,x),i); 
end; 
 
lam    = uniquetol(lam); %must use  uniquetol 
nTerms = 20; 
c      = zeros(nTerms,1); 
 
for i = 1:nTerms 
  c(i) = 1/lam(i)^2*besselj(1,lam(i)/2)/besselj(1,lam(i))^2; 
end 
 
  %------------- inner function -------- 
  function tot = mySol(r,t) 
    tot = 0; 
    for ii =1:nTerms 
        tot = tot + (c(ii)*besselj(0,lam(ii).*r).*sin(lam(ii)*t)); 
    end; 
    tot = 4/pi*tot; 
  end 
  %------------------- 
 
maxTime = 5; %seconds 
delay   = 0.05; 
nFrames = round(maxTime/delay); 
 
r   = 0:.05:1; 
phi = 0:pi/20:2*pi; 
[R,PHI] = meshgrid(r,phi); 
 
fig_handle   = figure(); 
set(fig_handle,'Name',.... 
   'Math 322, Final exam problem 4 animations by Nasser M. Abbasi'); 
 
for i=1:nFrames 
  Z = mySol(R,((i-1)*delay)); 
  surf(R.*cos(PHI), R.*sin(PHI), Z); 
  set(gca,'nextplot','replacechildren','visible','on'); 
  colormap cool ; 
  title(sprintf('time = %3.2f', (i-1)*delay)); 
  zlim([-0.6 0.6]); 
  drawnow; 
  pause(.01); 
  if GENERATE_GIF 
      frame = getframe(gcf); 
      im = frame2im(frame); 
      [imind,cm] = rgb2ind(im,256); 
      if i == 1 
          imwrite(imind,cm,'matlab_animations.gif','gif', ... 
                                     'DelayTime',0.1,'LoopCount',0); 
      else 
          imwrite(imind,cm,'matlab_animations.gif','gif',... 
                 'WriteMode','append','DelayTime',0.1,'LoopCount',0); 
      end 
  end 
end 
 
end

____________________________________________________________________________________

5.2.2.10 [413] θ dependency, fixed on edges, zero initial position with internal source (Haberman 8.5.5. (b)

problem number 413

Added January 15, 2020

Problem 8.5.5. (b) Richard Haberman applied partial di fb00erential equations book, 5th edition

Solve wave PDE inside circular membrane for u(r,θ,t) with 0<r<a and t>0 and π<θ<π utt=c22u(r,θ)+Q(r,θ,t) With boundary conditions u(a,θ,t)=0|u(0,θ,t)|<u(r,π,t)=u(r,π,t)uθ(r,π,t)=uθ(r,π,t)

With initial conditions u(r,θ,0)=f(r,θ)ut(r,θ,0)=0

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[r, theta, t], {t, 2}] == c^2*Laplacian[u[r,theta,t],{r,theta},"Polar"]+Q[r,theta,t]; 
ic  = {u[r, theta, 0] == f[r, theta], Derivative[0, 0, 1][u][r, theta, 0] == 0}; 
bc  = {u[a, theta, t] == 0, u[r, -Pi, t] == u[r, Pi, t], Derivative[0, 1, 0][u][r, -Pi, t] == Derivative[0, 1, 0][u][r, Pi, t]}; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[r, theta, t], {r, theta, t}, Assumptions -> {0 < r < a,t > 0, -Pi < theta < Pi}], 60*10]];
 

Failed

Maple

restart; 
pde := diff(u(r, theta, t), t$2) = c^2*VectorCalculus:-Laplacian(u(r,theta,t),'polar'[r,theta])+Q(r,theta,t); 
ic  := u(r, theta, 0) = f(r, theta) , (D[3](u))(r, theta, 0) = 0; 
bc  := u(a, theta, t) = 0, 
       u(r, -Pi, t) = u(r, Pi, t), 
       (D[2](u))(r, -Pi, t) = (D[2](u))(r, Pi, t); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, ic,bc], u(r, theta ,t),HINT = boundedseries(r=0)) assuming r>0,r<a),output='realtime'));
 

sol=()

Hand solution

The solution to the corresponding homogeneous wave PDE

2ut2=c22 Is known to be u(r,θ,t)=n=0m=1an(t)Jn(λnmr)cos(nθ)+n=1m=1an(t)Jn(λnmr)sin(nθ) Where λnm are found by solving roots of Jn(λnma)=0. To make things simpler, we will write u(r,θ,t)=iai(t)Φi(r,θ) Where the above means the double sum of all eigenvalues λi. So Φi(r,θ) represents Jn(λnmr){cos(nθ),sin(θ)} combined. So double sum is implied everywhere. Given this, we now expand the source termQ(r,θ,t)=iqi(t)Φi(r,θ) And the original PDE becomes(1)iai(t)Φ(λi)=c2iai(t)2(Φi(r,θ))+iqi(t)Φi(r,θ) But 2(Φi(r,θ))=λiΦi(r,θ) Hence (1) becomesiai(t)Φi(r,θ)+c2λiai(t)Φi(r,θ)=iqi(t)Φi(r,θ)i(ai(t)+c2λiai(t))Φi(r,θ)=iqi(t)Φi(r,θ)

Applying orthogonality givesai(t)+c2λiai(t)=qi(t) Where qi(t)=0aππQ(r,θ,t)Φi(r,θ)rdrdθ0aππΦi2(r,θ)rdrdθ The solution to the homogenous ODE isaih(t)=Aicos(cλit)+Bisin(cλit) And the particular solution is found if we know what Q(r,θ,t) and hence qi(t). For now, lets call the particular solution as aip(t). Hence the solution for ai(t) isai(t)=Aicos(cλit)+Bisin(cλit)+aip(t) Plugging the above into the u(r,θ,t)=iai(t)Φi(r,θ), gives(2)u(r,θ,t)=i(Aicos(cλit)+Bisin(cλit)+aip(t))Φi(r,θ) We now find Ai,Bi from initial conditions. At t=0f(r,θ)=i(Ai+aip(0))Φi(r,θ) Applying orthogonality0aππf(r,θ)Φj(r,θ)rdrdθ=0aππi(Ai+aip(0))Φi(r,θ)Φj(r,θ)rdrdθ0aππf(r,θ)Φj(r,θ)rdrdθ=(Aj+ajp(0))0aππΦj2(r,θ)rdrdθ(Ai+aip(0))=0aππf(r,θ)Φi(r,θ)rdrdθ0aππΦi2(r,θ)rdrdθ

Taking time derivative of  (2)u(r,θ,t)t=i(Aicλisin(cλit)+cλiBicos(cλit)+daip(t)dt)Φi(r,θ) At t=00=i(cλiBi+daip(0)dt)Φi(r,θ) Hence Bi=0. Therefore the final solution isu(r,θ,t)=i(Aicos(cλit)+aip(t))Φi(r,θ) Where(Ai+aip(0))=0aππf(r,θ)Φi(r,θ)rdrdθ0aππΦi2(r,θ)rdrdθ This complete the solution.