Electronics > Projects, Designs, and Technical Stuff

Solving quartic equations, something's not working

(1/6) > >>

MathWizard:
I can follow along and work out the steps for a cubic equation, and I made a calculator spreadsheet, in Open Office, and it works pretty good for something like x^3-9x^2+36x-80=0. The 2 equal sets of roots are 5, (2+/-j2*SQRT(3))

In the spread sheet it seems to get it right, and plugging it into the cubic eqn, it's not exactly zero, it's numbers like (-9.9*10e-13 + j1.3*10e-14)

So for a quartic equation, of a transfer function, in the s-domain, I just want to factor it. I'm pretty sure the circuit equations for it are spot on, and the LRC terms. I've calculated and graphed it in other ways and it matches great.

I can follow along and work out the method on wikipedia, going from a general quartic, to depressed quartic, to resolvent cubic. All constants are just real, LRC combo's, and I'm just treating the 4th and 3rd order poly's as real.

But when I get to the step of making the resolvent cubic, 8m^3 +8pm^2 +(2p^2-8r)m-q^2=0 something goes wrong. From there the cubic solver gives roots that don't solve to zero, in the resolvent cubic, but instead to a magnitude of 10^37. So never mind making the 4th order roots, the roots of the resolvent cubic, 8m^3 +8pm^2 +(2p^2-8r)m-q^2=0, aren't working.

But if I take  x^3-9x^2+36x-80=0, call that a resolvent cubic, and work back a few steps to the depressed quartic with
y^4 + py^2 + qy +r =0, well the spreadsheet calculator I made still works fine.

So I don't get what could be going wrong if I just start from a_4*s^4 + a_3*s^3 + ..... with my LRC combo's that match great in other equations, the magnitudes and phases.

I'm solving cubics like in this pdf below, and I'm following this little part of a wiki page for the quartic's, and I can do it, and it's entered into the spreadsheet right, I rechecked lot's of stuff many times, so what else could be wrong here ?

http://mathforcollege.com/nm/mws/gen/03nle/mws_gen_nle_bck_exactcubic.pdf

About 1/2 way down this wiki page is mainly what I tried for quartics so far.
https://en.wikipedia.org/wiki/Quartic_function#Converting_to_a_depressed_quartic

--- Quote ---Solution methods
Converting to a depressed quartic
For solving purposes, it is generally better to convert the quartic into a depressed quartic by the following simple change of variable. All formulas are simpler and some methods work only in this case. The roots of the original quartic are easily recovered from that of the depressed quartic by the reverse change of variable.

{\displaystyle 8m^{3}+8pm^{2}+(2p^{2}-8r)m-q^{2}=0.}

This is the resolvent cubic of the quartic equation. The value of m may thus be obtained from Cardano's formula. When m is a root of this equation, the right-hand side of equation (1) is the square

--- End quote ---

So my Cardano spreadsheet calculator seems to work fine, but not when coming from the 4th order poly, in s, that I'm leaving as s, not jw.

My coefficients are
5.821323366E-25 for s^4
4.860381796E-19 for s^3...etc
5.633629942E-10
2.225651784E-04
1.000000000E+00

All the units match, the each term when multiplied by the omega's, leaves no units. On my graphic calculator, there are no real roots in the graph.

IanB:

The reason I've never tried using this method is because it is pretty unusual for anyone to try solving polynomials analytically. I've seen it done for cubics, but even then the justification is dubious. For quartics, that seems like a lot of work.

Analytical solutions are of interest academically to mathematicians, but less so for working practitioners.

In general, unless equations are simple, engineers tend to favor numerical solution approaches.

Or, you could just use something like Wolfram Alpha and get the answer quickly and reliably.

MathWizard:
Well I still want to find what's going wrong with this method, but as an approximation, I tried dropping the a_1*s+1 part, and solving the remaining part as a cubic , and that gets the correct oscillation frequency as a root, I'll have to check what that does for  the overall magnitude of the circuit gain.

I read something about approximating the Q of a circuit, and somehow reducing higher degree transfer functions with that. I heard a prof. say that most circuits, like the internals of an op-amp for instance, can be reduced to 1st or 2nd order equations.

What techniques or topics should I be looking up for simplifying higher order equations ? Back when everyone used slide rulers, and computers were rare, what would they do ?

Ok 1 is the Dominant Pole Approximation

Doctorandus_P:
I have some vague memories of Newton-Raphson. There were two ways of setting up the iteration formula and usually only one of them converged, and the iteration formula that was easiest to derive usually was the one that did not work.

In school I was also forced to do Runge-Kutta a few times by hand. (second or third order? I can't remember). That was both a weird and wonderful beast.

In real life those things are hidden far away in libraries that are programmed by people who are far smarter than I am, and one thing I learned from those exercises in school is that mathematics is not (always) as beautiful and elegant as you'd like it to be.

IanB:
Higher order equations may often result from dynamic systems that have several time constants. One way to reduce the order is to keep only the dominant (larger) time constants and to discard any small time constants (ones which might be close to zero).

Another way to look at this mathematically is in terms of eigenvalues and eigenvectors and to discard the less significant ones (this might be called principle component analysis, for example).

To do this in a non-mathematical way, you could plot the higher order polynomial, find the region of interest (for example, where the main operating point lies), and then refit that local part of the curve to a lower order polynomial (linear or quadratic).

This is overall a very complex topic, and not easy to give a short answer.