Skip to main content

A Python implementation of Muller's method.

Project description

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

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.1.tar.gz (838.7 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.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mullerpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4b763b6f27d5c6b644ead47ef4e6d80b593ffb136d13bfdb08e74bd56796ae70
MD5 3c63dd08bda1461b25e18b2b02f3cb2e
BLAKE2b-256 efd8308e4509d64eaef53981e65a4abe1352c179f643852e3b29f4b86d8e334b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mullerpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0834f46ac636b8a363229434233ce6c758d8a647b7402ad618f867de5df11a2
MD5 108f316090ed7ed1416d0fceb638ce07
BLAKE2b-256 26b8f0f359309f80e6b2f59da6b5921657cfcd8869f7c4690ed3ed2bce689c11

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