MATH529 L12
Cylindrical, Spherical Harmonics

Separation of variables cylindrical, spherical coordinates.

Laplacian in  cylindrical coordinates

Laplacian[u[r,θ,z],{r,θ,z},"Cylindrical"]//Expand

Laplace equation - separation of variables

u[r_,θ_,z_] = R[r] Θ[θ] Z[z]

PDE=Apart[Expand[(r^2) Laplacian[u[r,θ,z],{r,θ,z},"Cylindrical"]]/u[r,θ,z]]== 0

θDE = PDE[[1,2]] == -(n^2)

rzPDE = PDE[[1,1]] == (n^2)

Periodicity in   θ

θsol=Assuming[{n∈Integers,n>0},DSolve[θDE,Θ[θ],θ]][[1,1]]

Separation of R,Z

rzPDE1=Assuming[r>0,Apart[DivideSides[rzPDE,(r^2)]]]

rzPDE2=Assuming[r>0,Apart[SubtractSides[rzPDE1,rzPDE1[[1,1]]]]]

R(r) ODE

rODE=Apart[Assuming[{(r^2)R[r]≠0},MultiplySides[rzPDE2[[2]]==(α^2),(r^2) R[r]]]]

rsol = Assuming[α>0,DSolve[rODE ,R[r],r]][[1,1]] /.  {(C[1])->(C[3]),(C[2])->(C[4])}

Plot[Table[BesselJ[n,r],{n,0,5}],{r,0,20}]

Plot[Table[BesselY[n,r],{n,0,5}],{r,0,20}]

Z(z) ODE

zODE=rzPDE2[[1]]==(α^2)

zsol = DSolve[zODE,Z[z],z][[1,1]] /. {(C[1])->(C[5]),(C[2])->(C[6])}

Overall solution

eigmode[n_,α_,r_,θ_,z_]=u[r,θ,z] /. {θsol,rsol,zsol}

Example: cylinder of radius    r =1  vibrational modes

mode[n_]=eigmode[n,1,1,θ,z]/. {(C[1])->1,(C[2])->1,(C[3])->1,(C[4])->0,(C[5])->1,(C[6])->1}

GraphicsGrid[{Table[ParametricPlot3D[{(1+mode[n])Cos[θ],(1+mode[n]) Sin[θ],z},{θ,0,2π},{z,-1,1}],{n,0,3}]}]

Laplacian in   spherical  cordinates

Clear[u];
Laplacian[u[r,θ,ϕ],{r,θ,ϕ},"Spherical"]//Expand

Laplace equation - separation of variables

u[r_,θ_,ϕ_] = R[r] Θ[θ] Φ[ϕ]

PDE1=Apart[Expand[(r^2) Laplacian[u[r,θ,ϕ],{r,θ,ϕ},"Spherical"]]/u[r,θ,ϕ]]== 0

PDE=Expand[Assuming[((Csc[θ])^2)≠0,DivideSides[PDE1,((Csc[θ])^2)]]]

((2 r ((Sin[θ])^2) R'[r])/(R[r]))+((Cos[θ] Sin[θ] Θ'[θ])/(Θ[θ]))+(((r^2) ((Sin[θ])^2) R''[r])/(R[r]))+(((Sin[θ])^2) Θ''[θ])/Θ[θExpand[(r^2) Laplacian[u[r,θ,ϕ],{r,θ,ϕ},"Spherical"]]/u[r,θ,ϕ]== 0]+((Φ''[ϕ])/(Φ[ϕ]))==0

ϕDE = PDE[[1,5]] == -(n^2)

rθPDE =Assuming[((Sin[θ])^2)≠0,Expand[DivideSides[ PDE[[1,1;;4]] == (n^2),((Sin[θ])^2)]]]

Φ(ϕ) ODE

ϕsol=Assuming[{n∈Integers},DSolve[ϕDE ,Φ[ϕ],ϕ]][[1,1]]

rθ separation

rθPDE1=rθPDE [[1,2]]+rθPDE [[1,4]]-rθPDE [[2]] == -rθPDE [[1,1]]-rθPDE [[1,3]]

Θ(θ) solution

θDE = rθPDE1[[1]] == (m^2)

θsol=DSolve[θDE,Θ[θ],θ][[1,1]] /. {(C[1])->(C[3]),(C[2])->(C[4])}

R(r) solution

rDE = rθPDE1[[2]] == (m^2)

rsol=DSolve[rDE,R[r],r][[1,1]] /. {(C[1])->(C[5]),(C[2])->(C[6])}

Overall solution

eigmode[n_,m_,r_,θ_,ϕ_]=u[r,θ,ϕ] /. {θsol,rsol,ϕsol}

Example:  sphere of radius 1 vibrational modes

mode[n_,m_]=eigmode[n,m,1,θ,ϕ]/. {(C[1])->1,(C[2])->1,(C[3])->0.,(C[4])->0.1,(C[5])->0.1,(C[6])->0.1}

Monitor[GraphicsGrid[Table[ParametricPlot3D[(1+mode[n,I m]){Sin[θ] Cos[ϕ],Sin[θ] Sin[ϕ],Cos[θ]},{θ,0,π},{ϕ,0,2π}],{n,0,2},{m,0,3}]],{m,n}]