×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

solving of ordinary differential equations

solving of ordinary differential equations

solving of ordinary differential equations

(OP)
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

RE: solving of ordinary differential equations

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.  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources