2
votes

Basically I have a linear system of equations, where every coefficient is a variable. For example, for a 2x2 system:

  • a11*x1 + a12*x2 = f1
  • a21*x1 + a22*x2 = f2

x1, x2 = .... (symbolic expression with a11, a12, a21, a22, f1, f2)

I tried solving it in MATLAB via Cramer's rule, writing the matrixes of the system in symbolic form and calculating the appropiate determinants. The issue is, the time required grows very quickly with the size of the system. My problem at hand requires a symbolic solution for a 12x12 system, but the time required with my current code is huge and not likely to finish anytime next month.

What is the best approach to solve this symbolic linear system? Some people told me that Maple is best suited for symbolic operations, could it be significantly faster than MATLAB for calculating symbolic determinants?

1
"Symbolic" and "efficient" in a sentence. No, that usually doesn't happen. And yes, MATLAB is best for numerical problems, personally I dislike its symbolic engine.Andras Deak
What possible practical use could there be for the solution of a 12x12 fully symbolic system? The determinant would have 12! = half a billion terms, each with 12 factors.Carl Love
If there is no structure in your matrix you can safely stop working on this as the comments have pointed out.percusse

1 Answers

1
votes

Yes, maple can solve a system of linear equations with symbolic coefficients in addition to the numerical coefficients of variables involved. Here is an example:

eq||1:=a11*x1+a12*x2=f1;
eq||2:=a21*x1+a22*x2=f2;
solve({eq||1, eq||2}, [x1,x2]);

Then you will get following answer within a second.

[[x1 = -(a12*f2-f1*a22)/(a11*a22-a21*a12), x2 = (a11*f2-a21*f1)/(a11*a22-a21*a12)]] 

For more information and solving complicated equations you can go through Maple Help page.