Engee documentation
Notebook

Numerical values of system characteristics in the time domain

This example shows how to obtain numerical values of step response characteristics such as rise time, steady-state time, and overshoot using stepinfo. You can use similar methods with lsim to obtain characteristics of the system's response to arbitrary input data or initial conditions.

Before you start, connect the package ControlSystems.jl.

In [ ]:
import Pkg
Pkg.add("ControlSystems")
In [ ]:
using ControlSystems
s = tf('s');
In [ ]:
H = tf([8, 18, 32],[1, 6, 14, 24]);
data = stepinfo(step(H))
Out[0]:
StepInfo:
Initial value:     0.000
Final value:       1.333
Step size:         1.333
Peak:              1.687
Peak time:         0.609 s
Overshoot:         26.54 %
Undershoot:         0.00 %
Settling time:     3.507 s
Rise time:         0.210 s

The output is a structure containing the values of the step response characteristics. To access these values or use them in other calculations, use dot notation. For example, data.overshoot — this is the overshoot value.

In [ ]:
data.overshoot
Out[0]:
26.543295948871087

To see how other characteristics are assigned in the structure StepInfo, run the following cell with the code. She calls for a quick reference.

In [ ]:
?stepinfo
search: stepinfo StepInfo CompositeException InvalidStateException

Out[0]:

?stepinfo

Calculate the time required for the step characteristic H to settle within 0.5% of its final value.

In [ ]:
data = stepinfo(step(H), settling_th = 0.005)
t05 = data.settlingtime
Out[0]:
4.893

By default stepinfo defines the steady-state time as the time required for the output signal to settle within 2% of its final value. Specifying a stricter "time tube" value of 0.005 leads to an increase in the value settlingtime.

Conclusion

In this demo example, we examined the functionality for analyzing the numerical characteristics of the system's responses in the time domain.