Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Strange behaviour of Solve
Replies: 1   Last Post: Dec 15, 2012 5:46 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
friedrich.gehring@gmail.com

Posts: 1
Registered: 12/14/12
Strange behaviour of Solve
Posted: Dec 14, 2012 2:59 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have a strange Problem with Solve: The number of solutions depends on the names for the variables. I am using Mathematica 8.0.1.0 on Linux x86 and this is my code:
Clear[K1, K2, K3, K4, K, G, Nf, vd, dg, d, l, a, b, s, p, t, v];
K1 = ({
{a - 2, -1, -3, -3},
{-1, 0, 0, 0},
{-3, 0, 0, -4},
{-3, 0, -4, 0}
});
K2 = ({
{0, -1, 0, 0},
{-1, a - 2, -3, -3},
{0, -3, -4, 0},
{0, -3, 0, -4}
});
K3 = 1/3 ({
{0, 0, 1, -4},
{0, 0, -3, 0},
{1, -3, -a - 2, -1},
{-4, 0, -1, 0}
});
K4 = 1/3 ({
{0, 0, -4, 1},
{0, 0, 0, -3},
{-4, 0, 0, -1},
{1, -3, -1, -a - 2}
});
g = {g1, g2, g3, g4};
K = Transpose[{K1, K2, K3, K4}];
G[g1_, g2_, g3_, g4_] = Simplify[(d - 2) g - b * g.K.g];
Par = {dg -> 4, d -> 3, Nf -> 2, vd -> 1/(8*Pi), l -> 2/3};
Kurz = {a -> dg*Nf, b -> 4 vd l /Nf};
sol =
FullSimplify[Solve[G[s, p, v, t] == 0 /. Kurz /. Par, {s, p, v, t}]]
Length[sol]

The System G consists of 4 coupled quadratic equations so it should have 16 solutions in general. If I take the order of variables as above, Mathematica returns the warning "Solve::svars: Equations may not give solutions for all "solve" variables. >>" and 17 solutions the first being {p->-s-\[Pi],v->-\[Pi],t->-\[Pi]}. This is obviously wrong in general because if you type:
FullSimplify[G[s, p, t, v] /. sol[[1]] /. Kurz /. Par]
you will get the result:
{(4 (-s^2-\[Pi] s+\[Pi]^2))/(3 \[Pi]),(4 (-s^2-\[Pi] s+\[Pi]^2))/(3 \[Pi]),0,0}
that is different from zero. It only holds true for the special cases s -> -(1/2) (1 + Sqrt[5]) \[Pi] and s -> (1/2) (-1 + Sqrt[5]) \[Pi], that are part of the remaining 16 solutions. That means that there are in fact only 16 solutions (as one would have expected) and the first one is wrong.
The strange thing is, that if I change the order of variables to {s, p, t, v}, the right result with only 16 solutions is generated. I was really wondering about this an tried with other names, sometimes is worked properly sometimes not. I would be interested why this problem arises and how I can avoid it to get the right result in all cases.
A further problem is, if I tune the parameter Nf e.g. to 4, the same error as above occurs, but the trick with changing the variables does not give the right result anyway (in fact for s,p,v,t there are 19 solutions and for s,p,v,t only 18 but both is too much). Actually there should be 16 solutions as you get using NSolve.
My question is: Why are there too many (wrong) solutions and is there a possibility to get the right ones for all names of variables?
Thank you very much,
Friedrich Gehring




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.