how to solve a system of linear equations (56 unknown Variables - 56 equations)
1 view (last 30 days)
Show older comments
with regards , how to solve this system of linear equations ? (56 equations)
(unknown Variables are : b1 c1 d1 e1 g1 f1 s1 q1 b2 c2 d2 e2 g2 f2 s2 q2 b3 c3 d3 e3 g3 f3 s3 q3 b4 c4 d4 e4 g4 f4 s4 q4 b5 c5 d5 e5 g5 f5 s5 q5 b6 c6 d6 e6 g6 f6 s6 q6 b7 c7 d7 e7 g7 f7 s7 q7 )
0 Comments
Accepted Answer
Walter Roberson
on 7 Aug 2017
One way is eliminating one variable at a time; see attached.
2 Comments
Walter Roberson
on 7 Aug 2017
Edited: Walter Roberson
on 7 Aug 2017
See also equationsToMatrix():
[A, b] = equationsToMatrix(eqns);
Bsol = A \ b;
[V(:), double(Bsol(:))]
Note that the result is notably different than
Bsol = double(A) \ double(B)
which suggests that your equation is badly conditioned. Indeed,
rcond(double(A))
is around 2E-60 which indicates your system is near singular.
That in turn suggests that the round-off error inherent in your various constants is going to have a major difference in the results.
For example the very first number in your .txt is 1.035 . Does that represent 1035/1000 exactly ? Does it represent 1.0349999999999999200639422269887290894985198974609375 exactly, which is the nearest representable double precision number? Does it represent "some number between 1.0345 (inclusive) and 1.0355 (exclusive)" which has been rounded to 1.035 ? The choice between these for even just this one number could lead to a huge difference in the outputs.
More Answers (0)
See Also
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!