|
|
◆ WDka()
| Function WDka |
( |
N As |
Long, |
|
|
A As |
Variant |
|
) |
| |
Roots of a polynomial (complex coefficients) DKA method (complex number representation in Excel format)
- Purpose
- WDka computes all roots of a polynomial p(z) with complex coefficients by DKA (Durand-Kerner-Aberth) method.
p(z) = a0*z^n + a1*z^(n-1) + ... + an
To represent complex numbers in Excel cells, complex number format in Excel (e.g. 2.5+1i) is used. Worksheet function Complex can be used to input complex numbers into cells.
- Returns
- N+2 x 1
| Column 1 |
| Rows 1 to N | Roots |
| Row N+1 | Return code |
| Row N+2 | Number of iterations performed to converge |
Return code.
= 0: Successful exit.
= 1: Maximum number of iterations exceeded.
- Parameters
-
| [in] | N | Degree of polynomial. (N >= 1) |
| [in] | A | (N+1 x 1) or (1 x N+1) Complex coefficients a0 to an of polynomial a0 x^n + a1 x^(n-1) + … + a(n-1)x + an. |
- Reference
- (Japanese book) Masatake Mori "FORTRAN77 Numerical Calculation Programming (augmented edition)" Iwanami Shoten (1987)
- Example
- Solve the following algebraic equation.
x^3 + (-19-14i)*x^2 + (67+191i)*x + 116-612i = 0
The exact solutions are 8 + 4i, 4 + 9i and 7 + i.
|