user1231969
user1231969

Reputation:

Matlab Using ode45 for 4th order ode

y'''' + (a1 + a2*v(t)^2)*y'' + (a3 + a4*v(t)^2)*y = 0 
y(0) = 2, Dy(0) = 0, D2y(0) = 0, D3y(0) = 0

I tried to solve the above 4th order ode with Matlab's dsolve but the results I got were very large. As I now understand, dsolve will not work here, I will have to use ode45 to solve this equation.

I tried to follow Matlab's document on ode45 but I couldn't understand it completely. Moreover, in my case, the coefficients are also time dependent.

How can I convert this equation in format understandable by ode45?

Upvotes: 2

Views: 2945

Answers (1)

reverse_engineer
reverse_engineer

Reputation: 4269

That's a 4th order ODE, you can't solve that directly. You must rewrite that as a system of first-order ODEs:

y_3' = -(a1+a2*v(t))*y_2 - (a3+a4*v(t)^2)*y
y_2' = y_3
y_1' = y_2
y' = y_1

with

y(0) = 2
y_1(0) = 0
y_2(0) = 0
y_3(0) = 0

This, you can feed to ODE45...

Upvotes: 2

Related Questions