findRoots: Complex roots of quadratic polynomial

View source: R/findRoots.R

findRootsR Documentation

Complex roots of quadratic polynomial

Description

Find complex roots of polynomials in x that are quadratic polynomials in x^k

Usage

findRoots(coefs, k = 1)

Arguments

coefs

Coefficients (c_0,c_k,c_2k) of quadratic polynomial in x^k. Also accepts matrix input (J,3).

k

Order of x^k

Details

It is assumed that c_2k is non-zero, and that at least one of c_0 and c_k are non-zero (otherwise, we have a double root, which is not treated by fdaLm in the present implementation). An error is issued if these assumptions are violated.

Value

A list with components

left

The k roots with left most real components

right

The k roots with right most real components

Note

This function is intended for internal usage in fdaLm to find eigenvalues. If a robust and stable method of finding all the complex roots is a polynomial were available, then this could be used in fdaLm instead enhancing the scope of this function.

Author(s)

Bo Markussen <bomar@math.ku.dk>

References

Solved using Section 5.6 in Press et al, "Numerical Recipies in C", second edition.

Examples

findRoots(c(-1,0,1),1)
findRoots(c(1,-1,1),2)

fdaMixed documentation built on Sept. 14, 2023, 1:09 a.m.