Disabling ContourPlot updating in Manipulate and Show commands
- To: mathgroup at smc.vnet.net
- Subject: [mg125208] Disabling ContourPlot updating in Manipulate and Show commands
- From: Galen Craven <gcraven98 at gmail.com>
- Date: Wed, 29 Feb 2012 07:22:29 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
In the below example, I would like to stop updating of the ContourPlot
when moving the T variable slider while still updating the
ParametricPlot. The ContourPlot does not depend on the T variable, but
it still updates whenever the slider is moved continuously or when the
slider is automated by pushing play. Does anyone know how to do this?
Thanks.
Manipulate[
system = {m Q1''[t] == MBderQ1, m Q2''[t] == MBderQ2};
Show[ContourPlot[ MB[Q1, Q2],
{Q1, -1.5, 1.0}, {Q2, -0.5, 2.0}, Contours -> 15,
ClippingStyle -> Automatic, FrameTicks -> None],
ParametricPlot[
Evaluate[{Q1[t], Q2[t]} /. solution[pt, system], {t, 0, T}],
AxesLabel -> {Subscript[Q, 1], Subscript[Q, 2]},
LabelStyle -> Directive[Black, Large], Ticks -> False,
PerformanceGoal -> "Quality", PlotStyle -> {Red, Thickness[0.001]},
ImageSize -> {400, 400}]],
Delimiter,
{T, 0.001, maxtime},
{{pt, {{0, 0}}}, {-2, -2}, {2, 2}, Locator},
Delimiter,
ControlPlacement -> Left, SynchronousUpdating -> False,
Initialization :>
(m = 100; maxtime = 100;
MB[x_, y_] := -200 Exp[-1 (x - 1)^2 - 10 y^2] -
100 Exp[-1 x^2 - 10 (y - 0.5)^2] -
170 Exp[-6.5 (x + 0.5)^2 + 11 (x + 0.5) (y - 1.5) -
6.5 (y - 1.5)^2] +
15 Exp[0.7 (x + 1)^2 + 0.6 (x + 1) (y - 1) + 0.7 (y - 1)^2];
MBderQ1 = -D[MB[Q1[t], Q2[t]], Q1[t]];
MBderQ2 = -D[MB[Q1[t], Q2[t]], Q2[t]];
solvesystem[{Q1init_, Q2init_}, localsystem_] :=
Quiet[NDSolve[
Join[localsystem, {Q1[0] == Q1init, Q2[0] == Q2init,
Q1'[0] == 0, Q2'[0] == 0}],
{Q1, Q2}, {t, 0, maxtime}, MaxSteps -> \[Infinity]]];
solution[initialpositions_, localsystem_] :=
Map[solvesystem[#, localsystem] &, initialpositions])]