The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: how to Solve coupled ODEs
Replies: 5   Last Post: Feb 12, 2013 11:07 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 1,717
Registered: 11/8/10
Re: (yet unsolved) how to Solve coupled ODEs
Posted: Feb 12, 2013 11:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Henry" wrote in message <kfb8m3$mom$>...
> Problem not yet solves, any helps please?

Just compare line for line:

global a b c d e
[t,y] = ode45(@odeeqns, [0 3], [1 1]);

function dyds = odeeqns(s,y)
global a b c d e
dyds = zeros(2,1)
dyds(1,1) = 1/y(1) *(y(2)*(d+s /y(2))-a *y(1)*sqrt(y(1)^2+(e+y(2))^2));
dyds(2,1) = -(y(2)*(b+y(2))*sqrt(y(1)^2+(e+y(2))^2))/y(1)-y(2)/s - c;

Best wishes

If you start with s=0 as I suggested in the call to ode45, you will get problems in the evaluation of dyds(2,1) because of the term y(2)/s (division by zero).
Please supply the values of the parameters a,b,c,d and e, the interval of integration and the error message you received.

Best wishes

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.