I'm trying to plot a function of x and t in 1D, using manipulate to step through the time evolution of the function.
Manipulate[
Plot[Norm[χ[x, t]]^2, {x, -10, 10} ],
{t, 0, 1.82}]
I have defined the function
χ[x_, t_] :=
E^{
I[.5*(x - Evaluate[q[t] /. sol])^2 (Evaluate[a[t] /. sol] +
I Evaluate[b[t] /. sol]) + Evaluate[p[t] /. sol] (x -Evaluate[q[t] /. sol])]}
where a
, b
, q
, p
are time dependent functions that have been found using NDSolve
,
sol =
NDSolve[
{q'[t] == -p[t]/m,
p'[t] == -E^(-1/(4 b[t])) Sin[q[t]],
b'[t] == 2 a[t]/m,
a'[t] == (a[t]^2 - b[t]^2)/m + E^(-1/(4 b[t])) Cos[q[t]],
q[0] == 0, p[0] == 1, a[0] == 1, b[0] == 1},
{q, p, a, b}, {t, 0 , 10}]
It's not clear to me from the documentation if this is the proper syntax for Evaluate or /.sol in this context. Manipulate does not return any kind of error, it just returns a blank plot.