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.
First-order linear feedback system demonstrating basic block connections and simulation setup.
Damped spring-mass-damper system with second-order dynamics and exponential decay.
Two spring-coupled spring-mass-damper systems with second-order dynamics.
Nonlinear mathematical pendulum demonstrating the sine nonlinearity and oscillatory behavior.
Self-oscillating system with nonlinear damping, demonstrating limit cycle behavior.
Chaotic system demonstrating sensitive dependence on initial conditions and strange attractors.
Event-Driven Systems¶
Hybrid dynamical systems with discrete events and zero-crossing detection.
Classic hybrid system with zero-crossing events for bounce detection and velocity reversal.
Nonlinear pendulum with ground collisions, featuring automatic differentiation through events.
Advanced event handling with multiple events, conditional logic, and dynamic event switching.
Temperature control system with hysteresis and on-off switching events.
Friction model with stick-slip transitions demonstrating state-dependent switching.
Control Systems¶
Feedback control examples including PID controllers, multi-domain systems, and automotive control.
Classical PID feedback control of a linear plant.
Two-loop cascade control architecture with nested PID controllers and subsystems.
Multi-domain DC motor modeling with anti-windup PID speed control and load rejection.
Anti-lock braking system with Pacejka tire model and slip ratio control.
Signal Processing & Communications¶
Examples demonstrating frequency domain analysis, filters, and signal processing systems.
Frequency-modulated continuous-wave radar system with mixing and frequency analysis.
Frequency domain analysis using the Spectrum block to recover filter frequency responses.
Linear system representation using poles and residues with complex conjugate dynamics.
Nonlinar noisy amplifier model as a subsystem with spectral sensitivities
Optimal state estimation from noisy measurements using the Kalman filter algorithm
Electronics & Circuit Systems¶
Analog and mixed-signal circuit simulations including ADCs, nonlinear components and RF networks.
Nonlinear diode characteristics with implicit solver for stiff circuit dynamics.
Oversampling analog-to-digital converter with noise shaping and quantization.
Successive approximation register ADC with binary search and comparator logic.
RF network with spectrum analysis. Enabled by Scikit-rf integration.
Advanced Topics¶
Complex systems featuring algebraic loops, subsystems, chemical processes, automatic differentiation, and FMU co-simulation.
Implicit system with algebraic constraints requiring iterative solvers.
Chemical reaction kinetics with temperature-dependent rates and nonlinear dynamics.
Hierarchical modeling with nested subsystems for modular system design.
Sensitivity analysis and uncertainty quantification using forward-mode automatic differentiation.
Integration of Functional Mock-up Units (FMU) as PathSim blocks using FMI co-simulation.
Model Exchange FMU with hybrid dynamics and state event detection.
Model Exchange FMU with nonlinear oscillations and stiff dynamics.
Using PathSim’s event system to create Poincaré maps of the chaotic Lorenz attractor.