Saturday, August 10, 2019

Solving a System of Conic Equations: An Unorthodox Method

Solving a System of Conic Equations: An Unorthodox Method 

Introduction

Problem:  Find the solutions to the following systems of equations:

ax^2 + by^2 = c
rx^2 + sy^2 = t

Assume that:
Only a or b can be negative, while c > 0, and
Only r or s can be negative, while t > 0.

Can use the matrix method to solve for x and y?

[ [a, b], [r, s] ] * [ [ x^2 ], [ y^2 ] ] = [ [ c ], [ t ] ]

[ [ x^2 ], [ y^2 ] ] = [ [a, b], [r, s] ]^(-1) * [ [ c ], [ t ] ]

If x^2 and y^2 are both positive, the conic curves have intersecting points.

Example 1 - Two Ellipses:

3x^2 + 5y^2 = 10
4x^2 + y^2 = 6



roots: 
x^2 = 1.17647058824,  x = ± 1.0846522891
y^2 = 1.29411764706,  y = ± 1.1375291799

Intersection Points:
( 1.0846522891, 1.1375291799 ), ( -1.0846522891, 1.1375291799 ),
( 1.0846522891, -1.1375291799 ), (- 1.0846522891, -1.1375291799 )

Example 2 - An Ellipse and a Hyperbola:

3x^2 + 5y^2 = 10
4x^2 -  y^2 = 6



roots:
x^2 = 1.73913043478, x = ± 1.31876094679
y^2 = 0.956521739126, y = ± 0.978019293849

Intersection Points:
( 1.31876094679, 0.978019293849 ), ( 1.31876094679, -0.978019293849 ),
( -1.31876094679, 0.978019293849 ), ( -1.31876094679, -0.978019293849 )

Example 3 - An Ellipse and a Hyperbola, part II:

3x^2 + 5y^2 = 10
-4x^2 + y^2 = 6



roots:
x^2 = -.86956217393
y^2 = 2.51273913043

There are no intersection points.

The program SYSCONIC (HP Prime) solves the system.  Output:  a 6 x 2 matrix:

[ [ x,   0 ]
[  y,  0 ]
[  a*x^2 + b*y^2,  c ]
[  r*x^2 + s*y^2, t ]
[  a*(-x)^2 + b*(-y)^2,  c ]
[  r*(-x)^2 + s*(-y)^2, t ] ]

The last four rows are to check solutions.

EXPORT SYSCONIC()
BEGIN
HComplex:=11; // complex
// 2019-07-15 EWS
// System conic equations
LOCAL a,b,c,r,s,t;
LOCAL m0,m1,m2,m3,x,y;
INPUT({a,b,c,r,s,t},
"ax^2+by^2=c  rx^2+sy^2=t",
{"a: ","b: ","c: ",
"r: ","s: ","t: "});
m0:=[[a,b],[r,s]];
m1:=[[c],[t]];
m2:=m0^(−1)*m1;
x:=m2(1,1);
x:=√x;
y:=m2(2,1);
y:=√y;
MSGBOX(x);
MSGBOX(y);
// results and check
m3:=MAKEMAT(0,6,2);
m3(1,1):=x;
m3(2,1):=y;
m3(3,1):=a*x^2+b*y^2;
m3(3,2):=c;
m3(4,1):=r*x^2+s*y^2;
m3(4,2):=t;
m3(5,1):=a*(−x)^2+b*(−y)^2;
m3(5,2):=c;
m3(6,1):=r*(−x)^2+s*(-y)^2;
m3(6,2):=t;
END;

Remarks

It is a wise idea to check the answers to make sure that they are correct, this is kind of an unorthodox approach. 

If we tried the matrix method on a system of equations like:

x^2 + 4x - y = 2
-3x^2 + x - 2y = 5

the method will not work.  Each term must have a different variable. 


Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.