0
votes

I have a linear system that I need to solve with MATLAB, but it gives warning about explicit solution cannot be found. Below is the code and the equations. Its odd I cannot get it to work, Please help.

syms a b c d e

eqs = [ c + 0.45*a - 0.45*d == 400,...
        -1*b - 0.89*a + 0.89*d + e == 0,...
        8.94*a - 8.94*d == -2000,...
        -5*b - 10*c + 5*e == -2000,...
        4.47*a - 10*c - 4.47*d == -2000];

S2 = solve(eqs)

Below is the output,

`Warning: Explicit solution could not be found. 
> In solve at 179
  In HandEquationsSolve at 12 

S2 =

[ empty sym ]`
1
Your system matrix is singular (try det([-.45 0 1 -.45 0; -.89 -1 0 .89 1; 8.94 0 0 -8.94 0; 0 -5 -10 0 5; 4.47 0 -10 -4.47 0])). That's why there are no solutions - Luis Mendo
solve() is a really verbose way to solve linear equations. You can just divide the constant vector by the coefficient matrix. - Ben Voigt

1 Answers

1
votes

You are getting the error because the equations cannot give a valid solution.

eqs = [ c + 0.45*a - 0.45*d == 400,... (1)
               -1*b - 0.89*a + 0.89*d + e == 0,... (2)
               8.94*a - 8.94*d == -2000,... (3)
              -5*b - 10*c + 5*e == -2000,... (4)
               4.47*a - 10*c - 4.47*d == -2000];  (5)

Assuming the equations are 1, 2, 3, 4, 5, equation (3) gives a-d= -223.7 Substituting in (1), you get c=500.7. Now when you apply a-d in (5), c= 100 which is clearly an error in the equations.