Search All of the Math Forum:

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

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

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

 Messages: [ Previous | Next ]
 Torsten Posts: 1,717 Registered: 11/8/10
Re: Solving a system of three coupled linear diff equations
Posted: Jan 14, 2014 9:18 AM

"Peter " <c4359385@drdrb.com> wrote in message <lb3eec\$n9\$1@newscl01ah.mathworks.com>...
> 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.

Date Subject Author
1/14/14 Peter
1/14/14 Torsten
1/14/14 Peter
1/14/14 Torsten
1/14/14 Peter
1/14/14 Torsten
1/14/14 Peter
1/14/14 Torsten
1/14/14 Peter
1/15/14 Torsten