What is the Problem with Calculating Roots of a Quartic Equation?

  • Context: Undergrad 
  • Thread starter Thread starter scottlangendy
  • Start date Start date
  • Tags Tags
    Roots
Click For Summary

Discussion Overview

The discussion revolves around the challenges of calculating the roots of a quartic equation, specifically using Ferrari's method. Participants explore issues related to precision, special cases in root calculation, and the need for robust algorithms for dynamic computation.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes implementing Ferrari's method and encountering incorrect roots for a specific quartic equation, suggesting a potential oversight regarding special cases when there are only two real roots.
  • Another participant provides results from Mathematica, indicating different roots and suggesting that these results align with graphical intersections on a plot.
  • A participant emphasizes the need for a programmatic solution that can dynamically calculate roots for any quartic equation, hinting at the necessity of addressing special cases to avoid incorrect results.
  • One contributor shares past experiences with precision issues when using Ferrari's method, recommending Sturm sequences and Newton's method as more robust alternatives for finding real roots.
  • Another participant notes the significance of precision in coefficients, suggesting that using extended precision might mitigate roundoff errors that could affect results.
  • A later post introduces a different problem related to eigenvalues in earthquake engineering, presenting a stiffness matrix and mass matrix for discussion.

Areas of Agreement / Disagreement

Participants express differing views on the effectiveness of Ferrari's method, with some advocating for alternative methods due to precision issues. The discussion remains unresolved regarding the best approach to dynamically calculate roots for quartic equations.

Contextual Notes

Participants mention potential limitations related to precision and roundoff errors, particularly when dealing with high significant digits in coefficients. The discussion also touches on the need for special case handling in root calculations.

scottlangendy
Messages
2
Reaction score
0
Hey guys,

I've been working on this computer application, and ended up needing to compute the roots of a quartic equation. So I implemented Ferrari's method and the results for the most part are working, however I've come across a few exceptions where I'm getting incorrect results.

For example if I try and calculate the roots for this equation:

y = 0.9604000000000001x^4 - 5.997600000000001x^3 + 13.951750054511718x^2 - 14.326264455924333x + 5.474214401412618

It returns the following roots:
1.7820304835380467 + 0i
1.34041662585388 + 0i
1.3404185025061823 + 0i
1.7820323472855648 + 0i

When I graph the equation with a graphing calculator, I find that these are actually incorrect, and the real roots are actually closer to 1.2 and 2.9 (approximately).

The results its returning aren't totally random, they actually seem to be the results of the equations first derivative.

I tried out a bunch of root calculators online (I presume they are using the same method) and they returned the same results, so I'm pretty certain I've implemented the formula correcting.

This only seems to happen when the quartic has only two real roots, so I'm under the impression that I'm ignoring some sort of special case!

Can anyone offer me any insight as to why this is happening?
 
Mathematics news on Phys.org
I am not at all an expert on quadratic functions, but i will just input what mathematica (you could also check this at wolfram alpha) has given as a result: x=1.20784 or x=1.56122-0.165428 i or x=1.56122+0.165428 i or x=1.9146 , which if then we use the plot we can see that the intersects are marked on the graph, which looks like the two end results (1.207 and 1.9146).
Hope that helps :)
 

Attachments

  • MSP6219b0ed30a007362h0000614daadb11dih517.gif
    MSP6219b0ed30a007362h0000614daadb11dih517.gif
    3.4 KB · Views: 591
Last edited:
The issue isn't so much as finding the roots for a specific quartic equation, its that I need to be able to dynamically calculate it programatically, for any quartic equation . Like I said I'm using Ferrari's solution http://en.wikipedia.org/wiki/Quartic_function#Ferrari.27s_solution. But I'm under the impression that I need to take into account some sort of special case, to get rid of the incorrect roots that I'm calculating in certain cases.
 
Many years ago I had to design a computer program involving solving a fourth degree equation. I found that they are serious precision related problems using Ferrari's method. I ended up using Sturm sequence and Newton's method (for real roots). This is much more robust.
 
scottlangendy said:
y = 0.9604000000000001x^4 - 5.997600000000001x^3 + 13.951750054511718x^2 - 14.326264455924333x + 5.474214401412618

Along the lines of mathman's comment, I noticed your stated problem had 16 significant digits for the coefficients. If that number of significant digits is important, then precision/roundoff might hurt you. I entered the numbers into Excel and it truncated the numbers (a handheld calculator would be worse).

You might try using extended precision with your program if you can.
 
hi
please help me with this problem from my earthquake engineering subject in determining eigenvalues
[K]-w2[M]=0

where:
K=[ 654.7 -327.35 0 0
-327.35 654.7 -327.35 0
0 -327.35 654.7 -327.35
0 0 -327.35 327.35]

and

M = [1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1]

then solve for w2

note : K - stiffness in matrix
M - mass in matrix also
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K