Skip to Content
Using R for Numerical Analysis in Science and Engineering
book

Using R for Numerical Analysis in Science and Engineering

by Victor A. Bloomfield
September 2018
Intermediate to advanced
359 pages
8h 12m
English
Chapman and Hall/CRC
Content preview from Using R for Numerical Analysis in Science and Engineering

Chapter 5Solving systems of algebraic equations

Solving equations is central to numerical analysis, and R has numerous tools for doing so. We begin by extending our consideration of polynomials from the previous chapter.

5.1 Finding the zeros of a polynomial

The base installation of R has the function polyroot to find the zeros of a real or complex polynomial, specified by the vector of its coefficients in ascending order. This function uses the algorithm of Jenkins and Traub (Jenkins and Traub (1972) TOMS Algorithm 419. Comm. ACM, 15, 9799). For example,

> polyroot(c(4,5,6))
[1] -0.4166667+0.7021791i -0.4166667-0.7021791i

Using the package PolynomF , the code is a bit more cumbersome

 > x = polynom() > (q = solve(4 + 5*x + 6*x^2)) # Solve ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Analyzing Baseball Data with R

Analyzing Baseball Data with R

Max Marchi, Jim Albert
A Course in Statistics with R

A Course in Statistics with R

Prabhanjan N. Tattar, Suresh Ramaiah, B. G. Manjunath

Publisher Resources

ISBN: 9781439884485