Creating Plots for a Family of Solutions
I guess you have some sort of time evolution of Bessel-like waves. I also see that your examples deal with 3rd zero of Bessel J0 - I'll use it too. Define a function:
mYf[r_, t_, n_] := With[
{k = BesselJZero[0, n]},
(Cos[k t] + Sin[k t]) BesselJ[0, k r]
]
Build a time evolution list:
giflist = Table[
RevolutionPlot3D[
Evaluate[N@mYf[r, t, 3]],
{r, 0, 1},
SphericalRegion -> True,
PlotRange -> {{-1, 1}, {-1, 1}, {-1.5, 1.5}},
ImageSize -> 450,
PlotStyle -> Opacity[.7],
ColorFunction -> "TemperatureMap",
MeshStyle -> Opacity[.5],
PlotLabel -> time == t
],
{t, 0, 2 Pi/N[BesselJZero[0, 3]], .05}
];
Display as animated .GIF -
Export["bessel.gif", giflist]
Display as a table:
GraphicsGrid[
Partition[
Show[#,Boxed ->False, Axes -> False] & /@ giflist,
5
],
ImageSize -> 500,
Spacings -> 0
]
Create an interface to investigate parameters. You BTW did not define dependence of a
and b
on n
so I'll just define them generically:
Manipulate[
RevolutionPlot3D[
Evaluate[N@mYf[r, t, n, a, b, α]],
{r, 0, 1},
SphericalRegion -> True,
PlotRange -> {{-1, 1}, {-1, 1}, {-1.5, 1.5}},
ImageSize -> 350,
PlotStyle -> Opacity[.7],
ColorFunction -> "TemperatureMap",
MeshStyle -> Opacity[.5],
PlotLabel -> time == t,
PlotPoints -> 25
],
{{t, 1.36, "time"}, 0, 2, ImageSize -> Tiny},
Delimiter,
"zero's order",
{{n, 7, ""}, Range[7], SetterBar, ImageSize -> Tiny},
Delimiter,
{{a, 1.2, "a_n"}, 0, 2, ImageSize -> Tiny},
{{b, 1, "b_n"}, 0, 2, ImageSize -> Tiny},
{{α, .9, "α"}, 0, 2, ImageSize -> Tiny},
FrameMargins -> 0,
ImageMargins -> 0,
ControlPlacement -> Left,
Initialization :> (
mYf[r_, t_, n_, a_, b_, α_] :=
With[
{k = BesselJZero[0, n]},
(a Cos[α k t] +
b Sin[α k t]) *
BesselJ[0, k r]
]
)
]
Let's say you want to plot a family of functions $f_{a,\,b,\,c}(x)=a\sin(b\,x^c)$ for $a\in\{-2,-1,1,2\}$, $b\in\{1,2\}$, $c\in\{1,2,3\}$:
(* Define the function itself *)
f[x_, a_, b_, c_] := a Sin[b x^c]
(* Generate a table consisting of all possible
combinations for the values of a, b, c *)
fPlot = Table[
f[#, a, b, c],
{a, {-2, -1, 1, 2}},
{b, 1, 2},
{c, 1, 3}
];
(* Flatten it so it's a 2-dimensional list that
can be plotted as usual *)
fPlot = Flatten[#, 1] & @ fPlot;
(* Convert it to a function, making use of the "#"
introduced in the Table statement above *)
fPlot = Function[Evaluate@fPlot];
(* Plot it *)
Plot[fPlot[x] // Evaluate, {x, 0, 3}]