Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problem in Evaluate/Manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88657] Re: Problem in Evaluate/Manipulate
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Sun, 11 May 2008 15:16:25 -0400 (EDT)
  • Organization: University of Bergen
  • References: <g03v2l$bno$1@smc.vnet.net>

wiso wrote:
> I have a problem with this code:
> 
> Solution =DSolve[{x^\[Prime][t]==a x[t]+b y[t],y^\[Prime][t]==c x[t]+d
> y[t],x[0]==x0,y[0]==-10},{x[t],y[t]},t];
> 
> Manipulate[
> Solutions = Evaluate [Table[{x[t],y[t]}/.Solution[[1]],
> {x0,-10,10,10}]]
> ,{a,-1,1},{b,-1,1},{c,-1,1},{d,-1,1}]
> 
> I want to solve only one time the PDE, then I placed it outside the
> Manipulate. The code doesn't evaluate the solution with the dynamic
> values.
> 

Remove "Solutions =".  From the doc page of Evaluate:

"Evaluate only overrides HoldFirst, etc. attributes when it appears 
directly as the head of the function argument that would otherwise be held."

This will work:

Manipulate[
  Evaluate[Solutions =
    Table[{x[t], y[t]} /. Solution[[1]], {x0, -10, 10, 10}]], {a, -1,
   1}, {b, -1, 1}, {c, -1, 1}, {d, -1, 1}]


  • Prev by Date: Conjugate of Symbolic Expression
  • Next by Date: Re: PlotLegend not working properly in my Mathematica 6
  • Previous by thread: Re: Problem in Evaluate/Manipulate
  • Next by thread: Bug in Plot?