MathGroup Archive 2009

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

Search the Archive

Re: Solving Weissinger's ODE

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104896] Re: Solving Weissinger's ODE
  • From: Valeri Astanoff <astanoff at gmail.com>
  • Date: Fri, 13 Nov 2009 05:50:39 -0500 (EST)
  • References: <hde08e$spq$1@smc.vnet.net>

On 11 nov, 10:30, Virgil Stokes <v... at it.uu.se> wrote:
> 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

Good day,

Here is one way to get around the trouble :

In[1]:= lhs=t*(y[t])^2*(y'[t])^3-(y[t])^3*(y'[t])^2+t*(t^2+1)*y'[t]-
t^2*y[t];

In[2]:= Solve[ (lhs/.t->1/.y[1]->Sqrt[3/2])==0,y'[1]]
Out[2]= {{Derivative[1][y][1] -> Sqrt[2/3]},
{Derivative[1][y][1] -> (1/12)*(Sqrt[6] - I*Sqrt[138])},
{Derivative[1][y][1] -> (1/12)*(Sqrt[6] + I*Sqrt[138])}}

In[3]:= dlhs=D[lhs,t];

In[4]:= f[t_] = y[t] /. NDSolve[{dlhs == 0,
y[1] == Sqrt[3/2], y'[1] == Sqrt[2/3]}, y[t], {t, 1, 10}]//First
Out[4]= InterpolatingFunction[{{1.,10.}},<>][t]

In[5]:= Plot[f[t],{t,1,10}]
[...]

Check :

In[6]:= f[1]-Sqrt[3/2]
Out[6]= 0.

In[7]:= f'[1]-Sqrt[2/3]
Out[7]= 0.

In[8]:= lhs/.y->f/.t->2
Out[8]= 1.5067638958754515*^-7

In[9]:= lhs/.y->f/.t->5
Out[9]= 3.0166387716690224*^-6

In[10]:= lhs/.y->f/.t->10
Out[10]= 0.00002105357486925641

hth

--
Valeri Astanoff


  • Prev by Date: Re: Non-Linear pendulum
  • Next by Date: Re: Set::setps error? Twitter.m's OOP-like approach?
  • Previous by thread: Re: Solving Weissinger's ODE
  • Next by thread: Line Wrapping Problems, Slow Delete All Output