PathSim
Open-source system simulation in pure Python.
PathSim is a pure-Python framework for modeling and simulating dynamical systems. Connect sources, integrators, functions, and scopes to build continuous-time, discrete-time, or hybrid systems as block diagrams. Built from first principles with custom solvers, an event system, and a modular block API. Minimal dependencies: numpy, scipy, matplotlib.
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, scp = Adder(), 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()
What sets it apart

PathSim is hot-swappable: blocks, parameters, and solvers can be modified during a running simulation. The solver suite spans more than thirty explicit and implicit integrators, adaptive and fixed-step, including stiff methods like BDF and ESDIRK. Hybrid systems are first-class: zero-crossing detection, scheduled events, and conditions put discrete events right next to continuous dynamics. Subsystems nest hierarchically, algebraic loops are handled robustly, and custom components are plain Python subclasses of Block.
PathSim is published in JOSS, adopted by JSBSim for flight dynamics, and used at the MIT Plasma Science and Fusion Center for nuclear fusion fuel-cycle modeling. Domain toolboxes cover chemical engineering, batteries, vehicles, flight dynamics, RF, and FMI co-simulation, several of them community-contributed.

Install with pip install pathsim or conda install conda-forge::pathsim. The documentation at docs.pathsim.org has tutorials, end-to-end examples, and the full API reference.
History
PathSim started in early 2023, at the beginning of my PhD, as an analog computer emulator side project. It grew into a full hybrid system simulation framework, went public on GitHub in August 2024, and was released in early 2025 as an open alternative to Simulink. Since then: a JOSS publication, roughly 400 GitHub stars, nine contributors, adoption by JSBSim and the MIT Plasma Science and Fusion Center, and community-contributed domain toolboxes. FastSim accelerates the same API as a drop-in Rust engine, and PathView edits PathSim models visually in the browser.