Skip to content

virtual-twin/tvbo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

48 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

TVBO logo

The Virtual Brain Ontology

Python package PyPI version PyPI - Downloads License

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).

๐Ÿš€ Installation

pip install tvbo

๐Ÿ“– Quick Start

Example: Lorenz Attractor Simulation

๐Ÿ“ 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()

๐Ÿ“š Documentation

๐Ÿ”ฌ Features

  • ๐Ÿง  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

๐Ÿ“ฆ Installation Options

Standard Installation

pip install tvbo

With API Server Support

pip install tvbo[api]

With TVB Integration

pip install tvbo[tvb]

Full Installation (All Features)

pip install tvbo[all]

Note: The knowledge extra requires manual installation:

pip install git+https://github.com/neurommsig/neurommsig-knowledge.git

๐Ÿ“„ License

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.

Packages

No packages published

Contributors 3

  •  
  •  
  •