SecondOrder model
Requirements.Examples.Elementary.StepResponse.SecondOrder
ยท source
A 0.1 m step into a second-order system (D = 0.5, w = 5 rad/s): every metric against its closed form, every check against its verdict
Extends Modelica.Icons.Example
The textbook step response, y'' + 2 D w y' + w² y = w² r with r stepping 0.1 m at 1 s,
D = 0.5, w = 5 rad/s, under StepResponse
and one StepResponseCheck per
metric, the window closing 4 s after the step. Every metric is asserted against its closed form
(the overshoot exp(-D pi / sqrt(1 - D²)) = 16.30 %, the peak time
pi / (w sqrt(1 - D²)), the rise, delay and settling times by root finding on the analytic
solution, the damping ratio recovered from the log decrement, the decay ratio
exp(-2 pi D / sqrt(1 - D²))), and every check against its verdict and margin: the early
decisions (an overshoot bound broken at 1.52 s, a settling deadline missed, a level reached) and the
decisions at the close. The same closed-form numbers hold for an evaluation of the metrics on the stored
trajectory after the run.
Copyright © 2026 Model Based Innovation LLC. All rights reserved.
Components and variables
| Name | Type | Description |
|---|---|---|
step | Modelica.Blocks.Sources.Step | the reference |
sys | Modelica.Blocks.Continuous.SecondOrder | the response; the states' nominal values scale the solver's absolute tolerance to the 0.1 m step (the owner's call) |
metrics | Requirements.SignalAnalysis.StepResponse | the running metrics, the window closing 4 s after the step |
overshoot20 | Requirements.ChecksInFixedWindow.StepResponseCheck | the overshoot shall be at most 20 %, tolerance 1 %: satisfied at the close by 3.70 tolerances |
overshoot10 | Requirements.ChecksInFixedWindow.StepResponseCheck | at most 10 %: violated at the first sample the excursion exceeds 10 % (1.52 s) |
rise | Requirements.ChecksInFixedWindow.StepResponseCheck | the 10-90 % rise time shall be at most 0.5 s: satisfied at the 90 % crossing (1.43 s) |
delay | Requirements.ChecksInFixedWindow.StepResponseCheck | the delay time shall be at most 0.3 s: satisfied at the 50 % crossing (1.26 s) |
settle | Requirements.ChecksInFixedWindow.StepResponseCheck | settled to within 2 % within 2 s: satisfied at the close (the last exit at 1.615 s) |
settle1 | Requirements.ChecksInFixedWindow.StepResponseCheck | within 1 s: violated at the first sample after the deadline outside the band |
damping | Requirements.ChecksInFixedWindow.StepResponseCheck | the damping ratio shall be at least 0.4: 0.5 from the log decrement, satisfied at the close |
decay | Requirements.ChecksInFixedWindow.StepResponseCheck | the decay ratio shall be at most 0.25: 0.0266 |
error | Requirements.ChecksInFixedWindow.StepResponseCheck | the steady-state error 4 s after the step shall be at most 1 % |