Skip to main content

bdsim: Block Diagram Simulation for Python

bdsim logo
A Pythonic block-diagram environment for the simulation and analysis of dynamic systems.

Block diagram thinking → Python coding

JupyterLite PyPI version Documentation

GitHub • Wiki • Changelog • Installation


Status & Project Health

Build Status Downloads Python Version Coverage Codacy Badge License: MIT

Ecosystem & Dependencies

A Python Robotics Package QUT Centre for Robotics Open Source

powered by NumPy powered by SciPy powered by Matplotlib Powered by Spatial Maths

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 bdsim aren't limited to scalars. Seamlessly pass NumPy arrays, dictionaries, or complex objects like SE3 and SO3 from the spatialmath-python library.
  • Modular & Extensible: Adding new functionality is straightforward. Create custom blocks by simply subclassing the Block class.
  • 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.

Metadata

Release files for bdsim 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bdsim 1.5.0
File Size Uploaded Provenance Actions
bdsim-1.5.0.tar.gz 916.2 kB With provenance Details for bdsim-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bdsim 1.5.0
File Interpreter ABI Platform Actions
bdsim-1.5.0-py3-none-any.whl Python 3 none any Details for bdsim-1.5.0-py3-none-any.whl

Total release size: 1.7 MB

Release files / bdsim-1.5.0.tar.gz

Download URL bdsim-1.5.0.tar.gz
Size 916.2 kB
Tags Source
SHA-256 checksum
How to use checksums
486c73cf3c9b1cd94571d702d1efddb703791a39801beacb5a32e09a40e95f39
BLAKE2b-256 checksum
How to use checksums
f3dec0741ec9eb183d8526c20e0b1753500a65f7a4c9df0b80cd606fb54cd158
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / bdsim-1.5.0-py3-none-any.whl

Download URL bdsim-1.5.0-py3-none-any.whl
Size 816.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abfd020d069f051ce88c79ec6b53985d377e4e4864bcc939c50b4c5fbc41d027
BLAKE2b-256 checksum
How to use checksums
e32f3bba9c1bfa584558cd335270cdbdff1ff7d1ca21400ddf807726f3c5b4a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for bdsim 1.5.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bdsim-1.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page