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

  • Thread starter Thread starter swraman
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary

Discussion Overview

The discussion revolves around using MATLAB's ODE45 function to solve a vector differential equation involving multiple variables and their derivatives. Participants explore the formulation of the problem, the representation of the equations in MATLAB, and the necessary steps to implement the solution.

Discussion Character

  • Homework-related
  • Technical explanation
  • Exploratory

Main Points Raised

  • One participant presents a vector differential equation involving variables e1, e2, and their derivatives, questioning how to input this into MATLAB for ODE45.
  • Another participant requests clarification on the representation of the equation to provide assistance.
  • A participant describes the complexity of the equation and mentions a dependent term, delta, which relates to e1 and e2.
  • One response suggests that the delta function is merely a delayed input and encourages defining the vectors and matrices in MATLAB to simplify the problem.
  • It is proposed that the differential equation can be rearranged into a linear algebra format suitable for ODE45, emphasizing the matrix representation.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and comfort with the problem, indicating that there is no consensus on the best approach to implement the solution in MATLAB. Some participants offer suggestions while others seek further clarification.

Contextual Notes

The discussion includes assumptions about the representation of the differential equation and the dependencies of the variables, which may not be fully resolved. Specific details about the matrices and their definitions are not provided, leaving some ambiguity in the implementation steps.

Who May Find This Useful

This discussion may be useful for students or individuals seeking to understand how to apply MATLAB's ODE45 function to complex vector differential equations, particularly in a homework or academic context.

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:

[tex]\frac{d [e1 ; e1', e2 ; e2'] }{dt}[/tex] = [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 [tex]\delta[/tex] = [tex]\frac{L}{R}[/tex] - 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
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 16 ·
Replies
16
Views
8K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K