From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: differential equation - problem
Date: Sun, 6 Jun 2010 08:31:14 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <hufmci$sck$>
References: <hufhq0$qgl$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1275813074 29076 (6 Jun 2010 08:31:14 GMT)
NNTP-Posting-Date: Sun, 6 Jun 2010 08:31:14 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:642509

"Tomasz " <> wrote in message <hufhq0$qgl$>...
> .......
> i have a problem how to solve that equation in matlab:
> d^2x/dt^2+2/t dx/dt=0 
> the initial state is:
> x(0)=0.005
> dx/dt(0)=0
> .......

  Using calculus the general solution to your differential equation is

 x(t) = k1/t^2 + k2

where k1 and k2 are any constants.  The only way for this to fit your initial conditions is to have k1 = 0 and k2 = .005, which would make x a constant 0.005 .

  I suspect ode45 will have a difficult time with this at the beginning, however, because it will then be faced with a zero-divided-by-zero situation in computing the initial 2/t*z value.  I have no idea whether it can successfully maintain an x output at a constant 0.005, as it theoretically should.  You are asking a lot of ode45.

  My question is, why would you want to use matlab to solve such an elementary problem?  It is intended for solving problems that are beyond the scope of elementary calculus.

Roger Stafford