StepResponse block

Requirements.SignalAnalysis.StepResponse  ยท source

Icon of StepResponse

Running step-response metrics of u after a step of r, sampled: the peak, the level crossings, the last exit from the settling band, the extrema

Syntax

metrics = StepResponse(u=..., r=..., target=..., samplePeriod=...);

Description

The running metrics of the step response of u after a step of r, evaluated at every samplePeriod: a step is a change of r between two samples of at least threshold (any change with the default 0); its window runs to the next step of r, or closes T_window after it when that is set; the target yInf is r after the step (target = Stepping) or the current value of the yRef input (Reference); y0 is u at the sample before the step, deltaY = yInf - y0 the base of every percent, and the excursion e = s (u - yInf) is oriented by the sign of the change -- for a disturbance (the response starts and ends at the target, its change below a quarter of its largest deviation) by the side of that deviation, so overshoot is the peak deviation.

Outputs: overshoot and undershoot with tPeak; the level crossings tLevel1, tLevel2, tHalf interpolated between the two samples around them, and from them riseTime (a lower bound -- the time since the lower level -- until the upper level is reached) and delayTime; settlingTime the last exit from the band around the target so far (the time since the step while outside, the interpolated re-entry once inside); error the current deviation from the target (the steady-state error when the window closes); the extrema beyond the target, counted from the first reach of the target, each a maximal segment of one sign beyond peakFraction of the base, closed when the other side is entered or the window closes (nExtrema, a1, a2, a3); zeta the damping ratio from the log decrement 2 ln(a1/a2), from the overshoot alone when only one extremum has closed, or 1 (monotone); decayRatio = a3/a1.

The metrics are sampled: an instant is known to one samplePeriod, a peak read low by the curvature over one period; a requirement that needs the full resolution of the result is evaluated on the stored trajectory after the run instead, and this block then serves as its cross-check. StepResponseCheck turns one of its metrics into a Property. The post-processing target the response's final value has no running form and is not offered here.

Example

Examples.Elementary.StepResponse: the second-order system's closed forms asserted against the block's outputs.

Parameters

NameTypeDescription
target parameterStepTargetThe target the metrics measure u against: the stepping signal after the step, or the yRef input
threshold parameterRealA step is a change of r between two samples of at least this (0: any change)
samplePeriod parameterSI.TimeThe metrics are evaluated at this period (at the half-periods, off a result grid of the same period); a level crossing is interpolated between two samples
level1 parameterRealLower level of the rise time, a fraction of the change
level2 parameterRealUpper level of the rise time, a fraction of the change
band parameterRealSettling band around the target: a fraction of the change (bandIsFraction) or an absolute value
bandIsFraction parameterBoolean= true: band is a fraction of |deltaY|; false: in u's unit
T_window parameterSI.Time0: a step's window runs to the next step of r; > 0: it closes T_window after the step
peakFraction parameterRealAn extremum beyond the target counts when its amplitude exceeds this fraction of the base (|deltaY|, or the largest deviation)

Components and variables

NameTypeDescription
uModelica.Blocks.Interfaces.RealInputThe response
rModelica.Blocks.Interfaces.RealInputThe stepping signal (the setpoint or the disturbance)
yRefModelica.Blocks.Interfaces.RealInputThe reference the response is measured against (target = Reference)
activeModelica.Blocks.Interfaces.BooleanOutput= true while a step's window is open
closedModelica.Blocks.Interfaces.BooleanOutput= true at the sample that closes a window (the next step, or T_window after the step)
nStepsModelica.Blocks.Interfaces.IntegerOutputNumber of steps seen so far
tStepModelica.Blocks.Interfaces.RealOutputInstant of the last step (-1 before the first)
y0Modelica.Blocks.Interfaces.RealOutputThe response before the step
yInfModelica.Blocks.Interfaces.RealOutputThe target
deltaYModelica.Blocks.Interfaces.RealOutputThe change yInf - y0, the base of every percent
overshootModelica.Blocks.Interfaces.RealOutputThe largest excursion beyond the target in the direction of the change, in u's unit (never negative)
undershootModelica.Blocks.Interfaces.RealOutputThe largest excursion opposite to the change, beyond y0, in u's unit
tPeakModelica.Blocks.Interfaces.RealOutputInstant of the overshoot
tLevel1Modelica.Blocks.Interfaces.RealOutputInstant the lower level is first reached (-1 until then)
tLevel2Modelica.Blocks.Interfaces.RealOutputInstant the upper level is first reached (-1 until then)
tHalfModelica.Blocks.Interfaces.RealOutputInstant half the change is first reached (-1 until then)
riseTimeModelica.Blocks.Interfaces.RealOutputThe rise time: tLevel2 - tLevel1 once both are reached, else the time since tLevel1 (or the step) so far -- a lower bound
delayTimeModelica.Blocks.Interfaces.RealOutputThe delay time: tHalf - tStep once reached, else the time since the step so far
settlingTimeModelica.Blocks.Interfaces.RealOutputThe last exit from the settling band so far, relative to the step (the time since the step while outside)
inBandModelica.Blocks.Interfaces.BooleanOutput= true while |u - yInf| <= the band
errorModelica.Blocks.Interfaces.RealOutput|u - yInf| now: the steady-state error when the window closes
nExtremaModelica.Blocks.Interfaces.IntegerOutputExtrema beyond the target closed so far (alternating in sign)
a1Modelica.Blocks.Interfaces.RealOutputAmplitude of the first extremum (0 until it closes)
a2Modelica.Blocks.Interfaces.RealOutputAmplitude of the second extremum
a3Modelica.Blocks.Interfaces.RealOutputAmplitude of the third extremum
zetaModelica.Blocks.Interfaces.RealOutputThe damping ratio: from the log decrement of a1 and a2, from the overshoot alone, or 1 (monotone); provisional until the window closes
decayRatioModelica.Blocks.Interfaces.RealOutputa3 / a1 (0 until a third extremum closes)
openAmplitudeModelica.Blocks.Interfaces.RealOutputAmplitude of the extremum segment still open (0: none) -- the last extremum when the window closes at a step
openSignModelica.Blocks.Interfaces.IntegerOutputSign of the open segment (0: none)
noBaseModelica.Blocks.Interfaces.BooleanOutput= true when the response's change over the step is below a quarter of its largest deviation (a disturbance): no base for a percent