7
7
__all__ = ['step' , 'stepinfo' , 'impulse' , 'initial' , 'lsim' ]
8
8
9
9
def step (sys , T = None , X0 = 0. , input = 0 , output = None , return_x = False ):
10
- '''
11
- Step response of a linear system
10
+ '''Step response of a linear system
12
11
13
12
If the system has multiple inputs or outputs (MIMO), one input has
14
13
to be selected for the simulation. Optionally, one output may be
@@ -20,35 +19,27 @@ def step(sys, T=None, X0=0., input=0, output=None, return_x=False):
20
19
----------
21
20
sys: StateSpace, or TransferFunction
22
21
LTI system to simulate
23
-
24
22
T: array-like or number, optional
25
23
Time vector, or simulation time duration if a number (time vector is
26
24
autocomputed if not given)
27
-
28
25
X0: array-like or number, optional
29
26
Initial condition (default = 0)
30
-
31
27
Numbers are converted to constant arrays with the correct shape.
32
-
33
28
input: int
34
29
Index of the input that will be used in this simulation.
35
-
36
30
output: int
37
31
If given, index of the output that is returned by this simulation.
38
32
39
33
Returns
40
34
-------
41
35
yout: array
42
36
Response of the system
43
-
44
37
T: array
45
38
Time values of the output
46
-
47
39
xout: array (if selected)
48
40
Individual response of each x variable
49
41
50
42
51
-
52
43
See Also
53
44
--------
54
45
lsim, initial, impulse
@@ -67,8 +58,7 @@ def step(sys, T=None, X0=0., input=0, output=None, return_x=False):
67
58
68
59
def stepinfo (sysdata , T = None , yfinal = None , SettlingTimeThreshold = 0.02 ,
69
60
RiseTimeLimits = (0.1 , 0.9 )):
70
- """
71
- Step response characteristics (Rise time, Settling Time, Peak and others).
61
+ """Step response characteristics (Rise time, Settling Time, Peak and others)
72
62
73
63
Parameters
74
64
----------
@@ -137,8 +127,7 @@ def stepinfo(sysdata, T=None, yfinal=None, SettlingTimeThreshold=0.02,
137
127
return S
138
128
139
129
def impulse (sys , T = None , X0 = 0. , input = 0 , output = None , return_x = False ):
140
- '''
141
- Impulse response of a linear system
130
+ '''Impulse response of a linear system
142
131
143
132
If the system has multiple inputs or outputs (MIMO), one input has
144
133
to be selected for the simulation. Optionally, one output may be
@@ -150,30 +139,24 @@ def impulse(sys, T=None, X0=0., input=0, output=None, return_x=False):
150
139
----------
151
140
sys: StateSpace, TransferFunction
152
141
LTI system to simulate
153
-
154
142
T: array-like or number, optional
155
143
Time vector, or simulation time duration if a number (time vector is
156
144
autocomputed if not given)
157
-
158
145
X0: array-like or number, optional
159
146
Initial condition (default = 0)
160
147
161
148
Numbers are converted to constant arrays with the correct shape.
162
-
163
149
input: int
164
150
Index of the input that will be used in this simulation.
165
-
166
151
output: int
167
152
Index of the output that will be used in this simulation.
168
153
169
154
Returns
170
155
-------
171
156
yout: array
172
157
Response of the system
173
-
174
158
T: array
175
159
Time values of the output
176
-
177
160
xout: array (if selected)
178
161
Individual response of each x variable
179
162
@@ -193,8 +176,7 @@ def impulse(sys, T=None, X0=0., input=0, output=None, return_x=False):
193
176
return (out [1 ], out [0 ], out [2 ]) if return_x else (out [1 ], out [0 ])
194
177
195
178
def initial (sys , T = None , X0 = 0. , input = None , output = None , return_x = False ):
196
- '''
197
- Initial condition response of a linear system
179
+ '''Initial condition response of a linear system
198
180
199
181
If the system has multiple outputs (?IMO), optionally, one output
200
182
may be selected. If no selection is made for the output, all
@@ -204,31 +186,25 @@ def initial(sys, T=None, X0=0., input=None, output=None, return_x=False):
204
186
----------
205
187
sys: StateSpace, or TransferFunction
206
188
LTI system to simulate
207
-
208
189
T: array-like or number, optional
209
190
Time vector, or simulation time duration if a number (time vector is
210
191
autocomputed if not given)
211
-
212
192
X0: array-like object or number, optional
213
193
Initial condition (default = 0)
214
194
215
195
Numbers are converted to constant arrays with the correct shape.
216
-
217
196
input: int
218
197
This input is ignored, but present for compatibility with step
219
198
and impulse.
220
-
221
199
output: int
222
200
If given, index of the output that is returned by this simulation.
223
201
224
202
Returns
225
203
-------
226
204
yout: array
227
205
Response of the system
228
-
229
206
T: array
230
207
Time values of the output
231
-
232
208
xout: array (if selected)
233
209
Individual response of each x variable
234
210
@@ -250,8 +226,7 @@ def initial(sys, T=None, X0=0., input=None, output=None, return_x=False):
250
226
251
227
252
228
def lsim (sys , U = 0. , T = None , X0 = 0. ):
253
- '''
254
- Simulate the output of a linear system.
229
+ '''Simulate the output of a linear system
255
230
256
231
As a convenience for parameters `U`, `X0`:
257
232
Numbers (scalars) are converted to constant arrays with the correct shape.
@@ -261,16 +236,13 @@ def lsim(sys, U=0., T=None, X0=0.):
261
236
----------
262
237
sys: LTI (StateSpace, or TransferFunction)
263
238
LTI system to simulate
264
-
265
239
U: array-like or number, optional
266
240
Input array giving input at each time `T` (default = 0).
267
241
268
242
If `U` is ``None`` or ``0``, a special algorithm is used. This special
269
243
algorithm is faster than the general algorithm, which is used otherwise.
270
-
271
244
T: array-like, optional for discrete LTI `sys`
272
245
Time steps at which the input is defined; values must be evenly spaced.
273
-
274
246
X0: array-like or number, optional
275
247
Initial condition (default = 0).
276
248
0 commit comments