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 am solving a system of 15 simultaneous linear equations using Solve. On running the code, I get a message saying "A very large output was generated" with options for viewing the ouput. I want to use the solution inside a larger program where the next step relies on the ouput of Solve. I am stuck unless there is a reasonable way for me to capture the output from Solve. Is there a way to do this?

share|improve this question
6  
You don't need to display the output; if you do sol = Solve[...]; you'll suppress the output (with ;) but everything will be assigned to sol. –  b.gatessucks Jan 4 '13 at 22:05
2  
If you have not already done so, set Cubics->False and Quartics->False and see if that improves matters. –  Daniel Lichtblau Jan 4 '13 at 22:05
3  
Because these are linear equations, why aren't you using LinearSolve? –  whuber Jan 5 '13 at 18:03
add comment

2 Answers 2

Thanks for the suggestions. I first put the set of equations as a SparseArray using CoefficientArrays function. Then solved using LinearSolve.

{b,m}=CoefficientArrays[Set of Equations, {Variable List}];
LinearSolve[m,-b]

See the tutorial "Solving Linear Systems" (I have version 8)

share|improve this answer
    
Ah, I missed "linear". That being the case you might also want to experiment with options Method->OneStepRowReduction or DivisionFreeRowReduction. –  Daniel Lichtblau Jan 10 '13 at 23:01
    
Thanks for your help. –  KnowledgeSeeker Jan 11 '13 at 3:38
add comment

Is something like this useful?

s1 = Solve[Table[RandomInteger[100, {15}]. Array[x, 15] == y@i, {i, 15}], Array[y, 15]];
y[1] /. s1[[1]]
share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.