SetDirectory[$HomeDirectory<>"/Documents/handouts/math467/SteadyStateSphere"]

Steady-State Temperature in a Sphere

u[ρ_,ϕ_]:=50-50Sum[(((-1))^k)Factorial[2k](4k-1)(ρ^(2k-1))LegendreP[2k-1,Cos[ϕ]]/((2^(2k))(2k-1)((Factorial[k])^2)),{k,1,50}]

DensityPlot[u[Sqrt[(x^2)+(y^2)],ArcTan[x,y]-π/2],{x,-1,1},{y,-1,1},RegionFunction->Function[{x,y},(x^2)+(y^2)≤1],FrameLabel->{"x","y"}]

ContourPlot[u[Sqrt[(x^2)+(y^2)],ArcTan[x,y]-π/2],{x,-1,1},{y,-1,1},RegionFunction->Function[{x,y},(x^2)+(y^2)≤1],FrameLabel->{"\!\(\*TemplateBox[<|"boxes" -> FormBox[
StyleBox["x", "TI"], TraditionalForm], "errors" -> {}, "input" -> "x", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)","\!\(\*TemplateBox[<|"boxes" -> FormBox[
StyleBox["z", "TI"], TraditionalForm], "errors" -> {}, "input" -> "z", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"},Contours->10Range[9],Epilog->{Map[Text[#,ρ{0,1}/.FindRoot[u[ρ,0]-#,{ρ,0}],Background->White]&,10Range[9]]},BaseStyle->FontSize->12]

Export["tempsphereindeptheta.pdf",%,"PDF"]

Export["tempsphereindeptheta.eps",%%,"EPS"]