From: Robert Israel on 13 Jan 2010 19:03 "Achava Nakhash, the Loving Snake" <achava(a)hotmail.com> writes: > On Jan 13, 4:00=A0am, Ross <rossclem...(a)gmail.com> wrote: > > PS: I think I've just properly understood. The Planet Math equations > > are correct, but produce complex numbers in their solution, as said. > > This causes difficulty to me, as I'm creating a computational example, > > and upgrading the code to handle complex numbers would be too > > difficult and computationally expensive. Since sqrt( a ) =3D sqrt( -1 * - > > a ) =3D i sqrt( -a ), I could do the algebra to handle the case where > > the operand of the sqrt is negative, by solving the equation to remove > > i, then using that resulting equation when the operand is negative. > > And of course, the other "more complicated looking" solutions use > > "discriminants" to branch in the solution structure. > > > > So, I'd guess that the lengthier solution that does work for me is a > > similar, or even the same, solution method. Just that more steps have > > been done so that no complex arithmetic is performed. In which case, I > > have a solution, and it's probably as simple as any I'm going to get. > > > > This is similar to designing digital filters by direct pole/zero > > placement on an Argand diagram. When the poles or zeroes are not on > > the real axis, they must be in conjugate pairs (r,omega), (r,-omega), > > so that when the filter different equation is derived, the imaginary > > parts drop out of the working, and final equation. > > Are you sure that you want to use closed-form solutions for solving > these equations on the computer? A glance at the formula for solving > quadratic equations shows you that it can be very sensitive to small > changes in the coefficients, and my practical experience with solving > quadratic equations on the computer showed that the result were often > quite inaccurate. I finally ditched that approach and used the Newton > method. I would not be a bit surprised if that approach is far more > stable and accurate for cubic equations as well, particularly if you > know in advance that you only get one root. The problem with quadratics is that in the usual quadratic formula (-b (+/-) sqrt(b^2 - 4 a c))/(2 a) the root close to 0 suffers from "catastrophic cancellation" if |b^2| is large compared to |4 a c|. That can be cured by using the alternative formula -2 c/(b (+/-) sqrt(b^2 - 4 a c)) for that root. I don't know if the cubic suffers from similar problems, or if there is a similar cure. -- Robert Israel israel(a)math.MyUniversitysInitials.ca Department of Mathematics http://www.math.ubc.ca/~israel University of British Columbia Vancouver, BC, Canada
From: Gib Bogle on 14 Jan 2010 00:38 Ross wrote: > Are the formulae for findin the roots of cubic equations on Wikipedia > correct? I've been through it over and over, and simply don't get > roots. > > I've gone to the original source, which is: > http://planetmath.org/?op=getobj&from=objects&name=CubicFormula > > Just looking at the first equation to calculate r1, then if I have the > cubic x^3 -2x^2 -11x + 12, then I get NaNs when I try to find r1. > > Specifically, if I set a1=-2, b1=-11, and c1=12, then the value of > which the square root is taken: > (2*a1^3 - 9*a1*b1 + 27*c1)^2 + 4*(-(a1^2)+3*b1)^3 > > works out to be negative, leading to the NaN result. > > Here's a cut and paste from "bc" where I first confirm that my > variables are set properly, then work out the operand of the square > root. > > a1 > -2 > b1 > -11 > c1 > 12 > (2*a1^3 - 9*a1*b1 + 27*c1)^2 + 4*(-(a1^2)+3*b1)^3 > -190512 > > Negative! > > I've also tried the modified form of these equations from the > Wikipedia page, but I get the same result. NaNs. > > I've really tried to find the error in my calculations or reasoning, > but I just can't see any. Are these equations correct? Am I misusing > them? > > I can successfully use the method in this page: http://www.1728.com/cubic2.htm. > However, I'd still like to know what I'm doing wrong with the > Wikipedia method. > > Any hints/help? I've just been reading A History of Mathematics by Boyer (and Merzbach). The cubic gave the old-timers plenty to think about, and solving it was a great feat. As David Ullrich mentioned, the occurrence of square roots of negative numbers in a cubic with three real roots was a real head-scratcher.
From: David Bernier on 14 Jan 2010 01:04 Gib Bogle wrote: > Ross wrote: [...] >> 12 >> (2*a1^3 - 9*a1*b1 + 27*c1)^2 + 4*(-(a1^2)+3*b1)^3 >> -190512 >> >> Negative! >> >> I've also tried the modified form of these equations from the >> Wikipedia page, but I get the same result. NaNs. >> >> I've really tried to find the error in my calculations or reasoning, >> but I just can't see any. Are these equations correct? Am I misusing >> them? >> >> I can successfully use the method in this page: >> http://www.1728.com/cubic2.htm. >> However, I'd still like to know what I'm doing wrong with the >> Wikipedia method. >> >> Any hints/help? > > I've just been reading A History of Mathematics by Boyer (and Merzbach). > The cubic gave the old-timers plenty to think about, and solving it was > a great feat. As David Ullrich mentioned, the occurrence of square > roots of negative numbers in a cubic with three real roots was a real > head-scratcher. It would be interesting to know which came first: - trigonometric and inverse trigonometric functions used to solve casus irreducibilis equations or: - the ( Argand) complex plane . David Bernier
From: Adam on 16 Jan 2010 14:03 On Wed, 13 Jan 2010 04:51:18 -0600, David C. Ullrich wrote: >On Wed, 13 Jan 2010 00:56:36 -0800 (PST), Ross <rossclement(a)gmail.com> >wrote: > >>Are the formulae for findin the roots of cubic equations on Wikipedia >>correct? I've been through it over and over, and simply don't get >>roots. >> >>I've gone to the original source, which is: >>http://planetmath.org/?op=getobj&from=objects&name=CubicFormula >> >>Just looking at the first equation to calculate r1, then if I have the >>cubic x^3 -2x^2 -11x + 12, then I get NaNs when I try to find r1. >> >>Specifically, if I set a1=-2, b1=-11, and c1=12, then the value of >>which the square root is taken: >>(2*a1^3 - 9*a1*b1 + 27*c1)^2 + 4*(-(a1^2)+3*b1)^3 >> >>works out to be negative, leading to the NaN result. > >No, the square root of a negative number is a complex number. >Complex numbers come into the formula even when the roots >of the original cubic turn out to be real. > >This has a lot to do with the history of complex numbers. >Way back then nobody was interested in saying that >x^2 = -1 had a solution because it obviously didn't. >But these funny "imaginary" numbers did arise in the >solution to cubics with _real_ roots - hence they couldn't >be just ignored. At first they were just "imaginary" >temporary things that luckily went away when we got the >final answer - people gradually decided they were interesing >in themselves. Imaginary numbers are the "dark matter" of math? They outnumber real numbers.
From: Don Redmond on 16 Jan 2010 14:47 On Jan 14, 12:04 am, David Bernier <david...(a)videotron.ca> wrote: > Gib Bogle wrote: > > Ross wrote: > > [...] > > > > >> 12 > >> (2*a1^3 - 9*a1*b1 + 27*c1)^2 + 4*(-(a1^2)+3*b1)^3 > >> -190512 > > >> Negative! > > >> I've also tried the modified form of these equations from the > >> Wikipedia page, but I get the same result. NaNs. > > >> I've really tried to find the error in my calculations or reasoning, > >> but I just can't see any. Are these equations correct? Am I misusing > >> them? > > >> I can successfully use the method in this page: > >>http://www.1728.com/cubic2.htm. > >> However, I'd still like to know what I'm doing wrong with the > >> Wikipedia method. > > >> Any hints/help? > > > I've just been reading A History of Mathematics by Boyer (and Merzbach). > > The cubic gave the old-timers plenty to think about, and solving it was > > a great feat. As David Ullrich mentioned, the occurrence of square > > roots of negative numbers in a cubic with three real roots was a real > > head-scratcher. > > It would be interesting to know which came first: > - trigonometric and inverse trigonometric functions used to solve > casus irreducibilis equations or: > - the ( Argand) complex plane . > > David Bernier Viete, at least, in 1500's did the trig soln of cubics. Argand and Wessel did the Argand diagram in the 1700's. It was spread by Gauss. Don
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: Axiom of Regularity. Next: Getting help with Time Series questions -- Garch etc. |