http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534
MATLAB Central Newsreader  solving a system of multivariable polynomial equations in mupad
Feed for thread: solving a system of multivariable polynomial equations in mupad
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Wed, 03 Oct 2012 21:35:08 +0000
solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#888725
Daniel
Dear Users<br>
<br>
I have a system of 24 multivariable 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! <br>
<br>
The 12 unknowns [a1f1], and [a2f2] 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 <br>
<br>
(i) where the 16 constants are treated as unknowns as well as the 12 data unknowns,<br>
<br>
and/or<br>
<br>
(ii) where only the 12 data unknowns are the unknowns.<br>
<br>
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 <br>
<br>
"Warning: Solution(s) may be lost. [solvelib::allvalues_warning]" ,<br>
<br>
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 nontrivial 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?<br>
<br>
Any help would be greatly appreciated.<br>
<br>
<br>
System of 24 equations (each equation is solved to equal zero):<br>
<br>
s  t_h + a1^2*(alpha1  beta1_h) + 2*a1*b1*(alpha2  beta2_h) + b1^2*(alpha3  beta3_h)<br>
<br>
a1*c1*(alpha1  beta1_h) + (b1*c1 + a1*d1)*(alpha2  beta2_h) + b1*d1*(alpha3  beta3_h)<br>
<br>
a1*e1*(alpha1  beta1_h) + (b1*e1 + a1*f1)*(alpha2  beta2_h) + b1*f1*(alpha3  beta3_h)<br>
<br>
s  t_h + c1^2*(alpha1  beta1_h) + 2*c1*d1*(alpha2  beta2_h) + d1^2*(alpha3  beta3_h)<br>
<br>
c1*e1*(alpha1  beta1_h) + (d1*e1 + c1*f1)*(alpha2  beta2_h) + d1*f1*(alpha3  beta3_h)<br>
<br>
s  t_h + e1^2*(alpha1  beta1_h) + 2*e1*f1*(alpha2  beta2_h) + f1^2*(alpha3  beta3_h)<br>
<br>
t  s_h + a1^2*(beta1  alpha1_h) + 2*a1*b1*(beta2  alpha2_h) + b1^2*(beta3  alpha3_h)<br>
<br>
a1*c1*(beta1  alpha1_h) + (b1*c1 + a1*d1)*(beta2  alpha2_h) + b1*d1*(beta3  alpha3_h)<br>
<br>
a1*e1*(beta1  alpha1_h) + (b1*e1 + a1*f1)*(beta2  alpha2_h) + b1*f1*(beta3  alpha3_h)<br>
<br>
t  s_h + c1^2*(beta1  alpha1_h) + 2*c1*d1*(beta2  alpha2_h) + d1^2*(beta3  alpha3_h)<br>
<br>
c1*e1*(beta1  alpha1_h) + (d1*e1 + c1*f1)*(beta2  alpha2_h) + d1*f1*(beta3  alpha3_h)<br>
<br>
t  s_h + e1^2*(beta1  alpha1_h) + 2*e1*f1*(beta2  alpha2_h) + f1^2*(beta3  alpha3_h)<br>
<br>
s  t_h + a2^2*(alpha1  beta1_h) + 2*a2*b2*(alpha2  beta2_h) + b2^2*(alpha3  beta3_h)<br>
<br>
a2*c2*(alpha1  beta1_h) + (b2*c2 + a2*d2)*(alpha2  beta2_h) + b2*d2*(alpha3  beta3_h)<br>
<br>
a2*e2*(alpha1  beta1_h) + (b2*e2 + a2*f2)*(alpha2  beta2_h) + b2*f2*(alpha3  beta3_h)<br>
<br>
s  t_h + c2^2*(alpha1  beta1_h) + 2*c2*d2*(alpha2  beta2_h) + d2^2*(alpha3  beta3_h)<br>
<br>
c2*e2*(alpha1  beta1_h) + (d2*e2 + c2*f2)*(alpha2  beta2_h) + d2*f2*(alpha3  beta3_h)<br>
<br>
s  t_h + e2^2*(alpha1  beta1_h) + 2*e2*f2*(alpha2  beta2_h) + f2^2*(alpha3  beta3_h)<br>
<br>
t  s_h + a2^2*(beta1  alpha1_h) + 2*a2*b2*(beta2  alpha2_h) + b2^2*(beta3  alpha3_h)<br>
<br>
a2*c2*(beta1  alpha1_h) + (b2*c2 + a2*d2)*(beta2  alpha2_h) + b2*d2*(beta3  alpha3_h)<br>
<br>
a2*e2*(beta1  alpha1_h) + (b2*e2 + a2*f2)*(beta2  alpha2_h) + b2*f2*(beta3  alpha3_h)<br>
<br>
t  s_h + c2^2*(beta1  alpha1_h) + 2*c2*d2*(beta2  alpha2_h) + d2^2*(beta3  alpha3_h)<br>
<br>
c2*e2*(beta1  alpha1_h) + (d2*e2 + c2*f2)*(beta2  alpha2_h) + d2*f2*(beta3  alpha3_h)<br>
<br>
t  s_h + e2^2*(beta1  alpha1_h) + 2*e2*f2*(beta2  alpha2_h) + f2^2*(beta3  alpha3_h<br>
<br>

Thu, 04 Oct 2012 22:42:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#888824
Roger Stafford
"Daniel " <danmeddings@gmail.com> wrote in message <k4ib2c$eel$1@newscl01ah.mathworks.com>...<br>
> Dear Users<br>
> <br>
> I have a system of 24 multivariable 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! <br>
> <br>
> The 12 unknowns [a1f1], and [a2f2] 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 <br>
> <br>
> (i) where the 16 constants are treated as unknowns as well as the 12 data unknowns,<br>
> <br>
> and/or<br>
> <br>
> (ii) where only the 12 data unknowns are the unknowns.<br>
> <br>
> 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 <br>
> <br>
> "Warning: Solution(s) may be lost. [solvelib::allvalues_warning]" ,<br>
> <br>
> 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 nontrivial 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?<br>
> <br>
> Any help would be greatly appreciated.<br>
> <br>
> <br>
> System of 24 equations (each equation is solved to equal zero):<br>
> <br>
> s  t_h + a1^2*(alpha1  beta1_h) + 2*a1*b1*(alpha2  beta2_h) + b1^2*(alpha3  beta3_h)<br>
> <br>
> a1*c1*(alpha1  beta1_h) + (b1*c1 + a1*d1)*(alpha2  beta2_h) + b1*d1*(alpha3  beta3_h)<br>
> <br>
> a1*e1*(alpha1  beta1_h) + (b1*e1 + a1*f1)*(alpha2  beta2_h) + b1*f1*(alpha3  beta3_h)<br>
> <br>
> s  t_h + c1^2*(alpha1  beta1_h) + 2*c1*d1*(alpha2  beta2_h) + d1^2*(alpha3  beta3_h)<br>
> <br>
> c1*e1*(alpha1  beta1_h) + (d1*e1 + c1*f1)*(alpha2  beta2_h) + d1*f1*(alpha3  beta3_h)<br>
> <br>
> s  t_h + e1^2*(alpha1  beta1_h) + 2*e1*f1*(alpha2  beta2_h) + f1^2*(alpha3  beta3_h)<br>
> <br>
> t  s_h + a1^2*(beta1  alpha1_h) + 2*a1*b1*(beta2  alpha2_h) + b1^2*(beta3  alpha3_h)<br>
> <br>
> a1*c1*(beta1  alpha1_h) + (b1*c1 + a1*d1)*(beta2  alpha2_h) + b1*d1*(beta3  alpha3_h)<br>
> <br>
> a1*e1*(beta1  alpha1_h) + (b1*e1 + a1*f1)*(beta2  alpha2_h) + b1*f1*(beta3  alpha3_h)<br>
> <br>
> t  s_h + c1^2*(beta1  alpha1_h) + 2*c1*d1*(beta2  alpha2_h) + d1^2*(beta3  alpha3_h)<br>
> <br>
> c1*e1*(beta1  alpha1_h) + (d1*e1 + c1*f1)*(beta2  alpha2_h) + d1*f1*(beta3  alpha3_h)<br>
> <br>
> t  s_h + e1^2*(beta1  alpha1_h) + 2*e1*f1*(beta2  alpha2_h) + f1^2*(beta3  alpha3_h)<br>
> <br>
> s  t_h + a2^2*(alpha1  beta1_h) + 2*a2*b2*(alpha2  beta2_h) + b2^2*(alpha3  beta3_h)<br>
> <br>
> a2*c2*(alpha1  beta1_h) + (b2*c2 + a2*d2)*(alpha2  beta2_h) + b2*d2*(alpha3  beta3_h)<br>
> <br>
> a2*e2*(alpha1  beta1_h) + (b2*e2 + a2*f2)*(alpha2  beta2_h) + b2*f2*(alpha3  beta3_h)<br>
> <br>
> s  t_h + c2^2*(alpha1  beta1_h) + 2*c2*d2*(alpha2  beta2_h) + d2^2*(alpha3  beta3_h)<br>
> <br>
> c2*e2*(alpha1  beta1_h) + (d2*e2 + c2*f2)*(alpha2  beta2_h) + d2*f2*(alpha3  beta3_h)<br>
> <br>
> s  t_h + e2^2*(alpha1  beta1_h) + 2*e2*f2*(alpha2  beta2_h) + f2^2*(alpha3  beta3_h)<br>
> <br>
> t  s_h + a2^2*(beta1  alpha1_h) + 2*a2*b2*(beta2  alpha2_h) + b2^2*(beta3  alpha3_h)<br>
> <br>
> a2*c2*(beta1  alpha1_h) + (b2*c2 + a2*d2)*(beta2  alpha2_h) + b2*d2*(beta3  alpha3_h)<br>
> <br>
> a2*e2*(beta1  alpha1_h) + (b2*e2 + a2*f2)*(beta2  alpha2_h) + b2*f2*(beta3  alpha3_h)<br>
> <br>
> t  s_h + c2^2*(beta1  alpha1_h) + 2*c2*d2*(beta2  alpha2_h) + d2^2*(beta3  alpha3_h)<br>
> <br>
> c2*e2*(beta1  alpha1_h) + (d2*e2 + c2*f2)*(beta2  alpha2_h) + d2*f2*(beta3  alpha3_h)<br>
> <br>
> t  s_h + e2^2*(beta1  alpha1_h) + 2*e2*f2*(beta2  alpha2_h) + f2^2*(beta3  alpha3_h<br>
         <br>
This is not a direct answer to your question, Daniel, but it might provide an insight into the nature of your problem.<br>
<br>
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<br>
<br>
A*x1^2 + 2*B*x1*y1 + C*y1^2 + F = 0<br>
A*x2^2 + 2*B*x2*y2 + C*y2^2 + F = 0<br>
A*x3^2 + 2*B*x3*y3 + C*y3^2 + F = 0<br>
A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0<br>
A*x3*x1 + B*(x3*y1+x1*y3) + C*y3*y1 = 0<br>
A*x1*x2 + B*(x1*y2+x2*y1) + C*y1*y2 = 0<br>
<br>
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<br>
<br>
x1^2/a^2 + y1^2/b^2 = 1<br>
x2^2/a^2 + y2^2/b^2 = 1<br>
x3^2/a^2 + y3^2/b^2 = 1<br>
x2*x3/a^2 + y2*y3/b^2 = 0<br>
x3*x1/a^2 + y3*y1/b^2 = 0<br>
x1*x2/a^2 + y1*y2/b^2 = 0<br>
<br>
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<br>
<br>
(y1/x1*y2/x2*y3/x3)^2 = (y2/x2*y3/x3)*(y3/x3*y1/x1)*(y1/x1*y2/x2) =<br>
(b^2/a^2)^3<br>
<br>
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.<br>
<br>
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).<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
Roger Stafford

Fri, 05 Oct 2012 18:09:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#888871
Daniel
"Roger Stafford" wrote in message <k4l3c0$2ed$1@newscl01ah.mathworks.com>...<br>
> "Daniel " <danmeddings@gmail.com> wrote in message <k4ib2c$eel$1@newscl01ah.mathworks.com>...<br>
> > Dear Users<br>
> > <br>
> > I have a system of 24 multivariable 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! <br>
> > <br>
> > The 12 unknowns [a1f1], and [a2f2] 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 <br>
> > <br>
> > (i) where the 16 constants are treated as unknowns as well as the 12 data unknowns,<br>
> > <br>
> > and/or<br>
> > <br>
> > (ii) where only the 12 data unknowns are the unknowns.<br>
> > <br>
> > 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 <br>
> > <br>
> > "Warning: Solution(s) may be lost. [solvelib::allvalues_warning]" ,<br>
> > <br>
> > 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 nontrivial 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?<br>
> > <br>
> > Any help would be greatly appreciated.<br>
> > <br>
> > <br>
> > System of 24 equations (each equation is solved to equal zero):<br>
> > <br>
> > s  t_h + a1^2*(alpha1  beta1_h) + 2*a1*b1*(alpha2  beta2_h) + b1^2*(alpha3  beta3_h)<br>
> > <br>
> > a1*c1*(alpha1  beta1_h) + (b1*c1 + a1*d1)*(alpha2  beta2_h) + b1*d1*(alpha3  beta3_h)<br>
> > <br>
> > a1*e1*(alpha1  beta1_h) + (b1*e1 + a1*f1)*(alpha2  beta2_h) + b1*f1*(alpha3  beta3_h)<br>
> > <br>
> > s  t_h + c1^2*(alpha1  beta1_h) + 2*c1*d1*(alpha2  beta2_h) + d1^2*(alpha3  beta3_h)<br>
> > <br>
> > c1*e1*(alpha1  beta1_h) + (d1*e1 + c1*f1)*(alpha2  beta2_h) + d1*f1*(alpha3  beta3_h)<br>
> > <br>
> > s  t_h + e1^2*(alpha1  beta1_h) + 2*e1*f1*(alpha2  beta2_h) + f1^2*(alpha3  beta3_h)<br>
> > <br>
> > t  s_h + a1^2*(beta1  alpha1_h) + 2*a1*b1*(beta2  alpha2_h) + b1^2*(beta3  alpha3_h)<br>
> > <br>
> > a1*c1*(beta1  alpha1_h) + (b1*c1 + a1*d1)*(beta2  alpha2_h) + b1*d1*(beta3  alpha3_h)<br>
> > <br>
> > a1*e1*(beta1  alpha1_h) + (b1*e1 + a1*f1)*(beta2  alpha2_h) + b1*f1*(beta3  alpha3_h)<br>
> > <br>
> > t  s_h + c1^2*(beta1  alpha1_h) + 2*c1*d1*(beta2  alpha2_h) + d1^2*(beta3  alpha3_h)<br>
> > <br>
> > c1*e1*(beta1  alpha1_h) + (d1*e1 + c1*f1)*(beta2  alpha2_h) + d1*f1*(beta3  alpha3_h)<br>
> > <br>
> > t  s_h + e1^2*(beta1  alpha1_h) + 2*e1*f1*(beta2  alpha2_h) + f1^2*(beta3  alpha3_h)<br>
> > <br>
> > s  t_h + a2^2*(alpha1  beta1_h) + 2*a2*b2*(alpha2  beta2_h) + b2^2*(alpha3  beta3_h)<br>
> > <br>
> > a2*c2*(alpha1  beta1_h) + (b2*c2 + a2*d2)*(alpha2  beta2_h) + b2*d2*(alpha3  beta3_h)<br>
> > <br>
> > a2*e2*(alpha1  beta1_h) + (b2*e2 + a2*f2)*(alpha2  beta2_h) + b2*f2*(alpha3  beta3_h)<br>
> > <br>
> > s  t_h + c2^2*(alpha1  beta1_h) + 2*c2*d2*(alpha2  beta2_h) + d2^2*(alpha3  beta3_h)<br>
> > <br>
> > c2*e2*(alpha1  beta1_h) + (d2*e2 + c2*f2)*(alpha2  beta2_h) + d2*f2*(alpha3  beta3_h)<br>
> > <br>
> > s  t_h + e2^2*(alpha1  beta1_h) + 2*e2*f2*(alpha2  beta2_h) + f2^2*(alpha3  beta3_h)<br>
> > <br>
> > t  s_h + a2^2*(beta1  alpha1_h) + 2*a2*b2*(beta2  alpha2_h) + b2^2*(beta3  alpha3_h)<br>
> > <br>
> > a2*c2*(beta1  alpha1_h) + (b2*c2 + a2*d2)*(beta2  alpha2_h) + b2*d2*(beta3  alpha3_h)<br>
> > <br>
> > a2*e2*(beta1  alpha1_h) + (b2*e2 + a2*f2)*(beta2  alpha2_h) + b2*f2*(beta3  alpha3_h)<br>
> > <br>
> > t  s_h + c2^2*(beta1  alpha1_h) + 2*c2*d2*(beta2  alpha2_h) + d2^2*(beta3  alpha3_h)<br>
> > <br>
> > c2*e2*(beta1  alpha1_h) + (d2*e2 + c2*f2)*(beta2  alpha2_h) + d2*f2*(beta3  alpha3_h)<br>
> > <br>
> > t  s_h + e2^2*(beta1  alpha1_h) + 2*e2*f2*(beta2  alpha2_h) + f2^2*(beta3  alpha3_h<br>
>          <br>
> This is not a direct answer to your question, Daniel, but it might provide an insight into the nature of your problem.<br>
> <br>
> 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<br>
> <br>
> A*x1^2 + 2*B*x1*y1 + C*y1^2 + F = 0<br>
> A*x2^2 + 2*B*x2*y2 + C*y2^2 + F = 0<br>
> A*x3^2 + 2*B*x3*y3 + C*y3^2 + F = 0<br>
> A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0<br>
> A*x3*x1 + B*(x3*y1+x1*y3) + C*y3*y1 = 0<br>
> A*x1*x2 + B*(x1*y2+x2*y1) + C*y1*y2 = 0<br>
> <br>
> 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<br>
> <br>
> x1^2/a^2 + y1^2/b^2 = 1<br>
> x2^2/a^2 + y2^2/b^2 = 1<br>
> x3^2/a^2 + y3^2/b^2 = 1<br>
> x2*x3/a^2 + y2*y3/b^2 = 0<br>
> x3*x1/a^2 + y3*y1/b^2 = 0<br>
> x1*x2/a^2 + y1*y2/b^2 = 0<br>
> <br>
> 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<br>
> <br>
> (y1/x1*y2/x2*y3/x3)^2 = (y2/x2*y3/x3)*(y3/x3*y1/x1)*(y1/x1*y2/x2) =<br>
> (b^2/a^2)^3<br>
> <br>
> 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.<br>
> <br>
> 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).<br>
> <br>
> 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.<br>
> <br>
> 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.<br>
> <br>
> 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.<br>
> <br>
> 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.<br>
> <br>
> Roger Stafford<br>
<br>
Firstly Roger thankyou 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? <br>
<br>
I understand some of your anaysyis of my first 6 equations: if the first three equations are nondegenerate 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." <br>
<br>
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? <br>
<br>
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 xaxis 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?<br>
<br>
Thankyou also for showing me how to informally and thoughtfully deal with the symmetry of the problem  i.e. equations 16 and 1318 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 712, and 1924  i.e we have a second conic since we have a different set of coefficients.

Fri, 05 Oct 2012 23:18:11 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#888899
Roger Stafford
"Daniel" wrote in message <k4n7o4$1hf$1@newscl01ah.mathworks.com>...<br>
> I understand some of your anaysyis of my first 6 equations: if the first three equations are nondegenerate 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." <br>
> <br>
> 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? <br>
         <br>
Yes, my description was rather vague. I'll try to improve upon it.<br>
<br>
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:<br>
<br>
A*x^2 + 2*B*x*y + C*y^2 = 0 .<br>
<br>
The rotation of coordinates I referred to earlier is defined by<br>
<br>
x = X*cos(theta)  Y*sin(theta)<br>
y = X*sin(theta) + Y*cos(theta)<br>
<br>
where theta is the angle of rotation given by<br>
<br>
sin(2*theta) = 2*B/sqrt(4*B^2+(AC)^2)<br>
cos(2*theta) = (AC)/sqrt(4*B^2+(AC)^2) ,<br>
<br>
or in other words,<br>
<br>
cot(2*theta) = (AC)/(2*B) .<br>
<br>
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:<br>
<br>
(A+C+sqrt(4*B^2+(AC)^2))/2*X^2+(A+Csqrt(4*B^2+(AC)^2))/2*Y^2<br>
<br>
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.<br>
<br>
With the points (x1,y1) and (x2,y2) transformed to (X1,Y1) and (X2,Y2) by the above rotation the equation<br>
<br>
A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2 = 0<br>
<br>
will transform to<br>
<br>
(A+C+sqrt(4*B^2+(AC)^2))/2*X1*X2+(A+Csqrt(4*B^2+(AC)^2))/2*Y1*Y2 = 0<br>
<br>
(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).<br>
<br>
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.<br>
<br>
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.<br>
<br>
(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.)<br>
<br>
Roger Stafford

Sun, 07 Oct 2012 21:55:09 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#888991
Roger Stafford
"Daniel" wrote in message <k4n7o4$1hf$1@newscl01ah.mathworks.com>...<br>
> ...... 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? <br>
           <br>
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.<br>
<br>
The points are found by first solving for angles a and b such that<br>
<br>
K*(x*sin(a)y*cos(a))*(x*sin(b)y*cos(b)) = A*x^2+2*B*x*y+C*y^2<br>
<br>
is identically true for all x and y, the two lines then being defined by<br>
<br>
x*sin(a)y*cos(a) = 0 and x*sin(b)y*cos(b) = 0.<br>
<br>
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.<br>
<br>
The matlab code:<br>
<br>
% Generate random A, B, & C such that B^2 >= A*C<br>
A = randn; C = randn;<br>
B = (2*round(rand)1)*sqrt(randn^2+max(A*C,0));<br>
<br>
% Solve for a & b in K*(x*sin(a)y*cos(a))*(x*sin(b)y*cos(b)) =<br>
% A*x^2+2*B*x*y+C*y^2 assuming K is some constant > 0.<br>
t1 = atan2(2*B,CA); t2 = atan2(2*sqrt(B^2A*C),A+C);<br>
a = (t1+t2)/2; b = (t1t2)/2;<br>
sa = sin(a); ca = cos(a); sb = sin(b); cb = cos(b);<br>
<br>
% Generate three random points along one line and three<br>
% along the other line.<br>
r1 = randn; x1 = r1*ca; y1 = r1*sa;<br>
r2 = randn; x2 = r2*ca; y2 = r2*sa;<br>
r3 = randn; x3 = r3*ca; y3 = r3*sa;<br>
r4 = randn; x4 = r4*cb; y4 = r4*sb;<br>
r5 = randn; x5 = r5*cb; y5 = r5*sb;<br>
r6 = randn; x6 = r6*cb; y6 = r6*sb;<br>
<br>
% Test 12 equalities<br>
format long<br>
<br>
% First set of six:<br>
[A*x1^2+2*B*x1*y1+C*y1^2;<br>
A*x2^2+2*B*x2*y2+C*y2^2;<br>
A*x3^2+2*B*x3*y3+C*y3^2;<br>
A*x2*x3+B*(x2*y3+x3*y2)+C*y2*y3;<br>
A*x3*x1+B*(x3*y1+x1*y3)+C*y3*y1;<br>
A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2]<br>
<br>
% Second set of six:<br>
[A*x4^2+2*B*x4*y4+C*y4^2;<br>
A*x5^2+2*B*x5*y5+C*y5^2;<br>
A*x6^2+2*B*x6*y6+C*y6^2;<br>
A*x5*x6+B*(x5*y6+x6*y5)+C*y5*y6;<br>
A*x6*x4+B*(x6*y4+x4*y6)+C*y6*y4;<br>
A*x4*x5+B*(x4*y5+x5*y4)+C*y4*y5]<br>
<br>
% These should all differ from zero by no more than very<br>
% small rounding errors.<br>
<br>
Roger Stafford

Mon, 08 Oct 2012 05:27:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889004
Daniel
"Roger Stafford" wrote in message <k4stnt$1sc$1@newscl01ah.mathworks.com>...<br>
> "Daniel" wrote in message <k4n7o4$1hf$1@newscl01ah.mathworks.com>...<br>
> > ...... 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? <br>
>            <br>
> 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.<br>
> <br>
> The points are found by first solving for angles a and b such that<br>
> <br>
> K*(x*sin(a)y*cos(a))*(x*sin(b)y*cos(b)) = A*x^2+2*B*x*y+C*y^2<br>
> <br>
> is identically true for all x and y, the two lines then being defined by<br>
> <br>
> x*sin(a)y*cos(a) = 0 and x*sin(b)y*cos(b) = 0.<br>
> <br>
> 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.<br>
> <br>
> The matlab code:<br>
> <br>
> % Generate random A, B, & C such that B^2 >= A*C<br>
> A = randn; C = randn;<br>
> B = (2*round(rand)1)*sqrt(randn^2+max(A*C,0));<br>
> <br>
> % Solve for a & b in K*(x*sin(a)y*cos(a))*(x*sin(b)y*cos(b)) =<br>
> % A*x^2+2*B*x*y+C*y^2 assuming K is some constant > 0.<br>
> t1 = atan2(2*B,CA); t2 = atan2(2*sqrt(B^2A*C),A+C);<br>
> a = (t1+t2)/2; b = (t1t2)/2;<br>
> sa = sin(a); ca = cos(a); sb = sin(b); cb = cos(b);<br>
> <br>
> % Generate three random points along one line and three<br>
> % along the other line.<br>
> r1 = randn; x1 = r1*ca; y1 = r1*sa;<br>
> r2 = randn; x2 = r2*ca; y2 = r2*sa;<br>
> r3 = randn; x3 = r3*ca; y3 = r3*sa;<br>
> r4 = randn; x4 = r4*cb; y4 = r4*sb;<br>
> r5 = randn; x5 = r5*cb; y5 = r5*sb;<br>
> r6 = randn; x6 = r6*cb; y6 = r6*sb;<br>
> <br>
> % Test 12 equalities<br>
> format long<br>
> <br>
> % First set of six:<br>
> [A*x1^2+2*B*x1*y1+C*y1^2;<br>
> A*x2^2+2*B*x2*y2+C*y2^2;<br>
> A*x3^2+2*B*x3*y3+C*y3^2;<br>
> A*x2*x3+B*(x2*y3+x3*y2)+C*y2*y3;<br>
> A*x3*x1+B*(x3*y1+x1*y3)+C*y3*y1;<br>
> A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2]<br>
> <br>
> % Second set of six:<br>
> [A*x4^2+2*B*x4*y4+C*y4^2;<br>
> A*x5^2+2*B*x5*y5+C*y5^2;<br>
> A*x6^2+2*B*x6*y6+C*y6^2;<br>
> A*x5*x6+B*(x5*y6+x6*y5)+C*y5*y6;<br>
> A*x6*x4+B*(x6*y4+x4*y6)+C*y6*y4;<br>
> A*x4*x5+B*(x4*y5+x5*y4)+C*y4*y5]<br>
> <br>
> % These should all differ from zero by no more than very<br>
> % small rounding errors.<br>
> <br>
> Roger Stafford<br>
<br>
Sorry I have not replied sooner Roger. Thanks for your earlier reply, and thankyou 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. Thankyou so much again for your efforts on my behalf.

Mon, 08 Oct 2012 21:22:05 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889088
Daniel
Hello Roger<br>
<br>
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 <br>
<br>
A*x^2 + 2*B*x*y + C*y^2 = 0 <br>
<br>
into <br>
<br>
(A+C+sqrt(4*B^2+(AC)^2))/2*X^2+(A+Csqrt(4*B^2+(AC)^2))/2*Y^2.<br>
<br>
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<br>
<br>
x = X*cos(theta)  Y*sin(theta)<br>
y = X*sin(theta) + Y*cos(theta)<br>
<br>
and with a little help from matlab I get the resulting coefficient for XY which we set to zero and solve for theta;<br>
<br>
(CA)*cos(theta)*sin(theta) + B*(cos^2(theta)  sin^2(theta)) = 0,<br>
<br>
or equivalently<br>
<br>
B*tan^2(theta) + (AC)*tan(theta)  B = 0,<br>
<br>
which is solved with the quadratic formula;<br>
<br>
tan(theta) = [(CA) +/ sqrt( (CA)^2 + 4*B^2)] / 2*B.<br>
<br>
From this solution how do you get the following results<br>
<br>
sin(2*theta) = 2*B/sqrt(4*B^2+(AC)^2)<br>
cos(2*theta) = (AC)/sqrt(4*B^2+(AC)^2)? <br>
<br>
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<br>
<br>
A*x^2 + 2*B*x*y + C*y^2 = 0 <br>
<br>
can be written<br>
<br>
(A+C+sqrt(4*B^2+(AC)^2))/2*X^2+(A+Csqrt(4*B^2+(AC)^2))/2*Y^2.<br>
<br>
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. <br>
<br>
As ever any help would be appreciated.

Mon, 08 Oct 2012 22:06:10 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889091
Bruno Luong
"Daniel" wrote in message <k4vg5t$nss$1@newscl01ah.mathworks.com>...<br>
<br>
> <br>
> 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. <br>
> <br>
<br>
I'm not Roger, but this magic equation comes from the diagonalization of the symmetric bilinear form.<br>
<br>
<a href="http://en.wikipedia.org/wiki/Quadratic_form">http://en.wikipedia.org/wiki/Quadratic_form</a><br>
<a href="http://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia">http://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia</a><br>
<a href="http://en.wikipedia.org/wiki/Symmetric_matrix">http://en.wikipedia.org/wiki/Symmetric_matrix</a><br>
<br>
Bruno

Tue, 09 Oct 2012 02:28:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889097
Roger Stafford
"Daniel" wrote in message <k4vg5t$nss$1@newscl01ah.mathworks.com>...<br>
> 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<br>
> <br>
> x = X*cos(theta)  Y*sin(theta)<br>
> y = X*sin(theta) + Y*cos(theta)<br>
> <br>
> and with a little help from matlab I get the resulting coefficient for XY which we set to zero and solve for theta;<br>
> <br>
> (CA)*cos(theta)*sin(theta) + B*(cos^2(theta)  sin^2(theta)) = 0,<br>
> <br>
> or equivalently<br>
> <br>
> B*tan^2(theta) + (AC)*tan(theta)  B = 0,<br>
> <br>
> which is solved with the quadratic formula;<br>
> <br>
> tan(theta) = [(CA) +/ sqrt( (CA)^2 + 4*B^2)] / 2*B.<br>
> <br>
> From this solution how do you get the following results<br>
> <br>
> sin(2*theta) = 2*B/sqrt(4*B^2+(AC)^2)<br>
> cos(2*theta) = (AC)/sqrt(4*B^2+(AC)^2)? <br>
           <br>
Hello Daniel.<br>
<br>
If we multiply by 2 in your equation <br>
<br>
(CA)*cos(theta)*sin(theta) + B*(cos^2(theta)  sin^2(theta)) = 0 ,<br>
<br>
and use the double angle formulas for sine and cosine, it leads to<br>
<br>
(AC)*sin(2*theta) = 2*B*cos(2*theta) .<br>
<br>
Now let k = sin(2*theta)/(2*B) and we then have<br>
<br>
sin(2*theta) = k*(2*B) and cos(2*theta) = k*(AC)<br>
<br>
but since the sum of the squares of the left sides is 1, this forces k to be either<br>
<br>
1/sqrt(4*B^2+(AC)^2)<br>
<br>
or its negative. We can choose either one for our desired rotation and we choose the positive case which gives<br>
<br>
sin(2*theta) = 2*B/sqrt(4*B^2+(AC)^2)<br>
cos(2*theta) = (AC)/sqrt(4*B^2+(AC)^2)<br>
<br>
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<br>
<br>
(A+C+sqrt(4*B^2+(AC)^2))/2*X1*X2+(A+Csqrt(4*B^2+(AC)^2))/2*Y1*Y2 = 0.<br>
<br>
Roger Stafford

Tue, 09 Oct 2012 08:02:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889114
Roger Stafford
"Daniel" wrote in message <k4vg5t$nss$1@newscl01ah.mathworks.com>...<br>
> ....... I am equally interested in understanding when the system has no solutions as when it does have solutions. .......<br>
          <br>
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.<br>
<br>
To begin with, there can be no solutions unless the two quantities which I have called F are zero. That is, st_h and ts_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^2A*C < 0, B^2A*C = 0, and B^2A*C > 0.<br>
<br>
Assuming zero F's, I find that seeing the situation from the point of view of six xy points in twodimensional space and two ABC 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 ABC points are<br>
<br>
(A1,B1,C1) = (alpha1beta1_h,alpha2beta2_h,alpha3beta3_h), and<br>
(A2,B2,C2) = (beta1alpha1_h,beta2alpha2_h,beta3alpha3_h) .<br>
<br>
First, if the six xy points are all located at the origin, that is, all zero, then any two ABC points anywhere in their 3D space will constitute a solution. That is quite obvious.<br>
<br>
Second, if all six xy 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 xaxis, 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<br>
<br>
A1*cos(a)^2 + 2*B1*sin(a)*cos(a) + C1*sin(a)^2 = 0 and<br>
A2*cos(a)^2 + 2*B2*sin(a)*cos(a) + C2*sin(a)^2 = 0 .<br>
<br>
Thus the ABC points must lie in a certain plane containing the origin. Showing that to be true for the equations of the form of<br>
<br>
A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0<br>
<br>
is also accomplished using the aforementioned rotation method.<br>
<br>
Finally, if the three points of the first xy 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 xaxis and these lines, then the set of ABC point pairs that provide solutions are all pairs that are orthogonal to both<br>
<br>
(cos(a)^2,2*sin(a)*cos(a),sin(a)^2) and <br>
(cos(b)^2,2*sin(b)*cos(b),sin(b)^2) .<br>
<br>
Stated equivalently, it is those ABC points which lie along the cross product of these vectors. However we can remove the common nonzero factor, sin(ab), from this cross product and arrive at the simpler vector<br>
<br>
(2*sin(a)*sin(b),sin(a+b),2*cos(a)*cos(b)) .<br>
<br>
Thus any two ABC points along this direction will constitute a solution to the 24 equations. The ABC points must therefore lie in a certain onedimensional line through the origin for such a set of six xy points.<br>
<br>
All other combinations of points in these respective xy and ABC spaces are nonsolutions.<br>
<br>
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.<br>
<br>
Roger Stafford

Tue, 09 Oct 2012 17:45:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889163
Roger Stafford
"Roger Stafford" wrote in message <k50lm0$qrj$1@newscl01ah.mathworks.com>...<br>
> ..... I will give you a summary here of my conclusions on that question. .....<br>
        <br>
A couple of corrections for this previous article.<br>
<br>
1) Where I said, "Showing that to be true for the equations of the form of<br>
<br>
A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0<br>
<br>
is also accomplished using the aforementioned rotation method" I should have said, "Showing that when a three point xy 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."<br>
<br>
2) Instead of "All other combinations of points in these respective xy and ABC spaces are nonsolutions" I should have said, "For all other combinations of points in these respective xy and ABC spaces, only the ABC origin (A = B = C = 0) is a solution."<br>
<br>
Roger Stafford

Tue, 09 Oct 2012 22:14:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889191
Daniel
> Hello Daniel.<br>
> <br>
> If we multiply by 2 in your equation <br>
> <br>
> (CA)*cos(theta)*sin(theta) + B*(cos^2(theta)  sin^2(theta)) = 0 ,<br>
> <br>
> and use the double angle formulas for sine and cosine, it leads to<br>
> <br>
> (AC)*sin(2*theta) = 2*B*cos(2*theta) .<br>
> <br>
> Now let k = sin(2*theta)/(2*B) and we then have<br>
> <br>
> sin(2*theta) = k*(2*B) and cos(2*theta) = k*(AC)<br>
> <br>
> but since the sum of the squares of the left sides is 1, this forces k to be either<br>
> <br>
> 1/sqrt(4*B^2+(AC)^2)<br>
> <br>
> or its negative. We can choose either one for our desired rotation and we choose the positive case which gives<br>
> <br>
> sin(2*theta) = 2*B/sqrt(4*B^2+(AC)^2)<br>
> cos(2*theta) = (AC)/sqrt(4*B^2+(AC)^2)<br>
> <br>
> 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<br>
> <br>
> (A+C+sqrt(4*B^2+(AC)^2))/2*X1*X2+(A+Csqrt(4*B^2+(AC)^2))/2*Y1*Y2 = 0.<br>
> <br>
> Roger Stafford<br>
<br>
Hi Roger<br>
<br>
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 thankyou'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.<br>
<br>
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 13 are ellipses. The 6 equations become<br>
<br>
x1^2/a^2 + y1^2/b^2 = 1<br>
x2^2/a^2 + y2^2/b^2 = 1<br>
x3^2/a^2 + y3^2/b^2 = 1<br>
x2*x3/a^2 + y2*y3/b^2 = 0<br>
x3*x1/a^2 + y3*y1/b^2 = 0<br>
x1*x2/a^2 + y1*y2/b^2 = 0<br>
<br>
You state the last 3 equations give a contradiction as;<br>
<br>
(y1/x1*y2/x2*y3/x3)^2 = (y2/x2*y3/x3)*(y3/x3*y1/x1)*(y1/x1*y2/x2) =<br>
(b^2/a^2)^3<br>
<br>
Presumably the lefthand side is positive or zero but the righthand 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;<br>
<br>
y2/x2*y3/x3=(b^2/a^2)(x2/y2*x3/y3)<br>
y3/x3*y1/x1=(b^2/a^2)(x3/y3*x1/y1)<br>
y1/x1*y2/x2=(b^2/a^2)(x1/y1*x2/y2)<br>
<br>
I see that I can substitute from equations 46 again into the righthand 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?<br>
<br>
Thanks again.

Tue, 09 Oct 2012 22:17:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889193
Daniel
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <k4vioi$3ci$1@newscl01ah.mathworks.com>...<br>
> "Daniel" wrote in message <k4vg5t$nss$1@newscl01ah.mathworks.com>...<br>
> <br>
> > <br>
> > 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. <br>
> > <br>
> <br>
> I'm not Roger, but this magic equation comes from the diagonalization of the symmetric bilinear form.<br>
> <br>
> <a href="http://en.wikipedia.org/wiki/Quadratic_form">http://en.wikipedia.org/wiki/Quadratic_form</a><br>
> <a href="http://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia">http://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia</a><br>
> <a href="http://en.wikipedia.org/wiki/Symmetric_matrix">http://en.wikipedia.org/wiki/Symmetric_matrix</a><br>
> <br>
> Bruno<br>
<br>
Many thanks Bruno for your help. I had forgotten the linearalgebra take on this problem, much neater and compact.

Tue, 09 Oct 2012 23:41:09 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889200
Roger Stafford
"Daniel" wrote in message <k527jg$8nq$1@newscl01ah.mathworks.com>...<br>
> y2/x2*y3/x3=(b^2/a^2)(x2/y2*x3/y3)<br>
> y3/x3*y1/x1=(b^2/a^2)(x3/y3*x1/y1)<br>
> y1/x1*y2/x2=(b^2/a^2)(x1/y1*x2/y2)<br>
> <br>
> I see that I can substitute from equations 46 again into the righthand 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?<br>
            <br>
Daniel, your three equations<br>
<br>
y2/x2*y3/x3=(b^2/a^2)(x2/y2*x3/y3)<br>
y3/x3*y1/x1=(b^2/a^2)(x3/y3*x1/y1)<br>
y1/x1*y2/x2=(b^2/a^2)(x1/y1*x2/y2)<br>
<br>
are incorrect and should actually be:<br>
<br>
y2/x2*y3/x3=(b^2/a^2)<br>
y3/x3*y1/x1=(b^2/a^2)<br>
y1/x1*y2/x2=(b^2/a^2)<br>
<br>
and the desired result immediately falls out from these latter.<br>
<br>
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 nonzero. Let's number the six equations:<br>
<br>
x1^2/a^2 + y1^2/b^2 = 1 (1)<br>
x2^2/a^2 + y2^2/b^2 = 1 (2)<br>
x3^2/a^2 + y3^2/b^2 = 1 (3)<br>
x2*x3/a^2 + y2*y3/b^2 = 0 (4)<br>
x3*x1/a^2 + y3*y1/b^2 = 0 (5)<br>
x1*x2/a^2 + y1*y2/b^2 = 0 (6)<br>
<br>
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 nonzero.<br>
<br>
Roger Stafford

Wed, 10 Oct 2012 21:43:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889289
Daniel
"Roger Stafford" wrote in message <k52cml$phg$1@newscl01ah.mathworks.com>...<br>
> "Daniel" wrote in message <k527jg$8nq$1@newscl01ah.mathworks.com>...<br>
> > y2/x2*y3/x3=(b^2/a^2)(x2/y2*x3/y3)<br>
> > y3/x3*y1/x1=(b^2/a^2)(x3/y3*x1/y1)<br>
> > y1/x1*y2/x2=(b^2/a^2)(x1/y1*x2/y2)<br>
> > <br>
> > I see that I can substitute from equations 46 again into the righthand 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?<br>
>             <br>
> Daniel, your three equations<br>
> <br>
> y2/x2*y3/x3=(b^2/a^2)(x2/y2*x3/y3)<br>
> y3/x3*y1/x1=(b^2/a^2)(x3/y3*x1/y1)<br>
> y1/x1*y2/x2=(b^2/a^2)(x1/y1*x2/y2)<br>
> <br>
> are incorrect and should actually be:<br>
> <br>
> y2/x2*y3/x3=(b^2/a^2)<br>
> y3/x3*y1/x1=(b^2/a^2)<br>
> y1/x1*y2/x2=(b^2/a^2)<br>
> <br>
> and the desired result immediately falls out from these latter.<br>
> <br>
> 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 nonzero. Let's number the six equations:<br>
> <br>
> x1^2/a^2 + y1^2/b^2 = 1 (1)<br>
> x2^2/a^2 + y2^2/b^2 = 1 (2)<br>
> x3^2/a^2 + y3^2/b^2 = 1 (3)<br>
> x2*x3/a^2 + y2*y3/b^2 = 0 (4)<br>
> x3*x1/a^2 + y3*y1/b^2 = 0 (5)<br>
> x1*x2/a^2 + y1*y2/b^2 = 0 (6)<br>
> <br>
> 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 nonzero.<br>
> <br>
> Roger Stafford<br>
<br>
Thanks again for this clarification Rodger. I can now see the steps needed in order to derive the equations <br>
<br>
y2/x2*y3/x3=(b^2/a^2)<br>
y3/x3*y1/x1=(b^2/a^2)<br>
y1/x1*y2/x2=(b^2/a^2) .<br>
<br>
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.<br>
<br>
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).<br>
<br>
The most general equation of the second degree in x and y can be written<br>
<br>
a*x^2 + 2h*x*y + b*y^2 + 2f*x + 2*g*y + c = 0,<br>
<br>
can be transformed according to your rotation into an equation in X and Y as <br>
<br>
a'*X^2 + 2h'*X*Y + b'*Y^2 + 2f'*X + 2g'*Y + c' = 0,<br>
<br>
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<br>
<br>
a'b'  h'^2 = ab  h^2<br>
<br>
holds for the rotation you describe, and so abh^2 is called an invariant. For theta chosen to make h'=0 we have the following situation;<br>
<br>
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);<br>
<br>
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;<br>
<br>
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.<br>
<br>
Now for the first 6 of my equations (in your notation)<br>
<br>
A*x1^2 + 2*B*x1*y1 + C*y1^2 + F = 0<br>
A*x2^2 + 2*B*x2*y2 + C*y2^2 + F = 0<br>
A*x3^2 + 2*B*x3*y3 + C*y3^2 + F = 0<br>
A*x2*x3 + B*(x2*y3+x3*y2) + C*y2*y3 = 0<br>
A*x3*x1 + B*(x3*y1+x1*y3) + C*y3*y1 = 0<br>
A*x1*x2 + B*(x1*y2+x2*y1) + C*y1*y2 = 0.<br>
<br>
My first equation (droping the 1's) <br>
<br>
A*x^2 + 2*B*x*y + C*y^2 + F = 0,<br>
<br>
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<br>
<br>
((C + A +/ d)/2)*X^2 + ((C + A /+ d)/2)*Y^2 + F = 0<br>
<br>
where d = sqrt((CA)^2 + 4*B^2), and the +/ d comes from the fact we can choose from one of two rotations cos(2*theta) = (CA)/+/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. <br>
<br>
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 nondegenerate ellipse. For these hypothetical coefficients, you then "rewrote" 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 <br>
<br>
x1^2/a^2 + y1^2/b^2 = 1<br>
x2^2/a^2 + y2^2/b^2 = 1<br>
x3^2/a^2 + y3^2/b^2 = 1<br>
x2*x3/a^2 + y2*y3/b^2 = 0<br>
x3*x1/a^2 + y3*y1/b^2 = 0<br>
x1*x2/a^2 + y1*y2/b^2 = 0.<br>
<br>
from the last of these three equations you then derived the contradiction<br>
<br>
(y1/x1*y2/x2*y3/x3)^2 = (b^2/a^2)^3 < 0,<br>
<br>
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. <br>
<br>
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). Rewriting 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<br>
<br>
x1^2/a^2  y1^2/b^2 = 0 <=> (x1/a  y1/b)*(x1/a + y1/b) = 0<br>
x2^2/a^2  y2^2/b^2 = 0 <=> (x2/a  y2/b)*(x2/a + y2/b) = 0<br>
x3^2/a^2  y3^2/b^2 = 0 <=> (x3/a  y3/b)*(x3/a + y3/b) = 0<br>
x2*x3/a^2  y2*y3/b^2 = 0 <=> x2*x3/a^2  y2*y3/b^2 = 0<br>
x3*x1/a^2  y3*y1/b^2 = 0 <=> x3*x1/a^2  y3*y1/b^2 = 0<br>
x1*x2/a^2  y1*y2/b^2 = 0 <=> x1*x2/a^2  y1*y2/b^2 = 0<br>
<br>
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 36 (I assume and will verify the same holds for solutions on the other line).<br>
<br>
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<br>
<br>
b^2*y1^2=0 <br>
b^2*y2^2=0<br>
b^2*y3^2=0<br>
b^2*y2*y3=0<br>
b^2*y3*y1=0<br>
b^2*y1*y2=0,<br>
<br>
and points along the xaxis of the form (X,0) obviously satisfy all 6 equations. <br>
<br>
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.

Thu, 11 Oct 2012 00:34:09 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889300
Roger Stafford
"Daniel" wrote in message <k54q5c$2pt$1@newscl01ah.mathworks.com>...<br>
> ........<br>
> 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). ......<br>
         <br>
What you have written looks substantially correct to me.<br>
<br>
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.)<br>
<br>
As has already been established, after the appropriate rotation the six equations would have this form:<br>
<br>
X1^2/a^2  Y1^2/b^2 = 1<br>
X2^2/a^2  Y2^2/b^2 = 1<br>
X3^2/a^2  Y3^2/b^2 = 1<br>
X2*X3/a^2  Y2*Y3/b^2 = 0<br>
X3*X1/a^2  Y3*Y1/b^2 = 0<br>
X1*X2/a^2  Y1*Y2/b^2 = 0<br>
<br>
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:<br>
<br>
(X1^2/a^2)*(X2^2/a^2)*(X3^2/a^2) =<br>
(Y1^2/b^2+1)*(Y2^2/b^2+1)*(Y3^2/b^2+1) ><br>
(Y1^2/b^2)*(Y2^2/b^2)*(Y3^2/b^2) = <br>
(Y2*Y3/b^2)*(Y3*Y1/b^2)*(Y1*Y2/b^2) =<br>
(X2*X3/a^2)*(X3*X1/a^2)*(X1*X2/a^2) =<br>
(X1^2/a^2)*(X2^2/a^2)*(X3^2/a^2) .<br>
<br>
The first quantity would have to be greater than the last and yet is also identical to it!<br>
<br>
Roger Stafford

Thu, 11 Oct 2012 21:51:07 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889391
Daniel
"Roger Stafford" wrote in message <k55461$5p9$1@newscl01ah.mathworks.com>...<br>
> "Daniel" wrote in message <k54q5c$2pt$1@newscl01ah.mathworks.com>...<br>
> > ........<br>
> > 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). ......<br>
>          <br>
> What you have written looks substantially correct to me.<br>
> <br>
> 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.)<br>
> <br>
> As has already been established, after the appropriate rotation the six equations would have this form:<br>
> <br>
> X1^2/a^2  Y1^2/b^2 = 1<br>
> X2^2/a^2  Y2^2/b^2 = 1<br>
> X3^2/a^2  Y3^2/b^2 = 1<br>
> X2*X3/a^2  Y2*Y3/b^2 = 0<br>
> X3*X1/a^2  Y3*Y1/b^2 = 0<br>
> X1*X2/a^2  Y1*Y2/b^2 = 0<br>
> <br>
> 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:<br>
> <br>
> (X1^2/a^2)*(X2^2/a^2)*(X3^2/a^2) =<br>
> (Y1^2/b^2+1)*(Y2^2/b^2+1)*(Y3^2/b^2+1) ><br>
> (Y1^2/b^2)*(Y2^2/b^2)*(Y3^2/b^2) = <br>
> (Y2*Y3/b^2)*(Y3*Y1/b^2)*(Y1*Y2/b^2) =<br>
> (X2*X3/a^2)*(X3*X1/a^2)*(X1*X2/a^2) =<br>
> (X1^2/a^2)*(X2^2/a^2)*(X3^2/a^2) .<br>
> <br>
> The first quantity would have to be greater than the last and yet is also identical to it!<br>
> <br>
> Roger Stafford<br>
<br>
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? <br>
<br>
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 <br>
<br>
K*(x*sin(a)y*cos(a))*(x*sin(b)y*cos(b)) = A*x^2+2*B*x*y+C*y^2<br>
<br>
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 righthand side, by changing the angles, and hence the gradients of the lines? <br>
<br>
As ever I appreciate your help on this, and I will at some point get through everything you have said!<br>
<br>
<br>
<br>
<br>
<br>
<br>

Fri, 12 Oct 2012 00:59:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889405
Roger Stafford
"Daniel" wrote in message <k57f0b$4gd$1@newscl01ah.mathworks.com>...<br>
> Specifically, I am just moving on now to the code you have written in message 6.<br>
         <br>
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.<br>
<br>
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<br>
<br>
x*sin(t)y*cos(t) = 0<br>
<br>
where t is the angle measured counterclockwise from the xaxis to the line, so we write<br>
<br>
K*(x*sin(a)y*cos(a))*(x*sin(b)y*cos(b)) = A*x^2+2*B*x*y+C*y^2<br>
<br>
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:<br>
<br>
A = K*sin(a)*sin(b) = K*(cos(ab)cos(a+b))/2<br>
2*B = K*(sin(a)*cos(b)+cos(a)*sin(b)) = K*sin(a+b)<br>
C = K*cos(a)*cos(b) = K*(cos(ab)+cos(a+b))/2<br>
<br>
It follows that<br>
<br>
CA = K*cos(a+b)<br>
C+A = K*cos(ab)<br>
4*B^2+(CA)^2 = K^2*(sin(a+b)^2+cos(a+b)^2) = K^2<br>
<br>
and also that<br>
<br>
K*sin(ab) = K*sqrt(1cos(ab)^2) = sqrt(K^2K^2*cos(ab)^2) =<br>
sqrt(4*B^2+(CA)^2(C+A)^2)) = 2*sqrt(B^2A*C) .<br>
<br>
In the equations K*sin(a+b) = 2*B and K*cos(a+b) = CA the angle a+b can be calculated using matlab's 'atan2' function:<br>
<br>
a+b = atan2(2*B,CA) .<br>
<br>
Similarly in the equations K*sin(ab) = 2*sqrt(B^2A*C) and<br>
K*cos(ab) = C+A the angle ab is found by<br>
<br>
ab = atan2(2*sqrt(B^2A*C),C+A)<br>
<br>
From these we can determine a and b:<br>
<br>
a = ((a+b)+(ab))/2 and b = ((a+b)(ab))/2 .<br>
<br>
Having found a and b, the code then finds three random points along each line and proceeds to test the twelve equations.<br>
<br>
Roger Stafford

Fri, 12 Oct 2012 16:01:09 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889438
Daniel
"Roger Stafford" wrote in message <k57q0s$9qm$1@newscl01ah.mathworks.com>...<br>
> "Daniel" wrote in message <k57f0b$4gd$1@newscl01ah.mathworks.com>...<br>
> > Specifically, I am just moving on now to the code you have written in message 6.<br>
>          <br>
> 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.<br>
> <br>
> 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<br>
> <br>
> x*sin(t)y*cos(t) = 0<br>
> <br>
> where t is the angle measured counterclockwise from the xaxis to the line, so we write<br>
> <br>
> K*(x*sin(a)y*cos(a))*(x*sin(b)y*cos(b)) = A*x^2+2*B*x*y+C*y^2<br>
> <br>
> 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:<br>
> <br>
> A = K*sin(a)*sin(b) = K*(cos(ab)cos(a+b))/2<br>
> 2*B = K*(sin(a)*cos(b)+cos(a)*sin(b)) = K*sin(a+b)<br>
> C = K*cos(a)*cos(b) = K*(cos(ab)+cos(a+b))/2<br>
> <br>
> It follows that<br>
> <br>
> CA = K*cos(a+b)<br>
> C+A = K*cos(ab)<br>
> 4*B^2+(CA)^2 = K^2*(sin(a+b)^2+cos(a+b)^2) = K^2<br>
> <br>
> and also that<br>
> <br>
> K*sin(ab) = K*sqrt(1cos(ab)^2) = sqrt(K^2K^2*cos(ab)^2) =<br>
> sqrt(4*B^2+(CA)^2(C+A)^2)) = 2*sqrt(B^2A*C) .<br>
> <br>
> In the equations K*sin(a+b) = 2*B and K*cos(a+b) = CA the angle a+b can be calculated using matlab's 'atan2' function:<br>
> <br>
> a+b = atan2(2*B,CA) .<br>
> <br>
> Similarly in the equations K*sin(ab) = 2*sqrt(B^2A*C) and<br>
> K*cos(ab) = C+A the angle ab is found by<br>
> <br>
> ab = atan2(2*sqrt(B^2A*C),C+A)<br>
> <br>
> From these we can determine a and b:<br>
> <br>
> a = ((a+b)+(ab))/2 and b = ((a+b)(ab))/2 .<br>
> <br>
> Having found a and b, the code then finds three random points along each line and proceeds to test the twelve equations.<br>
> <br>
> Roger Stafford<br>
<br>
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.<br>
<br>
Thanks again.

Mon, 15 Oct 2012 20:29:12 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889616
Daniel
"Roger Stafford" wrote in message <k57q0s$9qm$1@newscl01ah.mathworks.com>...<br>
> "Daniel" wrote in message <k57f0b$4gd$1@newscl01ah.mathworks.com>...<br>
> > Specifically, I am just moving on now to the code you have written in message 6.<br>
>          <br>
> 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.<br>
> <br>
> 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<br>
> <br>
> x*sin(t)y*cos(t) = 0<br>
> <br>
> where t is the angle measured counterclockwise from the xaxis to the line, so we write<br>
> <br>
> K*(x*sin(a)y*cos(a))*(x*sin(b)y*cos(b)) = A*x^2+2*B*x*y+C*y^2<br>
> <br>
> 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:<br>
> <br>
> A = K*sin(a)*sin(b) = K*(cos(ab)cos(a+b))/2<br>
> 2*B = K*(sin(a)*cos(b)+cos(a)*sin(b)) = K*sin(a+b)<br>
> C = K*cos(a)*cos(b) = K*(cos(ab)+cos(a+b))/2<br>
> <br>
> It follows that<br>
> <br>
> CA = K*cos(a+b)<br>
> C+A = K*cos(ab)<br>
> 4*B^2+(CA)^2 = K^2*(sin(a+b)^2+cos(a+b)^2) = K^2<br>
> <br>
> and also that<br>
> <br>
> K*sin(ab) = K*sqrt(1cos(ab)^2) = sqrt(K^2K^2*cos(ab)^2) =<br>
> sqrt(4*B^2+(CA)^2(C+A)^2)) = 2*sqrt(B^2A*C) .<br>
> <br>
> In the equations K*sin(a+b) = 2*B and K*cos(a+b) = CA the angle a+b can be calculated using matlab's 'atan2' function:<br>
> <br>
> a+b = atan2(2*B,CA) .<br>
> <br>
> Similarly in the equations K*sin(ab) = 2*sqrt(B^2A*C) and<br>
> K*cos(ab) = C+A the angle ab is found by<br>
> <br>
> ab = atan2(2*sqrt(B^2A*C),C+A)<br>
> <br>
> From these we can determine a and b:<br>
> <br>
> a = ((a+b)+(ab))/2 and b = ((a+b)(ab))/2 .<br>
> <br>
> Having found a and b, the code then finds three random points along each line and proceeds to test the twelve equations.<br>
> <br>
> Roger Stafford<br>
<br>
Hi Rodger<br>
<br>
Thankyou 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<br>
<br>
K*(x*sin(a)y*cos(a))*(x*sin(b)y*cos(b)) = A*x^2+2*B*x*y+C*y^2=0.<br>
<br>
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 xaxis, 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. <br>
<br>
<br>
<br>
<br>
<br>
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. <br>

Mon, 15 Oct 2012 22:42:15 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889629
Roger Stafford
"Daniel" wrote in message <k5hrmo$jtt$1@newscl01ah.mathworks.com>...<br>
> ..... But why can't the K be dropped? ......<br>
         <br>
The purpose of K lies in deriving an algebraic identity with the expression<br>
<br>
A*x^2+2*B*x*y+C*y^2<br>
<br>
regardless of whether it is to be equal to zero or not. For that you do need K. Otherwise such equations as<br>
<br>
2*B = K*sin(a+b)<br>
CA = K*cos(a+b)<br>
2*sqrt(B^2A*C) = K*sin(ab)<br>
C+A = K*cos(ab)<br>
<br>
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.<br>
<br>
(It is misleading to say that K scales the points on the lines.)<br>
<br>
Roger Stafford

Tue, 16 Oct 2012 22:42:21 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889708
Daniel
"Roger Stafford" wrote in message <k5i3g7$ie5$1@newscl01ah.mathworks.com>...<br>
> "Daniel" wrote in message <k5hrmo$jtt$1@newscl01ah.mathworks.com>...<br>
> > ..... But why can't the K be dropped? ......<br>
>          <br>
> The purpose of K lies in deriving an algebraic identity with the expression<br>
> <br>
> A*x^2+2*B*x*y+C*y^2<br>
> <br>
> regardless of whether it is to be equal to zero or not. For that you do need K. Otherwise such equations as<br>
> <br>
> 2*B = K*sin(a+b)<br>
> CA = K*cos(a+b)<br>
> 2*sqrt(B^2A*C) = K*sin(ab)<br>
> C+A = K*cos(ab)<br>
> <br>
> 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.<br>
> <br>
> (It is misleading to say that K scales the points on the lines.)<br>
> <br>
> Roger Stafford<br>
<br>
Hi Rodger<br>
<br>
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.<br>
<br>
I have finally got on to your message number 5. You give some very nice geometrical interpretations to the solution space of the A1B1C1, and A2B2C2 points given that the six xy 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.<br>
<br>
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 xaxis or yaxis (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;<br>
<br>
1) all six xy points are located at the origin  both conics are the point ellipse<br>
2) all six xy points lie along one line through the origin  both conics are the same degenerate parabola<br>
3) 3 xy points lie along one line through the origin whilst the other three lie on another line through the origin  both conics are the xaxis and yaxis respectively, or are the same hyperbola. <br>
<br>
Your geometric interpretations of the ABC solution space, i.e. the whole of R^3, a plane through the origin, or points in R^3 in the direction of a crossproduct, show that, given the xy points are located as discussed above, then there are an infinite number of (A1,B1,C1), and (A2,B2,C2) points that are solutions?<br>
<br>
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 xy 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.<br>
<br>
Thanks<br>
<br>
Dan

Thu, 18 Oct 2012 02:54:24 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889782
Roger Stafford
"Daniel" wrote in message <k5knsd$l1u$1@newscl01ah.mathworks.com>...<br>
> .........<br>
> 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 xaxis or yaxis (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;<br>
> <br>
> 1) all six xy points are located at the origin  both conics are the point ellipse<br>
> 2) all six xy points lie along one line through the origin  both conics are the same degenerate parabola<br>
> 3) 3 xy points lie along one line through the origin whilst the other three lie on another line through the origin  both conics are the xaxis and yaxis respectively, or are the same hyperbola. <br>
> ........<br>
         <br>
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 xaxis or yaxis; 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.<br>
<br>
It is easiest to first analyze all the solutions to the six homogeneous equations<br>
<br>
A*x1^2+2*B*x1*y1+C*y1^2 = 0<br>
A*x2^2+2*B*x2*y2+C*y2^2 = 0<br>
A*x3^2+2*B*x3*y3+C*y3^2 = 0<br>
A*x2*x3+B*(x2*y3+x3*y2)+C*y2*y3 = 0<br>
A*x3*x1+B*(x3*y1+x1*y3)+C*y3*y1 = 0<br>
A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2 = 0<br>
<br>
This can be divided into four different cases.<br>
<br>
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.<br>
<br>
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<br>
<br>
a = 1/2*atan2(2*B/(C+A),(CA)/(C+A))<br>
<br>
where 'a' is the angle between the line and the xaxis. 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<br>
<br>
A = K*sin(a)^2<br>
B = K*sin(a)*cos(a)<br>
C = K*cos(a)^2<br>
<br>
for some nonzero K.<br>
<br>
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<br>
<br>
A = K*sin(a)*sin(b)<br>
B = K/2*sin(a+b)<br>
C = K*cos(a)*cos(b)<br>
<br>
for some nonzero K.<br>
<br>
4) A = B = C = 0. In this case any set whatever of three xy points will obviously satisfy the six equations.<br>
<br>
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 st_h=0 and ts_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.<br>
<br>
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.<br>
<br>
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. <br>
<br>
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.<br>
<br>
If either set or both sets are elliptical, then only the xy origin for all six points will be a solution.<br>
<br>
Roger Stafford

Thu, 18 Oct 2012 15:06:10 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889834
EBS
"Roger Stafford" wrote in message <k5nr10$9mi$1@newscl01ah.mathworks.com>...<br>
>          <br>
> 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 xaxis or yaxis; 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.<br>
... <br>
> <br>
<br>
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 onesided :)<br>
<br>
Cheers

Thu, 18 Oct 2012 22:06:10 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#889853
Daniel
> 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 xaxis or yaxis; 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.<br>
<br>
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.<br>
<br>
Dan

Sun, 21 Oct 2012 21:39:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#890026
Daniel
> 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 xaxis or yaxis; 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.<br>
> <br>
> It is easiest to first analyze all the solutions to the six homogeneous equations<br>
> <br>
> A*x1^2+2*B*x1*y1+C*y1^2 = 0<br>
> A*x2^2+2*B*x2*y2+C*y2^2 = 0<br>
> A*x3^2+2*B*x3*y3+C*y3^2 = 0<br>
> A*x2*x3+B*(x2*y3+x3*y2)+C*y2*y3 = 0<br>
> A*x3*x1+B*(x3*y1+x1*y3)+C*y3*y1 = 0<br>
> A*x1*x2+B*(x1*y2+x2*y1)+C*y1*y2 = 0<br>
> <br>
> This can be divided into four different cases.<br>
> <br>
> 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.<br>
> <br>
> 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<br>
> <br>
> a = 1/2*atan2(2*B/(C+A),(CA)/(C+A))<br>
> <br>
> where 'a' is the angle between the line and the xaxis. 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<br>
> <br>
> A = K*sin(a)^2<br>
> B = K*sin(a)*cos(a)<br>
> C = K*cos(a)^2<br>
> <br>
> for some nonzero K.<br>
> <br>
> 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<br>
> <br>
> A = K*sin(a)*sin(b)<br>
> B = K/2*sin(a+b)<br>
> C = K*cos(a)*cos(b)<br>
> <br>
> for some nonzero K.<br>
> <br>
> 4) A = B = C = 0. In this case any set whatever of three xy points will obviously satisfy the six equations.<br>
> <br>
> 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 st_h=0 and ts_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.<br>
> <br>
> 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.<br>
> <br>
> 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. <br>
> <br>
> 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.<br>
> <br>
> If either set or both sets are elliptical, then only the xy origin for all six points will be a solution.<br>
> <br>
> Roger Stafford<br>
<br>
Hi Rodger<br>
<br>
Regarding your statement<br>
<br>
> 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 xaxis or yaxis; it could be any straight line through the origin, depending on the values of A, B, and C. <br>
<br>
Your remark about the parabola reminded me I should have been thinking about unrotated 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 xaxis (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 unrotated 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 yaxis? <br>
<br>
Furthermore your said<br>
<br>
> 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.<br>
<br>
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.<br>
<br>
Finally in your explanation of the different solutions to the six homogeneous equations, for the B^2=A*C parabolic condition, you give <br>
<br>
a = 1/2*atan2(2*B/(C+A),(CA)/(C+A)) <br>
<br>
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 <br>
<br>
A = K*sin(a)^2<br>
B = K*sin(a)*cos(a)<br>
C = K*cos(a)^2,<br>
<br>
i.e 2*B=k*sin(2*a), A+C = k*cos(2*a), CA = 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<br>
<br>
K*(x*sin(a)y*cos(a)) = A*x^2+2*B*x*y+C*y^2,<br>
<br>
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.<br>
<br>
Any help would be greatly appreciated.<br>
<br>
<br>
<br>

Wed, 31 Oct 2012 16:08:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#890659
Roger Stafford
"Daniel" wrote in message <k61q1s$h8b$1@newscl01ah.mathworks.com>...<br>
> .........<br>
> Finally in your explanation of the different solutions to the six homogeneous equations, for the B^2=A*C parabolic condition, you give <br>
> <br>
> a = 1/2*atan2(2*B/(C+A),(CA)/(C+A)) <br>
> <br>
> 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 <br>
> <br>
> A = K*sin(a)^2<br>
> B = K*sin(a)*cos(a)<br>
> C = K*cos(a)^2,<br>
> <br>
> i.e 2*B=k*sin(2*a), A+C = k*cos(2*a), CA = 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<br>
> <br>
> K*(x*sin(a)y*cos(a)) = A*x^2+2*B*x*y+C*y^2,<br>
> <br>
> 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? <br>
> ........<br>
         <br>
If instead of<br>
<br>
K*(x*sin(a)y*cos(a)) = A*x^2+2*B*x*y+C*y^2<br>
<br>
you solve for A, B, and C in<br>
<br>
K*(x*sin(a)y*cos(a))^2 = A*x^2+2*B*x*y+C*y^2<br>
<br>
those three equations will fall out very readily.<br>
<br>
It is analogous to the case when a quadratic equation has only one root, r. Then it can always be expressed as a*(xr)^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.<br>
<br>
Roger Stafford

Thu, 01 Nov 2012 22:36:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#890768
Daniel
If instead of<br>
<br>
K*(x*sin(a)y*cos(a)) = A*x^2+2*B*x*y+C*y^2<br>
<br>
you solve for A, B, and C in<br>
<br>
K*(x*sin(a)y*cos(a))^2 = A*x^2+2*B*x*y+C*y^2<br>
<br>
those three equations will fall out very readily.<br>
<br>
It is analogous to the case when a quadratic equation has only one root, r. Then it can always be expressed as a*(xr)^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.<br>
<br>
Hi Roger<br>
<br>
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.<br>
<br>
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). <br>
<br>
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.<br>
<br>
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. <br>
<br>
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.<br>
<br>
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<br>
<br>
Z1 = [X1,Y1;X2,Y2;X3,Y3] and Z2 = [X4,Y4;X5,Y5;X6,Y6],<br>
<br>
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 counterexample 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 nonzero. 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 <br>
Z matrices to be of full rank. <br>
<br>
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 fullrank condition you have provided accords well with many statistical results (across many areas), i.e. less than fullrank 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.<br>
<br>
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 fullrank 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.<br>
<br>
I will let you know how I get on.<br>
<br>
Many thanks again.

Fri, 02 Nov 2012 06:09:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#890780
Bruno Luong
It does not look to me a standard technique to study a bunch of conic hypersurface 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 wellposedness, observability, impact of the data error etc...<br>
<br>
Bruno

Fri, 02 Nov 2012 11:24:08 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#890790
Daniel
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <k6vo24$rv8$1@newscl01ah.mathworks.com>...<br>
> It does not look to me a standard technique to study a bunch of conic hypersurface 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 wellposedness, observability, impact of the data error etc...<br>
> <br>
> Bruno<br>
<br>
Hi Bruno<br>
<br>
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.<br>
<br>
Dan

Sat, 03 Nov 2012 01:50:13 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#890826
Roger Stafford
"Daniel" wrote in message <k70ago$r6f$1@newscl01ah.mathworks.com>...<br>
> Hi Bruno<br>
> <br>
> 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.<br>
> <br>
> Dan<br>
          <br>
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^2Y^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.<br>
<br>
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.<br>
<br>
Roger Stafford

Sat, 03 Nov 2012 09:12:09 +0000
Re: solving a system of multivariable polynomial equations in mupad
http://www.mathworks.com/matlabcentral/newsreader/view_thread/323534#890842
Daniel
"Roger Stafford" wrote in message <k71t8l$7ka$1@newscl01ah.mathworks.com>...<br>
> "Daniel" wrote in message <k70ago$r6f$1@newscl01ah.mathworks.com>...<br>
> > Hi Bruno<br>
> > <br>
> > 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.<br>
> > <br>
> > Dan<br>
>           <br>
> 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^2Y^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.<br>
> <br>
> 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.<br>
> <br>
> Roger Stafford<br>
<br>
Thankyou 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.<br>
<br>
Dan