Skip to main content

A simple package to perform numerical integration easily

Project description

Phyber NumInt

A numerical integrator for solving ODE systems

A simple package to solving ODE with different algorithms, written as explicitly as possible. I created this for a University course.

To use it you simply create an instance of the class ODEIntegrator

It takes the following parameters

  • F that's the function that represents the ODE system (X' = F(X))
  • X0 that's the initial conditions
  • ti the initial time
  • tf the final time
  • dt the time step

The function F should be structured in the following fashion

def F_lorenz(t, X, sigma, beta, rho):
    '''
        x' = sigma(y - x)
        y' = x(rho - z) - y
        z' = x*y - beta*z
    '''
    x, y, z = X
    dxdt = sigma * (y - x)
    dydt = x * (rho - z) - y
    dzdt = x * y - beta * z
    return (dxdt, dydt, dzdt)

Then, the method solve of ODEIntegrator can be called with the method argument. The method argument is an enum member of IntegrationMethods. The following exist

  • EULER_FORWARD
  • EULER_BACKWARD
  • EULER_IMPROVED
  • EULER_IMPROVED
  • RUNGE_KUTTA_2
  • RUNGE_KUTTA_3
  • RUNGE_KUTTA_4
  • RUNGE_KUTTA_FEHLBERG_45

For example, ode_integrator.solve(IntegrationMethod.EULER_FORWARD)

Examples in the file examples.py

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

phyber_numint-0.1.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

phyber_numint-0.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: phyber_numint-0.1.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for phyber_numint-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4048fdcdbf1e7772cd7735142fcc5d2b5458c9766249b07653bb171c22d5b7da
MD5 48357efa560d3630d49908c3c7a04d97
BLAKE2b-256 41d2bc1028c7f6a14eed8b20e1cceb971bd46eae9cf6f85a22ab18ad697da566

See more details on using hashes here.

File details

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

File metadata

  • Download URL: phyber_numint-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for phyber_numint-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab8161f43ced0926829b6246698992e7e08044f04d1bc92d85e49f6d61e8d783
MD5 13a0cb9f5f050067ff4b1e0f82dea28c
BLAKE2b-256 71de9a46c847f2f3a48061c4188d8347aa6c60a7ec8384be4c41260a045dc91f

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