ƒ

Bode Plot

Analysis
Run the live example Free · no sign-up · runs in your browser

The BodePlot block performs automated frequency response analysis of linear dynamic systems. By sweeping a sinusoidal excitation signal across a specified frequency spectrum and evaluating steady-state output amplitude and phase shift, it generates magnitude (decibels) and phase (degrees) plots against logarithmic frequency (radians per second).

This block is an essential tool for evaluating closed-loop stability margins, verifying system bandwidth, identifying resonance peaks, and designing frequency-domain compensators such as lead-lag networks and notch filters.

Mathematical Model

G(jω)=Y(jω)U(jω)=∣G(jω)∣ejϕ(ω)G(j\omega) = \frac{Y(j\omega)}{U(j\omega)} = |G(j\omega)| e^{j \phi(\omega)}

Magnitude in decibels and phase angle in degrees are computed as:

∣G(jω)∣dB=20log⁡10∣G(jω)∣,ϕ(ω)=atan2⁡(Im⁡{G(jω)},Re⁡{G(jω)})⋅180∘π|G(j\omega)|_{\text{dB}} = 20 \log_{10} |G(j\omega)|, \quad \phi(\omega) = \operatorname{atan2}\left(\operatorname{Im}\{G(j\omega)\}, \operatorname{Re}\{G(j\omega)\}\right) \cdot \frac{180^\circ}{\pi}

Frequency evaluation points are logarithmically distributed between ωstart\omega_{\text{start}} and ωend\omega_{\text{end}}:

ωk=ωstart⋅10kNdec,k∈{0,1,…,K}\omega_k = \omega_{\text{start}} \cdot 10^{\frac{k}{N_{\text{dec}}}}, \quad k \in \{0, 1, \dots, K\}

Inputs & Outputs

Direction ID Label Type Status
→ In in1 Input number Required
← Out out Result number Output

Parameters

Parameters Label Type Default Description
inputSource Input Source ID text sine1
startFreq Start Frequency (rad/s) number 0.1
endFreq End Frequency (rad/s) number 100
pointsPerDecade Points Per Decade number 10

Usage Examples

Example 1: First-Order Low-Pass Filter

Analyzing the transfer function G(s)=1s+1G(s) = \frac{1}{s + 1} reveals a flat 0 dB low-frequency gain, a −3 dB-3\text{ dB} cutoff frequency at 1 rad/s1\text{ rad/s}, and a high-frequency roll-off rate of −20 dB/decade-20\text{ dB/decade} with a −90∘-90^\circ asymptotic phase lag.

Example 2: Second-Order Resonant System

Analyzing a resonant plant G(s)=ωn2s2+2ζωns+ωn2G(s) = \frac{\omega_n^2}{s^2 + 2\zeta\omega_n s + \omega_n^2} with ζ=0.2\zeta = 0.2 displays a pronounced resonant amplification peak near ωn\omega_n and a rapid −180∘-180^\circ phase transition across the resonance band.

Remarks & Best Practices

  • Steady-state settling: The sweep engine waits for system transient responses to decay at each test frequency before measuring magnitude and phase angles.
  • Linearity assumption: Frequency response sweeps assume linear, time-invariant (LTI) dynamics; nonlinear elements such as saturation or backlash will cause amplitude-dependent distortion.
  • Bandwidth selection: Configure the frequency sweep interval to span at least one decade below the lowest system pole and one decade above the expected unity-gain crossover.
  • Stability margins: Gain margin (GmG_m) and phase margin (PmP_m) are determined directly from the unity-gain (0 dB0\text{ dB}) and −180∘-180^\circ phase crossover points.

Frequently Asked Questions (FAQ)

Q: What are safe gain and phase margins for robust industrial feedback systems?

Industrial rule of thumb specifies a Gain Margin GM≥6 dBGM \ge 6\text{ dB} (gain factor ≥2\ge 2) and Phase Margin PM∈[30∘,60∘]PM \in [30^\circ, 60^\circ] (ideally ∼45∘\sim 45^\circ). Phase margins below 30∘30^\circ yield underdamped, resonant responses with high overshoot, while margins above 65∘65^\circ yield sluggish transient responses.

Related Components

  • Online Bode Plot Generator: Type a transfer function and get its magnitude, phase and stability margins instantly.
  • Online PID Tuner: Tune a PID loop interactively and read its Bode stability margins in the browser.
  • NyquistPlot: Visualizes frequency response trajectories in the complex plane to evaluate the Nyquist stability criterion.
  • TransferFunction: Implements continuous-time Laplace domain transfer functions for linear plant models.
  • SignalGenerator: Generates sinusoidal and swept excitation waveforms for system identification.