evaluations in Plot in Manipulate?
- To: mathgroup at smc.vnet.net
- Subject: [mg90885] evaluations in Plot in Manipulate?
- From: J Davis <texasAUtiger at gmail.com>
- Date: Mon, 28 Jul 2008 07:52:15 -0400 (EDT)
I must be overlooking something simple in the way Mathematica handles the arguments of Manipulate. Could someone expound on the contrast in behavior between the last example below and the previous two? Clear[a, b, c, h]; a = 1; c = 1; h[t_] = InverseLaplaceTransform[1/(a s^2 + b s + c), s, t] Manipulate[ Plot[Evaluate[ InverseLaplaceTransform[1/(a s^2 + b s + c), s, t]], {t, 0, 10}, PlotRange -> {{0, 10}, {-1, 1}}], {b, 0, 5}] (* works fine *) Manipulate[ Plot[-((E^((-(b/(2 a)) - Sqrt[b^2 - 4 a c]/(2 a)) t) - E^((-(b/(2 a)) + Sqrt[b^2 - 4 a c]/(2 a)) t))/Sqrt[ b^2 - 4 a c]), {t, 0, 10}, PlotRange -> {{0, 10}, {-1, 1}}], {b, 0, 5}] (* works fine... I just copied and pasted the output of h[t] into the Plot[...] *) Manipulate[ Plot[Evaluate[h[t]], {t, 0, 10}, PlotRange -> {{0, 10}, {-1, 1}}], {b, 0, 5}] (* nothing... what am I missing? *) Doesn't Evaluate[h[t]] hold the evaluated form of h[t] (so that it is computed just once) and then Plot simply substitutes a sequence of numerical values into that evaluated form? If so, why is there no output? Thanks in advance, John