Re: Error with NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg50949] Re: Error with NDSolve
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 29 Sep 2004 03:15:15 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <cjaru4$nni$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, sol = NDSolve[{si2'[t] == 2, si2[0] == 0, th2'[t] == Sin[si2[t]]/r2[t], th2[0] == 0, r2'[t] == Cos[si2[t]], r2[0] == 1}, {si2, r2, th2}, {t, 0, 25}]; r[t_] = r2[t] /. First[sol]; th[t_] = th2[t] /. First[sol]; si[t_] = si2[t] /. First[sol]; no error. Avoid the usage of % in the FrontEnd. Regards Jens "Narasimham G.L." wrote: > > There is error in si[t] even after the interpolating function is > obtained. Thanks for fix. > > NDSolve[ {si2'[t] == 2, si2[0] == 0, > th2'[t] == Sin[si2[t]]/r2[t], th2[0] == 0, r2'[t] == Cos[si2[t]], > r2[0] == 1}, {si2, r2, th2}, {t, 0, 25}]; r [t_] = r2[t] /. First[%]; > th[t_] = th2[t] /. First[%]; > (* error -> *) si[t_] = si2[t] /. First[%];