Added January 12, 2020
Circular disk. fixed edge of disk, no
Solve for
With initial conditions
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;
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'));
Hand solution
Assuming
The time ODE is
Hence the solution is
Now initial conditions
Now we will look at the second initial conditions
____________________________________________________________________________________
Taken from Mathematica helps pages on DSolve
In circular disk. fixed edge of disk, no
Solve for
With initial conditions
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];
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'));
____________________________________________________________________________________
Added January 12, 2020.
In circular disk. fixed edge of disk, no
Solve for
With initial conditions
Using
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;
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'));
Hand solution
The basic solution for this type of PDE was already given in problem 5.2.2.1 on page 1545 as
In this problem
Where
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]}]]
____________________________________________________________________________________
Added Oct 6, 2019.
Taken from https://www.mapleprimes.com/posts/211274-Integral-Transforms-revamped-And-PDE
Solve
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);
____________________________________________________________________________________
Added Oct 6, 2019.
Taken from https://www.mapleprimes.com/posts/211274-Integral-Transforms-revamped-And-PDE
Solve
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'));
____________________________________________________________________________________
Added January 11, 2020
Solve for
With initial conditions
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]];
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
The time ODE is
Let the new separation constant be
With periodic boundary conditions and
Now it is in Sturm Liouville form, where
Looking at second B.C.
From (1,2), we see that both are satisfied if
Hence
Now that we know
Hence the solution is
We now break this sum as follows
Or
Then we break the above into 4 sums
Finally, we merge constants in the above as follows
Hence the final solution now becomes
Now initial conditions
Hence
Or
Replacing
We now apply orthogonality on
Therefore
At time
Now orthogonality is used. At
Similarly to the above we now find
____________________________________________________________________________________
Solve for
With initial conditions
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]];
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
as
____________________________________________________________________________________
Added January 11 2020.
Solve for
With initial conditions
Using
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]];
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
as
In this problem
Where
The following animations run for 80 seconds. They are for different
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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]}]]
____________________________________________________________________________________
Added January 11, 2020
Math 322 UW exam problem. 2018.
Solve for
With initial conditions
Where
Using
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]];
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
In this problem
Case
Hence
The same is now done to find
Hence all
Therefore the solution (8) reduces to only using
Now the limits are applied, using the fundamental theory of calculus
This completes finding the numerator integral in
Therefore the final solution becomes
When
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
____________________________________________________________________________________
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
With initial conditions
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
Applying orthogonality gives
Taking time derivative of (2)