Assignment 10 (final assignment) 
2026
Solutions

Problem 4

h[x_,omega_,t_] = (x/2) (2 - Cos[omega t]) ;

step[a_,b_,j_,k_]=a+(b-a) j/k;

equilibrium[L_]:=ListPlot[Table[{step[0,L,j,10],1},{j,0,10}],PlotStyle->{AbsolutePointSize[8],Black},PlotRange->{{-0.1,2 L+0.1},{-0.1,1.1}}]

equilibrium[2]

oscillate[L_,omega_,t_]:=ListPlot[Table[{h[step[0,L,j,10],omega ,t],0},{j,0,10}],PlotStyle->{AbsolutePointSize[8],Black}]

oscillate[2,1,1]

answer[L_,omega_]:=Animate[Show[equilibrium[L],oscillate[L,omega,t]],{t,0,20}]

answer[1,1]

answer[2,1]

answer[1,3]

Problem 5

wp[x_,t_]=x + 0.5 Cos[Pi t/2] Sin[Pi x/2];
Animate[ListPlot[Table[{wp[step[0,1,j,10],t],0},{j,0,10}],PlotStyle->{AbsolutePointSize[8],Black},PlotRange->{{-0.1,1.6},{-0.1,0.1}}],{t,0,20}]

wpx[x_,t_]=D[wp[x,t],x]

wpx[1,t]

answer[1,Pi/2]

Problem 8

Ajay[x_,L_,j_]= Sin[(2 j+1) Pi x /(2L)]

lambdajay[j_]=((2 j+1) Pi/(2L))^2

Plot[{Ajay[x,1,0],Ajay[x,1,1],Ajay[x,1,2]},{x,0,1}]

Integrate[Ajay[x,L,j] Sin[Pi x/L],{x,0,L}]

ajay[j_,L_]=(2/L) (-1)^(j+1) 4 L/((4 j^2 + 4j-3) Pi)

Bjay[t_,L_,j_]=E^(-lambdajay[j]^2 t)

partial[x_,t_,L_,k_]:=Sum[ajay[j,L] Ajay[x,L,j] Bjay[t,L,j],{j,0,k}]

partial[x,t,1,1]

Plot[{Sin[Pi x],partial[x,0,1,0],partial[x,0,1,1],partial[x,0,1,2],partial[x,0,1,20]},{x,0,1}]

Plot[{Sin[Pi x],partial[x,0,1,20]},{x,0,1}]

Problem 9

coeff[j_]:=NIntegrate[r (1-r^2) BesselJ[0,BesselJZero[0,j]r], {r,0,1}]/NIntegrate[r BesselJ[0,BesselJZero[0,j]r]^2, {r,0,1}]

ninepart[r_,t_,k_]:=Sum[coeff[j] BesselJ[0,BesselJZero[0,j]r] Cos[BesselJZero[0,j] t],{j,1,k}]

testninea=Plot[{1-r^2,ninepart[r,0,1]},{r,0,1}]

testnineb=Plot[{1-r^2,ninepart[r,0,4]},{r,0,1}]

Problem 9

Here I'll take L = 1/2 to be the height/length of the cylinder.

coefften[j_]:=-NIntegrate[r (1-r^2) BesselJ[0,BesselJZero[0,j]r], {r,0,1}]/NIntegrate[ Sinh[BesselJZero[0,j]/2]r BesselJ[0,BesselJZero[0,j]r]^2, {r,0,1}]

tenpart[r_,z_,k_]:=Sum[coefften[j] BesselJ[0,BesselJZero[0,j]r] Sinh[BesselJZero[0,j] (z-1/2)],{j,1,k}]

testtena=Plot[{1-r^2,tenpart[r,0,1]},{r,0,1}]

testnineb=Plot[{1-r^2,ninepart[r,0,4]},{r,0,1}]