MathGroup Archive 2006

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

Search the Archive

Re: How to use the max value from the solution of NDSolve ?



Hi Cham,

the output of NDSolve is an expression and parts of an expression may be 

accessed by Part. E.g.:

sol = NDSolve[{x'[t] == x[t], x[0] == 3.4}, {x}, {t, 0, 10}];

sol[[1, 1, 2, 1, 1, 2]]

give the x-max.

Daniel



Cham wrote:

> Suppose I'm solving a differential equation with NDSolve :

> 

> NDSolve[{ x'[t] == f[ x[t] ],  x[0] == 3.4 ], { x }, {t, 0, 10}]

> 

> Mathematica then finds a solution like this :

> 

> Out[]=  {{ x -> InterpolatingFunction[{{ 0.,  2.6532}}, <>}}

> 

> Next, I need to make several graphs of the solution.  How can I point to the max value t = 2.6532 without retyping that value each time, especially if I change the initial condition x[0] == 3.4 and redo NDSolve again ?  What is the name of the t_max found by Mathematica ?  Or how can I point to that special value ?  Is there a way ?

> 



  • Prev by Date: How to plot multiple surface plots each with different domains in
  • Next by Date: Re: Mathematica video output without printing frames
  • Previous by thread: How to use the max value from the solution of NDSolve ?
  • Next by thread: RE: How to use the max value from the solution of NDSolve ?