Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

solving of ordinary differential equations 1

Status
Not open for further replies.

olli78

New member
Jun 29, 2006
1
Hi there,

maybe someone can help me with this problem:

I need to solve two coupled ODE's (dq and dp) (each one has eight rows)
which I have written in one function file: function[dq,dp]=twopairs( here are the input
variables)

further down in this file
the dq is written out
and then the dp as a separate function
function dp=...

in the main file I want to solve dq and dp with
the ode45 solver. how do you refer to every function separately? They are stored in twopair.m
so this does not work?
[t1,Q]=ode45(@twopairs,...)
[t2,P]=ode45(@twopairs,...)

Any help is much appreciated!!!

Many thanks
olli
 
Replies continue below

Recommended for you

Since you have combined the equations, you will get Q=P, but neither will be what you desired. I think that is because MATLAB was told that there is only one equation, and you did not let MATLAB know that there were two uncoupled equations or not.

Since the equations are not coupled you might be able to assume the form of Q, and then take the part of the matrix that is the Q you want. Likewise for P, find out what part of the Q! you generate is and then take the part that is for the P that you want.. I am guessing that t1=t2 and it is good for both.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor