ƒ

2nd Order System

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

The SecondOrderSystem block implements a standard second-order continuous-time linear dynamic system. Parameterized intuitively by natural frequency (ωn\omega_n), damping ratio (ζ\zeta) or quality factor (QQ), and DC gain (KK), it models canonical damped oscillatory phenomena across engineering domains—including mechanical mass-spring-damper vibratory assemblies, RLC resonant electrical circuits, pneumatic actuator balances, and vehicle suspensions. The Property Editor features a live Transfer Function Insights dashboard that displays the Step Response (including DC gain, percent overshoot, and 2% settling time), Bode Plot, and Pole-Zero Map in real time as you adjust ωn\omega_n, ζ\zeta, or QQ.

Mathematical Model

In the Laplace domain (ss), the continuous transfer function relating input U(s)U(s) to output Y(s)Y(s) is:

G(s)=Y(s)U(s)=Kωn2s2+2ζωns+ωn2G(s) = \frac{Y(s)}{U(s)} = \frac{K \omega_n^2}{s^2 + 2\zeta\omega_n s + \omega_n^2}

where KK represents DC gain, ωn\omega_n is the undamped naturalFrequency, and ζ\zeta is the dampingRatio.

When parameterized via the quality factor QQ (qFactor), the damping relationship is:

Q=12ζ  ⟺  ζ=12QQ = \frac{1}{2\zeta} \iff \zeta = \frac{1}{2Q}

The system poles are the roots of the characteristic polynomial s2+2ζωns+ωn2=0s^2 + 2\zeta\omega_n s + \omega_n^2 = 0:

s1,2=−ζωn±ωnζ2−1s_{1,2} = -\zeta\omega_n \pm \omega_n\sqrt{\zeta^2 - 1}
  • Underdamped (0≤ζ<10 \le \zeta < 1): Complex conjugate poles s1,2=−ζωn±jωds_{1,2} = -\zeta\omega_n \pm j\omega_d, where ωd=ωn1−ζ2\omega_d = \omega_n\sqrt{1-\zeta^2} is the damped natural frequency. Transient response oscillates with percentage overshoot Mp=100⋅exp⁡(−πζ/1−ζ2)%M_p = 100 \cdot \exp(-\pi\zeta/\sqrt{1-\zeta^2})\%.
  • Critically Damped (ζ=1\zeta = 1): Repeated real pole at s=−ωns = -\omega_n. Fastest monotonic settling without oscillatory overshoot.
  • Overdamped (ζ>1\zeta > 1): Two distinct negative real poles. System response is non-oscillatory and sluggish, dominated by the slower pole.

In controllable canonical state-space form with continuous state vector x=[y,y˙]T\mathbf{x} = [y, \dot{y}]^T:

[x˙1x˙2]=[01−ωn2−2ζωn][x1x2]+[0Kωn2]u,y=x1\begin{bmatrix} \dot{x}_1 \\ \dot{x}_2 \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ -\omega_n^2 & -2\zeta\omega_n \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} + \begin{bmatrix} 0 \\ K\omega_n^2 \end{bmatrix} u, \quad y = x_1

with initial conditions x(0)=[y(0),y˙(0)]T\mathbf{x}(0) = [y(0), \dot{y}(0)]^T configured via initialCondition.

Inputs & Outputs

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

Parameters

Parameters Label Type Default Description
gain Gain (K) number 1 DC Gain of the system
naturalFrequency Frequency number 10 Undamped natural frequency
frequencyUnit Frequency Unit select rad/s
parameterMode Damping Parameter select dampingRatio
dampingRatio Damping Ratio ζ number 0.7 Damping ratio: ζ < 1 underdamped, ζ = 1 critically damped, ζ > 1 overdamped
qFactor Q-Factor number 0.707 Quality factor Q = 1 / (2ζ)
initialCondition Initial Condition [y, dy] vector 0,0

Usage Examples

Example 1: Quarter-Car Automotive Suspension Modeling

Modeling the vertical dynamics of a passenger vehicle wheel assembly over a road step bump. Setting naturalFrequency = 1.2 with frequencyUnit = "Hz" (ωn≈7.54 rad/s\omega_n \approx 7.54\text{ rad/s}), dampingRatio = 0.35 (underdamped shock absorber), and gain = 1.0. A unit step road displacement excites an initial bounce of approximately 31%31\% overshoot before decaying smoothly within 1.5 seconds1.5\text{ seconds}.

Example 2: Precision Galvanometer Mirror Positioning

Synthesizing a laser galvanometer beam steering positioner requiring maximum speed without overshoot. Configuring naturalFrequency = 500.0 rad/s and dampingRatio = 1.0 (critically damped) with initialCondition = "0,0". The mirror reaches 99%99\% of target setpoint in ts≈4.75/ωn≈9.5 mst_s \approx 4.75 / \omega_n \approx 9.5\text{ ms} with zero transient overshoot, preventing optical mechanical ringing.

Remarks & Best Practices

  • Live Step Response, Bode & Pole-Zero Dashboard: Dragging the naturalFrequency, dampingRatio, or qFactor sliders in the Property Editor updates the step response curve, overshoot readout, Bode magnitude/phase, and ss-plane conjugate pole markers instantaneously.
  • Key Analytical Transient Metrics:

- Peak time: tp=πωn1−ζ2t_p = \frac{\pi}{\omega_n \sqrt{1 - \zeta^2}}

- Settling time (2%2\% criterion): ts≈4ζωnt_s \approx \frac{4}{\zeta \omega_n}

- Peak overshoot percentage: Mp=100⋅exp⁡(−πζ1−ζ2)%M_p = 100 \cdot \exp\left(-\frac{\pi\zeta}{\sqrt{1 - \zeta^2}}\right)\%

  • Automatic Frequency Unit Conversion: Selecting Hz automatically multiplies the input frequency by 2π2\pi before assembling internal ODE matrices, eliminating manual conversion errors.
  • Continuous Two-State Integration: Implemented as two continuous dynamic ODE states in the WASM engine, integrating accurately across explicit Runge-Kutta (RK4, RK45) and implicit stiff TR-BDF2 solvers.
  • Free Vibration Decay: The initialCondition vector allows modeling natural unforced decay from initial physical offsets (y(0)≠0y(0) \ne 0) or impact momentum (y˙(0)≠0\dot{y}(0) \ne 0) with zero input force (u=0u = 0).

Frequently Asked Questions (FAQ)

Q: What damping ratio ζ produces fastest settling time without excessive overshoot?

A damping ratio ζ≈0.707\zeta \approx 0.707 (1/21/\sqrt{2}, Butterworth characteristic) provides the optimal trade-off: approximately 4.3%4.3\% overshoot, rapid rise time, and minimum settling time for a 2%2\% or 5%5\% error tolerance band. Critical damping (ζ=1.0\zeta = 1.0) eliminates overshoot entirely at the cost of a slightly slower rise time.

Related Components

  • TransferFunction: General continuous-time transfer function in polynomial fraction form B(s)/A(s)B(s)/A(s).
  • Integrator: Continuous 1/s1/s single-state accumulator.
  • LeadLag: First-order dynamic phase lead/lag compensator.
  • StateSpace: Multi-input multi-output state-space continuous plant model x˙=Ax+Bu\dot{\mathbf{x}} = \mathbf{A}\mathbf{x} + \mathbf{B}\mathbf{u}.