Re: Solving Weissinger's ODE
- To: mathgroup at smc.vnet.net
- Subject: [mg104892] Re: Solving Weissinger's ODE
- From: "Nasser M. Abbasi" <nma at 12000.org>
- Date: Thu, 12 Nov 2009 06:08:08 -0500 (EST)
- References: <hde08e$spq$1@smc.vnet.net>
"Virgil Stokes" <vs at it.uu.se> wrote in message news:hde08e$spq$1 at smc.vnet.net... >I can not see why the following does not work as expected, > > s = NDSolve[{t * (y[t])^2 * (y'[t])^3 - (y[t])^3 * (y'[t])^2 + t * > (t^2 + 1) * y'[t] - t^2 *y[t] == 0, y[1] == Sqrt[3/2]}, y[t], {t, 1, > 10}] > > Note, the solution to this nonlinear, non-autonomous, implicit ODE for > initial condition y[1] = Sqrt[3/2] is just y[t] = Sqrt[t^2 + 1]. > > Any suggestions on how to obtain the solution (either analytic or > numerical) would be appreciated. > > --V. Stokes > > Hello; Actually the numerical solution given by NDSolve is very good ! maxTime = 30; eq = t*y[t]^2*Derivative[1][y][t]^3 - y[t]^3*Derivative[1][y][t]^2 +t*(t^2 + 1)*Derivative[1][y][t] - t^2*y[t]; sol = NDSolve[{eq == 0, y[1] == Sqrt[3/2]}, y[t], {t, 1, maxTime}]; data = Table[{t, Evaluate[y[t] /. sol[[1,1]]]}, {t, 1, 30}]; trueSolution = Sqrt[t^2 + 0.5]; p1 = Plot[trueSolution, {t, 1, maxTime}, PlotRange -> All, AxesOrigin -> {0, 0}, PlotStyle -> Red]; p2 = ListPlot[data, PlotMarkers -> {Graphics[Disk[]], 0.02},AxesOrigin -> {0, 0}]; Show[p1, p2, PlotLabel -> "true vs numerical solution for weissinger ODE"] --Nasser