Numerical integrators using Numba
Project description
Numba Integrators
Numba Integrators is collection numerical integrators based on the ones in SciPy. Aim is to make them faster and much more compatible with Numba.
Table of Contents
Quick start guide
Here's how you can start numerically
The first steps
Installing
Install Numba Integrators with pip
pip install numba_integrators
Importing
Import name is the same as install name, numba_integrators
.
import numba_integrators
Example
import numba as nb
import numba_integrators as ni
import numpy as np
@nb.njit(nb.float64[:](nb.float64, nb.float64[:]))
def f(t, y):
'''Differential equation for sine wave'''
return np.array((y[1], -y[0]))
y0 = np.array((0., 1.))
solver = ni.RK45(f, 0.0, y0,
t_bound = 1, atol = 1e-8, rtol = 1e-8)
t = []
y = []
while ni.step(solver):
t.append(solver.t)
y.append(solver.y)
print(t)
print(y)
Changelog
0.1.2 2023-08-06
- Fixes
0.1.1 2023-08-05
- Initial working version
0.0.3 2023-05-14
- Inital working state
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
Built Distribution
Close
Hashes for numba_integrators-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19f775679a342152e5146a414f4a7adc100a5c7f3379c66adfe896d3b8acc423 |
|
MD5 | 84c67ba8631948ced881b149e06197dc |
|
BLAKE2b-256 | b8885336b3d9ed1c2f6e2eb0057aa123f285757e46304475c4a66537642aca53 |