'Explicit solution could not be found' solving a 12x12 matrix

2 views (last 30 days)
Hi all, I am currently stuck trying to solve this matrix for p1, I am assuming this is because 'comat' is so sparse, but I am not sure where to step next if the matlab solver can not find a solution:
syms p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12
states = [p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12];
dsdt = [ 0 0 0 0 0 0 0 0 0 0 0 1];
fb = 1/10; fs = 1/5; rb = 1/0.75; rs = 1/0.5;
comat = [-fs-fb, fb 0 0 fs 0 0 0 0 0 0 1;...
rb -rb-fb-fs fb 0 0 fs 0 0 0 0 0 1;...
0 rb -rb-fb-fs fb 0 0 fs 0 0 0 0 1;...
0 0 rb -rb 0 0 0 0 0 0 0 1;...
rs 0 0 0 -rs-fb-fs fb 0 0 fs 0 0 1;...
0 rs 0 0 rb -rs-rb-fs-fb fb 0 0 fs 0 1;...
0 0 rs 0 0 rb -rs-rb-fs-fb fb 0 0 fs 1;...
0 0 0 0 0 0 rb -rb 0 0 0 1;...
0 0 0 0 rs 0 0 0 -rs-fb fb 0 1;...
0 0 0 0 0 rs 0 0 rb -rs-rb-fb fb 1;...
0 0 0 0 0 0 rs 0 0 rb -rs-rb-fb 1;...
0 0 0 0 0 0 0 0 0 0 rb 1];
A1 = solve('dsdt = states*comat',p1)
Any help would be greatly appreciated! Thanks

Answers (1)

Walter Roberson
Walter Roberson on 19 Apr 2014
A1 = solve(subs(sym('dsdt = states*comat')),p1)
or if you have a newer MATLAB,
A1 = solve(dsdt == states*comat, p1)
MATLAB does not automatically substitute for names in strings.
  3 Comments
JRicard
JRicard on 19 Apr 2014
It didn't like having only one variable, however this worked, fairly confident it works properly, let me know if you see any issue with it:
[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12] = solve(dsdt - (states *... comat),p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12)
Thanks!!

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!