MathGroup Archive 2006

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

Search the Archive

Re: Getting the value of the independent var from the dep.var using NDSolve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63708] Re: [mg63667] Getting the value of the independent var from the dep.var using NDSolve
  • From: Pratik Desai <pdesai1 at umbc.edu>
  • Date: Tue, 10 Jan 2006 04:50:34 -0500 (EST)
  • References: <200601090949.EAA29672@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

pradeep suresh wrote:

>Hi all,
>i have a specific problem of finding the point at which the dependent 
>variable takes on a particular value in teh solution of a differential 
>equation.
>e.g. for simplicity
>we have the equation y'[t]==t, and the initial cond. y[0]==0.y is the 
>dep. variable and t is the independent variable.
>i want to find out the 't' at which y[t]==p(p is known, say 8)
>and since i am already using NDSolve to solve this and other equations 
>i'd like to achieve this working around NDSolve,
>could anyone suggets a solution to this problem??
>thanks a ton!
>Pradeep
>
>  
>
I think this is possible in Ver 5.2, here is a link with a nice example 
using widget by Robert Knapp
http://library.wolfram.com/infocenter/Conferences/5817/

For pre 5.2 I think if you look at EvaluationMonitor it will give you 
some work around. Here is one that I modified a bit

ww=Reap[Sow[NDSolve[{x''[t]+x[t]==0,x[0]==1,x'[0]==0},x,{t,0,2Ï?},Methodï?¢"ExplicitRungeKutta",StepMonitorï??Sow[t,"Steps"], 
EvaluationMonitorï??Sow[{t,x[t],x'[t]}]]]];
TableForm[Most[ww[[2,1]]],TableHeadings->{Automatic,{"t","x[t]","x'[t]"}}

I have never used Reap and Sow so some of the functionality is still 
unclear to me??

Hope this helps

Pratik


  • Prev by Date: Re: Question - Function Definition
  • Next by Date: Re: Performance improvement needed - Help.
  • Previous by thread: Getting the value of the independent var from the dep.var using NDSolve
  • Next by thread: Re: Moving an outsider to the closest point on the boundary