StepResponse block
Requirements.SignalAnalysis.StepResponse
ยท source
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
| Name | Type | Description |
|---|---|---|
target parameter | StepTarget | The target the metrics measure u against: the stepping signal after the step, or the yRef input |
threshold parameter | Real | A step is a change of r between two samples of at least this (0: any change) |
samplePeriod parameter | SI.Time | The 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 parameter | Real | Lower level of the rise time, a fraction of the change |
level2 parameter | Real | Upper level of the rise time, a fraction of the change |
band parameter | Real | Settling band around the target: a fraction of the change (bandIsFraction) or an absolute value |
bandIsFraction parameter | Boolean | = true: band is a fraction of |deltaY|; false: in u's unit |
T_window parameter | SI.Time | 0: a step's window runs to the next step of r; > 0: it closes T_window after the step |
peakFraction parameter | Real | An extremum beyond the target counts when its amplitude exceeds this fraction of the base (|deltaY|, or the largest deviation) |
Components and variables
| Name | Type | Description |
|---|---|---|
u | Modelica.Blocks.Interfaces.RealInput | The response |
r | Modelica.Blocks.Interfaces.RealInput | The stepping signal (the setpoint or the disturbance) |
yRef | Modelica.Blocks.Interfaces.RealInput | The reference the response is measured against (target = Reference) |
active | Modelica.Blocks.Interfaces.BooleanOutput | = true while a step's window is open |
closed | Modelica.Blocks.Interfaces.BooleanOutput | = true at the sample that closes a window (the next step, or T_window after the step) |
nSteps | Modelica.Blocks.Interfaces.IntegerOutput | Number of steps seen so far |
tStep | Modelica.Blocks.Interfaces.RealOutput | Instant of the last step (-1 before the first) |
y0 | Modelica.Blocks.Interfaces.RealOutput | The response before the step |
yInf | Modelica.Blocks.Interfaces.RealOutput | The target |
deltaY | Modelica.Blocks.Interfaces.RealOutput | The change yInf - y0, the base of every percent |
overshoot | Modelica.Blocks.Interfaces.RealOutput | The largest excursion beyond the target in the direction of the change, in u's unit (never negative) |
undershoot | Modelica.Blocks.Interfaces.RealOutput | The largest excursion opposite to the change, beyond y0, in u's unit |
tPeak | Modelica.Blocks.Interfaces.RealOutput | Instant of the overshoot |
tLevel1 | Modelica.Blocks.Interfaces.RealOutput | Instant the lower level is first reached (-1 until then) |
tLevel2 | Modelica.Blocks.Interfaces.RealOutput | Instant the upper level is first reached (-1 until then) |
tHalf | Modelica.Blocks.Interfaces.RealOutput | Instant half the change is first reached (-1 until then) |
riseTime | Modelica.Blocks.Interfaces.RealOutput | The rise time: tLevel2 - tLevel1 once both are reached, else the time since tLevel1 (or the step) so far -- a lower bound |
delayTime | Modelica.Blocks.Interfaces.RealOutput | The delay time: tHalf - tStep once reached, else the time since the step so far |
settlingTime | Modelica.Blocks.Interfaces.RealOutput | The last exit from the settling band so far, relative to the step (the time since the step while outside) |
inBand | Modelica.Blocks.Interfaces.BooleanOutput | = true while |u - yInf| <= the band |
error | Modelica.Blocks.Interfaces.RealOutput | |u - yInf| now: the steady-state error when the window closes |
nExtrema | Modelica.Blocks.Interfaces.IntegerOutput | Extrema beyond the target closed so far (alternating in sign) |
a1 | Modelica.Blocks.Interfaces.RealOutput | Amplitude of the first extremum (0 until it closes) |
a2 | Modelica.Blocks.Interfaces.RealOutput | Amplitude of the second extremum |
a3 | Modelica.Blocks.Interfaces.RealOutput | Amplitude of the third extremum |
zeta | Modelica.Blocks.Interfaces.RealOutput | The damping ratio: from the log decrement of a1 and a2, from the overshoot alone, or 1 (monotone); provisional until the window closes |
decayRatio | Modelica.Blocks.Interfaces.RealOutput | a3 / a1 (0 until a third extremum closes) |
openAmplitude | Modelica.Blocks.Interfaces.RealOutput | Amplitude of the extremum segment still open (0: none) -- the last extremum when the window closes at a step |
openSign | Modelica.Blocks.Interfaces.IntegerOutput | Sign of the open segment (0: none) |
noBase | Modelica.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 |