Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
differential equation - problem

Subject: differential equation - problem

From: Tomasz

Date: 6 Jun, 2010 07:13:04

Message: 1 of 3

Hi

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

i put the variable z
z=dx/dt
and my equation is in form

dz/dt+2/t * z=0

and now is my problem how to solve it with ode45 ???

thx for any help

Subject: differential equation - problem

From: Roger Stafford

Date: 6 Jun, 2010 08:31:14

Message: 2 of 3

"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 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

Subject: differential equation - problem

From: Tomasz

Date: 6 Jun, 2010 09:06:03

Message: 3 of 3


> 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

Yes, i want use matlab to solve that problem and don't know how to implement it in matlab

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us