SecondOrder model

Requirements.Examples.Elementary.StepResponse.SecondOrder  ยท source

Icon of SecondOrder

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

NameTypeDescription
stepModelica.Blocks.Sources.Stepthe reference
sysModelica.Blocks.Continuous.SecondOrderthe response; the states' nominal values scale the solver's absolute tolerance to the 0.1 m step (the owner's call)
metricsRequirements.SignalAnalysis.StepResponsethe running metrics, the window closing 4 s after the step
overshoot20Requirements.ChecksInFixedWindow.StepResponseCheckthe overshoot shall be at most 20 %, tolerance 1 %: satisfied at the close by 3.70 tolerances
overshoot10Requirements.ChecksInFixedWindow.StepResponseCheckat most 10 %: violated at the first sample the excursion exceeds 10 % (1.52 s)
riseRequirements.ChecksInFixedWindow.StepResponseCheckthe 10-90 % rise time shall be at most 0.5 s: satisfied at the 90 % crossing (1.43 s)
delayRequirements.ChecksInFixedWindow.StepResponseCheckthe delay time shall be at most 0.3 s: satisfied at the 50 % crossing (1.26 s)
settleRequirements.ChecksInFixedWindow.StepResponseChecksettled to within 2 % within 2 s: satisfied at the close (the last exit at 1.615 s)
settle1Requirements.ChecksInFixedWindow.StepResponseCheckwithin 1 s: violated at the first sample after the deadline outside the band
dampingRequirements.ChecksInFixedWindow.StepResponseCheckthe damping ratio shall be at least 0.4: 0.5 from the log decrement, satisfied at the close
decayRequirements.ChecksInFixedWindow.StepResponseCheckthe decay ratio shall be at most 0.25: 0.0266
errorRequirements.ChecksInFixedWindow.StepResponseCheckthe steady-state error 4 s after the step shall be at most 1 %