Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a system of 76 symbolic linear equations (i.e. some coefficients are symbolic) with a sparse coefficient matrix. However, neither Solve[] nor LinearSolve[] can solve this system in a reasonable amount of time (I have not received an answer in an hour).

On the other hand, Maple gives me the correct answer in a few seconds.

The 76 linear equations $equations in 76 $coefficients are (also can be found here.):

$equations = Uncompress["1:eJztXUuPHVcRdsbxOCCEEIsIKRISWURZzu3nDHt2WaCIP2BQLFkYInDy570IzNx+1a3qOqe+73S3HeVmYcczp/q8qurUu/709++/ff3Ns2fP3n36+Mc3b9798Prm6V8vHv/4y39+fPX29e+nX/717Y/vll/+7c2/vhv/+dnjH9+++uHN9/9+9fbN/x7/e3P+8fPHP15VNQ7SwyDNHQ5SvX5+ASJ+\ 1/Xvnv7xXauGeF99LrZ7hvyn/ngAsg9DfvL4DwFZP7CQzR0NWbH7bO8xyFtztjUO2WOQ9mwDkOcTWuaczpaArDBIe7b160891B6HfNe+e/n0s3+8evvqv3dvHv/3mab7L5/hdL8s5aSJ+DxgvI5T/nPqTKomuAIB0sIgdZSNCJDAwtRe6i4P8tPlaTb4LM0DDNLiJ9Z2MHqfRmI8wZBVE4Y0uMBC1nc\ 0ZHy1BkHYORt6zuaBhWzps23j+/xJcxf6KWhYtjzhEA5Z009BHV+txr4uDPn0kwtew87ZxB9LjQn02bbzPtVz8/RyDV8D3zDJqeCN8MxtQekNNqKJu8H5Ac1rF/xRy7wt2sOpQu7v5rwS/BIqYtfDXOxxnUBpz0xZZyW53xFUsEiMYaFIgAQkHK2OBcQVBRKWPYQ4Tys8Ez8lVKUTqyo1ccVOK1n0nC\ 24z01eufhbpU/odMBbpZUses75rbpSaVrpjlOphoxjr4NJBH3T5heASjUkuE+KSnmJ0uGAhCkElCgpKvUkylUq/XWCSoWJo8ZtmC1Owa0WUM960mjDrNZtmHJIkx/SOkPeL0Mesl/pnYm8y5CHgiGAPJvUNX6VuMaVb7+8RJGT5pz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ORVGtFfB2emhnpR6nTgaMiuliYfoSFGNBDDeZGIQ2+446Oke6YOnZS9CXwqqMj1zsal3t+tUxFuouz/UjbW2ryosM35vzwHTh3p/WzCEgpMezBuTucc/PY3jlvKR+vPDzRRLI4FLE8\ zkKLhDRjKUg1dYMN/g/TGBw4"];
$coefficients = Uncompress["1:eJwtzLtNQ1EQRdEnoBE6sOd3TQ+O6AACJCKCR//C4q5k9iRnvX7+vH/dj+M4Xx7n/n3+nk+P5+Oyc92Jndypnd6ZnbVz23k7n//nF71qaGpp6+jSm/KCF7zgBS94wQte8IIXvOQlL3nJS17ykpe85CWveMUrXvGKV7ziFa94xWte85rXvOY1r3nNa17zhje84Q1veMMb3vCGN7zFW7zFW7zFW/0H\ Ks1gug=="];

and I try the following code to solve:

$result = Solve[$equations,$coefficients]

or

$matrix = CoefficientArrays[$equations, $coefficients];
$result = LinearSolve[$matrix[[2]], $matrix[[1]]]  

Is there any way to solve this system with Mathematica in a reasonable amount of time?

share|improve this question
1  
If possible, please try to post code directly in your question to make it permanent and give viewers direct feedback what awaits them. It is also good practice to provide all relevant code to show what you already tried. –  Yves Klett Jul 2 '13 at 14:52
    
I think you should use sparse arrays for sparse equations, like in LinearSolve @@ Reverse@CoefficientArrays[$equations, $coefficients] though I doubt it's going to give you much speed up –  panda-34 Jul 2 '13 at 17:11
1  
Can you say anything about the values of the constants scalar0, k, etc. Adding some assumptions might make a difference. –  Corey Kelly Jul 2 '13 at 17:12
    
I tried to use LinearSolve @@ Reverse@CoefficientArrays[$equations, $coefficients] but steel I have no solution. The constants scalar0 and others are arbitrary (not even real) constants. –  Stanislav Poslavsky Jul 2 '13 at 17:19
1  
Can you at least be certain that the determinant is non-zero? i.e. 1 + e5 scalar0 != 0, -1 + 2 e5 scalar0 + 6 e6 scalar0 != 0, etc. Mathematica might require this as an assumption. –  Corey Kelly Jul 3 '13 at 11:01
show 9 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.