Skip to main content

A Python implementation of Muller's method.

Project description

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

You can install mullerpy in one of the following ways:

From source (locally)

Clone the repository and install using pip:

git clone https://github.com/fgittins/mullerpy.git
cd mullerpy
pip install .

Directly from GitHub

Or you can install directly from GitHub:

pip install git+https://github.com/fgittins/mullerpy.git

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mullerpy-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mullerpy-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file mullerpy-0.1.0.tar.gz.

File metadata

  • Download URL: mullerpy-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for mullerpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2702ee269f848f43f1e4d111c86bc2da6d0d08da376b012a3062ce54462a185c
MD5 9e64d4cf161966fe71117067cb5cb5f9
BLAKE2b-256 e5432f51e5efc268c8d6ee07aa7b166e2c023340e4a1561abc5c0af8b2bcf546

See more details on using hashes here.

File details

Details for the file mullerpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mullerpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for mullerpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cf6dfedac976a60d1dfd2e476fae720cba80d628f9eab1130851936e4e17a98
MD5 09147f733735916bb078751413fe59bb
BLAKE2b-256 8f5325683b077b74728507e00ca1709e2bfe0fa4b34d21c380806b19ebb4ec6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page