Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: Solving a system of three coupled linear diff equations
Replies: 9   Last Post: Jan 15, 2014 2:15 AM

Advanced Search

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

Posts: 1,477
Registered: 11/8/10
Re: Solving a system of three coupled linear diff equations
Posted: Jan 14, 2014 9:18 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Peter " <c4359385@drdrb.com> wrote in message <lb3eec$n9$1@newscl01ah.mathworks.com>...
> Thanks for your reply!
> So it would be something like
> p1 = 0.05;
> p2 = 0.05;
> p3 = 0.05;
> p4 = 0.05;
> Y = dsolve({diff(M1) == -p1*M1+p2*M2, diff(M2) == -(p2+p3)*M2+p1*M1+p4*M3, diff(M3) == -p4*M3+p3*M2}, {M1(0) == 1, M2(0) == 0, M3(0) ==0})
>
> However, this doesn't really work as it wouldn't know what M2 is before solving it, right?


p1 = 0.05;
p2 = 0.05;
p3 = 0.05;
p4 = 0.05;
syms M1(t) M2(t) M3(t)
Y = dsolve({diff(M1) == -p1*M1+p2*M2, diff(M2) == -(p2+p3)*M2+p1*M1+p4*M3, diff(M3) == -p4*M3+p3*M2}, {M1(0) == 1, M2(0) == 0, M3(0) ==0})

Does that work ?
The solution should be stored in Y.M1, Y.M2 and Y.M3.

Best wishes
Torsten.



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.