XY Plot
SinksThe XYPlot block displays the parametric relationship between two real-time scalar signals ( and ) in a phase-plane coordinate frame. Unlike time-domain scopes where the horizontal axis represents simulation time, the XYPlot maps the first input directly to the horizontal axis and the second input to the vertical axis. It features an animated fading trail of configurable length, providing immediate visual insight into limit cycles, chaotic attractors, orbital trajectories, state-space portraits, and hysteresis loops.
Mathematical Model
The block samples the continuous or discrete input pair at each simulation time step :
The active visual trajectory is maintained in a FIFO sliding queue of length (trailLength):
When , the queue retains the complete trajectory from simulation start without discarding points.
When autoScale = true, the coordinate viewport bounds expand dynamically to encompass the active trail:
When autoScale = false, the viewport is rigidly locked to .
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | x |
X | number | Required |
| → In | y |
Y | number | Required |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
autoScale |
Auto Scale Axes | boolean | true |
|
xMin |
X Min | number | -1 |
|
xMax |
X Max | number | 1 |
|
yMin |
Y Min | number | -1 |
|
yMax |
Y Max | number | 1 |
|
showGrid |
Show Grid | boolean | true |
|
pointColor |
Point Color | string | #f97316 |
|
trailLength |
Max Points (0 = keep all) | number | 0 |
Usage Examples
Example 1: Van der Pol Nonlinear Oscillator Phase Portrait and Limit Cycle
Visualizing the state-space orbit of a Van der Pol relaxation oscillator . Routing state to the port and velocity to the port with trailLength = 500 and autoScale = true. As simulation time advances, trajectories starting from different initial conditions visibly converge onto the characteristic closed limit cycle.
Example 2: Controller Error vs. Actuator Control Effort Phase Plane
Connecting tracking error to the input and control effort to the input with autoScale = true. This visualizes controller gain slope, actuator saturation thresholds, and switching chattering in real time.
Remarks & Best Practices
- Pure Phase-Plane Formulation: The horizontal axis strictly represents signal , never simulation time . For time-series waveforms, use
uPlotDisplay. - Sliding-Window Memory Efficiency: Setting a finite
trailLength(e.g. to points) ensures bounded memory consumption and fast rendering during long continuous simulation runs. - Two Independent Scalar Inputs: Accepts two independent scalar wires on separate and ports; vector signals should be demuxed before connection.
- Sink Probe Architecture: Terminal sink block that reads values directly from simulation buffers without creating algebraic loops or altering system dynamics.
Related Components
- ScatterPlot: Accumulates static point-cloud datasets for statistical correlation analysis.
- uPlotDisplay: Multi-channel time-series oscilloscope with rolling and expanding windows.
- NumericDisplay: Real-time LCD digital scalar value readout.
- StateSpace: Continuous dynamic system often analyzed via phase-plane trajectories.