Skip to main content
Version: 0.2.1

Synapsys

Modern Python control systems framework with distributed multi-agent simulation.

PyPI version Python License: MIT

Synapsys is designed as a MATLAB-compatible alternative for control engineers who want:

  • A clean Python API that mirrors MATLAB/Simulink syntax
  • Distributed simulation — plant and controller running as independent processes
  • Ultra-low latency communication via shared memory (zero-copy) or ZeroMQ
  • A solid LTI core that scales from simple PID loops to multi-agent CPS architectures

Overview

Synapsys covers the full control-design workflow — from continuous-time LTI modelling to discrete real-time closed-loop simulation — with a consistent API across all stages.

from synapsys.api import tf, ss, step, bode, feedback, c2d

# Transfer function — same syntax as MATLAB
G = tf([1], [1, 2, 1]) # G(s) = 1 / (s² + 2s + 1)

# Block algebra
T = feedback(G) # T = G / (1 + G)
t, y = step(T) # step response
w, mag, ph = bode(G) # Bode diagram

# ZOH discretisation at 20 Hz
Gd = c2d(G, dt=0.05)
print(Gd.is_stable()) # True

Why Synapsys? (Developer Experience)

Beyond the robust multi-agent architecture for SIL/HIL simulations, Synapsys is built to provide an incredible Developer Experience (DX) for control engineers:

  • Zero Learning Curve (MATLAB Mirror): The synapsys.api layer provides functions like tf(), ss(), step(), and bode(). It allows engineers to bring legacy scripts to open-source Python with almost zero friction, avoiding the complex object-oriented overhead of SciPy.
  • Natural Block Algebra: Overloaded operators allow composing LTI systems exactly as they look in textbooks without invoking complex matrix concatenations manually:
    • Series (Cascade): G_total = G1 * G2
    • Parallel: G_total = G1 + G2
    • Closed-loop: T = (C * G).feedback()
  • Continuous vs. Discrete Abstraction: You don't need to manually switch between differential ODE solvers and difference equations. Setting dt > 0 on any object automatically changes behavior across all underlying .bode(), .step(), and is_stable() calls.
  • Zero Callback Hell: Integrating distributed network agents usually forces complicated async/await wrappers or .on_message() callbacks. Synapsys's ControllerAgent relies on synchronous, deterministic functions, hiding the FIPA ACL communication overhead under a clean procedural layer.
  • Strict Type Hinting: Built for Modern Python 3.10+, rigorous typing enables rich IDE IntelliSense (VSCode/PyCharm), catching structural array dimension issues before they execute.

Installation

pip install synapsys

Or with uv:

uv add synapsys

Project Status

Pre-Alpha

Synapsys is under active development. The API may change between versions.

ModuleStatus
synapsys.core — LTI, StateSpace, TransferFunctionStable
synapsys.algorithms — PID, LQRStable
synapsys.broker — MessageBroker, Topic, SharedMemoryBackend, ZMQBrokerBackendStable
synapsys.agents — PlantAgent, ControllerAgent, HardwareAgentFunctional
synapsys.transport — SharedMemory, ZMQ (low-level)Functional
synapsys.api — MATLAB-compat layerStable
synapsys.hw — Hardware abstractionInterface only
MPC, adaptive controlPlanned
Graphical block editorPlanned