Skip to content

fgittins/mullerpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mullerpy logo

PyPI version

mullerpy

A Python implementation of Muller's method.


Usage

This library requires no dependencies beyond the Python standard library.

Here is a quick example to show how it is used:

from mullerpy import muller
from math import exp, sin

def f(x):
    return exp(-x) * sin(x)

xguesses = (-1, 0, 1)
res = muller(f, xguesses)

print(res.root)

This finds a root of the function

$$ f(x) = e^{-x} \sin(x), $$

which has roots at $x = n \pi$ for integer $n$. The result object has a .root attribute storing the estimated solution.

Installation

It is easy to install mullerpy with pip:

pip install mullerpy

Testing

To test, run

python -m unittest tests.test_muller

in the root directory. I like to use pytest, where you can simply enter

pytest

About

A Python implementation of Muller's method.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages