voles
Collocation-method solvers for Volterra integral and integro-differential equations (VIEs/VIDEs), based on:
Brunner H. Collocation Methods for Volterra Integral and Related Functional Differential Equations. Cambridge University Press; 2004.
Solvers
Two families of solvers are provided. The array-based family is the fastest path when the kernel and forcing are already sampled on a uniform grid; the callable-input family accepts callables, supports arbitrary meshes, and handles weakly singular kernels.
| Equation | Array-based | Callable-input |
|---|---|---|
| \(g(t) = \int_0^t K(t-s)y(s)ds\) | solve_VIE_1 |
function_solve_VIE_1 |
| \(y(t) = g(t) + \int_0^t K(t-s)y(s)ds\) | solve_VIE_2 |
function_solve_VIE_2 |
| \(y'(t) = a(t)y(t) + g(t) + \int_0^t K(t-s)y(s)ds\) | solve_VIDE |
function_solve_VIDE |
The callable-input solvers also expose optimal_graded_mesh(alpha, T, M,
order) for building a Brunner-graded mesh suitable for kernels
with a \(u^{-\alpha}\) singularity.
Installation
pip install voles[full]
This gives you the fully-capable package, so everything just works out of the box. Pre-built wheels are provided for Linux x86_64, macOS arm64 (Apple Silicon), and Windows x64. The D extension is bundled in the wheel and requires no extra tooling. Intel Macs are no longer supported as of 0.3.2; users can pin to volterra-equation-solvers==0.3.1 or build from source (see CONTRIBUTING.md).
Requirements: Python ≥ 3.10, numpy, scipy
If you have trouble installing a dependency, you can use a slimmer install instead. numba and scipy are only needed for some features (see below), so any of these will still give you a working package:
pip install voles # core: numpy + scipy (no numba)
pip install voles --no-deps && pip install numpy # leanest: numpy only, no scipy or numba
What the optional pieces buy you:
- scipy (core dependency) — required for the callable-input function_solve_* family.
- numba (added by [full]) — only needed for the array-based solvers when using non-standard collocation settings not compiled into the D extension.
To build from source (e.g. on an unsupported platform), see CONTRIBUTING.md.
Mathematical derivations
The docs/ directory contains worked derivations of the analytic solutions used in the test suite:
| File | Contents |
|---|---|
scalar_solutions.pdf |
Derivations for all six scalar test cases (VIE-1, VIE-2, VIDE) |
coupled_vector_solutions.pdf |
Derivations for the coupled 2×2 vector test cases, constructed via a similarity transform |
LaTeX source files are provided alongside the PDFs.
Quick example
import numpy as np
from voles import solve_VIE_2
# y(t) = sin(t) satisfies this VIE-2
time_step = 0.05
times = np.arange(0, 9.05, time_step)
kernel = np.exp(-times)
g = np.sin(times) - 0.5 * (np.exp(-times) + np.sin(times) - np.cos(times))
soln = solve_VIE_2(kernel_values=kernel, g_values=g, time_step=time_step)