Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fgittins/muller
Python implementation of Muller's method for root finding.
https://github.com/fgittins/muller
Last synced: about 2 months ago
JSON representation
Python implementation of Muller's method for root finding.
- Host: GitHub
- URL: https://github.com/fgittins/muller
- Owner: fgittins
- License: mit
- Created: 2023-09-30T14:52:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-07T12:35:54.000Z (about 1 year ago)
- Last Synced: 2023-11-07T13:34:56.693Z (about 1 year ago)
- Language: Python
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# muller
Python implementation of Muller's method for root finding.## Usage
`muller` has no dependencies.Here is a quick example to show how it is used. First, import the root finder
```
from muller import muller
```
We will look for a root of
$$f(x) = e^{-x} \sin(x).$$
This has zeros at $x = n \pi$ with $n$ an integer.We will look for the root at $x = 0$. We need three initial guesses for the root and will use $x = -1, 0, 1$. So,
```
from math import exp, sindef f(x): return exp(-x)*sin(x)
xguesses = (-1, 0, 1)
```
To search for the root, we type
```
res = muller(f, xguesses)
```
We may examine the `res` object. The most useful attribute is `res.root`, which contains the estimate of the root.## Testing
To test, run
```
python -m unittest tests.test
```
in the root directory.