Torsten
Posts:
1,627
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>... > 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.

