PathSim

A flexible block-based time-domain system simulation framework in Python with automatic differentiation capabilities and event handling!

PathSim provides a variety of classes that enable modeling and simulating complex interconnected dynamical systems through intuitive Python scripting.

Minimal dependencies: only numpy, scipy and matplotlib!


Key Features

🔄 Hot-Swappable

Switch blocks and solvers during simulation for flexible experimentation and analysis.

🎯 MIMO Capable

Blocks are inherently Multiple Input, Multiple Output capable for complex systems.

🔢 Numerical Integrators

Wide range of solvers: implicit, explicit, high-order, and adaptive time-stepping.

🏗️ Modular & Hierarchical

Build complex systems with nested subsystems (Subsystem, example).

⚡ Event Handling

Detect and resolve discrete events with zero-crossing detection (example).

🎓 Auto Differentiation

Fully differentiable system simulations for optimization and analysis (example).

🔧 Extensible

Subclass the base Block class and implement just a handful of methods.

📖 Open Source

MIT licensed on GitHub - star to support development!

Quickstart

Get started with PathSim in three simple steps:

1️⃣ Install

Install PathSim with pip:

pip install pathsim
2️⃣ Build

Create a system using blocks and connections

3️⃣ Run

Execute the simulation and visualize results


Example: Integrating a Cosine

Here’s a simple interactive example that demonstrates PathSim basics. Click to view the full notebook with live code execution:

🚀 Quickstart Example

Interactive notebook demonstrating basic PathSim usage - integrating a cosine function to produce a sine wave.

_images/sin_cos_blockdiagram_g.png
Quickstart

Explore the Documentation

📚 Examples

Explore practical examples demonstrating PathSim’s capabilities, from simple oscillators to complex hybrid systems with event handling and automatic differentiation.

Examples
📖 API Reference

Complete API documentation for all PathSim classes, methods, and modules.

API Reference
🛣️ Roadmap

See what’s planned for future releases and contribute your ideas.

Roadmap
🤝 Contributing

Learn how to contribute to PathSim development and join the community.

Contributing
🔍 Index

Alphabetical index of all functions, classes, and terms.

Index