Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: nummath
See also: nmpolroots complex

Quantlet: nmpolrootlaguer
Description: implements Laguerre's method for improving a given complex value until it converges to a root of a given polynomial

Reference(s):

Usage: root = nmpolrootlaguer(coef {,m,x})
Input:
coef n x 1 vector of real or complex numbers, coefficients of the polynomial sum_{i=0}^{n-1} coef[i] * x^i
m optional integer, order of the polynomial. Default m = rows(coef) - 1.
x optional complex number, initial estimate of the root. Default x = 0 + 0*i.
Output:
root complex number, approximation of a root of the given polynomial

Note:

Example:
library("nummath")
; x^2 + 16
coef = #(16,0,1)
nmpolrootlaguer(coef,2,complex(10,-2))
nmpolrootlaguer(coef,2,1)

Result:
Contents of root.re
[1,]        0

Contents of root.im
[1,]       -4

Contents of root.re
[1,] -2.2204e-16

Contents of root.im
[1,]        4
Example:
library("nummath")
; x^5 - 32
coef = #(-32,0,0,0,0,1)
nmpolrootlaguer(coef,5,1)

Result:
Contents of root.re
[1,]        2

Contents of root.im
[1,]        0
Example:
library("nummath")
; x
coef = #(0,1)
nmpolrootlaguer(coef)

Result:
Contents of root.re
[1,]        0

Contents of root.im
[1,]        0
Example:
library("nummath")
; 1 => no solution
coef = #(1,0)
nmpolrootlaguer(coef)

Result:
Produces a warning "Convergence not achieved before maxiter! Maybe different initial guess helps."



Author: L. Cizkova, 20030402 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006