This example requires external dependencies and cannot be run in the browser.

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

Python
Loading...

FMU Path

Python
Loading...

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.

Python
Loading...

Display FMU metadata:

Python
Loading...

Simulation Setup

We use a high-order adaptive solver (RKDP54) for accurate nonlinear integration.

Python
Loading...

Results

Python
Loading...

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.

Python
Loading...
Python
Loading...

Key Features

  • Seamless integration of nonlinear dynamics
  • Adaptive timestepping for varying dynamics
  • Parameter sweep capabilities
  • Handles moderately stiff systems