Worksheet: Bongo.mw 

Solution to the Wave Equation in a Disc 

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

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

BC:    u(1,θ,t)=0 

IC:     u(r,theta,0)=f(r,θ)  u[t](r,theta,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):
 

Eigenfunctions in the Disc  

> p:=3;q:=2; p is the angular mode number; q is the radial mode number
 

 

3
2
 

> R:=(p,q)->BesselJ(p,Z(p,q)*r); R(p,q) is the  (p,q)-eigenfunction
 

proc (p, q) options operator, arrow; BesselJ(p, `*`(Z(p, q), `*`(r))) end proc
 

> T:=(p,q)->cos(Z(p,q)*t); T(p,q)  is the (p,q)- time function
 

proc (p, q) options operator, arrow; cos(`*`(Z(p, q), `*`(t))) end proc
 

> u:=(p,q)->R(p,q)*T(p,q)*cos(p*theta);
 

proc (p, q) options operator, arrow; `*`(R(p, q), `*`(T(p, q), `*`(cos(`*`(p, `*`(theta)))))) end proc
 

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

.6437015080
 

> animate3d(u(p,q),r=0..1,theta=0..2*Pi,t=0..Tmax,shading=zhue,style=patchnogrid,coords=z_cylindrical);
 

Plot_2d
 

Orthogonal Expansion of an Initial Condition 

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

> f:=r->r^3*(1-r)^2;
 

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

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

Plot_2d
 

Compute the coefficients: 

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

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

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

3
 

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

0.5375286600e-1, -0.1747670127e-1, -0.1038294014e-1
 

Approximate the Initial Condition 

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

`+`(`*`(0.5375286600e-1, `*`(BesselJ(1, `*`(Z(1, 1), `*`(r))))), `-`(`*`(0.1747670127e-1, `*`(BesselJ(1, `*`(Z(1, 2), `*`(r)))))), `-`(`*`(0.1038294014e-1, `*`(BesselJ(1, `*`(Z(1, 3), `*`(r)))))))
`+`(`*`(0.5375286600e-1, `*`(BesselJ(1, `*`(Z(1, 1), `*`(r))))), `-`(`*`(0.1747670127e-1, `*`(BesselJ(1, `*`(Z(1, 2), `*`(r)))))), `-`(`*`(0.1038294014e-1, `*`(BesselJ(1, `*`(Z(1, 3), `*`(r)))))))
 

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:=cos(theta)*sum(a[n]*T(1,n)*R(1,n),n=1..M1);
 

`*`(cos(theta), `*`(`+`(`*`(0.5375286600e-1, `*`(cos(`*`(Z(1, 1), `*`(t))), `*`(BesselJ(1, `*`(Z(1, 1), `*`(r)))))), `-`(`*`(0.1747670127e-1, `*`(cos(`*`(Z(1, 2), `*`(t))), `*`(BesselJ(1, `*`(Z(1, 2),...
`*`(cos(theta), `*`(`+`(`*`(0.5375286600e-1, `*`(cos(`*`(Z(1, 1), `*`(t))), `*`(BesselJ(1, `*`(Z(1, 1), `*`(r)))))), `-`(`*`(0.1747670127e-1, `*`(cos(`*`(Z(1, 2), `*`(t))), `*`(BesselJ(1, `*`(Z(1, 2),...
 

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

Plot_2d
 

>