Vekta
Small NumPy-based toolkit for numerical simulation work: grids, finite differences, a 2D Laplace (steady-state heat) solver, Fourier series, and ODE integrators. Vekta only computes: it returns arrays and contains no plotting or animation code, so results can go to Matplotlib, Manim, PyQt6, or anything else.
Status: early development (0.x). The API may change between releases.
Installation
Not yet published on PyPI. From a local clone:
python -m pip install -e .
Requires Python 3.11 or later. The only dependency is NumPy.
Functions
| Function | Module | Purpose |
|---|---|---|
remap |
core |
Linearly map values from one range to another |
make_grid |
grid |
Uniform 2D grid ([i, j] indexing: i along x, j along y) |
laplacian |
fd |
5-point finite-difference Laplacian of a 2D field |
solve_plate_laplace |
laplace |
Steady-state 2D heat (Laplace) solution, red-black SOR |
fourier_series |
fourier |
Coefficients and evaluator for a periodic function |
euler, rk4 |
ode |
Fixed-step ODE integrators (1st and 4th order) |
rk45 |
ode |
Adaptive Dormand-Prince integrator |
Quick start
Steady-state temperature on a plate. The edge values of the initial field are the fixed boundary temperatures:
import numpy as np
import vekta
x_grid, y_grid, dx, dy = vekta.make_grid((0, 1), (0, 1), (101, 101))
field = np.zeros(x_grid.shape)
field[-1, :] = 90.0 # right edge held at 90
temperature, iterations, residual = vekta.solve_plate_laplace(field, dx, dy)
ODE integration, using derivative(t, state):
import numpy as np
import vekta
def decay(t, state):
return -state
times, states = vekta.rk4(decay, np.array([1.0]), 0.0, 5.0, step_size=0.01)
times, states = vekta.rk45(decay, np.array([1.0]), 0.0, 5.0) # adaptive, uneven times
Fourier series of a periodic function:
import numpy as np
import vekta
square_wave = lambda x: np.sign(np.sin(x))
mean_value, cosine_coeffs, sine_coeffs, evaluate = vekta.fourier_series(
square_wave, period=2 * np.pi, num_terms=15)
approximation = evaluate(np.linspace(0, 2 * np.pi, 400))
Notes
fourier_seriesneeds a vectorised function and a known period.rk45returns unevenly spaced times; interpolate them if you need animation frames.laplacianreturns zero on the boundary points.
Development
python -m pip install -e .
src/vekta/ library source
tests/ automated tests
examples/ usage scripts
License
MIT. See LICENSE.
Metadata
Release files for vekta 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vekta-0.1.0.tar.gz | 8.6 kB | Without provenance | Details for vekta-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vekta-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for vekta-0.1.0-py3-none-any.whl |
Total release size: 16.4 kB
Release files / vekta-0.1.0.tar.gz
| Download URL | vekta-0.1.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8556ccbaf48472d04303e40165d29b1fe9cc89c4c0c348fc7c5c4866a8c826ec
|
|
BLAKE2b-256 checksum How to use checksums |
0f3cdac48115fb918476e29efea473a2f3ac59dd320ad6f4670fb810c3d79e0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / vekta-0.1.0-py3-none-any.whl
| Download URL | vekta-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b639e2a0489d7b7ce67fddb4366440e7ac76c04c043634f81c5956903a04266
|
|
BLAKE2b-256 checksum How to use checksums |
0a03e2217b38582bbdd67a4e467dff14013a82988b12f0a8f320cbf57736998f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for vekta 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.