Skip to main content

Vekta logo

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

python -m pip install vekta

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_series needs a vectorised function and a known period.
  • rk45 returns unevenly spaced times; interpolate them if you need animation frames.
  • laplacian returns 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vekta 0.1.1
File Size Uploaded Provenance Actions
vekta-0.1.1.tar.gz 8.6 kB Without provenance Details for vekta-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vekta 0.1.1
File Interpreter ABI Platform Actions
vekta-0.1.1-py3-none-any.whl Python 3 none any Details for vekta-0.1.1-py3-none-any.whl

Total release size: 16.4 kB

Release files / vekta-0.1.1.tar.gz

Download URL vekta-0.1.1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
87208baaff7c339c6e0744727c3440437d02abce2b519523cc95441afe66cd00
BLAKE2b-256 checksum
How to use checksums
2c61d7e800d3685f60564cfe6e4967661f1c9dd3eddfca9f276d523e5576e54b
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.1-py3-none-any.whl

Download URL vekta-0.1.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dcaa418d1fb93b31efe53e3390f23f1edf5e05a82c07274e176c3423bc6a85f
BLAKE2b-256 checksum
How to use checksums
2da13ebb59fe17365f392c9d5fcc9ab46e1f4d439ae64180553103d1cf724627
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.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page