MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Question on Solve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112720] Question on Solve
  • From: carlos at colorado.edu
  • Date: Tue, 28 Sep 2010 06:04:44 -0400 (EDT)

I have noticed some erratic behavior of Solve,
illustrated in the following two examples.
Suppose I have 8 homogenous linear equations

eqs={(9*v1-3*Sqrt[3]*v2+v3+v4-(8*I)*Sqrt[3]*v4-
9*Sqrt[3]*v5+9*v6-Sqrt[3]*v7-3*Sqrt[3]*v8)/16==0,
(-(Sqrt[3]*v1)+5*v2-Sqrt[3]*v3+3*Sqrt[3]*v4-5*v5-
(8*I)*Sqrt[3]*v5-5*Sqrt[3]*v6+3*v7-3*v8)/16==0,
(-5*v1-Sqrt[3]*v2+3*v3+3*v4+5*Sqrt[3]*v5-5*v6-
(8*I)*Sqrt[3]*v6-3*Sqrt[3]*v7-Sqrt[3]*v8)/16==0,
(-3*Sqrt[3]*v1-9*v2-3*Sqrt[3]*v3+Sqrt[3]*v4+9*v5+
9*Sqrt[3]*v6+v7-(8*I)*Sqrt[3]*v7-v8)/16==0,
(-9*Sqrt[3]*v1+9*v2-Sqrt[3]*v3+3*Sqrt[3]*v4-9*v5+
3*Sqrt[3]*v6-v7+v8-(8*I)*Sqrt[3]*v8)/16==0,
((-5-(8*I)*Sqrt[3])*v1-5*Sqrt[3]*v2+3*v3+3*v4+
Sqrt[3]*v5-5*v6+Sqrt[3]*v7+3*Sqrt[3]*v8)/16==0,
(5*Sqrt[3]*v1+(-5-(8*I)*Sqrt[3])*v2-3*Sqrt[3]*v3+
Sqrt[3]*v4+5*v5+Sqrt[3]*v6-3*v7+3*v8)/16==0,
(9*v1+9*Sqrt[3]*v2+v3-(8*I)*Sqrt[3]*v3+v4+
3*Sqrt[3]*v5+9*v6+3*Sqrt[3]*v7+Sqrt[3]*v8)/16==0};

The variables are
v={v1,v2,v3,v4,v5,v6,v7,v8};
Then
sol=Solve[eqs,v]; Print[sol];

gives the parametric solution
{{v4->-v3,v5->v2,v6->(-2*I)*v2-v3,
v7->-3*v2+(2*I)*v3,v8->-3*v2+(2*I)*v3,v1->(2*I)*v2+v3}};
which is correct.

Change the above equations to

eqs={(-3*Sqrt[3]*v1+v2+17*v3+(8*I)*Sqrt[3]*v3-
9*Sqrt[3]*v4+9*v5-Sqrt[3]*v6-3*Sqrt[3]*v7+9*v8)/16==0,
(5*v1-Sqrt[3]*v2+3*Sqrt[3]*v3+11*v4+(8*I)*Sqrt[3]*v4-
5*Sqrt[3]*v5+3*v6-3*v7-Sqrt[3]*v8)/16==0,
(-(Sqrt[3]*v1)+3*v2+3*v3+5*Sqrt[3]*v4+11*v5+
(8*I)*Sqrt[3]*v5-3*Sqrt[3]*v6-Sqrt[3]*v7-5*v8)/16==0,
(-9*v1-3*Sqrt[3]*v2+Sqrt[3]*v3+9*v4+9*Sqrt[3]*v5+
17*v6+(8*I)*Sqrt[3]*v6-v7-3*Sqrt[3]*v8)/16==0,
(9*v1-Sqrt[3]*v2+3*Sqrt[3]*v3-9*v4+3*Sqrt[3]*v5-v6+
17*v7+(8*I)*Sqrt[3]*v7-9*Sqrt[3]*v8)/16==0,
(-5*Sqrt[3]*v1+3*v2+3*v3+Sqrt[3]*v4-5*v5+Sqrt[3]*v6+
3*Sqrt[3]*v7+11*v8+(8*I)*Sqrt[3]*v8)/16==0,
((11+(8*I)*Sqrt[3])*v1-3*Sqrt[3]*v2+Sqrt[3]*v3+5*v4+
Sqrt[3]*v5-3*v6+3*v7+5*Sqrt[3]*v8)/16==0,
(9*Sqrt[3]*v1+(17+(8*I)*Sqrt[3])*v2+v3+3*Sqrt[3]*v4+
9*v5+3*Sqrt[3]*v6+Sqrt[3]*v7+9*v8)/16==0};
v={v1,v2,v3,v4,v5,v6,v7,v8};

sol=Solve[eqs,v]; Print[sol];

and I get only the trivial solution
{{v1->0,v2->0,v3->0,v4->0,v5->0,v6->0,v7->0,v8->0}};

But the system has an infinity of nontrivial solutions,
for example (this one was obtained with another method)

vsol={v1->-I,v2->1,v3->1,v4->I,v5->-1,v6->-I,v7->I,v8->-1};
Print[Simplify[eqs/.vsol]];
gives {True,True,True,True,True,True,True,True};

These 2 examples are extracted from several thousands
similar ones.  Solve returns the trivial solution in
about 1/3 of the instances.  Mathematica version used
is 5.2 under Mac OS 10.5.9.

Question: what do I have to do to get the correct
parametric answers in all cases?


  • Prev by Date: Re: calculate vertex of a parabola
  • Next by Date: Re: Mathematica calculates RSquared wrongly?
  • Previous by thread: Re: Manipulating Solution List from NDSolve
  • Next by thread: Re: Question on Solve