Qu

lti_step

Builtin index · Signal processing

result = lti_step(sys, t, [n=501], [input=0])

Input: sys, t, n, input · Output: result

What it is

No chapter describes this one yet. It exists -- the name comes from the interpreter's own table -- but the prose has not been written. That is a gap in the documentation, not in the engine.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = lti_step(sys, t, [n=501], [input=0])
sys —not documented yet
t number or vectort: an end time (a number), giving n evenly spaced samples from 0 for a continuous system or every multiple of dt for a discrete one, or the vector of sample times itself (increasing, not necessarily evenly spaced for a continuous system).
n number or vector, optional (default 501)t: an end time (a number), giving n evenly spaced samples from 0 for a continuous system or every multiple of dt for a discrete one, or the vector of sample times itself (increasing, not necessarily evenly spaced for a continuous system).
input optional (default 0)input (optional): which input is stepped, for a system with several.
input —optional
Returns a record {t, y, x}: the response from rest to a unit step applied at t = 0. t: an end time (a number), giving n evenly spaced samples from 0 for a continuous system or every multiple of dt for a discrete one, or the vector of sample times itself (increasing, not necessarily evenly spaced for a continuous system); input (optional): which input is stepped, for a system with several. y is a vector for one output and a len(t) x outputs matrix otherwise; x is the len(t) x states matrix of states. A continuous response is exact at every sample (matrix exponential, no ODE solver and no tolerance).

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

plant = lti_tf([1], [1, 3, 2, 0])             # 1 / (s (s+1) (s+2))

m = lti_margin(plant)
print("{m.gm} at {m.w_gm} rad/s")             # 6 at 1.414214 rad/s

closed = lti_feedback(lti_series(2, plant))    # gain 2, unity negative feedback

print(lti_is_stable(closed))                   # true

r = lti_step(closed, 20)
print(r.y[len(r.y) - 1])                       # 1.006126

d = lti_c2d(lti_tf([1], [0.5, 1]), 0.1)        # first-order lag, tau = 0.5

print(d.A)                                     # [0.818731], exp(-0.1/0.5)

output
6 at 1.414214 rad/s
true
1.006126
[0.818731]

from signal-processing