This release is a pre-release and may not be stable for production use.
PhysioModeler
PhysioModeler is an educational tool for modelling and simulating physiological systems described by ordinary differential equations (ODEs). It is built for physiological models, but works for a wide range of ODE models.
The interface aims to be explicit and easy to read. You describe a model by its state components, the functions that say how the state changes, and its parameters and inputs. PhysioModeler solves it with SciPy and returns the result as a pandas DataFrame.
Installation
With uv:
uv add physiomodeler
Or with pip:
pip install physiomodeler
PhysioModeler requires Python 3.12 or newer.
Example: an undamped pendulum
A pendulum is described by its angle theta and angular velocity dtheta. The dynamics
function receives the current state and returns how the state changes: the angular
acceleration ddtheta.
import math
from physiomodeler import Model
def pendulum(state, inputs, parameters):
gravity = inputs["gravity"]
length = parameters["length"]
return {"ddtheta": -gravity / length * math.sin(state["theta"])}
pendulum_model = Model(
pendulum,
name="pendulum",
state_components=["theta", "dtheta"], # rad, rad/s
parameters={"length": 1.0}, # m
inputs={"gravity": 9.81}, # m/s²
)
result = pendulum_model.run_simulation(time=10, initial_state={"theta": 1.0})
result.plot(y=["theta", "dtheta"])
Parameters and inputs are part of the model, so comparing scenarios only takes a change in the arguments, for example the same pendulum on the Moon:
on_the_moon = pendulum_model.run_simulation(
time=10,
initial_state={"theta": 1.0},
inputs={"gravity": 1.625},
)
Features
- Combine several dynamics functions, or nest models within other models.
- Inputs that are constant or change over time.
- Events, for example to detect when a state crosses a value or to stop a simulation.
- Post-analysis functions that add calculated values to the result.
- Run many simulations at once, or run a model until it reaches equilibrium.
Documentation
The full documentation, with more examples, is at https://psomhorst.github.io/physiomodeler/.
See the changelog for what changed between versions.
License
PhysioModeler is released under the MIT License.
Metadata
Release files for physiomodeler 2.0.0rc1
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 |
|---|---|---|---|---|
| physiomodeler-2.0.0rc1.tar.gz | 1.2 MB | Without provenance | Details for physiomodeler-2.0.0rc1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| physiomodeler-2.0.0rc1-py3-none-any.whl | Python 3 | none | any | Details for physiomodeler-2.0.0rc1-py3-none-any.whl |
Total release size: 1.7 MB
Release files / physiomodeler-2.0.0rc1.tar.gz
| Download URL | physiomodeler-2.0.0rc1.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3003069f66c707ab815ab0dee0c73a6c0482f7b4cc2f0c88b69f4ffeab1f9d41
|
|
BLAKE2b-256 checksum How to use checksums |
f1e3d78de5dc509c3d6ed87483d2744bcb777bcaad490ab4a0f8fd2ff693965f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / physiomodeler-2.0.0rc1-py3-none-any.whl
| Download URL | physiomodeler-2.0.0rc1-py3-none-any.whl |
|---|---|
| Size | 534.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9475bd8f742975e4d4b4f51a70f9a64edb1a89e7db1702da04a75a7d92493e66
|
|
BLAKE2b-256 checksum How to use checksums |
da1a65d9cd5e3bfdf9516f9332237e8547983a72e7c6ac8a688d3447ff8c048c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for physiomodeler 2.0.0rc1
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.