bdsim: Block Diagram Simulation for Python
A Pythonic block-diagram environment for the simulation and analysis of dynamic systems.
Block diagram thinking → Python coding
GitHub • Wiki • Changelog • Installation
Status & Project Health
Ecosystem & Dependencies
Synopsis
bdsim bridges the gap between mathematical block diagrams and executable Python code. Unlike traditional graphical-only tools, it treats modelling as code, allowing you to define, simulate, and analyze continuous-time, discrete-time, or hybrid systems within a modern software engineering workflow. Wires in bdsim aren't limited to scalars; they pass NumPy arrays, dictionaries, or even SpatialMath objects seamlessly through your system, integrating directly with the Robotics and Machine Vision toolboxes.
🚀 Key Features
- Python-First Workflow: Define your systems in pure Python code. Use your preferred IDE (like VS Code), manage versions with Git, and integrate with standard unit-testing frameworks.
- Rich Data Types: Wires in
bdsimaren't limited to scalars. Seamlessly pass NumPy arrays, dictionaries, or complex objects likeSE3andSO3from thespatialmath-pythonlibrary. - Modular & Extensible: Adding new functionality is straightforward. Create custom blocks by simply subclassing the
Blockclass. - Hybrid Ecosystem: Native integration with the Robotics Toolbox and Machine Vision Toolbox for Python.
- Powerful Editor: Includes
bdedit, a PySide-based graphical editor for visual system design and discovery. - Publication Ready: Export diagrams or simulation data to to high-quality formats such as PDF or SVG for use in publications.
💻 Quick start
You can install bdsim directly from PyPI:
pip install bdsim
To include the graphical editor (bdedit) and its dependencies:
pip install bdsim[editor]
Install locally with help from the detailed installation guide.
Or skip setup and run the browser-based JupyterLite examples.
Example
The power of bdsim lies in its conciseness. The step response of a simple first-order system can be defined and simulated in just a few lines of code:
import bdsim
sim = bdsim.BDSim()
bd = sim.blockdiagram()
# Define blocks
step = bd.STEP(T=1, pos=1)
plant = bd.LTI_SISO(1, [1, 1]) # 1/(s+1)
scope = bd.SCOPE()
# Connect blocks
bd.connect(step, plant)
bd.connect(plant, scope)
bd.compile()
out = sim.run(bd, T=5)
🔍 Why bdsim?
In contrast to traditional graphical simulation tools, bdsim treats modelling as code. This ensures:
-
Better Version Control: No more opaque binary blobs. Your models are searchable, diffable text.
-
Seamless Integration: Incorporate SciPy solvers, PyTorch models, or custom robotic vision pipelines directly into your simulation loops.
-
Scalability: Programmatically generate massive block diagrams or run large-scale batch simulations on headless servers.
📚 Documentation
Full Documentation: https://petercorke.github.io/bdsim/
Wiki: Access the community wiki for deep dives into specific block behaviours and tutorials.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bdsim-1.3.0.tar.gz.
File metadata
- Download URL: bdsim-1.3.0.tar.gz
- Upload date:
- Size: 6.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b97c47576930dc98a77b0ddbd0476131e1957219a71098c4f0795aa327e8456
|
|
| MD5 |
5a8836c0f8b7158112acf2b408fb33bd
|
|
| BLAKE2b-256 |
265d8d8f1ddea76b71889c933c579cf80374fd16238fa5c2c932d3897db03cff
|
Provenance
The following attestation bundles were made for bdsim-1.3.0.tar.gz:
Publisher:
release.yml on petercorke/bdsim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bdsim-1.3.0.tar.gz -
Subject digest:
4b97c47576930dc98a77b0ddbd0476131e1957219a71098c4f0795aa327e8456 - Sigstore transparency entry: 2434279915
- Sigstore integration time:
-
Permalink:
petercorke/bdsim@bbb5c7770f9ea4f4a7d4e203a03c447d45a333ad -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/petercorke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bbb5c7770f9ea4f4a7d4e203a03c447d45a333ad -
Trigger Event:
release
-
Statement type:
File details
Details for the file bdsim-1.3.0-py3-none-any.whl.
File metadata
- Download URL: bdsim-1.3.0-py3-none-any.whl
- Upload date:
- Size: 616.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53814f6dc7448bc0cbb53aac27a9b6639fc18ed6d5038f00942d9be92238740d
|
|
| MD5 |
a82b36c5162165b1f98f0a1580b10278
|
|
| BLAKE2b-256 |
bff82a12fe9f23b8af626648069ca5ebca99c73edd7a2e36c046ee40134e4e19
|
Provenance
The following attestation bundles were made for bdsim-1.3.0-py3-none-any.whl:
Publisher:
release.yml on petercorke/bdsim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bdsim-1.3.0-py3-none-any.whl -
Subject digest:
53814f6dc7448bc0cbb53aac27a9b6639fc18ed6d5038f00942d9be92238740d - Sigstore transparency entry: 2434280157
- Sigstore integration time:
-
Permalink:
petercorke/bdsim@bbb5c7770f9ea4f4a7d4e203a03c447d45a333ad -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/petercorke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bbb5c7770f9ea4f4a7d4e203a03c447d45a333ad -
Trigger Event:
release
-
Statement type: