Analysis

BodePlot Block

Performs frequency response sweeps and calculates Gain/Phase margins.

Open BodePlot in BlockWerk →

Description

The Bode Plot block performs a frequency response analysis of a linear system. It generates two simultaneous plots:

1. Magnitude (dB) vs Frequency (rad/s): Shows the gain of the system across a range of frequencies. 2. Phase (degrees) vs Frequency (rad/s): Shows the phase shift of the output relative to the input.

This block is essential for analyzing system stability, bandwidth, and resonance characteristics in the frequency domain. It performs an automated frequency sweep by injecting a sinusoidal signal at varying frequencies into the system and measuring the steady-state response.

Mathematical Model

A linear time-invariant (LTI) system $G(s)$ responds to a sinusoidal input $u(t) = A \sin(\omega t)$ with a sinusoidal output $y(t) = A' \sin(\omega t + \phi)$ in steady state.

The sweep scans from $\omega_{start}$ to $\omega_{end}$ logarithmicly, calculating points based on $Points Per Decade$.

Parameters

Input Source ID (inputSource)

The ID of a source block (typically a SignalGenerator) that provides the excitation signal.

Start Frequency (startFreq)

The lower bound of the frequency sweep.

End Frequency (endFreq)

The upper bound of the frequency sweep.

Points per Decade (pointsPerDecade)

Resolution of the frequency sweep. Higher values provide smoother plots but take longer to compute.

Examples

1-pole Low-Pass Filter

System: $G(s) = \frac{1}{s + 1}$. The Bode plot shows a -3dB cutoff at 1 rad/s and a magnitude slope of -20dB/decade at higher frequencies.

Second-Order Resonant System

System: $G(s) = \frac{\omega_n^2}{s^2 + 2\zeta\omega_ns + \omega_n^2}$. The Bode plot shows a peak (resonance) near $\omega_n$ if the damping ratio $\zeta < 0.707$.

Remarks

See Also