How Can MATLAB's ODE45 Be Used to Solve Vector Differential Equations?

  • Thread starter Thread starter swraman
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
To solve vector differential equations using MATLAB's ODE45, the equation must be reformulated into a suitable matrix form. The user is advised to define the necessary vectors and matrices in MATLAB, including the 4x1 vectors and the 4x4 matrix. The differential equation can be expressed as dE/dt = MMM*E + AAA, where E represents the solution vector and AAA is a linear combination of other terms. This transformation simplifies the problem into a linear algebra format, allowing ODE45 to be effectively utilized. Properly structuring the input will facilitate the solution of the complex differential equation.
swraman
Messages
165
Reaction score
0

Homework Statement


I have a Differential equation, it is in the form of a vector. It consists of 2 errors and their derivatives:

[e1 ; e1', e2 ; e2']

they are all related by:

\frac{d [e1 ; e1', e2 ; e2'] }{dt} = [4x1 matrix] + [4x1 matrix]*e1 + [4x1 matrix]*e1' + [4x1 matrix]*e2 + [4x1 matrix]*e2' + [4x4 matrix]*[e1 ; e1', e2 ; e2']


The Attempt at a Solution



I don't know how to input this into MATLAB for use with ODE45. All the matricies I have are constants, except for the e1, e2, and their derivatives. Can this be treated as a fourth order differential equation in Matlab even though it is 2 second order problems?

Any help appreciated.

Thanks
 
Physics news on Phys.org
can you provide a few more details, I don't understand the represntation, but I can help you!
 
Hi, thanks for the reply.

I have a Differential equation describing e1',e1'',e2',and e2''.
It is rather complicated so I photoed it here:

3273283873_5b3b74df9e_o.jpg


I have no idea how enter that into matlab.

Also, in this equation \delta = \frac{L}{R} - e1 - e1' - e2 - e2'. So that term has dependence on the vars e1 and e2 also.

This is a bit overwhelming for me, I don't know where to go. Any help appreciated!

Thanks
 
dont fret about the delta functon, its just delayed so that the input will be definted for the instant you are interested in!

you want to start by defining the 4, 4x1 vectors in your program:

say v1, v2, v3, v4

define the 4x4 matrix 'MMM' in the same fashion
your desired vector can be defined as:

E_solution = [e1 ; e1', e2 ; e2']



employing the correct matrix/vector multipliaction, you will reduce this differential equation problem to a linear algebra problem...


thsi is th ebeauty of MATLAB thi si sthe construct for which it is based on.

if you define the multiplicative factors in your pic as, for instance:

delta, psi_dot_des, sin_phi (not sure if these are functions somehow maybe)

you reduce your equation to somethig of the form:

dE_solution/dt = delta*v1 + psi_dot_des*v2 + sin_phi*v3 + MMM*E_solution

I think you can rearange this to be something of the form

dE/dt = MMM*E + AAA where AAA is the linear combination of the other terms...

so now you have something in matrix form and you can use the appriate inputs into the ode45 function... let me know ho wit goes, I need to go scan for my CT experiments this afternoon so I may not be able to get back to you right away

best of luck
 
Back
Top