Overview
Solverz is an open-source python-based simulation modelling language that provides symbolic interfaces for you to model your equations and can then generate functions or numba-jitted python modules for numerical solutions.
Solverz supports three types of abstract equation types, that are
- Algebraic Equations (AEs) $0=F(y,p)$
- Finite Difference Algebraic Equations (FDAEs) $0=F(y,p,y_0)$
- Differential Algebraic Equations (DAEs) $M\dot{y}=F(t,y,p)$
where $p$ is the parameter set of your models, $y_0$ is the previous time node value of $y$.
Say, we want to know how long it will take for an apple, launched from the ground into the air, to fall back to the ground. We have the differential equations
$$ \begin{aligned} &v'=-9.8\ &h'=v \end{aligned} $$
with $v(0)=20$ and $h(0)=0$, we can just type the codes
import matplotlib.pyplot as plt
import numpy as np
from Solverz import Model, Var, Ode, Opt, made_numerical, Rodas
# Declare a simulation model
m = Model()
# Declare variables and equations
m.h = Var('h', 0)
m.v = Var('v', 20)
m.f1 = Ode('f1', f=m.v, diff_var=m.h)
m.f2 = Ode('f2', f=-9.8, diff_var=m.v)
# Create the symbolic equation instance and the variable combination
bball, y0 = m.create_instance()
# Transform symbolic equations to python numerical functions.
nbball = made_numerical(bball, y0, sparse=True)
# Define events, that is, if the apple hits the ground then the simulation will cease.
def events(t, y):
value = np.array([y[0]])
isterminal = np.array([1])
direction = np.array([-1])
return value, isterminal, direction
# Solve the DAE
sol = Rodas(nbball,
np.linspace(0, 30, 100),
y0,
Opt(event=events))
# Visualize
plt.plot(sol.T, sol.Y['h'][:, 0])
plt.xlabel('Time/s')
plt.ylabel('h/m')
plt.show()
Then we have
The model is solved with the stiffly accurate Rosenbrock type method, but you can also write your own solvers by the generated numerical interfaces since, for example, the Newton-Raphson solver implememtation for AEs is as simple as below.
@ae_io_parser
def nr_method(eqn: nAE,
y: np.ndarray,
opt: Opt = None):
if opt is None:
opt = Opt(ite_tol=1e-8)
tol = opt.ite_tol
p = eqn.p
df = eqn.F(y, p)
ite = 0
# main loop
while max(abs(df)) > tol:
ite = ite + 1
y = y - solve(eqn.J(y, p), df)
df = eqn.F(y, p)
if ite >= 100:
print(f"Cannot converge within 100 iterations. Deviation: {max(abs(df))}!")
break
return aesol(y, ite)
The implementation of the NR solver just resembles the formulae you read in any numerical analysis book. This is because the numerical AE object eqn provides the $F(t,y,p)$ interface and its Jacobian $J(t,y,p)$, which is derived by symbolic differentiation.
Sometimes you have very complex models and you dont want to re-derive them everytime. With Solverz, you can just use
from Solverz import module_printer
pyprinter = module_printer(bball,
y0,
'bounceball',
jit=True)
pyprinter.render()
to generate an independent python module of your simulation models. You can import them to your .py file by
from bounceball import mdl as nbball, y as y0
Installation
Solverz requires python>=3.10, and can be installed locally with
pip install Solverz
Useful Resources
Cite Solverz
In Chinese
[1] 俞睿智,顾伟,陆帅,张苏涵,徐一骏.面向综合能源系统的开源高性能仿真建模工具开发[J/OL].中国电机工程学报,1-12[2025-05-29]. https://doi.org/10.13334/j.0258-8013.pcsee.242788.
In English
[1] R. Yu, W. Gu, S. Lu, S. Zhang, and Y. Xu, "Development of an Open-Source High-Performance Simulation Modeling Tool for Integrated Energy Systems," Proceedings of the CSEE, May 2025, Advance online publication, doi: 10.13334/j.0258-8013.pcsee.242788.
Metadata
Release files for Solverz 0.8.1
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 |
|---|---|---|---|---|
| solverz-0.8.1.tar.gz | 663.0 kB | With provenance | Details for solverz-0.8.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| solverz-0.8.1-py3-none-any.whl | Python 3 | none | any | Details for solverz-0.8.1-py3-none-any.whl |
Total release size: 818.4 kB
Release files / solverz-0.8.1.tar.gz
| Download URL | solverz-0.8.1.tar.gz |
|---|---|
| Size | 663.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba01eb0b2a7ea116f379aa5d7113be2f2e9a10330090fb10b8bda3dec39c6310
|
|
BLAKE2b-256 checksum How to use checksums |
f1f84b3e78fd06f1f74d9de15c0907892217c0d9e410ebf32b455cebacb54326
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.
Transparency logRelease files / solverz-0.8.1-py3-none-any.whl
| Download URL | solverz-0.8.1-py3-none-any.whl |
|---|---|
| Size | 155.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e7086ae8efa4e3318a482f4a9c8a56d775f668e921ed2c13054a85b5a5d13be
|
|
BLAKE2b-256 checksum How to use checksums |
1745067f624e9c997add33728b4a5bc641a2d0d8b0150e464d41970334a6df16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.
Transparency logSecurity for Solverz 0.8.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for solverz-0.8.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.
Transparency logA 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.