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
Fthat's the function that represents the ODE system (X' = F(X))X0that's the initial conditionstithe initial timetfthe final timedtthe 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_FORWARDEULER_BACKWARDEULER_IMPROVEDEULER_IMPROVEDRUNGE_KUTTA_2RUNGE_KUTTA_3RUNGE_KUTTA_4RUNGE_KUTTA_FEHLBERG_45
For example, ode_integrator.solve(IntegrationMethod.EULER_FORWARD)
Examples in the file examples.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phyber_numint-0.1.0.tar.gz.
File metadata
- Download URL: phyber_numint-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a23000945516e0b684cc65af1a001e9c703a5a0fa590f0a4ae8e8c496226e872
|
|
| MD5 |
c6c2b9c3c6005527dbd1f67166a074ac
|
|
| BLAKE2b-256 |
09fdfd9d544285e3c88d2747d97efcb060599f61c328f65f9d94fc45cf29f2bb
|
File details
Details for the file phyber_numint-0.1.0-py3-none-any.whl.
File metadata
- Download URL: phyber_numint-0.1.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
594620c409deef8f244b5d840c70e555905e545677cff40f396c1e50beac6c50
|
|
| MD5 |
0e03d9a468c93d31f4dde53ac1cd86ba
|
|
| BLAKE2b-256 |
a4d6081eeff70a4bee721788d3a9b00e95800bc12a857ee7b2e73342ee4b6981
|