Hi, I'm trying to model a spiral galaxy using some density distributions and display them with a 2D density plot. The functions are integrated along a line of sight in order to reduce the 3 variables functions to 2 variables function. In order to make a rotating plot I'm trying to use Manipulate. Here it is my code, which gives me as output only a static image that doesn't rotate moving the slider. The code is this:
LogarithmicScaling[x_, min_, max_] := Log[x/min]/Log[max/min]
f[x_?NumericQ, y_?NumericQ, t_?NumericQ] :=
NIntegrate[
2.872416767*10^3*Exp[(-Sqrt[x^2 + y^2])/2.676]*Exp[(-Abs[z] + 1- Cos[2*(ArcTan[y/x] - t) + (2/(Tan[7*Pi/90]))*Log[Sqrt[x^2 + y^2]/4.9]])] +7.013941065*10^5*Exp[-Sqrt[x^2 + y^2 + z^2]/0.09866] + (7.321354473)/(1 + (Sqrt[x^2 + y^2 + z^2]/3.936)^2)^(5/2), {z, -Infinity, +Infinity}]
plotter[min_, max_, NumberOfTicks_] :=
Manipulate[DensityPlot[f[x, y, t], {x, -25, 25}, {y, -25, 25},
PlotRange -> Full, ColorFunctionScaling -> False,
ColorFunction -> (ColorData["SunsetColors"][
LogarithmicScaling[#, min, max]] &), PlotPoints -> 50,
PlotLegends ->
BarLegend[{ColorData["SunsetColors"], {0, 1}},
LegendMarkerSize -> 370,
Ticks -> ({LogarithmicScaling[#, min, max],
ScientificForm[#, 1]} & /@ (min (max/min)^
Range[0, 1, 1/NumberOfTicks]))]], {t, 0, 100},
AnimationRunning -> False, SynchronousUpdating -> False ]
plotter[10^1, 10^5, 4]
The static image which has to rotate is shown in the attachment. If I plot the function fixing t with different values, it actually rotates, but the manipulate function seems to not work at all. Any idea?
Attachments: