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

*To*: mathgroup at smc.vnet.net*Subject*: [mg72213] Re: How to use the max value from the solution of NDSolve ?*From*: dh <dh at metrohm.ch>*Date*: Thu, 14 Dec 2006 05:49:43 -0500 (EST)*Organization*: hispeed.ch*References*: <elosjf$on7$1@smc.vnet.net>

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 ? >