Git Product home page Git Product logo

prm's Introduction

prm

Find polynomial roots with multiplicities using mpmath.

The goal is to find the roots of a polynomial with arbitrary complex coefficients whose roots may be singular or multiple. This method (prm) starts two separate methods in parallel -- one method converges well when all roots are singular, and the second converges better than the first when there are multiple roots.

For polynomials with only singular roots, there are many algorithms that will find roots simultaneously with varying degrees of rate of convergence. This software (prm_sing) has options for WeierStrass-Durand-Kerner, Aberth-Ehrlich, Sakurai-Torii-Sugiura, and Sakurai-Petkovic, but using the test polynomials included (prm_test and polygen), seems to show that Sakurai-Torii-Sugiura (delta_sakurai) performed generally the best. This is the default for this method. It uses an algorithm found in Krishnan-Foskey-Culver-Keyser-Manocha (rootmax11) to generate initial root estimates.

For polynomials with multiple roots, the methods for singular roots converge much more slowly. The method here (prm_mult) uses the fact that, for multiplicities greater than one, the polynomial's derivative also has a root there. This second algorithm finds the roots of the derivative and checks them in the original polynomial. It is recursive, so all derivatives are checked. The roots of the derivative are then used as initial root estimates for the polynomial (as this seemed better than using rootmax11). The Aberth-Ehrlich (delta_aberth) method seems generally the best here, so it is the default.

If the first algorithm to finish is close enough, the second is stopped. Otherwise, the second is allowed to finish and the better solution is chosen.

Running prm.py will solve about 70 test polynomials and roots, multiplicities, iterations, execution times, figures of merit and method used. The software still has issues on some of the tests, but it generally seems to work OK.

prm's People

Contributors

raboehm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.