Re: Re: Error with NDSolve

*To*: mathgroup at smc.vnet.net*Subject*: [mg51010] Re: [mg50976] Re: Error with NDSolve*From*: DrBob <drbob at bigfoot.com>*Date*: Fri, 1 Oct 2004 04:49:13 -0400 (EDT)*References*: <200409280458.AAA23991@smc.vnet.net> <cjdq6g$ass$1@smc.vnet.net> <200409300852.EAA26524@smc.vnet.net>*Reply-to*: drbob at bigfoot.com*Sender*: owner-wri-mathgroup at wolfram.com

All three schemes work just fine. If the first doesn't work for you, there's something wrong with your Mathematica installation or option settings. Bobby On Thu, 30 Sep 2004 04:52:30 -0400 (EDT), Narasimham G.L. <mathma18 at hotmail.com> wrote: > DrBob <drbob at bigfoot.com> wrote in message news:<cjdq6g$ass$1 at smc.vnet.net>... >> 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[%%] >> si[t_] = si2[t] /. First[%%%] > > Above three lines have some problem,but next two schemes work fine, Thanks. > >> solution = First@ >> 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] /. solution >> th[t_] = th2[t] /. solution >> si[t_] = si2[t] /. solution > > >> or (better yet): >> >> {r, th, si} = {si2, r2, th2} /. First@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}] >> >> Bobby >> > > > > -- DrBob at bigfoot.com www.eclecticdreams.net