Skip to main content

A differentiable block based hybrid system simulation framework.

Project description

PathSim Logo

A block-based time-domain system simulation framework in Python

DOI PySimHub PyPI Conda License Release Downloads Coverage

HomepageDocumentationPathView EditorSponsor


PathSim lets you model and simulate complex dynamical systems using an intuitive block diagram approach. Connect sources, integrators, functions, and scopes to build continuous-time, discrete-time, or hybrid systems.

Minimal dependencies: just numpy, scipy, and matplotlib.

Features

  • Hot-swappable — modify blocks and solvers during simulation
  • Stiff solvers — implicit methods (BDF, ESDIRK) for challenging systems
  • Event handling — zero-crossing detection for hybrid systems
  • Hierarchical — nest subsystems for modular designs
  • Extensible — subclass Block to create custom components

Install

pip install pathsim

or with conda:

conda install conda-forge::pathsim

Quick Example

from pathsim import Simulation, Connection
from pathsim.blocks import Integrator, Amplifier, Adder, Scope

# Damped harmonic oscillator: x'' + 0.5x' + 2x = 0
int_v = Integrator(5)       # velocity, v0=5
int_x = Integrator(2)       # position, x0=2
amp_c = Amplifier(-0.5)     # damping
amp_k = Amplifier(-2)       # spring
add = Adder()
scp = Scope()

sim = Simulation(
    blocks=[int_v, int_x, amp_c, amp_k, add, scp],
    connections=[
        Connection(int_v, int_x, amp_c),
        Connection(int_x, amp_k, scp),
        Connection(amp_c, add),
        Connection(amp_k, add[1]),
        Connection(add, int_v),
    ],
    dt=0.05
)

sim.run(30)
scp.plot()

PathView

PathView is the graphical editor for PathSim — design systems visually and export to Python.

Learn More

Citation

If you use PathSim in research, please cite:

@article{Rother2025,
  author = {Rother, Milan},
  title = {PathSim - A System Simulation Framework},
  journal = {Journal of Open Source Software},
  year = {2025},
  volume = {10},
  number = {109},
  pages = {8158},
  doi = {10.21105/joss.08158}
}

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pathsim-0.16.8.tar.gz (7.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pathsim-0.16.8-py3-none-any.whl (184.3 kB view details)

Uploaded Python 3

File details

Details for the file pathsim-0.16.8.tar.gz.

File metadata

  • Download URL: pathsim-0.16.8.tar.gz
  • Upload date:
  • Size: 7.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pathsim-0.16.8.tar.gz
Algorithm Hash digest
SHA256 c2ed67a61312fa7c0fcead6f2f468e2d5594c50ec7fee5fae2eff45a0c3beff1
MD5 3d4f6d3b6ef47676284a4b7992027df3
BLAKE2b-256 b8c005736eca9fa2e4e10bf0f3504b6e71b4ba1b238006047ef7e65b432e1be5

See more details on using hashes here.

File details

Details for the file pathsim-0.16.8-py3-none-any.whl.

File metadata

  • Download URL: pathsim-0.16.8-py3-none-any.whl
  • Upload date:
  • Size: 184.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pathsim-0.16.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b63a2a952f1dab720509e1c8a23bfa7346a9e02f89fe45a3adc7b88070c5a6d4
MD5 f5777bce6d865e90a436d5370b6ecc41
BLAKE2b-256 796f0ac34d1eb00758cffefd56c0acd096e85367b2b232fdb169beb7bed8f091

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page