Torsten
Posts:
1,459
Registered:
11/8/10


Re: Solving a system of three coupled linear diff equations
Posted:
Jan 14, 2014 9:44 AM


"Peter " <c4359385@drdrb.com> wrote in message <lb3hr5$e12$1@newscl01ah.mathworks.com>... > Hm, this gives me > > Error using char > Cell elements must be character arrays. > > Error in dsolve>mupadDsolve (line 279) > if isvarname(char(args{end})) > > Error in dsolve (line 186) > sol = mupadDsolve(args, options); > > Error in SpinLifetimes (line 23) > 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}); > > I don't really see what that means in this context, why does it need something to be a character?
Maybe like this: 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)
Best wishes Torsten.

