Python toolbox to obtain reduced model expressions using time-scale separation, conservation laws, sensitivity analysis, and projection-based interfaces to established reduction libraries.
AutoReduce is a Python package for automated model reduction of nonlinear dynamical systems. It provides tools for:
- Automated model reduction using QSSA (Quasi-Steady State Approximation)
- Conservation-law based reductions
- Local sensitivity analysis
- SBML import/export through python-libsbml
- Integration with BioCRNPyler for synthetic biology models
- Optional python-control and PyDMD interfaces
See the bioRxiv paper and International Journal of Robust and Nonlinear Control paper for the model-reduction background.
import numpy as np
from sympy import symbols
from autoreduce import System, solve_timescale_separation
S, C, P, k1, k2, k3, E_total = symbols("S C P k1 k2 k3 E_total")
E = E_total - C
x = [S, C, P]
f = [
-k1 * E * S + k2 * C,
k1 * E * S - (k2 + k3) * C,
k3 * C,
]
system = System(
x,
f,
params_dict={k1: 1.0, k2: 0.5, k3: 0.25, E_total: 1.0},
x_init=[10.0, 0.0, 0.0],
C=np.array([[1, 0, 0], [0, 0, 1]]),
)
reduced_system, collapsed_system = solve_timescale_separation(
system,
[S, P],
fast_states=[C],
)params_dict can be used to set, get, and update parameters:
system.set_param(k1, 2.0)
system.get_param(k1)
system.set_param_dict({k2: 1.0, k3: 0.1})For more examples, check out the documentation.
Supported Python versions are 3.9 - 3.13.
Install the latest version of AutoReduce:
pip install autoreduceInstall with all optional dependencies:
pip install autoreduce[all]Install optional integrations explicitly:
pip install "autoreduce[bio]"
pip install "autoreduce[control]"
pip install "autoreduce[dmd]"For development installation:
git clone https://github.com/ayush9pandey/autoreduce.git
cd autoreduce
pip install -e ".[dev]"Full documentation is available at autoreduce.readthedocs.io.
We welcome contributions. Developer notes and release instructions are in the documentation.
For questions, feedback, or suggestions, please contact:
- Ayush Pandey (ayushpandey at ucmerced dot edu)
- GitHub Issues
Released under the BSD 3-Clause License (see LICENSE)
