Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Manipulating a Plot Function' topicStudent Support Forum > General > "Manipulating a Plot Function"

Next Comment >Help | Reply To Topic
Author Comment/Response
04/28/10 10:43am

Consider the following lines of matheamtica code:

(* 1 *) Manipulate[Plot[Sin[a x], {x, 0, 2 Pi}], {a, 1, 2}]
Expr = Sin[a x];
(* 2 *) Manipulate[Plot[Expr, {x, 0, 2 Pi}], {a, 1, 2}]
(* 3 *) Manipulate[Expr /. x -> Pi, {a, 1, 2}]

I want (* 2 *) to produce the same result as (* 1 *) but the variable 'a' is not being touched by Manipulate. However 'a' is manipulated in (* 3 *). Does anyone understand this problem. It seems like it has to do with the order in which variables are substituted.

The reason I care is that Expr may be a huge expression output from an ODE solver (which takes a long time to solve). I would like to pre-compute it, and plot it without having to copy and paste the expression in.

URL: ,

Subject (listing for 'Manipulating a Plot Function')
Author Date Posted
Manipulating a Plot Function Michael 04/28/10 10:43am
Re: Manipulating a Plot Function yehuda ben-s... 05/03/10 11:34am
Next Comment >Help | Reply To Topic