tvbo is a Python library to access the knowledge representation system (i.e., ontology) and data model for the neuroinformatics platform The Virtual Brain (TVB).
pip install tvbo๐ Model Specification (YAML)
name: LorenzAttractor
parameters:
sigma:
value: 10
label: Prandtl number
rho:
label: Rayleigh number
value: 28
beta:
value: 2.6666666666666665
state_variables:
X:
equation:
lhs: \dot{X}
rhs: sigma * (Y - X)
Y:
equation:
lhs: \dot{Y}
rhs: X * (rho - Z) - Y
Z:
equation:
lhs: \dot{Z}
rhs: X * Y - beta * Z๐ง Generate Code
from tvbo import Dynamics, SimulationExperiment
lorenz = Dynamics(
parameters={
"sigma": {"value": 10.0},
"rho": {"value": 28.0},
"beta": {"value": 8 / 3},
},
state_variables={
"X": {"equation": {"rhs": "sigma * (Y - X)"}},
"Y": {"equation": {"rhs": "X * (rho - Z) - Y"}},
"Z": {"equation": {"rhs": "X * Y - beta * Z"}},
},
)
code = SimulationExperiment(local_dynamics=lorenz).render_code('jax')
print(code)โถ๏ธ Run Simulation
from tvbo import Dynamics, SimulationExperiment
lorenz = Dynamics(
parameters={
"sigma": {"value": 10.0},
"rho": {"value": 28.0},
"beta": {"value": 8 / 3},
},
state_variables={
"X": {"equation": {"rhs": "sigma * (Y - X)"}},
"Y": {"equation": {"rhs": "X * (rho - Z) - Y"}},
"Z": {"equation": {"rhs": "X * Y - beta * Z"}},
},
)
# Run simulation and plot results
SimulationExperiment(local_dynamics=lorenz).run(duration=1000).plot()- Full Documentation
- Model Browser - Browse models, parameters, and equations
- Metadata Schema - Explore the TVB-O data model
- ๐ง Access TVB ontology and knowledge base
- ๐ Define and simulate dynamical systems
- ๐ Code generation for multiple backends (JAX, NumPy)
- ๐ Built-in visualization tools
- ๐๏ธ Structured metadata schema
pip install tvbopip install tvbo[api]pip install tvbo[tvb]pip install tvbo[all]Note: The
knowledgeextra requires manual installation:pip install git+https://github.com/neurommsig/neurommsig-knowledge.git
Copyright ยฉ 2025 Charitรฉ Universitรคtsmedizin Berlin. This software is licensed under the terms of the European Union Public Licence (EUPL) version 1.2 or later.