I am trying to animate a sum together with a circle (specifically the vector field $(r \sin \theta , r \cos \theta, u(r,t))$ using Animate
and ParametricPlot3D
in the following code.
Clear["Global`*"]
f[r_] := 1 - r^4
a = 1;
c = 1;
x0m[m_] := N[BesselJZero[0, m]]
omega0[m_] := c/a*x0m[m]
d[m_] := (Integrate[
r*BesselJ[0, (x0m[m]*r)/(a*c)]*f[r], {r, 0, a}])/(Integrate[
r*(BesselJ[0, (x0m[m]*r)/(a*c)])^2, {r, 0, a}])
u[r_, t_, mmax_] :=
Sum[d[m]*BesselJ[0, (x0m[m]*r)/(a*c)]*Cos[omega0[m]*t], {m, 1, mmax}]
Animate[ParametricPlot3D[{r*Cos[theta], r*Sin[theta], u[r, t, 5]}, {r,
0, 1}, {theta, 0, 2*π}, PlotRange -> {-1.2, 1.2},
BoundaryStyle -> Directive[Red, Thick],
ColorFunction -> "SolarColors", Mesh -> True], {t, 0, 10, 0.0001}]
However Animate
does nothing, although Mathematica computes the sum. I think the problem is the ParametricPlot3D
inside Animate
but I don't understand what is wrong with it. Can you help?