Examples

Here we show a range of examples utilizing PathSim to simulate different dynamical systems and how to implement them step by step, starting from the system definition.

There is an even more comprehensive collection of example dynamical system simulations availabe in the GitHub repository.

Note

Examples are available as interactive Jupyter notebooks that can be downloaded and executed directly.


Fundamental Systems

Basic examples demonstrating core PathSim concepts with linear and nonlinear systems.

📐 Linear Feedback

First-order linear feedback system demonstrating basic block connections and simulation setup.

Linear Feedback System
🌊 Harmonic Oscillator

Damped spring-mass-damper system with second-order dynamics and exponential decay.

Harmonic Oscillator
🔗 Coupled Oscillators

Two spring-coupled spring-mass-damper systems with second-order dynamics.

Coupled Oscillators
⚙️ Pendulum

Nonlinear mathematical pendulum demonstrating the sine nonlinearity and oscillatory behavior.

Pendulum
🌀 Van der Pol Oscillator

Self-oscillating system with nonlinear damping, demonstrating limit cycle behavior.

Van der Pol
🦋 Lorenz Attractor

Chaotic system demonstrating sensitive dependence on initial conditions and strange attractors.

Lorenz Attractor

Event-Driven Systems

Hybrid dynamical systems with discrete events and zero-crossing detection.

⚽ Bouncing Ball

Classic hybrid system with zero-crossing events for bounce detection and velocity reversal.

Bouncing Ball
🎯 Bouncing Pendulum

Nonlinear pendulum with ground collisions, featuring automatic differentiation through events.

Bouncing Pendulum
🔀 Switched Bouncing Ball

Advanced event handling with multiple events, conditional logic, and dynamic event switching.

Switched Bouncing Ball
🌡️ Thermostat

Temperature control system with hysteresis and on-off switching events.

Thermostat
🔧 Stick-Slip Friction

Friction model with stick-slip transitions demonstrating state-dependent switching.

Stick Slip

Control Systems

Feedback control examples including PID controllers, multi-domain systems, and automotive control.

🎛️ PID Controller

Classical PID feedback control of a linear plant.

PID Controller
🔗 Cascade Controller

Two-loop cascade control architecture with nested PID controllers and subsystems.

Cascade Controller
⚡ DC Motor Control

Multi-domain DC motor modeling with anti-windup PID speed control and load rejection.

DC Motor Speed Control
🚗 ABS Braking

Anti-lock braking system with Pacejka tire model and slip ratio control.

Anti-lock Braking System (ABS)

Signal Processing & Communications

Examples demonstrating frequency domain analysis, filters, and signal processing systems.

📡 FMCW Radar

Frequency-modulated continuous-wave radar system with mixing and frequency analysis.

FMCW Radar
📊 Spectrum Analysis

Frequency domain analysis using the Spectrum block to recover filter frequency responses.

Spectrum Analysis
🔄 Transfer Function

Linear system representation using poles and residues with complex conjugate dynamics.

Transfer Function
📢 Noisy Amplifier

Nonlinar noisy amplifier model as a subsystem with spectral sensitivities

Noisy Amplifier
🎯 Kalman Filter

Optimal state estimation from noisy measurements using the Kalman filter algorithm

Kalman Filter

Electronics & Circuit Systems

Analog and mixed-signal circuit simulations including ADCs, nonlinear components and RF networks.

💡 Diode Circuit

Nonlinear diode characteristics with implicit solver for stiff circuit dynamics.

Diode Circuit
📈 Delta-Sigma ADC

Oversampling analog-to-digital converter with noise shaping and quantization.

Delta-Sigma ADC
🔢 SAR ADC

Successive approximation register ADC with binary search and comparator logic.

SAR ADC
📡 RF Network

RF network with spectrum analysis. Enabled by Scikit-rf integration.

RF Network - One Port

Advanced Topics

Complex systems featuring algebraic loops, subsystems, chemical processes, automatic differentiation, and FMU co-simulation.

🔁 Algebraic Loop

Implicit system with algebraic constraints requiring iterative solvers.

Algebraic Loop
🧪 Chemical Reactor

Chemical reaction kinetics with temperature-dependent rates and nonlinear dynamics.

Chemical Reactor
📦 Nested Subsystems

Hierarchical modeling with nested subsystems for modular system design.

Sensitivity analysis and uncertainty quantification using forward-mode automatic differentiation.

Nested Subsystems
🔌 FMU Co-Simulation

Integration of Functional Mock-up Units (FMU) as PathSim blocks using FMI standard.

FMU Co-Simulation
💫 Lorenz Poincaré Maps

Using PathSim’s event system to create Poincaré maps of the chaotic Lorenz attractor.

Poincaré Maps