FMU ME: Van der Pol
This example demonstrates Model Exchange FMU integration with a nonlinear oscillator. The Van der Pol equation exhibits self-sustained oscillations:
MATHDISPLAY0ENDMATH
where MATHINLINE3ENDMATH controls nonlinearity. As a first-order system:
MATHDISPLAY1ENDMATH MATHDISPLAY2ENDMATH
You can also find the FMU integration tests in the GitHub repository.
This example demonstrates the ModelExchangeFMU block with purely continuous-time dynamics (no events), showcasing PathSim's adaptive integration for nonlinear systems.
Import and Setup
FMU Path
System Definition
We simulate with MATHINLINE0ENDMATH for clear nonlinear oscillations:
The ModelExchangeFMU exposes states $(x_0, x_1)$ and provides derivatives to PathSim's solvers.
Display FMU metadata:
Simulation Setup
We use a high-order adaptive solver (RKDP54) for accurate nonlinear integration.
Results
Relaxation Oscillations
For very large MATHINLINE0ENDMATH, the system exhibits relaxation oscillations with extreme stiffness. We use MATHINLINE1ENDMATH to demonstrate PathSim's capability with severe stiffness:
Stiff systems require implicit solvers with large stability regions. We use ESDIRK43, a 4th-order implicit solver designed for stiff problems.
Key Features
- Seamless integration of nonlinear dynamics
- Adaptive timestepping for varying dynamics
- Parameter sweep capabilities
- Handles moderately stiff systems