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 working with large (linear) equations set within Mathematica in numerical notation. For example, set from 4056 eq. is solved for a second, no more. There is no doubt, result is great. But even simple mixed (both numeric and symbolic) data in 5-20 equation set is the problem... What is the reason? And what the way to solve it? Is it necessary to filter (provide) all data to symbolic form. Data are presented by three forms: 23.234 (float), 23/11 (aka fraction), F/w (symbolic).

Example

Equations = {c1bXZ[1] - c1bXZ[2] + c1bXZ[5] == (-1)*0, -c1bXZ[1] + 
c1bXZ[3] + c1bXZ[4] == (-1)*0, 
c1bXZ[2] == (-1)*RX[3], -c1bXZ[3] == (-1)*
RX[4], -c1bXZ[4] == (-1)*0, -c1bXZ[5] == (-1)*F, -c1bYZ[1] + 
c1bYZ[2] + c1sStr[5] == (-1)*0, -1000 + c1bYZ[1] - c1bYZ[3] + 
c1sStr[4] == (-1)*0, -c1bYZ[2] == (-1)*RY[3], 
c1bYZ[3] == (-1)*
RY[4], -c1sStr[4] == (-1)*0, -c1sStr[5] == (-1)*0, -c1bYZ[5] - 
c1sStr[1] + c1sStr[2] == (-1)*0, -c1bYZ[4] + c1sStr[1] - 
c1sStr[3] == (-1)*0, -c1sStr[2] == (-1)*RZ[3], 
c1sStr[3] == (-1)*RZ[4], c1bYZ[4] == (-1)*0, c1bYZ[5] == (-1)*0, 
c1bYZ[2] - c2bYZ[1] + c2bYZ[2] - c2bYZ[5] == 
0, -500 + c1bYZ[1] + c2bYZ[1] - c2bYZ[3] - c2bYZ[4] == 
0, -c2bYZ[2] == 0, c1bYZ[3] + c2bYZ[3] == 0, 
c1bYZ[4] + c2bYZ[4] == 0, c1bYZ[5] + c2bYZ[5] == 0, 
c1bXZ[2] - c1tTor[5] - c2bXZ[1] + c2bXZ[2] == 0, 
c1bXZ[1] - c1tTor[4] + c2bXZ[1] - c2bXZ[3] == 0, -c2bXZ[2] == 0, 
c1bXZ[3] + c2bXZ[3] == 0, 200 + c1tTor[4] == 0, 
200 + c1tTor[5] == 0, 
c1tTor[1] - c1tTor[2] - c2bXZ[5] == 
0, -c1tTor[1] + c1tTor[3] - c2bXZ[4] == 0, 
c1tTor[2] == MZ[3], -c1tTor[3] == MZ[4], 
200 + c1bXZ[4] + c2bXZ[4] == 0, -200 + c1bXZ[5] + c2bXZ[5] == 
0, -c4bXZ[2] == 
0, (-c1bXZ[3] - 3*c2bXZ[3] - 2400000*c3bXZ[3])/2400000 - 
c4bXZ[3] == 0, 
c4bYZ[2] == 
0, (c1bYZ[3] + 3*c2bYZ[3] + 2400000*c3bYZ[3])/2400000 + c4bYZ[3] ==
0, -c2sStr[2] == 0, -c1sStr[3]/2000000000 - c2sStr[3] == 
0, -c4bXZ[1] == (-c1bXZ[2] - 3*c2bXZ[2] - 2400000*c3bXZ[2])/
 2400000 - 
c4bXZ[2], (-c1bXZ[2] - 3*c2bXZ[2] - 2400000*c3bXZ[2])/2400000 - 
c4bXZ[2] == -c4bXZ[
 5], (-c1bXZ[1] - 3*c2bXZ[1] - 2400000*c3bXZ[1])/2400000 - 
c4bXZ[1] == -c4bXZ[3], -c4bXZ[3] == -c4bXZ[4], 
c4bYZ[1] == (c1bYZ[2] + 3*c2bYZ[2] + 2400000*c3bYZ[2])/2400000 + 
c4bYZ[2], (c1bYZ[2] + 3*c2bYZ[2] + 2400000*c3bYZ[2])/2400000 + 
c4bYZ[2] == 
c2sStr[5], (-250 + c1bYZ[1] + 3*c2bYZ[1] + 2400000*c3bYZ[1])/
 2400000 + c4bYZ[1] == c4bYZ[3], 
c4bYZ[3] == 
c2sStr[4], -c2sStr[1] == -c1sStr[2]/2000000000 - 
c2sStr[2], -c1sStr[2]/2000000000 - c2sStr[2] == 
c4bYZ[5], -c1sStr[1]/2000000000 - 
c2sStr[1] == -c2sStr[3], -c2sStr[3] == c4bYZ[4], -c2tTor[2] == 
0, -c1tTor[3]/140000 - c2tTor[3] == 0, 
c3bYZ[1] == (c1bYZ[2] + 2*c2bYZ[2])/800000 + 
c3bYZ[2], (c1bYZ[2] + 2*c2bYZ[2])/800000 + c3bYZ[2] == 
c3bYZ[5], (-1000 + 3*c1bYZ[1] + 6*c2bYZ[1])/2400000 + c3bYZ[1] == 
c3bYZ[3], c3bYZ[3] == c3bYZ[4], 
c3bXZ[1] == (c1bXZ[2] + 2*c2bXZ[2])/800000 + 
c3bXZ[2], (c1bXZ[2] + 2*c2bXZ[2])/800000 + c3bXZ[2] == 
c2tTor[5], (c1bXZ[1] + 2*c2bXZ[1])/800000 + c3bXZ[1] == c3bXZ[3], 
c3bXZ[3] == 
c2tTor[4], -c2tTor[1] == -c1tTor[2]/140000 - 
c2tTor[2], -c1tTor[2]/140000 - c2tTor[2] == 
c3bXZ[5], -c1tTor[1]/140000 - 
c2tTor[1] == -c2tTor[3], -c2tTor[3] == c3bXZ[4]}

And Unknowns:

Unknows = {c1bXZ[1], c1bXZ[2], c1bXZ[3], c1bXZ[4], c1bXZ[5], c2bXZ[1],
c2bXZ[2], c2bXZ[3], c2bXZ[4], c2bXZ[5], c3bXZ[1], c3bXZ[2], 
c3bXZ[3], c3bXZ[4], c3bXZ[5], c4bXZ[1], c4bXZ[2], c4bXZ[3], 
c4bXZ[4], c4bXZ[5], c1bYZ[1], c1bYZ[2], c1bYZ[3], c1bYZ[4], 
c1bYZ[5], c2bYZ[1], c2bYZ[2], c2bYZ[3], c2bYZ[4], c2bYZ[5], 
c3bYZ[1], c3bYZ[2], c3bYZ[3], c3bYZ[4], c3bYZ[5], c4bYZ[1], 
c4bYZ[2], c4bYZ[3], c4bYZ[4], c4bYZ[5], c1sStr[1], c1sStr[2], 
c1sStr[3], c1sStr[4], c1sStr[5], c2sStr[1], c2sStr[2], c2sStr[3], 
c2sStr[4], c2sStr[5], c1tTor[1], c1tTor[2], c1tTor[3], c1tTor[4], 
c1tTor[5], c2tTor[1], c2tTor[2], c2tTor[3], c2tTor[4], c2tTor[5], 
RX[3], RY[3], RZ[3], RX[4], RY[4], RZ[4], MZ[3], MZ[4]}

I see hard work of processor in Mathematica without any result

And momentary result from Maple:

{MZ[3] = -200/3+(2/3)*F, MZ[4] = 200/3+(1/3)*F, RX[3] = -(2/3)*F+400/3, RX[4] = -(1/3)*F-400/3, RY[3] = 500, RY[4] = 500, RZ[3] = 0, RZ[4] = 0, c1bXZ[1] = -(1/3)*F-400/3, c1bXZ[2] = (2/3)*F-400/3, c1bXZ[3] = -(1/3)*F-400/3, c1bXZ[4] = 0, c1bXZ[5] = F, c1bYZ[1] = 500, c1bYZ[2] = 500, c1bYZ[3] = -500, c1bYZ[4] = 0, c1bYZ[5] = 0, c1sStr[1] = 0, c1sStr[2] = 0, c1sStr[3] = 0, c1sStr[4] = 0, c1sStr[5] = 0, c1tTor[1] = 400/3-(1/3)*F, c1tTor[2] = -200/3+(2/3)*F, c1tTor[3] = -200/3-(1/3)*F, c1tTor[4] = -200, c1tTor[5] = -200, c2bXZ[1] = (2/3)*F+200/3, c2bXZ[2] = 0, c2bXZ[3] = (1/3)*F+400/3, c2bXZ[4] = -200, c2bXZ[5] = 200-F, c2bYZ[1] = 500, c2bYZ[2] = 0, c2bYZ[3] = 500, c2bYZ[4] = 0, c2bYZ[5] = 0, c2sStr[1] = 0, c2sStr[2] = 0, c2sStr[3] = 0, c2sStr[4] = -11/9600, c2sStr[5] = -11/9600, c2tTor[1] = -1/2100+(1/210000)*F, c2tTor[2] = 0, c2tTor[3] = 1/2100+(1/420000)*F, c2tTor[4] = (1/1440000)*F-1/12000, c2tTor[5] = -(1/1800000)*F-1/12000, c3bXZ[1] = -(1/1800000)*F-1/12000, c3bXZ[2] = 1/12000-(1/720000)*F, c3bXZ[3] = (1/1440000)*F-1/12000, c3bXZ[4] = -1/2100-(1/420000)*F, c3bXZ[5] = 1/2100-(1/210000)*F, c3bYZ[1] = -7/9600, c3bYZ[2] = -13/9600, c3bYZ[3] = 7/9600, c3bYZ[4] = 7/9600, c3bYZ[5] = -7/9600, c4bXZ[1] = 1/36000-(1/900000)*F, c4bXZ[2] = 0, c4bXZ[3] = -(7/7200000)*F-1/36000, c4bXZ[4] = -(7/7200000)*F-1/36000, c4bXZ[5] = 1/36000-(1/900000)*F, c4bYZ[1] = -11/9600, c4bYZ[2] = 0, c4bYZ[3] = -11/9600, c4bYZ[4] = 0, c4bYZ[5] = 0}

By the word, Maple is more worse in numeric power.

Last example was very simple. The simple example where I can not to get symbolic solution here Equation set solution problem

share|improve this question
    
Could you provide a minimal "model" example showing some time difference? It is hard to give advise without seeing code. –  Vitaliy Kaurov Nov 28 '12 at 23:24
    
It is not easy to do it within a comment. Where I can provide full example? –  Siarhei A Arlou Nov 28 '12 at 23:50
    
I was hoping for a small prototype example, not the whole thing. –  Vitaliy Kaurov Nov 28 '12 at 23:58
    
I will place it within question. –  Siarhei A Arlou Nov 29 '12 at 0:00
3  
maybe CoefficientArrays is useful –  acl Nov 29 '12 at 14:35
show 13 more comments

1 Answer 1

up vote 3 down vote accepted

What specifically did you do? I seem to obtain a solution quickly.

In[8]:= InputForm[Timing[soln=Solve[Equations,Unknows]]]

(* Out[8]//InputForm= 
{0.02000000000000000041633363423443370266`4.321629908943605, 
 {{c1bXZ[1] -> (-400 - F)/3, c1bXZ[2] -> -400/3 + (2*F)/3, 
   c1bXZ[3] -> -400/3 - F/3, c1bXZ[4] -> 0, c1bXZ[5] -> F, 
   c2bXZ[1] -> 200/3 + (2*F)/3, c2bXZ[2] -> 0, c2bXZ[3] -> 400/3 + F/3, 
   c2bXZ[4] -> -200, c2bXZ[5] -> 200 - F, c3bXZ[1] -> -1/12000 - F/1800000, 
   c3bXZ[2] -> 1/12000 - F/720000, c3bXZ[3] -> -1/12000 + F/1440000, 
   c3bXZ[4] -> -1/2100 - F/420000, c3bXZ[5] -> 1/2100 - F/210000, 
   c4bXZ[1] -> 1/36000 - F/900000, c4bXZ[2] -> 0, 
   c4bXZ[3] -> -1/36000 - (7*F)/7200000, 
   c4bXZ[4] -> -1/36000 - (7*F)/7200000, c4bXZ[5] -> 1/36000 - F/900000, 
   c1bYZ[1] -> 500, c1bYZ[2] -> 500, c1bYZ[3] -> -500, c1bYZ[4] -> 0, 
   c1bYZ[5] -> 0, c2bYZ[1] -> 500, c2bYZ[2] -> 0, c2bYZ[3] -> 500, 
   c2bYZ[4] -> 0, c2bYZ[5] -> 0, c3bYZ[1] -> -7/9600, c3bYZ[2] -> -13/9600, 
   c3bYZ[3] -> 7/9600, c3bYZ[4] -> 7/9600, c3bYZ[5] -> -7/9600, 
   c4bYZ[1] -> -11/9600, c4bYZ[2] -> 0, c4bYZ[3] -> -11/9600, c4bYZ[4] -> 0, 
   c4bYZ[5] -> 0, c1sStr[1] -> 0, c1sStr[2] -> 0, c1sStr[3] -> 0, 
   c1sStr[4] -> 0, c1sStr[5] -> 0, c2sStr[1] -> 0, c2sStr[2] -> 0, 
   c2sStr[3] -> 0, c2sStr[4] -> -11/9600, c2sStr[5] -> -11/9600, 
   c1tTor[1] -> 400/3 - F/3, c1tTor[2] -> -200/3 + (2*F)/3, 
   c1tTor[3] -> -200/3 - F/3, c1tTor[4] -> -200, c1tTor[5] -> -200, 
   c2tTor[1] -> -1/2100 + F/210000, c2tTor[2] -> 0, 
   c2tTor[3] -> 1/2100 + F/420000, c2tTor[4] -> -1/12000 + F/1440000, 
   c2tTor[5] -> -1/12000 - F/1800000, RX[3] -> 400/3 - (2*F)/3, RY[3] -> 500, 
   RZ[3] -> 0, RX[4] -> -400/3 - F/3, RY[4] -> 500, RZ[4] -> 0, 
   MZ[3] -> -200/3 + (2*F)/3, MZ[4] -> 200/3 + F/3}}} *)
share|improve this answer
    
Sorry, it works... The reason is I prepare data programmatically and forgot something at copy-paste... I hope the TIMO Structural 2.0 (Mathematica) will with full symbolic notation orlovsoft.com/Silverlight.html#/Screenshots –  Siarhei A Arlou Nov 29 '12 at 0:33
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.