mem1-2.mws Vibrating of circular membrane (example2 for wave2-1.doc) - Standing Waves
> | restart; |
> | with(plots): |
Warning, the name changecoords has been redefined
> | a:=0.05; |
> | r1:=1; |
Eigenvalues:
> | w(x):=BesselJ(0,x*r1); |
> | plot(w(x),x=0..30); |
> | lambda:=array(1..50); |
> | n:=1: for m from 1 to 300 do z:=fsolve(w(x)=0,x=m/10..(m+1)/10); if type (z,float) then lambda[n]:=z: n:=n+1 fi od: |
> | for i to 5 do lambda[i] od; |
> | N:=n-1; |
> | n:='n':i:='i': |
Initial conditions:
> | f(r):=BesselJ(0,lambda[4]*r); |
> | g(r):=0; |
> | n:=4; |
Fourier coefficients:
> | b[n]:=int(r*f(r)*BesselJ(0,lambda[n]*r),r=0..r1)/int(r*BesselJ(0,lambda[n]*r)^2,r=0..r1); |
> | d[n]:=int(r*g(r)*BesselJ(0,lambda[n]*r),r=0..r1)/int(r*BesselJ(0,lambda[n]*r)^2,r=0..r1)/a/lambda[n]; |
> | u[n](r,t):=BesselJ(0,lambda[n]*r)*(b[n]*cos(lambda[n]*a*t)+d[n]*sin(lambda[n]*a*t)); |
> | u(r,t):=u[n](r,t): |
> | u(r,0):=subs(t=0,u(r,t)): |
> | u(r,1):=subs(t=1,u(r,t)): |
> | u(r,2):=subs(t=2,u(r,t)): |
> | u(r,3):=subs(t=3,u(r,t)): |
> | u(r,4):=subs(t=4,u(r,t)): |
> | u(r,5):=subs(t=5,u(r,t)): |
> | plot({f(r),u(r,0),u(r,1),u(r,2),u(r,3),u(r,4),u(r,5)},r=0..r1,color=black,axes=boxed); |
> | un(-r,t)=u(r,t): |
> | T:=2*Pi/a/lambda[1]; |
> | animate({un(-r,t),u(r,t)},r=-1..1,t=0..T,frames=100,color=blue,axes=boxed); |
> | cylinderplot([r,theta,u(r,5)],r=0..r1,theta=0..2*Pi,grid=[50,50]); |
> | animate3d([r,theta,u(r,t)],r=0..r1,theta=0..2*Pi,t=0..2*T,coords=cylindrical,style=patchnogrid,frames=100); |
> |