Worksheet: Axiwave.mw 

Solution to the Axisymmetric Wave Equation 

In this worksheet we solve the radial wave equation for u(r,t): 

DE:   u[tt] = u[rr]+ `/`(1, `*`(r)) u[r]  r<1 

BC:    u(1,t)=0 

IC:     u(r,0)=f(r)  u[t](r,0)=0                          

 

> restart:with(plots):
 

Cylindrical coordinates 

> addcoords(z_cylindrical,[z,r,theta],[r*cos(theta),r*sin(theta),z]);
 

I don't like typing BesselJZeros!   Maple has a nice alias feature: 

> alias(Z=BesselJZeros):
 

Radial Eigenfunctions  

> M:=20;M is the number of terms in the expansion
 

20
 

> R:=seq(BesselJ(0,Z(0,m)*r),m=1..M): R[m] is the m-th eigenfunction
 

> T:=seq(cos(Z(0,m)*t),m=1..M): T[m] is the m-th time function
 

> j:=3:Tmax:=evalf(2*Pi/(Z(0,j)));Let's graph a solution R[j]*T[j]
 

.7260668894
 

> animate3d(R[j]*T[j],r=0..1,theta=0..2*Pi,t=0..Tmax,shading=zhue,style=patchnogrid,coords=z_cylindrical);
 

Plot_2d
 

Orthogonal Expansion of the Initial Condition 

Now, let's expand the solution for a given initial condition f(r) 

> f:=(r)->exp(-40*r^2);
 

proc (r) options operator, arrow; exp(`+`(`-`(`*`(40, `*`(`^`(r, 2)))))) end proc
 

> plot(f(r),r=0..1,thickness=2);
 

Plot_2d
 

Compute the coefficients: 

> A:=n->int(r*f(r)*R[n],r=0..1)/int(r*R[n]^2,r=0..1);
 

proc (n) options operator, arrow; `/`(`*`(int(`*`(r, `*`(f(r), `*`(R[n]))), r = 0 .. 1)), `*`(int(`*`(r, `*`(`^`(R[n], 2))), r = 0 .. 1))) end proc
 

> M1:=7; M is the number of terms in the expansion
 

7
 

> a:=seq(evalf(A(n)),n=1..M1);
 

0.8946660212e-1, .1784828786, .2124633970, .1940177641, .1454756903, 0.9214548240e-1, 0.5003121346e-1
0.8946660212e-1, .1784828786, .2124633970, .1940177641, .1454756903, 0.9214548240e-1, 0.5003121346e-1
 

Approximate the Initial Condition 

> F:=sum(a[n]*R[n],n=1..M1);
 

`+`(`*`(0.8946660212e-1, `*`(BesselJ(0, `*`(Z(0, 1), `*`(r))))), `*`(.1784828786, `*`(BesselJ(0, `*`(Z(0, 2), `*`(r))))), `*`(.2124633970, `*`(BesselJ(0, `*`(Z(0, 3), `*`(r))))), `*`(.1940177641, `*`(...
`+`(`*`(0.8946660212e-1, `*`(BesselJ(0, `*`(Z(0, 1), `*`(r))))), `*`(.1784828786, `*`(BesselJ(0, `*`(Z(0, 2), `*`(r))))), `*`(.2124633970, `*`(BesselJ(0, `*`(Z(0, 3), `*`(r))))), `*`(.1940177641, `*`(...
`+`(`*`(0.8946660212e-1, `*`(BesselJ(0, `*`(Z(0, 1), `*`(r))))), `*`(.1784828786, `*`(BesselJ(0, `*`(Z(0, 2), `*`(r))))), `*`(.2124633970, `*`(BesselJ(0, `*`(Z(0, 3), `*`(r))))), `*`(.1940177641, `*`(...
`+`(`*`(0.8946660212e-1, `*`(BesselJ(0, `*`(Z(0, 1), `*`(r))))), `*`(.1784828786, `*`(BesselJ(0, `*`(Z(0, 2), `*`(r))))), `*`(.2124633970, `*`(BesselJ(0, `*`(Z(0, 3), `*`(r))))), `*`(.1940177641, `*`(...
 

To see if we're on track lets plot the real initial data with its solution approximation (at t=0) 

> plot({f(r),F},r=0..1,thickness=2);
 

Plot_2d
 

Solution to the Wave Equation 

> u:=sum(a[n]*T[n]*R[n],n=1..M1);
 

`+`(`*`(0.8946660212e-1, `*`(cos(`*`(Z(0, 1), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 1), `*`(r)))))), `*`(.1784828786, `*`(cos(`*`(Z(0, 2), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 2), `*`(r)))))), `*`(.212463397...
`+`(`*`(0.8946660212e-1, `*`(cos(`*`(Z(0, 1), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 1), `*`(r)))))), `*`(.1784828786, `*`(cos(`*`(Z(0, 2), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 2), `*`(r)))))), `*`(.212463397...
`+`(`*`(0.8946660212e-1, `*`(cos(`*`(Z(0, 1), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 1), `*`(r)))))), `*`(.1784828786, `*`(cos(`*`(Z(0, 2), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 2), `*`(r)))))), `*`(.212463397...
`+`(`*`(0.8946660212e-1, `*`(cos(`*`(Z(0, 1), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 1), `*`(r)))))), `*`(.1784828786, `*`(cos(`*`(Z(0, 2), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 2), `*`(r)))))), `*`(.212463397...
`+`(`*`(0.8946660212e-1, `*`(cos(`*`(Z(0, 1), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 1), `*`(r)))))), `*`(.1784828786, `*`(cos(`*`(Z(0, 2), `*`(t))), `*`(BesselJ(0, `*`(Z(0, 2), `*`(r)))))), `*`(.212463397...
 

> animate3d(u,r=0..1,theta=0..2*Pi,t=0..5*2*Pi/Z(0,1),shading=zhue,style=patchnogrid,coords=z_cylindrical,frames=120);
 

Plot_2d