# Thread: Non-linear eq sys with 6 unknown, please solve for me!

1. ## Non-linear eq sys with 6 unknown, please solve for me!

EDIT[By the way, don't waste your time on this. See post #4!]

I need an algebraic expression (hence iteration is not possible) for each of the unknown parameters A, B, C, D, E and F expressed in terms of x = x1 ... x6 and y = y1 ... y6, in the following expression:

y = (-E-B x+((E+B x)^2-4C(F+D x+A x^2))^(1/2))/(2C)

which is one of the two solutions of y from:

A x^2+B x y+C y^2+D x+E y+F = 0

where B^2 < 4 A C. NOTE THIS RESTRICTION!

Please! I'm getting desperate. I need to have this symbolic processing over and done with, so that I can continue to work on this whole project.

I've been struggling with the Solve-command in Mathematica, but I can't get it done (Mathematica works for hours and hours without giving any output) If you have a math software which can do the job, I'd very much appreciate your help!

Alternatively, give me a hint on how I could do it in Mathematica. I'm about to write some VBA-code to do the basically very simple but very tedious substitutions (then I'd hope that Mathematica could simplify the messy output for me), but that could take me quite some time.

You can have the equation system in this shape:

y1 == (-E-B x1+((E+B x1)^2-4C(F+D x1+A x1^2))^(1/2))/(2C)
y2 == (-E-B x2+((E+B x2)^2-4C(F+D x2+A x2^2))^(1/2))/(2C)
y3 == (-E-B x3+((E+B x3)^2-4C(F+D x3+A x3^2))^(1/2))/(2C)
y4 == (-E-B x4+((E+B x4)^2-4C(F+D x4+A x4^2))^(1/2))/(2C)
y5 == (-E-B x5+((E+B x5)^2-4C(F+D x5+A x5^2))^(1/2))/(2C)
y6 == (-E-B x6+((E+B x6)^2-4C(F+D x6+A x6^2))^(1/2))/(2C)

or in this shape, with the parameters on the left side:

A == (-F-D x1-E y1-B x1 y1-C y1^2)/(x1^2)
B == (-F-D x2-A x2^2-E y2-C y2^2)/(x2 y2)
C == (-F-D x3-A x3^2-E y3-B x3 y3)/(y3^2)
D == (-F-A x4^2-E y4-B x4 y4-Cy4^2)/x4
E == (-F-D x5-A x5^2-B x5 y5-C y5^2)/y5
F == (D x6-A x6^2-E y6-B x6 y6-C y6^2)

or in any shape you want!

Note:
Space between letters means multiplication. Multiplication of course also between a variable and parenthesis although there are no space there. It should be pastable into Mathematica and possibly other math software too. Also note that Mathematica tends to assume that E=e=2.718... so one has to rename E to G or something if one uses Mathematica.

Bakground:

{x1,y1} ... {x6,y6} are coordinates for points. The formulas describe half an ellipse, an arc, on which the points are distributed. I need to determine the parameters of the elliptic arc using the coordinates of some points on it. This is part of a greater project.

EDIT:
Fixed a typo in the first equation. (Thanks Soroban!)

2. Hello, Optiminimal!

You first equation has typos . . . (You had me worried!)
. . but your later equations are correct.

We have the general quadratic: .Ax² + Bxy + Cy² + Dx + Ey + F .= .0

In terms of y: .Cy² + (Bx + E)y + (Ax² + Dx + F) .= .0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . _________________________
. . . . . . . . . . . . . . . . . . . -(Bx + E) ± √(Bx + E)² - 4C(Ax² + Dx + F)
Quadratic Formula: . y .= . ----------------------------------------------------
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2C

I haven't solved it yet.
Maybe others are more willing to help . . . now that it's more easily read.

3. Yes, thank you soroban!

The formulas as I wrote them should be pastable to Mathematica, although it's more clear for human eyes as Soroban wrote it.

The formulas for the parameters (A...F) each expressed as functions of the 12 coordinates (x1...x6,y1...y6) will surely be large. Will they even be practical to handle? Lets see, with quadratic formulas, there should be 7 by 7 or 49 terms in each of the formulas (of the kind x3*y6), minus those terms which happen to get zero coefficient. Or will there be even MANY more terms, of the kind(x2^3)*(x4*(x5^3))^(1/2)?

Will the result be practical to handle at all? In that case, an interesting lesson in how complicated non-linear equation systems can become...

4. ## Beyond algebraic solutions...

By simply ignoring the last of the 6 expressions, the (thus incomplete!) solution for A seems to be:

A = -(-y1*x5*y5*x4*y3^2+y1*x1*x3*y4^2*y2+x4*y1*x1*y5^2*y2 -x4*y1*x1*y3^2*y2+y1*x1*x5*y3^2*y2+y5*x5*y4*x1*y3^2 +y4*x4*y5^2*x1*y3-y4*x4*y5*x1*y3^2+y5*y4^2*x1*x3*y3-x4*y5^2*x1*y3*y1+x4*y5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*x2*y3^2*y1-y5*x5*y4*x1*x3^2*y2^2+y5*x5*y4*x1*x2^2*y3^2+y5*x5* y4*x1^2*x3*y2^2-y5*x5*y4*x1^2*x2*y3^2-y5*x5*y4*x2^2*x3*y1^2+y5*x5*y4*x3^2*x2*y1^2+y5*y4^ 2*x1*x2^2*x3*y3-y4*x4*x5*x1^2*y3^2*y2+y4*x4*x5*x2^2*y3^2*y1-y4*x4*x5*x2^2*y3*y1^2-y4*x4*x5*y2^2*x3^2*y1+y5*x4^2*x1*x2*y3^2*y2-y5*x4^2*x1*x2*y3^2*y1-y5*x4^2*x2*x3*y2*y1^2-y5*x4^2*x1*x3*y2^2*y3+y5*x4^2*x1*y1*x3*y2^2-y4*x4*y5^2*x1*x3^2*y2-y4*x4*y5^2*x1^2*x2*y3+y4*x4*y5^2*x1^2*x3*y2+y4*x4* y5^2*x1*x2^2*y3-x5^2*y4^2*x2

Which contains 853 multiplications and 270 squares in about 200 terms!

Just for one of six parameters describing an ellipse which fit a number of points!

Now I'm thinking about developing an interest for numerical methods...