"Tomasz " <skorpionxx@tlen.pl> wrote in message <hufhq0$qgl$1@fred.mathworks.com>...
> .......
> 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 zerodividedbyzero 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
