Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
solving a system of multi-variable polynomial equations in mupad

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 3 Oct, 2012 21:35:08

Message: 1 of 32

Dear Users

I have a system of 24 multi-variable polynomials (of order 2) in either 28 or 12 unknowns depending on how I view my problem. I must admit I am out of my depth in solving this problem, in fact I do not even know if it is solvable. I appreciate this is a complex area, and many "computer" problems are actually caused by inexperience in use of numerical methods. Unfortunatley I lack the time to pursue this vast area in detail, and so I would very much appreciate some advice from those with experience, in particular in terms of which Matlab functions to use to try to solve my system. I have given my system of equations at the end of this post so as not to clogg up my text!

The 12 unknowns [a1-f1], and [a2-f2] are analagous to the X,Y,Z etc that appear in most polynomials (i.e. what I think of as the data), whilst the 16 unknowns [s,alpha1,alpha2,alpha3], [s_h,alpha1_h,alpha2_h,alpha3_h], [t,beta1,beta2,beta3], and [t_h,beta1_h,beta2_h,beta3_h] are analagous to the constants that multiply the data. I am interested in finding solutions to my system in 2 cases

(i) where the 16 constants are treated as unknowns as well as the 12 data unknowns,

and/or

(ii) where only the 12 data unknowns are the unknowns.

This may sound weird but it is motivated by statistical considerations where it is of interest theoretically to consider constants as parameters. I have opted to use numeric::polysysroots in mupad which gives the warning

"Warning: Solution(s) may be lost. [solvelib::allvalues_warning]" ,

along with a trivial solution where every unknown is zero. Another trivial solution not obtained is where s=t_h, t=s_h, and where the appropriate alpha's and beta's are equal to make the terms in parentheses zero. Is this missed second trivial solution what my warning is about? More importantly how can I determine if there are non-trivial solutions that have also been missed? More generally is there any theory that states such a system can only have the trivial solution as is sometimes the case in linear systems?

Any help would be greatly appreciated.


System of 24 equations (each equation is solved to equal zero):

s - t_h + a1^2*(alpha1 - beta1_h) + 2*a1*b1*(alpha2 - beta2_h) + b1^2*(alpha3 - beta3_h)

a1*c1*(alpha1 - beta1_h) + (b1*c1 + a1*d1)*(alpha2 - beta2_h) + b1*d1*(alpha3 - beta3_h)

a1*e1*(alpha1 - beta1_h) + (b1*e1 + a1*f1)*(alpha2 - beta2_h) + b1*f1*(alpha3 - beta3_h)

s - t_h + c1^2*(alpha1 - beta1_h) + 2*c1*d1*(alpha2 - beta2_h) + d1^2*(alpha3 - beta3_h)

c1*e1*(alpha1 - beta1_h) + (d1*e1 + c1*f1)*(alpha2 - beta2_h) + d1*f1*(alpha3 - beta3_h)

s - t_h + e1^2*(alpha1 - beta1_h) + 2*e1*f1*(alpha2 - beta2_h) + f1^2*(alpha3 - beta3_h)
             
t - s_h + a1^2*(beta1 - alpha1_h) + 2*a1*b1*(beta2 - alpha2_h) + b1^2*(beta3 - alpha3_h)

a1*c1*(beta1 - alpha1_h) + (b1*c1 + a1*d1)*(beta2 - alpha2_h) + b1*d1*(beta3 - alpha3_h)

a1*e1*(beta1 - alpha1_h) + (b1*e1 + a1*f1)*(beta2 - alpha2_h) + b1*f1*(beta3 - alpha3_h)

t - s_h + c1^2*(beta1 - alpha1_h) + 2*c1*d1*(beta2 - alpha2_h) + d1^2*(beta3 - alpha3_h)

c1*e1*(beta1 - alpha1_h) + (d1*e1 + c1*f1)*(beta2 - alpha2_h) + d1*f1*(beta3 - alpha3_h)

t - s_h + e1^2*(beta1 - alpha1_h) + 2*e1*f1*(beta2 - alpha2_h) + f1^2*(beta3 - alpha3_h)
               
s - t_h + a2^2*(alpha1 - beta1_h) + 2*a2*b2*(alpha2 - beta2_h) + b2^2*(alpha3 - beta3_h)

a2*c2*(alpha1 - beta1_h) + (b2*c2 + a2*d2)*(alpha2 - beta2_h) + b2*d2*(alpha3 - beta3_h)

a2*e2*(alpha1 - beta1_h) + (b2*e2 + a2*f2)*(alpha2 - beta2_h) + b2*f2*(alpha3 - beta3_h)

s - t_h + c2^2*(alpha1 - beta1_h) + 2*c2*d2*(alpha2 - beta2_h) + d2^2*(alpha3 - beta3_h)

c2*e2*(alpha1 - beta1_h) + (d2*e2 + c2*f2)*(alpha2 - beta2_h) + d2*f2*(alpha3 - beta3_h)

s - t_h + e2^2*(alpha1 - beta1_h) + 2*e2*f2*(alpha2 - beta2_h) + f2^2*(alpha3 - beta3_h)
                
t - s_h + a2^2*(beta1 - alpha1_h) + 2*a2*b2*(beta2 - alpha2_h) + b2^2*(beta3 - alpha3_h)

a2*c2*(beta1 - alpha1_h) + (b2*c2 + a2*d2)*(beta2 - alpha2_h) + b2*d2*(beta3 - alpha3_h)

a2*e2*(beta1 - alpha1_h) + (b2*e2 + a2*f2)*(beta2 - alpha2_h) + b2*f2*(beta3 - alpha3_h)

t - s_h + c2^2*(beta1 - alpha1_h) + 2*c2*d2*(beta2 - alpha2_h) + d2^2*(beta3 - alpha3_h)

c2*e2*(beta1 - alpha1_h) + (d2*e2 + c2*f2)*(beta2 - alpha2_h) + d2*f2*(beta3 - alpha3_h)

t - s_h + e2^2*(beta1 - alpha1_h) + 2*e2*f2*(beta2 - alpha2_h) + f2^2*(beta3 - alpha3_h
               
 

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 4 Oct, 2012 22:42:08

Message: 2 of 32

"Daniel " <danmeddings@gmail.com> wrote in message <k4ib2c$eel$1@newscl01ah.mathworks.com>...
> Dear Users
>
> I have a system of 24 multi-variable polynomials (of order 2) in either 28 or 12 unknowns depending on how I view my problem. I must admit I am out of my depth in solving this problem, in fact I do not even know if it is solvable. I appreciate this is a complex area, and many "computer" problems are actually caused by inexperience in use of numerical methods. Unfortunatley I lack the time to pursue this vast area in detail, and so I would very much appreciate some advice from those with experience, in particular in terms of which Matlab functions to use to try to solve my system. I have given my system of equations at the end of this post so as not to clogg up my text!
>
> The 12 unknowns [a1-f1], and [a2-f2] are analagous to the X,Y,Z etc that appear in most polynomials (i.e. what I think of as the data), whilst the 16 unknowns [s,alpha1,alpha2,alpha3], [s_h,alpha1_h,alpha2_h,alpha3_h], [t,beta1,beta2,beta3], and [t_h,beta1_h,beta2_h,beta3_h] are analagous to the constants that multiply the data. I am interested in finding solutions to my system in 2 cases
>
> (i) where the 16 constants are treated as unknowns as well as the 12 data unknowns,
>
> and/or
>
> (ii) where only the 12 data unknowns are the unknowns.
>
> This may sound weird but it is motivated by statistical considerations where it is of interest theoretically to consider constants as parameters. I have opted to use numeric::polysysroots in mupad which gives the warning
>
> "Warning: Solution(s) may be lost. [solvelib::allvalues_warning]" ,
>
> along with a trivial solution where every unknown is zero. Another trivial solution not obtained is where s=t_h, t=s_h, and where the appropriate alpha's and beta's are equal to make the terms in parentheses zero. Is this missed second trivial solution what my warning is about? More importantly how can I determine if there are non-trivial solutions that have also been missed? More generally is there any theory that states such a system can only have the trivial solution as is sometimes the case in linear systems?
>
> Any help would be greatly appreciated.
>
>
> System of 24 equations (each equation is solved to equal zero):
>
> s - t_h + a1^2*(alpha1 - beta1_h) + 2*a1*b1*(alpha2 - beta2_h) + b1^2*(alpha3 - beta3_h)
>
> a1*c1*(alpha1 - beta1_h) + (b1*c1 + a1*d1)*(alpha2 - beta2_h) + b1*d1*(alpha3 - beta3_h)
>
> a1*e1*(alpha1 - beta1_h) + (b1*e1 + a1*f1)*(alpha2 - beta2_h) + b1*f1*(alpha3 - beta3_h)
>
> s - t_h + c1^2*(alpha1 - beta1_h) + 2*c1*d1*(alpha2 - beta2_h) + d1^2*(alpha3 - beta3_h)
>
> c1*e1*(alpha1 - beta1_h) + (d1*e1 + c1*f1)*(alpha2 - beta2_h) + d1*f1*(alpha3 - beta3_h)
>
> s - t_h + e1^2*(alpha1 - beta1_h) + 2*e1*f1*(alpha2 - beta2_h) + f1^2*(alpha3 - beta3_h)
>
> t - s_h + a1^2*(beta1 - alpha1_h) + 2*a1*b1*(beta2 - alpha2_h) + b1^2*(beta3 - alpha3_h)
>
> a1*c1*(beta1 - alpha1_h) + (b1*c1 + a1*d1)*(beta2 - alpha2_h) + b1*d1*(beta3 - alpha3_h)
>
> a1*e1*(beta1 - alpha1_h) + (b1*e1 + a1*f1)*(beta2 - alpha2_h) + b1*f1*(beta3 - alpha3_h)
>
> t - s_h + c1^2*(beta1 - alpha1_h) + 2*c1*d1*(beta2 - alpha2_h) + d1^2*(beta3 - alpha3_h)
>
> c1*e1*(beta1 - alpha1_h) + (d1*e1 + c1*f1)*(beta2 - alpha2_h) + d1*f1*(beta3 - alpha3_h)
>
> t - s_h + e1^2*(beta1 - alpha1_h) + 2*e1*f1*(beta2 - alpha2_h) + f1^2*(beta3 - alpha3_h)
>
> s - t_h + a2^2*(alpha1 - beta1_h) + 2*a2*b2*(alpha2 - beta2_h) + b2^2*(alpha3 - beta3_h)
>
> a2*c2*(alpha1 - beta1_h) + (b2*c2 + a2*d2)*(alpha2 - beta2_h) + b2*d2*(alpha3 - beta3_h)
>
> a2*e2*(alpha1 - beta1_h) + (b2*e2 + a2*f2)*(alpha2 - beta2_h) + b2*f2*(alpha3 - beta3_h)
>
> s - t_h + c2^2*(alpha1 - beta1_h) + 2*c2*d2*(alpha2 - beta2_h) + d2^2*(alpha3 - beta3_h)
>
> c2*e2*(alpha1 - beta1_h) + (d2*e2 + c2*f2)*(alpha2 - beta2_h) + d2*f2*(alpha3 - beta3_h)
>
> s - t_h + e2^2*(alpha1 - beta1_h) + 2*e2*f2*(alpha2 - beta2_h) + f2^2*(alpha3 - beta3_h)
>
> t - s_h + a2^2*(beta1 - alpha1_h) + 2*a2*b2*(beta2 - alpha2_h) + b2^2*(beta3 - alpha3_h)
>
> a2*c2*(beta1 - alpha1_h) + (b2*c2 + a2*d2)*(beta2 - alpha2_h) + b2*d2*(beta3 - alpha3_h)
>
> a2*e2*(beta1 - alpha1_h) + (b2*e2 + a2*f2)*(beta2 - alpha2_h) + b2*f2*(beta3 - alpha3_h)
>
> t - s_h + c2^2*(beta1 - alpha1_h) + 2*c2*d2*(beta2 - alpha2_h) + d2^2*(beta3 - alpha3_h)
>
> c2*e2*(beta1 - alpha1_h) + (d2*e2 + c2*f2)*(beta2 - alpha2_h) + d2*f2*(beta3 - alpha3_h)
>
> t - s_h + e2^2*(beta1 - alpha1_h) + 2*e2*f2*(beta2 - alpha2_h) + f2^2*(beta3 - alpha3_h
- - - - - - - - - -
  This is not a direct answer to your question, Daniel, but it might provide an insight into the nature of your problem.

  First, consider just the first six of your equations. Instead of a1, b1, c1, d1, e1, and f1, let these be called, respectively, x1, y1, x2, y2, x3, and y3. Lumping the coefficient differences into the single quantities A, B, C, and F these six equations can then be rearranged and expressed as

 A*x1^2 + 2*B*x1*y1 + C*y1^2 + F = 0
 A*x2^2 + 2*B*x2*y2 + C*y2^2 + F = 0
 A*x3^2 + 2*B*x3*y3 + C*y3^2 + F = 0
 A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0
 A*x3*x1 + B*(x3*y1+x1*y3) + C*y3*y1 = 0
 A*x1*x2 + B*(x1*y2+x2*y1) + C*y1*y2 = 0

  If we consider the x's and y's as unknowns and the coefficients as given, the task would be to find solutions for these six unknowns. The first three equations have the form of the same conic section, which depends only on the four coefficients. It is convenient to rotate the x and y axes in the standard way such that the x*y term disappears. If the conic is not degenerate with F = 0, it can thus be obtained in the form of an ellipse x^2/a^2 + y^2/b^2 = 1 or a hyperbola x^2/a^2 - y^2/b^2 = 1. For an ellipse this would transform the six equations to

 x1^2/a^2 + y1^2/b^2 = 1
 x2^2/a^2 + y2^2/b^2 = 1
 x3^2/a^2 + y3^2/b^2 = 1
 x2*x3/a^2 + y2*y3/b^2 = 0
 x3*x1/a^2 + y3*y1/b^2 = 0
 x1*x2/a^2 + y1*y2/b^2 = 0

where it is understood that these are now the rotated x's and y's. However, it will be noticed that these last three equations can have no solution, since we would have

 (y1/x1*y2/x2*y3/x3)^2 = (y2/x2*y3/x3)*(y3/x3*y1/x1)*(y1/x1*y2/x2) =
 (-b^2/a^2)^3

which is impossible. A somewhat similar demonstration will show that they also have no solution in the hyperbola case. Only if the conic is a degenerate hyperbola consisting of two crossed lines will there exist a simultaneous solution to these six equations, and therefore to the original six.

  This places a strong constraint on the original coefficients if the six equations are to have any solutions. The three "points" (x1,y1), (x2,y2), (x3,y3) must all lie along one of the lines of a degenerate hyperbola defined by coefficients A, B, C, and F (=0).

  The third six of your 24 equations must represent the same conic as the first six and its set of three points are therefore also along one of its degenerate lines.

  Satisfying the second and fourth sets of six equations from your original set for a possibly different conic will nevertheless require that it be degenerate with all six of the above points also along its lines.

  All of this implies that when the coefficients permit solutions, there will be an infinite continuum of possible positions along a line or pair of lines.

  As you can see, it is not easy to describe the constraints that apply to your variables that permit them to satisfy all 24 equations. It is not likely that mupad is capable of carrying through such an automatic analysis, and even if it could, it would not be easy for it to inform you of its results. In other words there is undoubtedly a need here for a deeper analysis than you can obtain simply by running Matlab.

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 5 Oct, 2012 18:09:08

Message: 3 of 32

"Roger Stafford" wrote in message <k4l3c0$2ed$1@newscl01ah.mathworks.com>...
> "Daniel " <danmeddings@gmail.com> wrote in message <k4ib2c$eel$1@newscl01ah.mathworks.com>...
> > Dear Users
> >
> > I have a system of 24 multi-variable polynomials (of order 2) in either 28 or 12 unknowns depending on how I view my problem. I must admit I am out of my depth in solving this problem, in fact I do not even know if it is solvable. I appreciate this is a complex area, and many "computer" problems are actually caused by inexperience in use of numerical methods. Unfortunatley I lack the time to pursue this vast area in detail, and so I would very much appreciate some advice from those with experience, in particular in terms of which Matlab functions to use to try to solve my system. I have given my system of equations at the end of this post so as not to clogg up my text!
> >
> > The 12 unknowns [a1-f1], and [a2-f2] are analagous to the X,Y,Z etc that appear in most polynomials (i.e. what I think of as the data), whilst the 16 unknowns [s,alpha1,alpha2,alpha3], [s_h,alpha1_h,alpha2_h,alpha3_h], [t,beta1,beta2,beta3], and [t_h,beta1_h,beta2_h,beta3_h] are analagous to the constants that multiply the data. I am interested in finding solutions to my system in 2 cases
> >
> > (i) where the 16 constants are treated as unknowns as well as the 12 data unknowns,
> >
> > and/or
> >
> > (ii) where only the 12 data unknowns are the unknowns.
> >
> > This may sound weird but it is motivated by statistical considerations where it is of interest theoretically to consider constants as parameters. I have opted to use numeric::polysysroots in mupad which gives the warning
> >
> > "Warning: Solution(s) may be lost. [solvelib::allvalues_warning]" ,
> >
> > along with a trivial solution where every unknown is zero. Another trivial solution not obtained is where s=t_h, t=s_h, and where the appropriate alpha's and beta's are equal to make the terms in parentheses zero. Is this missed second trivial solution what my warning is about? More importantly how can I determine if there are non-trivial solutions that have also been missed? More generally is there any theory that states such a system can only have the trivial solution as is sometimes the case in linear systems?
> >
> > Any help would be greatly appreciated.
> >
> >
> > System of 24 equations (each equation is solved to equal zero):
> >
> > s - t_h + a1^2*(alpha1 - beta1_h) + 2*a1*b1*(alpha2 - beta2_h) + b1^2*(alpha3 - beta3_h)
> >
> > a1*c1*(alpha1 - beta1_h) + (b1*c1 + a1*d1)*(alpha2 - beta2_h) + b1*d1*(alpha3 - beta3_h)
> >
> > a1*e1*(alpha1 - beta1_h) + (b1*e1 + a1*f1)*(alpha2 - beta2_h) + b1*f1*(alpha3 - beta3_h)
> >
> > s - t_h + c1^2*(alpha1 - beta1_h) + 2*c1*d1*(alpha2 - beta2_h) + d1^2*(alpha3 - beta3_h)
> >
> > c1*e1*(alpha1 - beta1_h) + (d1*e1 + c1*f1)*(alpha2 - beta2_h) + d1*f1*(alpha3 - beta3_h)
> >
> > s - t_h + e1^2*(alpha1 - beta1_h) + 2*e1*f1*(alpha2 - beta2_h) + f1^2*(alpha3 - beta3_h)
> >
> > t - s_h + a1^2*(beta1 - alpha1_h) + 2*a1*b1*(beta2 - alpha2_h) + b1^2*(beta3 - alpha3_h)
> >
> > a1*c1*(beta1 - alpha1_h) + (b1*c1 + a1*d1)*(beta2 - alpha2_h) + b1*d1*(beta3 - alpha3_h)
> >
> > a1*e1*(beta1 - alpha1_h) + (b1*e1 + a1*f1)*(beta2 - alpha2_h) + b1*f1*(beta3 - alpha3_h)
> >
> > t - s_h + c1^2*(beta1 - alpha1_h) + 2*c1*d1*(beta2 - alpha2_h) + d1^2*(beta3 - alpha3_h)
> >
> > c1*e1*(beta1 - alpha1_h) + (d1*e1 + c1*f1)*(beta2 - alpha2_h) + d1*f1*(beta3 - alpha3_h)
> >
> > t - s_h + e1^2*(beta1 - alpha1_h) + 2*e1*f1*(beta2 - alpha2_h) + f1^2*(beta3 - alpha3_h)
> >
> > s - t_h + a2^2*(alpha1 - beta1_h) + 2*a2*b2*(alpha2 - beta2_h) + b2^2*(alpha3 - beta3_h)
> >
> > a2*c2*(alpha1 - beta1_h) + (b2*c2 + a2*d2)*(alpha2 - beta2_h) + b2*d2*(alpha3 - beta3_h)
> >
> > a2*e2*(alpha1 - beta1_h) + (b2*e2 + a2*f2)*(alpha2 - beta2_h) + b2*f2*(alpha3 - beta3_h)
> >
> > s - t_h + c2^2*(alpha1 - beta1_h) + 2*c2*d2*(alpha2 - beta2_h) + d2^2*(alpha3 - beta3_h)
> >
> > c2*e2*(alpha1 - beta1_h) + (d2*e2 + c2*f2)*(alpha2 - beta2_h) + d2*f2*(alpha3 - beta3_h)
> >
> > s - t_h + e2^2*(alpha1 - beta1_h) + 2*e2*f2*(alpha2 - beta2_h) + f2^2*(alpha3 - beta3_h)
> >
> > t - s_h + a2^2*(beta1 - alpha1_h) + 2*a2*b2*(beta2 - alpha2_h) + b2^2*(beta3 - alpha3_h)
> >
> > a2*c2*(beta1 - alpha1_h) + (b2*c2 + a2*d2)*(beta2 - alpha2_h) + b2*d2*(beta3 - alpha3_h)
> >
> > a2*e2*(beta1 - alpha1_h) + (b2*e2 + a2*f2)*(beta2 - alpha2_h) + b2*f2*(beta3 - alpha3_h)
> >
> > t - s_h + c2^2*(beta1 - alpha1_h) + 2*c2*d2*(beta2 - alpha2_h) + d2^2*(beta3 - alpha3_h)
> >
> > c2*e2*(beta1 - alpha1_h) + (d2*e2 + c2*f2)*(beta2 - alpha2_h) + d2*f2*(beta3 - alpha3_h)
> >
> > t - s_h + e2^2*(beta1 - alpha1_h) + 2*e2*f2*(beta2 - alpha2_h) + f2^2*(beta3 - alpha3_h
> - - - - - - - - - -
> This is not a direct answer to your question, Daniel, but it might provide an insight into the nature of your problem.
>
> First, consider just the first six of your equations. Instead of a1, b1, c1, d1, e1, and f1, let these be called, respectively, x1, y1, x2, y2, x3, and y3. Lumping the coefficient differences into the single quantities A, B, C, and F these six equations can then be rearranged and expressed as
>
> A*x1^2 + 2*B*x1*y1 + C*y1^2 + F = 0
> A*x2^2 + 2*B*x2*y2 + C*y2^2 + F = 0
> A*x3^2 + 2*B*x3*y3 + C*y3^2 + F = 0
> A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0
> A*x3*x1 + B*(x3*y1+x1*y3) + C*y3*y1 = 0
> A*x1*x2 + B*(x1*y2+x2*y1) + C*y1*y2 = 0
>
> If we consider the x's and y's as unknowns and the coefficients as given, the task would be to find solutions for these six unknowns. The first three equations have the form of the same conic section, which depends only on the four coefficients. It is convenient to rotate the x and y axes in the standard way such that the x*y term disappears. If the conic is not degenerate with F = 0, it can thus be obtained in the form of an ellipse x^2/a^2 + y^2/b^2 = 1 or a hyperbola x^2/a^2 - y^2/b^2 = 1. For an ellipse this would transform the six equations to
>
> x1^2/a^2 + y1^2/b^2 = 1
> x2^2/a^2 + y2^2/b^2 = 1
> x3^2/a^2 + y3^2/b^2 = 1
> x2*x3/a^2 + y2*y3/b^2 = 0
> x3*x1/a^2 + y3*y1/b^2 = 0
> x1*x2/a^2 + y1*y2/b^2 = 0
>
> where it is understood that these are now the rotated x's and y's. However, it will be noticed that these last three equations can have no solution, since we would have
>
> (y1/x1*y2/x2*y3/x3)^2 = (y2/x2*y3/x3)*(y3/x3*y1/x1)*(y1/x1*y2/x2) =
> (-b^2/a^2)^3
>
> which is impossible. A somewhat similar demonstration will show that they also have no solution in the hyperbola case. Only if the conic is a degenerate hyperbola consisting of two crossed lines will there exist a simultaneous solution to these six equations, and therefore to the original six.
>
> This places a strong constraint on the original coefficients if the six equations are to have any solutions. The three "points" (x1,y1), (x2,y2), (x3,y3) must all lie along one of the lines of a degenerate hyperbola defined by coefficients A, B, C, and F (=0).
>
> The third six of your 24 equations must represent the same conic as the first six and its set of three points are therefore also along one of its degenerate lines.
>
> Satisfying the second and fourth sets of six equations from your original set for a possibly different conic will nevertheless require that it be degenerate with all six of the above points also along its lines.
>
> All of this implies that when the coefficients permit solutions, there will be an infinite continuum of possible positions along a line or pair of lines.
>
> As you can see, it is not easy to describe the constraints that apply to your variables that permit them to satisfy all 24 equations. It is not likely that mupad is capable of carrying through such an automatic analysis, and even if it could, it would not be easy for it to inform you of its results. In other words there is undoubtedly a need here for a deeper analysis than you can obtain simply by running Matlab.
>
> Roger Stafford

Firstly Roger thank-you so much for spending time on my question, your answer is absolutley superb in terms of bringing some geometrical intuition to this problem. I really appreciate you efforts. Unfortunatley my geometry ability is almost as bad as my equation solving ability, and so I was wondering if you would be kind enough to offer a little clarification on some of your points?

I understand some of your anaysyis of my first 6 equations: if the first three equations are non-degenerate conics there can be no solution to the last 3 equations, and so no solution to all 24 equations. I am confused however as to how you arrived at your statement "Only if the conic is a degenerate hyperbola consisting of two crossed lines will there exist a simultaneous solution to these six equations, and therefore to the original six."

From your arguments I see that solutions to the last 3 equations can only exist if the first 3 equations are degenerate conics, but the converse is not nessessarily true, i.e. the first 3 equations being degenerate conics does not guarantee solutions exist for the last 3?

Thus the challenge is to find coeficient values A,B,C that determine a degenerate conic such that we can find 3 points (x1,y1), (x2,y2), (x3,y3) producing zero values on the conic (i.e. the first 3 equations are satisfied) that also satisfy the last 3 equations? I see that 2 crossed lines form a degenerate conic, and will always cross the x-axis in two places thus giving us two points that can satisfy the first 3 equations (we can then choose one of these points twice). I have probably misunderstood your answer since you are saying the points (x1,y1), (x2,y2), (x3,y3) can lie anywhere on the lines of the degenerate conics rather than being restricted to points that are roots of the conic?

Thank-you also for showing me how to informally and thoughtfully deal with the symmetry of the problem - i.e. equations 1-6 and 13-18 share the same coefficients but different data, and so for a given choice of coefficients define the same conic. Similarly the whole analysis repeats for equations 7-12, and 19-24 - i.e we have a second conic since we have a different set of coefficients.

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 5 Oct, 2012 23:18:11

Message: 4 of 32

"Daniel" wrote in message <k4n7o4$1hf$1@newscl01ah.mathworks.com>...
> I understand some of your anaysyis of my first 6 equations: if the first three equations are non-degenerate conics there can be no solution to the last 3 equations, and so no solution to all 24 equations. I am confused however as to how you arrived at your statement "Only if the conic is a degenerate hyperbola consisting of two crossed lines will there exist a simultaneous solution to these six equations, and therefore to the original six."
>
> From your arguments I see that solutions to the last 3 equations can only exist if the first 3 equations are degenerate conics, but the converse is not nessessarily true, i.e. the first 3 equations being degenerate conics does not guarantee solutions exist for the last 3?
- - - - - - - - - -
  Yes, my description was rather vague. I'll try to improve upon it.

  My claim about solving the first six equations (of your 24) was that solutions only exist if the F term is zero, that is, if s = t_h. The corresponding degenerate conic would then be:

 A*x^2 + 2*B*x*y + C*y^2 = 0 .

  The rotation of coordinates I referred to earlier is defined by

 x = X*cos(theta) - Y*sin(theta)
 y = X*sin(theta) + Y*cos(theta)

where theta is the angle of rotation given by

 sin(2*theta) = 2*B/sqrt(4*B^2+(A-C)^2)
 cos(2*theta) = (A-C)/sqrt(4*B^2+(A-C)^2) ,

or in other words,

 cot(2*theta) = (A-C)/(2*B) .

If the above transformation is made in A*x^2 + 2*B*x*y + C*y^2, the result (after a some healthy amount of manipulation) is:

 (A+C+sqrt(4*B^2+(A-C)^2))/2*X^2+(A+C-sqrt(4*B^2+(A-C)^2))/2*Y^2

  It can be seen from this that this expression becomes zero on either 1) two crossed lines through the origin if B^2 > A*C, 2) a single line through the origin if B^2 = A*C, or 3) just a single point at the origin itself if B^2 < A*C.

  With the points (x1,y1) and (x2,y2) transformed to (X1,Y1) and (X2,Y2) by the above rotation the equation

 A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2 = 0

will transform to

 (A+C+sqrt(4*B^2+(A-C)^2))/2*X1*X2+(A+C-sqrt(4*B^2+(A-C)^2))/2*Y1*Y2 = 0

(as can be seen with some further effort.) Analogous results are obtained with pairings of (x1,y1) with (x3,y3) and (x2,y2) with (x3,y3).

  From all of this one can conclude that for B^2>A*C any three points on one of the two corresponding crossed lines will solve all six equations (they do have to all be on the same line); for B^2=A*C any three points on the single line will solve all six equations; and for B^2<A*C the only solution is to have all three together at the origin.

  I hope this leaves things a little clearer. (There is some effort required to verify the above transformation results.) My original statement "Only if the conic is a degenerate hyperbola" was actually not right. As you see, there are also solutions with degenerate "parabolas", and degenerate ellipses.

  (Note: In the case B^2 = A*C with F not equal to zero your conic section A*x^2+2*B*x*y+C*y^2+F=0 is not a true parabola but rather a pair of parallel lines on opposite sides of the origin. However as already mentioned, it cannot yield any solutions to all six equations.)
 
Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 7 Oct, 2012 21:55:09

Message: 5 of 32

"Daniel" wrote in message <k4n7o4$1hf$1@newscl01ah.mathworks.com>...
> ...... Unfortunatley my geometry ability is almost as bad as my equation solving ability, and so I was wondering if you would be kind enough to offer a little clarification on some of your points?
- - - - - - - - - - - -
  Daniel, in case it might help you to understand your problem better, I have written some matlab code that generates a random A, B, and C set of coefficients with B^2>A*C (with F understood to be zero,) and then finds three random points on each of its two lines: (x1,y1), (x2,y2), (x3,y3) and (x4,y4), (x5,y5), (x6,y6). It then shows how 12 of your 24 equations are satisfied by these six points which verifies the claim I made about them.

  The points are found by first solving for angles a and b such that

 K*(x*sin(a)-y*cos(a))*(x*sin(b)-y*cos(b)) = A*x^2+2*B*x*y+C*y^2

is identically true for all x and y, the two lines then being defined by

 x*sin(a)-y*cos(a) = 0 and x*sin(b)-y*cos(b) = 0.

  In this example with both lines occupied, the second set of 12 equations of your 24 would necessarily have to involve the same two lines and its associated A, B, C coefficients would consequently have to be proportional to those above. On the other hand, if these six points are all located on the same line, then the second set of A, B, C coefficients would share just that one line with the first set, with the other line being arbitrary.

  The matlab code:

% Generate random A, B, & C such that B^2 >= A*C
A = randn; C = randn;
B = (2*round(rand)-1)*sqrt(randn^2+max(A*C,0));

% Solve for a & b in K*(x*sin(a)-y*cos(a))*(x*sin(b)-y*cos(b)) =
% A*x^2+2*B*x*y+C*y^2 assuming K is some constant > 0.
t1 = atan2(-2*B,C-A); t2 = atan2(2*sqrt(B^2-A*C),A+C);
a = (t1+t2)/2; b = (t1-t2)/2;
sa = sin(a); ca = cos(a); sb = sin(b); cb = cos(b);

% Generate three random points along one line and three
% along the other line.
r1 = randn; x1 = r1*ca; y1 = r1*sa;
r2 = randn; x2 = r2*ca; y2 = r2*sa;
r3 = randn; x3 = r3*ca; y3 = r3*sa;
r4 = randn; x4 = r4*cb; y4 = r4*sb;
r5 = randn; x5 = r5*cb; y5 = r5*sb;
r6 = randn; x6 = r6*cb; y6 = r6*sb;

% Test 12 equalities
format long

% First set of six:
[A*x1^2+2*B*x1*y1+C*y1^2;
 A*x2^2+2*B*x2*y2+C*y2^2;
 A*x3^2+2*B*x3*y3+C*y3^2;
 A*x2*x3+B*(x2*y3+x3*y2)+C*y2*y3;
 A*x3*x1+B*(x3*y1+x1*y3)+C*y3*y1;
 A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2]

% Second set of six:
[A*x4^2+2*B*x4*y4+C*y4^2;
 A*x5^2+2*B*x5*y5+C*y5^2;
 A*x6^2+2*B*x6*y6+C*y6^2;
 A*x5*x6+B*(x5*y6+x6*y5)+C*y5*y6;
 A*x6*x4+B*(x6*y4+x4*y6)+C*y6*y4;
 A*x4*x5+B*(x4*y5+x5*y4)+C*y4*y5]

% These should all differ from zero by no more than very
% small rounding errors.

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 8 Oct, 2012 05:27:08

Message: 6 of 32

"Roger Stafford" wrote in message <k4stnt$1sc$1@newscl01ah.mathworks.com>...
> "Daniel" wrote in message <k4n7o4$1hf$1@newscl01ah.mathworks.com>...
> > ...... Unfortunatley my geometry ability is almost as bad as my equation solving ability, and so I was wondering if you would be kind enough to offer a little clarification on some of your points?
> - - - - - - - - - - - -
> Daniel, in case it might help you to understand your problem better, I have written some matlab code that generates a random A, B, and C set of coefficients with B^2>A*C (with F understood to be zero,) and then finds three random points on each of its two lines: (x1,y1), (x2,y2), (x3,y3) and (x4,y4), (x5,y5), (x6,y6). It then shows how 12 of your 24 equations are satisfied by these six points which verifies the claim I made about them.
>
> The points are found by first solving for angles a and b such that
>
> K*(x*sin(a)-y*cos(a))*(x*sin(b)-y*cos(b)) = A*x^2+2*B*x*y+C*y^2
>
> is identically true for all x and y, the two lines then being defined by
>
> x*sin(a)-y*cos(a) = 0 and x*sin(b)-y*cos(b) = 0.
>
> In this example with both lines occupied, the second set of 12 equations of your 24 would necessarily have to involve the same two lines and its associated A, B, C coefficients would consequently have to be proportional to those above. On the other hand, if these six points are all located on the same line, then the second set of A, B, C coefficients would share just that one line with the first set, with the other line being arbitrary.
>
> The matlab code:
>
> % Generate random A, B, & C such that B^2 >= A*C
> A = randn; C = randn;
> B = (2*round(rand)-1)*sqrt(randn^2+max(A*C,0));
>
> % Solve for a & b in K*(x*sin(a)-y*cos(a))*(x*sin(b)-y*cos(b)) =
> % A*x^2+2*B*x*y+C*y^2 assuming K is some constant > 0.
> t1 = atan2(-2*B,C-A); t2 = atan2(2*sqrt(B^2-A*C),A+C);
> a = (t1+t2)/2; b = (t1-t2)/2;
> sa = sin(a); ca = cos(a); sb = sin(b); cb = cos(b);
>
> % Generate three random points along one line and three
> % along the other line.
> r1 = randn; x1 = r1*ca; y1 = r1*sa;
> r2 = randn; x2 = r2*ca; y2 = r2*sa;
> r3 = randn; x3 = r3*ca; y3 = r3*sa;
> r4 = randn; x4 = r4*cb; y4 = r4*sb;
> r5 = randn; x5 = r5*cb; y5 = r5*sb;
> r6 = randn; x6 = r6*cb; y6 = r6*sb;
>
> % Test 12 equalities
> format long
>
> % First set of six:
> [A*x1^2+2*B*x1*y1+C*y1^2;
> A*x2^2+2*B*x2*y2+C*y2^2;
> A*x3^2+2*B*x3*y3+C*y3^2;
> A*x2*x3+B*(x2*y3+x3*y2)+C*y2*y3;
> A*x3*x1+B*(x3*y1+x1*y3)+C*y3*y1;
> A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2]
>
> % Second set of six:
> [A*x4^2+2*B*x4*y4+C*y4^2;
> A*x5^2+2*B*x5*y5+C*y5^2;
> A*x6^2+2*B*x6*y6+C*y6^2;
> A*x5*x6+B*(x5*y6+x6*y5)+C*y5*y6;
> A*x6*x4+B*(x6*y4+x4*y6)+C*y6*y4;
> A*x4*x5+B*(x4*y5+x5*y4)+C*y4*y5]
>
> % These should all differ from zero by no more than very
> % small rounding errors.
>
> Roger Stafford

Sorry I have not replied sooner Roger. Thanks for your earlier reply, and thank-you for this code. I am still trying to familiarise myself with some of the standard material on conics, after which I shall give your answers the full attention they deserve. I will get back to you hopefully a little later on today. Thank-you so much again for your efforts on my behalf.

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 8 Oct, 2012 21:22:05

Message: 7 of 32

Hello Roger

Thanks very much for your code you posted earlier - I will try and use it to find some numerical solutions to my equations. For reasons I will not bore you with here, I am equally interested in understanding when the system has no solutions as when it does have solutions. You have already said quite a lot of very useful stuff about the former situation, but in trying to understand the many things you have said, I am a little embarrased to admit that I am having a little difficulty with your initial transformation of the equation

A*x^2 + 2*B*x*y + C*y^2 = 0

into

 (A+C+sqrt(4*B^2+(A-C)^2))/2*X^2+(A+C-sqrt(4*B^2+(A-C)^2))/2*Y^2.

This is the derivation you state requires "healthy manipulation"! I understand that the purpose of the transformation is to eliminate the xy term, and in so doing produce a specific example of an equation of a conic, in terms of X and Y now, whose axes are parellel to the coordinate axes. Using your transformation

x = X*cos(theta) - Y*sin(theta)
y = X*sin(theta) + Y*cos(theta)

and with a little help from matlab I get the resulting coefficient for XY which we set to zero and solve for theta;

(C-A)*cos(theta)*sin(theta) + B*(cos^2(theta) - sin^2(theta)) = 0,

or equivalently

B*tan^2(theta) + (A-C)*tan(theta) - B = 0,

which is solved with the quadratic formula;

tan(theta) = [(C-A) +/- sqrt( (C-A)^2 + 4*B^2)] / 2*B.

From this solution how do you get the following results

sin(2*theta) = 2*B/sqrt(4*B^2+(A-C)^2)
cos(2*theta) = (A-C)/sqrt(4*B^2+(A-C)^2)?

I know there is a simple step here using one or a few of the multitude of trig identities, but I cannot seem to find it! These solutions in terms of 2*theta do indeed eliminate the XY term, and as you say from these results the equation

A*x^2 + 2*B*x*y + C*y^2 = 0

can be written

 (A+C+sqrt(4*B^2+(A-C)^2))/2*X^2+(A+C-sqrt(4*B^2+(A-C)^2))/2*Y^2.

I think when I am happy where your magic equation has come from I can get to the more interesting stuff of degenerate conics and numerical solutions to my equations.

As ever any help would be appreciated.

Subject: solving a system of multi-variable polynomial equations in mupad

From: Bruno Luong

Date: 8 Oct, 2012 22:06:10

Message: 8 of 32

"Daniel" wrote in message <k4vg5t$nss$1@newscl01ah.mathworks.com>...

>
> I think when I am happy where your magic equation has come from I can get to the more interesting stuff of degenerate conics and numerical solutions to my equations.
>

I'm not Roger, but this magic equation comes from the diagonalization of the symmetric bilinear form.

http://en.wikipedia.org/wiki/Quadratic_form
http://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia
http://en.wikipedia.org/wiki/Symmetric_matrix

Bruno

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 9 Oct, 2012 02:28:08

Message: 9 of 32

"Daniel" wrote in message <k4vg5t$nss$1@newscl01ah.mathworks.com>...
> This is the derivation you state requires "healthy manipulation"! I understand that the purpose of the transformation is to eliminate the xy term, and in so doing produce a specific example of an equation of a conic, in terms of X and Y now, whose axes are parellel to the coordinate axes. Using your transformation
>
> x = X*cos(theta) - Y*sin(theta)
> y = X*sin(theta) + Y*cos(theta)
>
> and with a little help from matlab I get the resulting coefficient for XY which we set to zero and solve for theta;
>
> (C-A)*cos(theta)*sin(theta) + B*(cos^2(theta) - sin^2(theta)) = 0,
>
> or equivalently
>
> B*tan^2(theta) + (A-C)*tan(theta) - B = 0,
>
> which is solved with the quadratic formula;
>
> tan(theta) = [(C-A) +/- sqrt( (C-A)^2 + 4*B^2)] / 2*B.
>
> From this solution how do you get the following results
>
> sin(2*theta) = 2*B/sqrt(4*B^2+(A-C)^2)
> cos(2*theta) = (A-C)/sqrt(4*B^2+(A-C)^2)?
- - - - - - - - - - - -
  Hello Daniel.

  If we multiply by 2 in your equation

 (C-A)*cos(theta)*sin(theta) + B*(cos^2(theta) - sin^2(theta)) = 0 ,

and use the double angle formulas for sine and cosine, it leads to

 (A-C)*sin(2*theta) = 2*B*cos(2*theta) .

Now let k = sin(2*theta)/(2*B) and we then have

 sin(2*theta) = k*(2*B) and cos(2*theta) = k*(A-C)

but since the sum of the squares of the left sides is 1, this forces k to be either

 1/sqrt(4*B^2+(A-C)^2)

or its negative. We can choose either one for our desired rotation and we choose the positive case which gives

 sin(2*theta) = 2*B/sqrt(4*B^2+(A-C)^2)
 cos(2*theta) = (A-C)/sqrt(4*B^2+(A-C)^2)

  You will find it desirable to express the coefficients of X^2 and Y^2 also in terms of 2*theta and you can then replace the sin(2*theta) and cos(2*theta) by these last expressions. This will lead you directly to the "magic equation" (after the smoke clears away.) The same kind of manipulation will also lead you to the other magic formula

 (A+C+sqrt(4*B^2+(A-C)^2))/2*X1*X2+(A+C-sqrt(4*B^2+(A-C)^2))/2*Y1*Y2 = 0.

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 9 Oct, 2012 08:02:08

Message: 10 of 32

"Daniel" wrote in message <k4vg5t$nss$1@newscl01ah.mathworks.com>...
> ....... I am equally interested in understanding when the system has no solutions as when it does have solutions. .......
- - - - - - - - - - -
  Daniel, you have said, "... I am equally interested in understanding when the system has no solutions as when it does have solutions." I will give you a summary here of my conclusions on that question.

  To begin with, there can be no solutions unless the two quantities which I have called F are zero. That is, s-t_h and t-s_h must both be zero. In fact none of the sets of just six equations can have a solution unless the associated F is zero. This can be demonstrated using the rotation method which I described earlier which with nonzero F's leads to contradictions in each of the three separate cases B^2-A*C < 0, B^2-A*C = 0, and B^2-A*C > 0.

  Assuming zero F's, I find that seeing the situation from the point of view of six x-y points in two-dimensional space and two A-B-C points in three dimensional space to be useful. The six points are the two sets, (a1,b1), (c1,d1), (e1,f1) and (a2,b2), (c2,d2), (e2,f2) which I have called (x1,y1), (x2,y2), (x3,y3), and (x4,y4), (x5,y5), and (x6,y6). The two A-B-C points are

 (A1,B1,C1) = (alpha1-beta1_h,alpha2-beta2_h,alpha3-beta3_h), and
 (A2,B2,C2) = (beta1-alpha1_h,beta2-alpha2_h,beta3-alpha3_h) .

  First, if the six x-y points are all located at the origin, that is, all zero, then any two A-B-C points anywhere in their 3D space will constitute a solution. That is quite obvious.

  Second, if all six x-y points lie along some one line through the origin with not all points at the origin and if a is the angle between that line and the x-axis, then any two points (A1,B1,C1) and (A2,B2,C2) will constitute a solution to the 24 equations provided that each is orthogonal to the 3D vector (cos(a)^2,2*sin(a)*cos(a),sin(a)^2), that is if

 A1*cos(a)^2 + 2*B1*sin(a)*cos(a) + C1*sin(a)^2 = 0 and
 A2*cos(a)^2 + 2*B2*sin(a)*cos(a) + C2*sin(a)^2 = 0 .

Thus the A-B-C points must lie in a certain plane containing the origin. Showing that to be true for the equations of the form of

 A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0

is also accomplished using the aforementioned rotation method.

  Finally, if the three points of the first x-y set lie along one line through the origin, not all at the origin, and if the second set of three points lie along a different line through the origin, again not all at the origin, and if a and b are the respective angles between the x-axis and these lines, then the set of A-B-C point pairs that provide solutions are all pairs that are orthogonal to both

 (cos(a)^2,2*sin(a)*cos(a),sin(a)^2) and
 (cos(b)^2,2*sin(b)*cos(b),sin(b)^2) .

Stated equivalently, it is those A-B-C points which lie along the cross product of these vectors. However we can remove the common nonzero factor, sin(a-b), from this cross product and arrive at the simpler vector

 (-2*sin(a)*sin(b),sin(a+b),-2*cos(a)*cos(b)) .

Thus any two A-B-C points along this direction will constitute a solution to the 24 equations. The A-B-C points must therefore lie in a certain one-dimensional line through the origin for such a set of six x-y points.

  All other combinations of points in these respective x-y and A-B-C spaces are non-solutions.

  Again I point out that MuPAD would have had a very difficult time explaining to humans, not to mention arriving at, such a complicated situation.

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 9 Oct, 2012 17:45:08

Message: 11 of 32

"Roger Stafford" wrote in message <k50lm0$qrj$1@newscl01ah.mathworks.com>...
> ..... I will give you a summary here of my conclusions on that question. .....
- - - - - - - - -
  A couple of corrections for this previous article.

  1) Where I said, "Showing that to be true for the equations of the form of

 A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0

is also accomplished using the aforementioned rotation method" I should have said, "Showing that when a three point x-y set does not lie along a line through the origin, then that set cannot satisfy the associated six equations, is also accomplished using the aforementioned rotation method."

  2) Instead of "All other combinations of points in these respective x-y and A-B-C spaces are non-solutions" I should have said, "For all other combinations of points in these respective x-y and A-B-C spaces, only the A-B-C origin (A = B = C = 0) is a solution."

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 9 Oct, 2012 22:14:08

Message: 12 of 32

> Hello Daniel.
>
> If we multiply by 2 in your equation
>
> (C-A)*cos(theta)*sin(theta) + B*(cos^2(theta) - sin^2(theta)) = 0 ,
>
> and use the double angle formulas for sine and cosine, it leads to
>
> (A-C)*sin(2*theta) = 2*B*cos(2*theta) .
>
> Now let k = sin(2*theta)/(2*B) and we then have
>
> sin(2*theta) = k*(2*B) and cos(2*theta) = k*(A-C)
>
> but since the sum of the squares of the left sides is 1, this forces k to be either
>
> 1/sqrt(4*B^2+(A-C)^2)
>
> or its negative. We can choose either one for our desired rotation and we choose the positive case which gives
>
> sin(2*theta) = 2*B/sqrt(4*B^2+(A-C)^2)
> cos(2*theta) = (A-C)/sqrt(4*B^2+(A-C)^2)
>
> You will find it desirable to express the coefficients of X^2 and Y^2 also in terms of 2*theta and you can then replace the sin(2*theta) and cos(2*theta) by these last expressions. This will lead you directly to the "magic equation" (after the smoke clears away.) The same kind of manipulation will also lead you to the other magic formula
>
> (A+C+sqrt(4*B^2+(A-C)^2))/2*X1*X2+(A+C-sqrt(4*B^2+(A-C)^2))/2*Y1*Y2 = 0.
>
> Roger Stafford

Hi Roger

Thanks for the above response. I can now derive these equations using the standard trig identities - easy when you know how! Once again so many thank-you's for your continued responses, unfortunatley you are going too fast for me and I can't keep up! I will endevour to comment on all of your responses in due course, however I was wondering if I can ask for a further clarification on one of your earlier points? It is regarding the contradiction obtained if F is not equal to zero.

From message 3 in this post you give the 6 equations we have been discussing (the first 6 of 24), after being transformed, and assuming the coefficients A,B,C,F not zero, are such that the resulting conics in equations 1-3 are ellipses. The 6 equations become

x1^2/a^2 + y1^2/b^2 = 1
x2^2/a^2 + y2^2/b^2 = 1
x3^2/a^2 + y3^2/b^2 = 1
x2*x3/a^2 + y2*y3/b^2 = 0
x3*x1/a^2 + y3*y1/b^2 = 0
x1*x2/a^2 + y1*y2/b^2 = 0

You state the last 3 equations give a contradiction as;

(y1/x1*y2/x2*y3/x3)^2 = (y2/x2*y3/x3)*(y3/x3*y1/x1)*(y1/x1*y2/x2) =
(-b^2/a^2)^3

Presumably the left-hand side is positive or zero but the right-hand side is less than but not equal to zero and hence the contradiction? I have tried to derive this contradiction but failed. For example from the last 3 equations I have derived;

y2/x2*y3/x3=(-b^2/a^2)(x2/y2*x3/y3)
y3/x3*y1/x1=(-b^2/a^2)(x3/y3*x1/y1)
y1/x1*y2/x2=(-b^2/a^2)(x1/y1*x2/y2)

I see that I can substitute from equations 4-6 again into the right-hand sides to get different expressions, but I can't seem to get your result. Presumably the correct combination of substitutions leads to all the X's and Y's cancelling leaving the (-b^2/a^2)^3 term? Is there any chance you could point out the correct substitutions?

Thanks again.

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 9 Oct, 2012 22:17:08

Message: 13 of 32

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <k4vioi$3ci$1@newscl01ah.mathworks.com>...
> "Daniel" wrote in message <k4vg5t$nss$1@newscl01ah.mathworks.com>...
>
> >
> > I think when I am happy where your magic equation has come from I can get to the more interesting stuff of degenerate conics and numerical solutions to my equations.
> >
>
> I'm not Roger, but this magic equation comes from the diagonalization of the symmetric bilinear form.
>
> http://en.wikipedia.org/wiki/Quadratic_form
> http://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia
> http://en.wikipedia.org/wiki/Symmetric_matrix
>
> Bruno

Many thanks Bruno for your help. I had forgotten the linear-algebra take on this problem, much neater and compact.

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 9 Oct, 2012 23:41:09

Message: 14 of 32

"Daniel" wrote in message <k527jg$8nq$1@newscl01ah.mathworks.com>...
> y2/x2*y3/x3=(-b^2/a^2)(x2/y2*x3/y3)
> y3/x3*y1/x1=(-b^2/a^2)(x3/y3*x1/y1)
> y1/x1*y2/x2=(-b^2/a^2)(x1/y1*x2/y2)
>
> I see that I can substitute from equations 4-6 again into the right-hand sides to get different expressions, but I can't seem to get your result. Presumably the correct combination of substitutions leads to all the X's and Y's cancelling leaving the (-b^2/a^2)^3 term? Is there any chance you could point out the correct substitutions?
- - - - - - - - - - - - -
  Daniel, your three equations

 y2/x2*y3/x3=(-b^2/a^2)(x2/y2*x3/y3)
 y3/x3*y1/x1=(-b^2/a^2)(x3/y3*x1/y1)
 y1/x1*y2/x2=(-b^2/a^2)(x1/y1*x2/y2)

are incorrect and should actually be:

 y2/x2*y3/x3=(-b^2/a^2)
 y3/x3*y1/x1=(-b^2/a^2)
 y1/x1*y2/x2=(-b^2/a^2)

and the desired result immediately falls out from these latter.

  In that argument I was a bit sloppy and didn't allow for the possibility that some of the x or y quantities might be zero. A more rigorous proof would first go through the following reasoning. Remember, we are assuming here that a and b are both non-zero. Let's number the six equations:

 x1^2/a^2 + y1^2/b^2 = 1 (1)
 x2^2/a^2 + y2^2/b^2 = 1 (2)
 x3^2/a^2 + y3^2/b^2 = 1 (3)
 x2*x3/a^2 + y2*y3/b^2 = 0 (4)
 x3*x1/a^2 + y3*y1/b^2 = 0 (5)
 x1*x2/a^2 + y1*y2/b^2 = 0 (6)

From (1) we have the fact that x1 and y1 can't both be zero. From (2) and (3) the same is true for x2 and y2 and then x3 and y3. Now suppose, for example, x1 were zero. Then from (6) y2 must be zero since y1 can't be zero. If y2 is zero, from (4) x3 must be zero since x2 mustn't be zero. If x3 is zero, from (5) y1 must be zero since y3 can't be zero. But y1 = 0 contradicts our original assumption of having x1 equal to zero. By similar arguments starting with each possible x or y we conclude they must all be non-zero.

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 10 Oct, 2012 21:43:08

Message: 15 of 32

"Roger Stafford" wrote in message <k52cml$phg$1@newscl01ah.mathworks.com>...
> "Daniel" wrote in message <k527jg$8nq$1@newscl01ah.mathworks.com>...
> > y2/x2*y3/x3=(-b^2/a^2)(x2/y2*x3/y3)
> > y3/x3*y1/x1=(-b^2/a^2)(x3/y3*x1/y1)
> > y1/x1*y2/x2=(-b^2/a^2)(x1/y1*x2/y2)
> >
> > I see that I can substitute from equations 4-6 again into the right-hand sides to get different expressions, but I can't seem to get your result. Presumably the correct combination of substitutions leads to all the X's and Y's cancelling leaving the (-b^2/a^2)^3 term? Is there any chance you could point out the correct substitutions?
> - - - - - - - - - - - - -
> Daniel, your three equations
>
> y2/x2*y3/x3=(-b^2/a^2)(x2/y2*x3/y3)
> y3/x3*y1/x1=(-b^2/a^2)(x3/y3*x1/y1)
> y1/x1*y2/x2=(-b^2/a^2)(x1/y1*x2/y2)
>
> are incorrect and should actually be:
>
> y2/x2*y3/x3=(-b^2/a^2)
> y3/x3*y1/x1=(-b^2/a^2)
> y1/x1*y2/x2=(-b^2/a^2)
>
> and the desired result immediately falls out from these latter.
>
> In that argument I was a bit sloppy and didn't allow for the possibility that some of the x or y quantities might be zero. A more rigorous proof would first go through the following reasoning. Remember, we are assuming here that a and b are both non-zero. Let's number the six equations:
>
> x1^2/a^2 + y1^2/b^2 = 1 (1)
> x2^2/a^2 + y2^2/b^2 = 1 (2)
> x3^2/a^2 + y3^2/b^2 = 1 (3)
> x2*x3/a^2 + y2*y3/b^2 = 0 (4)
> x3*x1/a^2 + y3*y1/b^2 = 0 (5)
> x1*x2/a^2 + y1*y2/b^2 = 0 (6)
>
> From (1) we have the fact that x1 and y1 can't both be zero. From (2) and (3) the same is true for x2 and y2 and then x3 and y3. Now suppose, for example, x1 were zero. Then from (6) y2 must be zero since y1 can't be zero. If y2 is zero, from (4) x3 must be zero since x2 mustn't be zero. If x3 is zero, from (5) y1 must be zero since y3 can't be zero. But y1 = 0 contradicts our original assumption of having x1 equal to zero. By similar arguments starting with each possible x or y we conclude they must all be non-zero.
>
> Roger Stafford

Thanks again for this clarification Rodger. I can now see the steps needed in order to derive the equations

y2/x2*y3/x3=(-b^2/a^2)
y3/x3*y1/x1=(-b^2/a^2)
y1/x1*y2/x2=(-b^2/a^2) .

I had not considered the question of whether the x's and y's are all zero, which as you indicate, would invalidate the contradiction obtained. I have tried your method to show x1,x2 and x3 must be zero and it indeed works. I am sure it will too for y1,y2,y3 - but I will check anyhow.

I think I now finally understand all of your comments regarding when the first 6 of my 24 equations have solutions, and the signficance of the mysterious AC>B^2, AC<B^2, and AC=B^2 terms. I was wondering if I could just summarise to see if I have my story straight? I find it instructive to summarise a bit of theory for conics (which I have just read) and relate it to some of the things you have described (although you may have derived your statements from first principles).

The most general equation of the second degree in x and y can be written

a*x^2 + 2h*x*y + b*y^2 + 2f*x + 2*g*y + c = 0,

can be transformed according to your rotation into an equation in X and Y as

a'*X^2 + 2h'*X*Y + b'*Y^2 + 2f'*X + 2g'*Y + c' = 0,

where c'=c, and a',h',b' and f' are all functions of a,b,h, sin(theta), and cos(theta), which for brevity I omit writing. Choosing theta to make h'=0 eliminates the X*Y term which gives the equation of a conic whose axes are parallel to the coordinate axes, although the equation is not in standard form. The following equality

a'b' - h'^2 = ab - h^2

holds for the rotation you describe, and so ab-h^2 is called an invariant. For theta chosen to make h'=0 we have the following situation;

ab=h^2: a'=0 or b'=0 but not both. The conic is a parabola or two parallel lines (when the conic is a quadratic in just X or Y);

ab>h^2: a' and b' are the same sign. For k=f^2/a + g^2/b -c, the conic is an ellipse real or imaginary according as k has the same or different sign respectively to a' and b', or it is a point ellipse (consisting of just the point (0,0)) when k=0;

ab<h^2: a' and b' differ in sign. The conic is a hyperbola if k is not zero (k as defined above), or is 2 intersecting lines if k=0.

Now for the first 6 of my equations (in your notation)

 A*x1^2 + 2*B*x1*y1 + C*y1^2 + F = 0
 A*x2^2 + 2*B*x2*y2 + C*y2^2 + F = 0
 A*x3^2 + 2*B*x3*y3 + C*y3^2 + F = 0
 A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0
 A*x3*x1 + B*(x3*y1+x1*y3) + C*y3*y1 = 0
 A*x1*x2 + B*(x1*y2+x2*y1) + C*y1*y2 = 0.

My first equation (droping the 1's)

 A*x^2 + 2*B*x*y + C*y^2 + F = 0,

then has a=A, h= B, b=C, f=g=0, and c=F. The rotated version of this with no x*y term is then

((C + A +/- d)/2)*X^2 + ((C + A -/+ d)/2)*Y^2 + F = 0

where d = sqrt((C-A)^2 + 4*B^2), and the +/- d comes from the fact we can choose from one of two rotations cos(2*theta) = -(C-A)/+/-d, and sin(2*theta) = 2*B/+/-d. Thus a' = (C + A +/- d)/2, b' = (C + A -/+ d)/2, h'=f'=g'=0, and c'=F. Thus the invariant inequalities ab=h^2, ab>h^2, and ab<h^2 become AC=B^2, AC>B^2, and AC<B^2.

Supposing now we choose values for our coefficients A,B,C and F (not zero) such that AC>B^2, that is we choose our coefficients such that our rotated conic is a non-degenerate ellipse. For these hypothetical coefficients, you then "re-wrote" the first three of my equations in standard form for some coefficients a and b (ignoring now the previous a's, b's, etc and their primed counterparts), and expressed the last three equations also as a function of a and b (presumably by dividing through by F which would appear in the a and b coefficients). The equations you obtained were

x1^2/a^2 + y1^2/b^2 = 1
x2^2/a^2 + y2^2/b^2 = 1
x3^2/a^2 + y3^2/b^2 = 1
x2*x3/a^2 + y2*y3/b^2 = 0
x3*x1/a^2 + y3*y1/b^2 = 0
x1*x2/a^2 + y1*y2/b^2 = 0.

from the last of these three equations you then derived the contradiction

(y1/x1*y2/x2*y3/x3)^2 = (-b^2/a^2)^3 < 0,

which shows that for F not zero the last three equations cannot have any solution (and hence nor can the 6 equations, nor the whole 24). Thus we must have F=0 for any solution to exist for these 6 equations. For our ellipse, F=0 means we have the point ellipse (0,0). Thus any point on this ellipse, i.e. (0,0) will obviously satisfy all 6 equations.

If we had AC<B^2 for our choice of A,B, and C, then we would have a hyperbola. I have not checked that the above all of the above holds in this scenario - you assure me it does, and so I assume it will hold (I will check in due course). Re-writing the first 3 equations in standard form as a function of some coefficients a and b, and writing the last three also to be a function of these, we have

x1^2/a^2 - y1^2/b^2 = 0 <=> (x1/a - y1/b)*(x1/a + y1/b) = 0
x2^2/a^2 - y2^2/b^2 = 0 <=> (x2/a - y2/b)*(x2/a + y2/b) = 0
x3^2/a^2 - y3^2/b^2 = 0 <=> (x3/a - y3/b)*(x3/a + y3/b) = 0
x2*x3/a^2 - y2*y3/b^2 = 0 <=> x2*x3/a^2 - y2*y3/b^2 = 0
x3*x1/a^2 - y3*y1/b^2 = 0 <=> x3*x1/a^2 - y3*y1/b^2 = 0
x1*x2/a^2 - y1*y2/b^2 = 0 <=> x1*x2/a^2 - y1*y2/b^2 = 0

You stated that any point on the lines Y = +/- (b/a)X are solutions to all the equations. I have indeed verified that for points on Y = + (b/a)X, that these points also satisfy equations 3-6 (I assume and will verify the same holds for solutions on the other line).

For AC=B^2 for our choice of A,B, and C, then we would have quadratics in either the y's or x's as the conics for the first 3 equations (I again need to check I can obtain a contradiciton showing we must have F=0). Assuming a=a'=(C + A +/- d)/2=0, our 6 equations become

b^2*y1^2=0
b^2*y2^2=0
b^2*y3^2=0
b^2*y2*y3=0
b^2*y3*y1=0
b^2*y1*y2=0,

and points along the x-axis of the form (X,0) obviously satisfy all 6 equations.

Thus I think I now see what you mean when you say only F=0 can lead to solutions for all 6 equations. I hope this sounds OK. Thanks again for your help, I really appreciate it. I will try and comment later on your code you have written to find solutions to 12 out of my 24 equations, and on some of the other things you have said.

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 11 Oct, 2012 00:34:09

Message: 16 of 32

"Daniel" wrote in message <k54q5c$2pt$1@newscl01ah.mathworks.com>...
> ........
> If we had AC<B^2 for our choice of A,B, and C, then we would have a hyperbola. I have not checked that the above all of the above holds in this scenario - you assure me it does, and so I assume it will hold (I will check in due course). ......
- - - - - - - - - -
  What you have written looks substantially correct to me.

  I add here here the reasoning that in the "hyperbolic" case you must have F = 0 to have solutions to your six basic equations. (It is obvious in the "parabolic" case.)

  As has already been established, after the appropriate rotation the six equations would have this form:

 X1^2/a^2 - Y1^2/b^2 = 1
 X2^2/a^2 - Y2^2/b^2 = 1
 X3^2/a^2 - Y3^2/b^2 = 1
 X2*X3/a^2 - Y2*Y3/b^2 = 0
 X3*X1/a^2 - Y3*Y1/b^2 = 0
 X1*X2/a^2 - Y1*Y2/b^2 = 0

where a and b are positive and where the X's and Y's refer to the rotated coordinates. However, there can be no solution to such a set of equations as shown by the following impossibility:

 (X1^2/a^2)*(X2^2/a^2)*(X3^2/a^2) =
 (Y1^2/b^2+1)*(Y2^2/b^2+1)*(Y3^2/b^2+1) >
 (Y1^2/b^2)*(Y2^2/b^2)*(Y3^2/b^2) =
 (Y2*Y3/b^2)*(Y3*Y1/b^2)*(Y1*Y2/b^2) =
 (X2*X3/a^2)*(X3*X1/a^2)*(X1*X2/a^2) =
 (X1^2/a^2)*(X2^2/a^2)*(X3^2/a^2) .

The first quantity would have to be greater than the last and yet is also identical to it!

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 11 Oct, 2012 21:51:07

Message: 17 of 32

"Roger Stafford" wrote in message <k55461$5p9$1@newscl01ah.mathworks.com>...
> "Daniel" wrote in message <k54q5c$2pt$1@newscl01ah.mathworks.com>...
> > ........
> > If we had AC<B^2 for our choice of A,B, and C, then we would have a hyperbola. I have not checked that the above all of the above holds in this scenario - you assure me it does, and so I assume it will hold (I will check in due course). ......
> - - - - - - - - - -
> What you have written looks substantially correct to me.
>
> I add here here the reasoning that in the "hyperbolic" case you must have F = 0 to have solutions to your six basic equations. (It is obvious in the "parabolic" case.)
>
> As has already been established, after the appropriate rotation the six equations would have this form:
>
> X1^2/a^2 - Y1^2/b^2 = 1
> X2^2/a^2 - Y2^2/b^2 = 1
> X3^2/a^2 - Y3^2/b^2 = 1
> X2*X3/a^2 - Y2*Y3/b^2 = 0
> X3*X1/a^2 - Y3*Y1/b^2 = 0
> X1*X2/a^2 - Y1*Y2/b^2 = 0
>
> where a and b are positive and where the X's and Y's refer to the rotated coordinates. However, there can be no solution to such a set of equations as shown by the following impossibility:
>
> (X1^2/a^2)*(X2^2/a^2)*(X3^2/a^2) =
> (Y1^2/b^2+1)*(Y2^2/b^2+1)*(Y3^2/b^2+1) >
> (Y1^2/b^2)*(Y2^2/b^2)*(Y3^2/b^2) =
> (Y2*Y3/b^2)*(Y3*Y1/b^2)*(Y1*Y2/b^2) =
> (X2*X3/a^2)*(X3*X1/a^2)*(X1*X2/a^2) =
> (X1^2/a^2)*(X2^2/a^2)*(X3^2/a^2) .
>
> The first quantity would have to be greater than the last and yet is also identical to it!
>
> Roger Stafford

Roger thanks very much for confirming my summary is OK, and thanks for showing me the contradiction in the hyperbolic case. A very quick general question: what is your strategy for finding these contradictions? For example do you say try to solve them (manually or with Matlab), then if you can't solve them do you make the assumption there is no solution, and proceed to try and find a contradiciton which shows there cannot be solutions? Or do you do the reverse, that is do you try and find a contradicition, and then if you cannot find one do you then move on to trying to find a solution? If so is this a general strategy you employ for all problems?

Specifically, I am just moving on now to the code you have written in message 6. I am not sure if I have forgotten a lot of trig or simply have never learnt it well enough to forget it, but are the two equations in parentheses in the equation

K*(x*sin(a)-y*cos(a))*(x*sin(b)-y*cos(b)) = A*x^2+2*B*x*y+C*y^2

equivalent to the two lines y=x*tan(a) and y=x*tan(b) respectively, where tan(a), and tan(b) are the slopes of the lines? These two lines are then the crossed lines of the degenerate hyperbola, and so you are initially trying to find two lines that are defined by the right-hand side, by changing the angles, and hence the gradients of the lines?

As ever I appreciate your help on this, and I will at some point get through everything you have said!






 

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 12 Oct, 2012 00:59:08

Message: 18 of 32

"Daniel" wrote in message <k57f0b$4gd$1@newscl01ah.mathworks.com>...
> Specifically, I am just moving on now to the code you have written in message 6.
- - - - - - - - - -
  As you will recall, the object of that matlab code was 1) to start with random A, B, and C subject to the condition B^2>=A*C, 2) to then find the two lines that are solutions to A*x^2+2*B*x*y+C*y^2 = 0, and finally 3) to choose three random points along each line. Then the code verified that your twelve equations were valid.

  The reasoning behind the code is a little obscure so I will explain it here in greater detail. The equation of any line through the origin must necessarily have the form

 x*sin(t)-y*cos(t) = 0

where t is the angle measured counterclockwise from the x-axis to the line, so we write

 K*(x*sin(a)-y*cos(a))*(x*sin(b)-y*cos(b)) = A*x^2+2*B*x*y+C*y^2

which would produce zeros along the lines, and try to determine a, b, and K>=0 such that this is an identity in x and y. The result of equating coefficients of x^2, x*y, and y^2 is:

 A = K*sin(a)*sin(b) = K*(cos(a-b)-cos(a+b))/2
 -2*B = K*(sin(a)*cos(b)+cos(a)*sin(b)) = K*sin(a+b)
 C = K*cos(a)*cos(b) = K*(cos(a-b)+cos(a+b))/2

It follows that

 C-A = K*cos(a+b)
 C+A = K*cos(a-b)
 4*B^2+(C-A)^2 = K^2*(sin(a+b)^2+cos(a+b)^2) = K^2

and also that

 K*sin(a-b) = K*sqrt(1-cos(a-b)^2) = sqrt(K^2-K^2*cos(a-b)^2) =
    sqrt(4*B^2+(C-A)^2-(C+A)^2)) = 2*sqrt(B^2-A*C) .

In the equations K*sin(a+b) = -2*B and K*cos(a+b) = C-A the angle a+b can be calculated using matlab's 'atan2' function:

 a+b = atan2(-2*B,C-A) .

Similarly in the equations K*sin(a-b) = 2*sqrt(B^2-A*C) and
K*cos(a-b) = C+A the angle a-b is found by

 a-b = atan2(2*sqrt(B^2-A*C),C+A)

From these we can determine a and b:

 a = ((a+b)+(a-b))/2 and b = ((a+b)-(a-b))/2 .

Having found a and b, the code then finds three random points along each line and proceeds to test the twelve equations.

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 12 Oct, 2012 16:01:09

Message: 19 of 32

"Roger Stafford" wrote in message <k57q0s$9qm$1@newscl01ah.mathworks.com>...
> "Daniel" wrote in message <k57f0b$4gd$1@newscl01ah.mathworks.com>...
> > Specifically, I am just moving on now to the code you have written in message 6.
> - - - - - - - - - -
> As you will recall, the object of that matlab code was 1) to start with random A, B, and C subject to the condition B^2>=A*C, 2) to then find the two lines that are solutions to A*x^2+2*B*x*y+C*y^2 = 0, and finally 3) to choose three random points along each line. Then the code verified that your twelve equations were valid.
>
> The reasoning behind the code is a little obscure so I will explain it here in greater detail. The equation of any line through the origin must necessarily have the form
>
> x*sin(t)-y*cos(t) = 0
>
> where t is the angle measured counterclockwise from the x-axis to the line, so we write
>
> K*(x*sin(a)-y*cos(a))*(x*sin(b)-y*cos(b)) = A*x^2+2*B*x*y+C*y^2
>
> which would produce zeros along the lines, and try to determine a, b, and K>=0 such that this is an identity in x and y. The result of equating coefficients of x^2, x*y, and y^2 is:
>
> A = K*sin(a)*sin(b) = K*(cos(a-b)-cos(a+b))/2
> -2*B = K*(sin(a)*cos(b)+cos(a)*sin(b)) = K*sin(a+b)
> C = K*cos(a)*cos(b) = K*(cos(a-b)+cos(a+b))/2
>
> It follows that
>
> C-A = K*cos(a+b)
> C+A = K*cos(a-b)
> 4*B^2+(C-A)^2 = K^2*(sin(a+b)^2+cos(a+b)^2) = K^2
>
> and also that
>
> K*sin(a-b) = K*sqrt(1-cos(a-b)^2) = sqrt(K^2-K^2*cos(a-b)^2) =
> sqrt(4*B^2+(C-A)^2-(C+A)^2)) = 2*sqrt(B^2-A*C) .
>
> In the equations K*sin(a+b) = -2*B and K*cos(a+b) = C-A the angle a+b can be calculated using matlab's 'atan2' function:
>
> a+b = atan2(-2*B,C-A) .
>
> Similarly in the equations K*sin(a-b) = 2*sqrt(B^2-A*C) and
> K*cos(a-b) = C+A the angle a-b is found by
>
> a-b = atan2(2*sqrt(B^2-A*C),C+A)
>
> From these we can determine a and b:
>
> a = ((a+b)+(a-b))/2 and b = ((a+b)-(a-b))/2 .
>
> Having found a and b, the code then finds three random points along each line and proceeds to test the twelve equations.
>
> Roger Stafford

Thanks for the clarification Roger. I will see what types of solutions your code throws up. Since degenerate conics are central to this analysis I will not be surprised if the solutions are degenerate in some way - degenerate from the point of view of the interpretation of the original equations (it is basically about parametised covariance matrices in a statistical model). However we will see.

Thanks again.

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 15 Oct, 2012 20:29:12

Message: 20 of 32

"Roger Stafford" wrote in message <k57q0s$9qm$1@newscl01ah.mathworks.com>...
> "Daniel" wrote in message <k57f0b$4gd$1@newscl01ah.mathworks.com>...
> > Specifically, I am just moving on now to the code you have written in message 6.
> - - - - - - - - - -
> As you will recall, the object of that matlab code was 1) to start with random A, B, and C subject to the condition B^2>=A*C, 2) to then find the two lines that are solutions to A*x^2+2*B*x*y+C*y^2 = 0, and finally 3) to choose three random points along each line. Then the code verified that your twelve equations were valid.
>
> The reasoning behind the code is a little obscure so I will explain it here in greater detail. The equation of any line through the origin must necessarily have the form
>
> x*sin(t)-y*cos(t) = 0
>
> where t is the angle measured counterclockwise from the x-axis to the line, so we write
>
> K*(x*sin(a)-y*cos(a))*(x*sin(b)-y*cos(b)) = A*x^2+2*B*x*y+C*y^2
>
> which would produce zeros along the lines, and try to determine a, b, and K>=0 such that this is an identity in x and y. The result of equating coefficients of x^2, x*y, and y^2 is:
>
> A = K*sin(a)*sin(b) = K*(cos(a-b)-cos(a+b))/2
> -2*B = K*(sin(a)*cos(b)+cos(a)*sin(b)) = K*sin(a+b)
> C = K*cos(a)*cos(b) = K*(cos(a-b)+cos(a+b))/2
>
> It follows that
>
> C-A = K*cos(a+b)
> C+A = K*cos(a-b)
> 4*B^2+(C-A)^2 = K^2*(sin(a+b)^2+cos(a+b)^2) = K^2
>
> and also that
>
> K*sin(a-b) = K*sqrt(1-cos(a-b)^2) = sqrt(K^2-K^2*cos(a-b)^2) =
> sqrt(4*B^2+(C-A)^2-(C+A)^2)) = 2*sqrt(B^2-A*C) .
>
> In the equations K*sin(a+b) = -2*B and K*cos(a+b) = C-A the angle a+b can be calculated using matlab's 'atan2' function:
>
> a+b = atan2(-2*B,C-A) .
>
> Similarly in the equations K*sin(a-b) = 2*sqrt(B^2-A*C) and
> K*cos(a-b) = C+A the angle a-b is found by
>
> a-b = atan2(2*sqrt(B^2-A*C),C+A)
>
> From these we can determine a and b:
>
> a = ((a+b)+(a-b))/2 and b = ((a+b)-(a-b))/2 .
>
> Having found a and b, the code then finds three random points along each line and proceeds to test the twelve equations.
>
> Roger Stafford

Hi Rodger

Thank-you for the above explanation of your Matlab code, which works perfectly. I have managed to use it to find solutions to all 24 of my equations which has thrown up some very interesting results (but more on this perhaps a little later). I am confused now on only one point of your Matlab code which concerns the role of K in the equality

K*(x*sin(a)-y*cos(a))*(x*sin(b)-y*cos(b)) = A*x^2+2*B*x*y+C*y^2=0.

As I understand this equality, for arbitrary and fixed A,B,C, such that B^2>AC, then A*x^2+2*B*x*y+C*y^2 defines a degenerate hyperbola consisting of two crossed lines through the origin (in unrotated coordinates). The LHS is an equivalent representation in terms of two lines defined by angles measured from the x-axis, and a constant K. But why can't the K be dropped? For example I see that if (x1,y1) is on the line x*sin(a)-y*cos(a)=0 then so is (K*x1,K*y1). Or conversely (x1,y1) and (K*x1,K*y1) are both on the line K*(x*sin(a)-y*cos(a))=0. So K only scales a line and so seems irrelevant to me? I am sure I have got this very muddled up but any help would as ever be appreciated.





we are trying to find angles a, and b such that the RHS equation, which is in untransfromed coordinates, is a degenerate hyperbola, that is 2 crossed lines through the origin.
 

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 15 Oct, 2012 22:42:15

Message: 21 of 32

"Daniel" wrote in message <k5hrmo$jtt$1@newscl01ah.mathworks.com>...
> ..... But why can't the K be dropped? ......
- - - - - - - - - -
  The purpose of K lies in deriving an algebraic identity with the expression

 A*x^2+2*B*x*y+C*y^2

regardless of whether it is to be equal to zero or not. For that you do need K. Otherwise such equations as

 -2*B = K*sin(a+b)
 C-A = K*cos(a+b)
 2*sqrt(B^2-A*C) = K*sin(a-b)
 C+A = K*cos(a-b)

would all be inherently false with K absent and with arbitrary A, B, and C. You will notice however that K does drop out of the picture with the two 'atan2' operations and does not play a role in solving the two line angles. So, yes, K is definitely needed in the theory behind the matlab code but is never explicitly solved for in the code because the lines' angles are independent of its value.

  (It is misleading to say that K scales the points on the lines.)

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 16 Oct, 2012 22:42:21

Message: 22 of 32

"Roger Stafford" wrote in message <k5i3g7$ie5$1@newscl01ah.mathworks.com>...
> "Daniel" wrote in message <k5hrmo$jtt$1@newscl01ah.mathworks.com>...
> > ..... But why can't the K be dropped? ......
> - - - - - - - - - -
> The purpose of K lies in deriving an algebraic identity with the expression
>
> A*x^2+2*B*x*y+C*y^2
>
> regardless of whether it is to be equal to zero or not. For that you do need K. Otherwise such equations as
>
> -2*B = K*sin(a+b)
> C-A = K*cos(a+b)
> 2*sqrt(B^2-A*C) = K*sin(a-b)
> C+A = K*cos(a-b)
>
> would all be inherently false with K absent and with arbitrary A, B, and C. You will notice however that K does drop out of the picture with the two 'atan2' operations and does not play a role in solving the two line angles. So, yes, K is definitely needed in the theory behind the matlab code but is never explicitly solved for in the code because the lines' angles are independent of its value.
>
> (It is misleading to say that K scales the points on the lines.)
>
> Roger Stafford

Hi Rodger

Thanks again for your helpful response. I see now the use of K - I forgot the important fact that sin(a+b) and cos(a+b) are in the range [-1,1]! So yes I see that -2*B = sin(a+b) will always be false if -2*B is not in the range [-1,1], and the K can be chosen to make the equality work. I think I convinced myself it must be superfluous when it dissappered from the subsequent analysis.

I have finally got on to your message number 5. You give some very nice geometrical interpretations to the solution space of the A1-B1-C1, and A2-B2-C2 points given that the six x-y points lie somewhere on the two degenerate conics defined by equations 1/4/6 and 13/16/18 (for the coefficients A1,B1,C1), and equations 7/10/12 and 19/22/24 (for the coefficients A2,B2,C2) - here the equation numbers relate to the 24 equations I give in my original post.

I hope I have got this right by now when I say that each of the two degenerate conics can either be the point ellipse, the x-axis or y-axis (if the conic is a degenerate parabola), or two crossed lines through the origin (if the conic is a degenerate hyperbola). So the scenarios you outline correspond to the following situations;

1) all six x-y points are located at the origin - both conics are the point ellipse
2) all six x-y points lie along one line through the origin - both conics are the same degenerate parabola
3) 3 x-y points lie along one line through the origin whilst the other three lie on another line through the origin - both conics are the x-axis and y-axis respectively, or are the same hyperbola.

Your geometric interpretations of the A-B-C solution space, i.e. the whole of R^3, a plane through the origin, or points in R^3 in the direction of a cross-product, show that, given the x-y points are located as discussed above, then there are an infinite number of (A1,B1,C1), and (A2,B2,C2) points that are solutions?

I suppose this says a similar thing as your Matlab code but in reverse - i.e., for the 12 equations using (A1,B1,C1) chosen arbitrarily, we can always find two lines from which to draw an infinite number of x-y points as solutions. If the coefficient differences making up (A2,B2,C2) are chosen so that A1=A2, B1=B2, and C1=C2, then the 12 equations using (A2,B2,C2) define the same conic, and there are an infinite number of solutions.

Thanks

Dan

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 18 Oct, 2012 02:54:24

Message: 23 of 32

"Daniel" wrote in message <k5knsd$l1u$1@newscl01ah.mathworks.com>...
> .........
> I hope I have got this right by now when I say that each of the two degenerate conics can either be the point ellipse, the x-axis or y-axis (if the conic is a degenerate parabola), or two crossed lines through the origin (if the conic is a degenerate hyperbola). So the scenarios you outline correspond to the following situations;
>
> 1) all six x-y points are located at the origin - both conics are the point ellipse
> 2) all six x-y points lie along one line through the origin - both conics are the same degenerate parabola
> 3) 3 x-y points lie along one line through the origin whilst the other three lie on another line through the origin - both conics are the x-axis and y-axis respectively, or are the same hyperbola.
> ........
 - - - - - - - - - -
  I think you misinterpreted some of the statements I made, Daniel. For instance, the "parabolic" condition B^2=A*C>0 does not imply the xy points have to be either the x-axis or y-axis; it could be any straight line through the origin, depending on the values of A, B, and C. Also, having all points in a solution lie along a single straight line through the origin does not imply that the parabolic condition must hold; it might be one of the lines of a "hyperbolic" (B^2>A*C) set.

  It is easiest to first analyze all the solutions to the six homogeneous equations

 A*x1^2+2*B*x1*y1+C*y1^2 = 0
 A*x2^2+2*B*x2*y2+C*y2^2 = 0
 A*x3^2+2*B*x3*y3+C*y3^2 = 0
 A*x2*x3+B*(x2*y3+x3*y2)+C*y2*y3 = 0
 A*x3*x1+B*(x3*y1+x1*y3)+C*y3*y1 = 0
 A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2 = 0

This can be divided into four different cases.

1) B^2 < A*C (elliptical). The only possible solution in this case is for all xy points to lie at the origin: x1=y1=x2=y2=x3=y3=0.

2) B^2 = A*C > 0 (parabolic). The only possible solutions in this case must have all three xy points lying along some particular straight line through the xy origin. For given A, B, and C of this type, the line can be determined by

 a = 1/2*atan2(-2*B/(C+A),(C-A)/(C+A))

where 'a' is the angle between the line and the x-axis. For a given set of three xy points along a straight line through the origin with angle 'a', the corresponding A, B, C values for this case will be any satisfying

 A = K*sin(a)^2
 B = -K*sin(a)*cos(a)
 C = K*cos(a)^2

for some non-zero K.

3) B^2 > A*C (hyperbolic). The only possible solution here is for the three points to all lie along one particular straight line through the origin or else all along some particular second, distinct line also through the origin. You have already seen how the two angles 'a' and 'b' of these two lines can be found from A, B, and C of this case. It was the method using two atan2's contained in my Oct. 7 article. If angles 'a' and 'b' of the two lines are given, then A, B, and C can be any numbers satisfying

 A = K*sin(a)*sin(b)
 B = -K/2*sin(a+b)
 C = K*cos(a)*cos(b)

for some non-zero K.

4) A = B = C = 0. In this case any set whatever of three xy points will obviously satisfy the six equations.

  For your 24 equations which involve two sets of three xy points and two sets of ABC values in all four possible combinations, first of all, there will be no solutions at all unless s-t_h=0 and t-s_h=0, making the equations homogeneous. If this is true, then all solutions can be found in terms of appropriate combinations of solutions from the above set of six equations.

  If both ABC sets are hyperbolic and if both sets of associated lines are the same, then the two sets of A,B,C values must be proportional to one another and the xy solution is to either have all six points on one of the lines or to have the first three on one line and the second three on the other line. If instead, only one of the lines is shared between the two ABC sets, then the xy solution is to have all six points along this common line. If no lines are shared between the two ABC sets, then all six xy points must be at the origin.

  If A1,B1,C1 are hyperbolic (B1^2>A1*C1) and A2,B2,C2 are parabolic (B2^2=A2*C2>0), and if one of the lines of the (A1,B1,C1) set is the same as the unique line of the (A2,B2,C2) set, then the xy solutions consist of all possible sets of six points along this common line. If there is not this match of lines, then the only solution is with all six points at the origin.

  If both ABC sets are parabolic and if these both correspond to the same line, then the ABC values must be proportional to one another and the xy solution is any six points along this common line. If their lines are not the same, then having the six points at the origin is the only solution.

  If either set or both sets are elliptical, then only the xy origin for all six points will be a solution.

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: EBS

Date: 18 Oct, 2012 15:06:10

Message: 24 of 32

"Roger Stafford" wrote in message <k5nr10$9mi$1@newscl01ah.mathworks.com>...
> - - - - - - - - - -
> I think you misinterpreted some of the statements I made, Daniel. For instance, the "parabolic" condition B^2=A*C>0 does not imply the xy points have to be either the x-axis or y-axis; it could be any straight line through the origin, depending on the values of A, B, and C. Also, having all points in a solution lie along a single straight line through the origin does not imply that the parabolic condition must hold; it might be one of the lines of a "hyperbolic" (B^2>A*C) set.
...
>

Roger, I just wanted to say that you are both amazingly knowledgeable and generous with your time. Have you ever considered setting up a PayPal 'tip jar', like Yair has? You have contributed so much to this community that it can feel one-sided :)

Cheers

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 18 Oct, 2012 22:06:10

Message: 25 of 32

> I think you misinterpreted some of the statements I made, Daniel. For instance, the "parabolic" condition B^2=A*C>0 does not imply the xy points have to be either the x-axis or y-axis; it could be any straight line through the origin, depending on the values of A, B, and C. Also, having all points in a solution lie along a single straight line through the origin does not imply that the parabolic condition must hold; it might be one of the lines of a "hyperbolic" (B^2>A*C) set.

Roger thanks again for this clarification, I will take a look through this at the weekend and get back to you next week. As somebody posted earlier, you are very generous with your time and I appreciate that very much.

Dan

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 21 Oct, 2012 21:39:08

Message: 26 of 32

> I think you misinterpreted some of the statements I made, Daniel. For instance, the "parabolic" condition B^2=A*C>0 does not imply the xy points have to be either the x-axis or y-axis; it could be any straight line through the origin, depending on the values of A, B, and C. Also, having all points in a solution lie along a single straight line through the origin does not imply that the parabolic condition must hold; it might be one of the lines of a "hyperbolic" (B^2>A*C) set.
>
> It is easiest to first analyze all the solutions to the six homogeneous equations
>
> A*x1^2+2*B*x1*y1+C*y1^2 = 0
> A*x2^2+2*B*x2*y2+C*y2^2 = 0
> A*x3^2+2*B*x3*y3+C*y3^2 = 0
> A*x2*x3+B*(x2*y3+x3*y2)+C*y2*y3 = 0
> A*x3*x1+B*(x3*y1+x1*y3)+C*y3*y1 = 0
> A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2 = 0
>
> This can be divided into four different cases.
>
> 1) B^2 < A*C (elliptical). The only possible solution in this case is for all xy points to lie at the origin: x1=y1=x2=y2=x3=y3=0.
>
> 2) B^2 = A*C > 0 (parabolic). The only possible solutions in this case must have all three xy points lying along some particular straight line through the xy origin. For given A, B, and C of this type, the line can be determined by
>
> a = 1/2*atan2(-2*B/(C+A),(C-A)/(C+A))
>
> where 'a' is the angle between the line and the x-axis. For a given set of three xy points along a straight line through the origin with angle 'a', the corresponding A, B, C values for this case will be any satisfying
>
> A = K*sin(a)^2
> B = -K*sin(a)*cos(a)
> C = K*cos(a)^2
>
> for some non-zero K.
>
> 3) B^2 > A*C (hyperbolic). The only possible solution here is for the three points to all lie along one particular straight line through the origin or else all along some particular second, distinct line also through the origin. You have already seen how the two angles 'a' and 'b' of these two lines can be found from A, B, and C of this case. It was the method using two atan2's contained in my Oct. 7 article. If angles 'a' and 'b' of the two lines are given, then A, B, and C can be any numbers satisfying
>
> A = K*sin(a)*sin(b)
> B = -K/2*sin(a+b)
> C = K*cos(a)*cos(b)
>
> for some non-zero K.
>
> 4) A = B = C = 0. In this case any set whatever of three xy points will obviously satisfy the six equations.
>
> For your 24 equations which involve two sets of three xy points and two sets of ABC values in all four possible combinations, first of all, there will be no solutions at all unless s-t_h=0 and t-s_h=0, making the equations homogeneous. If this is true, then all solutions can be found in terms of appropriate combinations of solutions from the above set of six equations.
>
> If both ABC sets are hyperbolic and if both sets of associated lines are the same, then the two sets of A,B,C values must be proportional to one another and the xy solution is to either have all six points on one of the lines or to have the first three on one line and the second three on the other line. If instead, only one of the lines is shared between the two ABC sets, then the xy solution is to have all six points along this common line. If no lines are shared between the two ABC sets, then all six xy points must be at the origin.
>
> If A1,B1,C1 are hyperbolic (B1^2>A1*C1) and A2,B2,C2 are parabolic (B2^2=A2*C2>0), and if one of the lines of the (A1,B1,C1) set is the same as the unique line of the (A2,B2,C2) set, then the xy solutions consist of all possible sets of six points along this common line. If there is not this match of lines, then the only solution is with all six points at the origin.
>
> If both ABC sets are parabolic and if these both correspond to the same line, then the ABC values must be proportional to one another and the xy solution is any six points along this common line. If their lines are not the same, then having the six points at the origin is the only solution.
>
> If either set or both sets are elliptical, then only the xy origin for all six points will be a solution.
>
> Roger Stafford

Hi Rodger

Regarding your statement

> I think you misinterpreted some of the statements I made, Daniel. For instance, the "parabolic" condition B^2=A*C>0 does not imply the xy points have to be either the x-axis or y-axis; it could be any straight line through the origin, depending on the values of A, B, and C.

Your remark about the parabola reminded me I should have been thinking about un-rotated coordinates since these are the coordinates I am working with, and in which I need to find solutions to my equations. However my remarks about B^2=A*C impying we have a degenerate parabola that is either the y or x-axis (I think this is correct?), was related to the rotated coordinates, and I was not being clear about that. Whilst on the subject however, presumably in un-rotated coordinates, if the equation A*X^2 + 2*B*X*Y + C*Y^2 = 0 represents a degenerate parabola (which from the rotated form we can see has to be one line through the origin), then the rotation you described earlier gives us a degenerate parabola that is either the x or y-axis?

Furthermore your said

> Also, having all points in a solution lie along a single straight line through the origin does not imply that the parabolic condition must hold; it might be one of the lines of a "hyperbolic" (B^2>A*C) set.

makes it clear that yes I did misunderstand your comments. It seems obvious now, thank to your clear explanation, that two different degenerate conics (i.e a parabola and a hyperbola) can yield solutions to the 24 equations that lie along the same line.

Finally in your explanation of the different solutions to the six homogeneous equations, for the B^2=A*C parabolic condition, you give

a = 1/2*atan2(-2*B/(C+A),(C-A)/(C+A))

as to how to compute the angle of the line through the origin of this conic, given A,B, and C. I can see how this equation is determined from the equations

 A = K*sin(a)^2
 B = -K*sin(a)*cos(a)
 C = K*cos(a)^2,

i.e -2*B=k*sin(2*a), A+C = -k*cos(2*a), C-A = k*cos(2*a) can be derived which give your result. I am not clear as to how you get the above three equations however. Do you use a technique similar to that of the hyperbola you described previously was used. That is we try and solve the following equality

K*(x*sin(a)-y*cos(a)) = A*x^2+2*B*x*y+C*y^2,

i.e. the LHS represents a line through the origin, and we want to make this equal to the RHS subject to B^2=A*C? The coefficient comparison technique seems not to work in this case? I think I can easily write some Matlab code similar to the code you wrote me, but this time to select six random points along this line through the origin. It will be interesting to compare these solutions to the hyperbolic case.

Any help would be greatly appreciated.


 
 

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 31 Oct, 2012 16:08:08

Message: 27 of 32

"Daniel" wrote in message <k61q1s$h8b$1@newscl01ah.mathworks.com>...
> .........
> Finally in your explanation of the different solutions to the six homogeneous equations, for the B^2=A*C parabolic condition, you give
>
> a = 1/2*atan2(-2*B/(C+A),(C-A)/(C+A))
>
> as to how to compute the angle of the line through the origin of this conic, given A,B, and C. I can see how this equation is determined from the equations
>
> A = K*sin(a)^2
> B = -K*sin(a)*cos(a)
> C = K*cos(a)^2,
>
> i.e -2*B=k*sin(2*a), A+C = -k*cos(2*a), C-A = k*cos(2*a) can be derived which give your result. I am not clear as to how you get the above three equations however. Do you use a technique similar to that of the hyperbola you described previously was used. That is we try and solve the following equality
>
> K*(x*sin(a)-y*cos(a)) = A*x^2+2*B*x*y+C*y^2,
>
> i.e. the LHS represents a line through the origin, and we want to make this equal to the RHS subject to B^2=A*C? The coefficient comparison technique seems not to work in this case?
> ........
- - - - - - - - - -
  If instead of

 K*(x*sin(a)-y*cos(a)) = A*x^2+2*B*x*y+C*y^2

you solve for A, B, and C in

 K*(x*sin(a)-y*cos(a))^2 = A*x^2+2*B*x*y+C*y^2

those three equations will fall out very readily.

  It is analogous to the case when a quadratic equation has only one root, r. Then it can always be expressed as a*(x-r)^2 = 0 and the root is considered a "double" root. In your homogenous "parabolic" case your points all lie along a single line which can be considered a "double" line. If it weren't homogeneous (F~=0), the "parabola" would be two distinct parallel straight lines.

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 1 Nov, 2012 22:36:08

Message: 28 of 32

If instead of

 K*(x*sin(a)-y*cos(a)) = A*x^2+2*B*x*y+C*y^2

you solve for A, B, and C in

 K*(x*sin(a)-y*cos(a))^2 = A*x^2+2*B*x*y+C*y^2

those three equations will fall out very readily.

  It is analogous to the case when a quadratic equation has only one root, r. Then it can always be expressed as a*(x-r)^2 = 0 and the root is considered a "double" root. In your homogenous "parabolic" case your points all lie along a single line which can be considered a "double" line. If it weren't homogeneous (F~=0), the "parabola" would be two distinct parallel straight lines.

Hi Roger

Thanks once again for this. It is so easy when you know how! I would never have thought to square the equation, and as you say the results follow easily.

The 24 equations we have been looking at are one of two ways of looking at my original problem (a statistical one). The second way of looking at my problem gives rise to another 24 equations, with the same 6 (X,Y) points, but this time with 4 rather than 2 (A,B,C) points (involving the same alpha and beta coefficients but in different orders).

Thankfully the analysis you have taught me for the original 6 equations involving a conic also hold for these new 24 equations. The end result is that for solutions to exist for the 24 equations, the 4 (A,B,C) points need to define degenerate conics that all intersect - again the intersection can be at the origin (all 4 conics are the point ellipse), or along one or two lines through the origin according to whether the 4 conics are degenerate hyperbolas or parabolas etc.

I think I have troubled you enough Rodger, and I cannot thank you enough for all your efforts on my behalf. You have been a **BIG** help.

My 24 equations actually come from equating sets of parametised covariance matrices from a statistical model. For example the first 6 equations of your analysis involving the single conic comes from equating two covariance matrices (involving the same 3 (X,Y) points) but under two different vector parameters (the vector parameters contained the alpha's and beta's). The other sets of equations are similar.

Basically solutions to all 24 equations mean the statistical model I am looking at is the same probabalistically under two different vector parameters (since my covariance matrices are the same under these two different paramters). This as you may be aware is bad news, since we do not have a unique model (usually called an unidentifiable model). The (X,Y) solutions we are taking from lines actually belong to matrices in my model. For example I have the matrices

Z1 = [X1,Y1;X2,Y2;X3,Y3] and Z2 = [X4,Y4;X5,Y5;X6,Y6],

i.e. the (X,Y) points are actually matrix rows. As you can see, all the rows in each Z matrix being along the same line lead to matrices with linearly dependent rows and hence rank deficient matrices. Thus using your code to find solutions to my 24 equations actually represent a counter-example to identifiability holding in my model. I am interested in when the system can have no solutions (identifiability holds), and you have already given this condition - the F's must be non-zero. But this is a condition on the coefficients in my model (which are unknown) and I am interested in conditions on the (X,Y) points since these are my data and these conditions can be checked. But we can see easily this condition from your analysis. If we were to forbid one of the set of 3 (X,Y) points from being on the same line then we could not ever find any solutions. This means we need at least one of the
Z matrices to be of full rank.

Now my 24 equations actually come from a very simple model (very small amount of data and coefficients) in order to get some understanding of the problem which might then hint at a sufficient condition (for a general model) that would ensure no solutions (i.e. a sufficient condition for identifiability). The full-rank condition you have provided accords well with many statistical results (across many areas), i.e. less than full-rank matrices usually lead to big problems. You have provided this condition without any knowledge of the statistics, just pure maths if you like, and this gives me even more confidence that this is indeed the sufficient condition I am after.

Unfortunatley extending your conic method to a general proof will involve many equations, indeed an infinite number, and so a proof along the lines of your analysis will be tricky, although perhaps not impossible. For example we may end up with an infinite number of conics that all must intersect in one or two lines from which we must sample our data - i.e. your analysis may scale up easily, but I doubt it! However I think direct use of the full-rank condition will be easier, leading to some sort of contradiction. It seems to me that proofs by contradiction work better for more complex cases - the problem is knowing the condition to start the proof.

I will let you know how I get on.

Many thanks again.

Subject: solving a system of multi-variable polynomial equations in mupad

From: Bruno Luong

Date: 2 Nov, 2012 06:09:08

Message: 29 of 32

It does not look to me a standard technique to study a bunch of conic hyper-surface in statistics. Usually people just study the eigen values and eigen vectors of the covariance matrix. This is much simpler, and it tells a lot of thing as well-posedness, observability, impact of the data error etc...

Bruno

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 2 Nov, 2012 11:24:08

Message: 30 of 32

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <k6vo24$rv8$1@newscl01ah.mathworks.com>...
> It does not look to me a standard technique to study a bunch of conic hyper-surface in statistics. Usually people just study the eigen values and eigen vectors of the covariance matrix. This is much simpler, and it tells a lot of thing as well-posedness, observability, impact of the data error etc...
>
> Bruno

Hi Bruno

You are right about this not being standard technique. But remember that the conic stuff is one of possibly multiple methods that tell me when my equations have solutions. It may be possible to derive the same conclusions/conditions for solutions using eigenvalue/vector theory, but at this stage it does not matter. What matters is that I now have insight into my problem. Your are right about the eigenvalue stuff in terms of how matrices are to a large extent characterised by things such as positivity of eigenvalues, whether the eigenvalues repeat etc. However it is not clear to me how this can be brought to bear on my system of polynomial equations.

Dan

Subject: solving a system of multi-variable polynomial equations in mupad

From: Roger Stafford

Date: 3 Nov, 2012 01:50:13

Message: 31 of 32

"Daniel" wrote in message <k70ago$r6f$1@newscl01ah.mathworks.com>...
> Hi Bruno
>
> You are right about this not being standard technique. But remember that the conic stuff is one of possibly multiple methods that tell me when my equations have solutions. It may be possible to derive the same conclusions/conditions for solutions using eigenvalue/vector theory, but at this stage it does not matter. What matters is that I now have insight into my problem. Your are right about the eigenvalue stuff in terms of how matrices are to a large extent characterised by things such as positivity of eigenvalues, whether the eigenvalues repeat etc. However it is not clear to me how this can be brought to bear on my system of polynomial equations.
>
> Dan
- - - - - - - - - - -
  There is a connection between your quadratic polynomials and the eigenvectors Bruno speaks of. In my first article Oct. 4 in this thread I wrote of rotations that would get rid of the x*y term and put a quadratic into a "standard" form such as X^2/a^2+Y^2/b^2 or X^2/a^2-Y^2/b^2 in rotated coordinates X,Y. There are always two such rotations that will accomplish this task and which are ninety degrees apart. Their two directions are just those defined by the two orthogonal eigenvectors of the matrix M = [A,B;B,C] corresponding to the quadratic polynomial A*x^2+2*B*x*y+C*y^2. Moreover its eigenvalues determine the type of conic: if both are nonzero and of like sign, you have an elliptical form; if both are nonzero and of opposite sign, it is hyperbolic; and if one of them is zero, it is parabolic.

  Of course if M is itself a covariance matrix, you would have only an elliptical form, but all types of conics are possible for the differences between covariance matrices, as your original set of equations on Oct. 3 appeared to be.

Roger Stafford

Subject: solving a system of multi-variable polynomial equations in mupad

From: Daniel

Date: 3 Nov, 2012 09:12:09

Message: 32 of 32

"Roger Stafford" wrote in message <k71t8l$7ka$1@newscl01ah.mathworks.com>...
> "Daniel" wrote in message <k70ago$r6f$1@newscl01ah.mathworks.com>...
> > Hi Bruno
> >
> > You are right about this not being standard technique. But remember that the conic stuff is one of possibly multiple methods that tell me when my equations have solutions. It may be possible to derive the same conclusions/conditions for solutions using eigenvalue/vector theory, but at this stage it does not matter. What matters is that I now have insight into my problem. Your are right about the eigenvalue stuff in terms of how matrices are to a large extent characterised by things such as positivity of eigenvalues, whether the eigenvalues repeat etc. However it is not clear to me how this can be brought to bear on my system of polynomial equations.
> >
> > Dan
> - - - - - - - - - - -
> There is a connection between your quadratic polynomials and the eigenvectors Bruno speaks of. In my first article Oct. 4 in this thread I wrote of rotations that would get rid of the x*y term and put a quadratic into a "standard" form such as X^2/a^2+Y^2/b^2 or X^2/a^2-Y^2/b^2 in rotated coordinates X,Y. There are always two such rotations that will accomplish this task and which are ninety degrees apart. Their two directions are just those defined by the two orthogonal eigenvectors of the matrix M = [A,B;B,C] corresponding to the quadratic polynomial A*x^2+2*B*x*y+C*y^2. Moreover its eigenvalues determine the type of conic: if both are nonzero and of like sign, you have an elliptical form; if both are nonzero and of opposite sign, it is hyperbolic; and if one of them is zero, it is parabolic.
>
> Of course if M is itself a covariance matrix, you would have only an elliptical form, but all types of conics are possible for the differences between covariance matrices, as your original set of equations on Oct. 3 appeared to be.
>
> Roger Stafford

Thank-you Rodger for this. As ever in mathematics there is more than one way of doing things, and I had forgot the matrix approach to conics - Bruno posted earlier also about this. I see what you mean about covariance matrices and eigenvalues, that is since they are positive definite their eigenvalues must all be positive - hence an ellipse, but that anything goes for differences of covariance matrices.

Dan

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us