VBA polynomial functions update

Following several comments at an old post I have made updates to the Polynomial spreadsheet. The new files can be downloaded from:

Polynomial.zip

The changes are:

  • SolvePoly was amended to accept numbers or signed cell addresses in the input.
  • QuarticR, CubicR, QuadraticR and SolvePolyR functions were added, returning only the real roots.
  • SolvePoly was modified to return all real roots before the complex roots, and sort all real roots in ascending order in all cases.
  • The CubiCC was found to have been corrupted at some stage, and was returning incorrect results in some cases. It has been corrected and verified against the SolvePoly function and by checking the returned error values.
  • SolvePoly was modified to allow the first input argument to be either a single row or column range, with any remaining coefficients entered as single cells or values.
  • The Python polynomial functions have been moved to the pyNumpy module.

New functions returning real roots only:

Updated SolvePoly and SolvePolyR:

SolvePoly with an array as the first argument:

Also see Complex Numbers and Solving Quartic Polynomial Equations and Solving higher order polynomials.

For links to the latest Python polynomial functions see Calling Numpy polynomial functions from Excel.

This entry was posted in Excel, Link to Python, Maths, Newton, NumPy and SciPy, PyXLL, UDFs, VBA and tagged , , , , , , , . Bookmark the permalink.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.