@@ -1128,21 +1128,217 @@ def dcgain(*args):
11281128# Call corresponding functions in timeresp, with arguments transposed
11291129
11301130def step (sys , T = None , X0 = 0. , input = 0 , output = 0 , ** keywords ):
1131+ '''
1132+ Step response of a linear system
1133+
1134+ If the system has multiple inputs or outputs (MIMO), one input and one
1135+ output have to be selected for the simulation. The parameters `input`
1136+ and `output` do this. All other inputs are set to 0, all other outputs
1137+ are ignored.
1138+
1139+ Parameters
1140+ ----------
1141+ sys: StateSpace, or TransferFunction
1142+ LTI system to simulate
1143+
1144+ T: array-like object, optional
1145+ Time vector (argument is autocomputed if not given)
1146+
1147+ X0: array-like or number, optional
1148+ Initial condition (default = 0)
1149+
1150+ Numbers are converted to constant arrays with the correct shape.
1151+
1152+ input: int
1153+ Index of the input that will be used in this simulation.
1154+
1155+ output: int
1156+ Index of the output that will be used in this simulation.
1157+
1158+ **keywords:
1159+ Additional keyword arguments control the solution algorithm for the
1160+ differential equations. These arguments are passed on to the function
1161+ :func:`control.ForcedResponse`, which in turn passes them on to
1162+ :func:`scipy.integrate.odeint`. See the documentation for
1163+ :func:`scipy.integrate.odeint` for information about these
1164+ arguments.
1165+
1166+ Returns
1167+ -------
1168+ T: array
1169+ Time values of the output
1170+
1171+ yout: array
1172+ Response of the system
1173+
1174+ See Also
1175+ --------
1176+ lsim, initial, impulse
1177+
1178+ Examples
1179+ --------
1180+ >>> T, yout = step(sys, T, X0)
1181+ '''
11311182 T , yout = timeresp .StepResponse (sys , T , X0 , input , output ,
11321183 transpose = True , ** keywords )
11331184 return T , yout
11341185
1135- def impulse (sys , T = None , X0 = 0. , input = 0 , output = 0 , ** keywords ):
1136- T , yout = timeresp .ImpulseResponse (sys , T , X0 , input , output ,
1186+ def impulse (sys , T = None , input = 0 , output = 0 , ** keywords ):
1187+ '''
1188+ Impulse response of a linear system
1189+
1190+ If the system has multiple inputs or outputs (MIMO), one input and
1191+ one output must be selected for the simulation. The parameters
1192+ `input` and `output` do this. All other inputs are set to 0, all
1193+ other outputs are ignored.
1194+
1195+ Parameters
1196+ ----------
1197+ sys: StateSpace, TransferFunction
1198+ LTI system to simulate
1199+
1200+ T: array-like object, optional
1201+ Time vector (argument is autocomputed if not given)
1202+
1203+ input: int
1204+ Index of the input that will be used in this simulation.
1205+
1206+ output: int
1207+ Index of the output that will be used in this simulation.
1208+
1209+ **keywords:
1210+ Additional keyword arguments control the solution algorithm for the
1211+ differential equations. These arguments are passed on to the function
1212+ :func:`lsim`, which in turn passes them on to
1213+ :func:`scipy.integrate.odeint`. See the documentation for
1214+ :func:`scipy.integrate.odeint` for information about these
1215+ arguments.
1216+
1217+ Returns
1218+ -------
1219+ T: array
1220+ Time values of the output
1221+ yout: array
1222+ Response of the system
1223+
1224+ See Also
1225+ --------
1226+ lsim, step, initial
1227+
1228+ Examples
1229+ --------
1230+ >>> T, yout = impulse(sys, T)
1231+ '''
1232+ T , yout = timeresp .ImpulseResponse (sys , T , 0 , input , output ,
11371233 transpose = True , ** keywords )
11381234 return T , yout
11391235
11401236def initial (sys , T = None , X0 = 0. , input = 0 , output = 0 , ** keywords ):
1237+ '''
1238+ Initial condition response of a linear system
1239+
1240+ If the system has multiple inputs or outputs (MIMO), one input and one
1241+ output have to be selected for the simulation. The parameters `input`
1242+ and `output` do this. All other inputs are set to 0, all other outputs
1243+ are ignored.
1244+
1245+ Parameters
1246+ ----------
1247+ sys: StateSpace, or TransferFunction
1248+ LTI system to simulate
1249+
1250+ T: array-like object, optional
1251+ Time vector (argument is autocomputed if not given)
1252+
1253+ X0: array-like object or number, optional
1254+ Initial condition (default = 0)
1255+
1256+ Numbers are converted to constant arrays with the correct shape.
1257+
1258+ input: int
1259+ Index of the input that will be used in this simulation.
1260+
1261+ output: int
1262+ Index of the output that will be used in this simulation.
1263+
1264+ **keywords:
1265+ Additional keyword arguments control the solution algorithm for the
1266+ differential equations. These arguments are passed on to the function
1267+ :func:`lsim`, which in turn passes them on to
1268+ :func:`scipy.integrate.odeint`. See the documentation for
1269+ :func:`scipy.integrate.odeint` for information about these
1270+ arguments.
1271+
1272+
1273+ Returns
1274+ -------
1275+ T: array
1276+ Time values of the output
1277+ yout: array
1278+ Response of the system
1279+
1280+ See Also
1281+ --------
1282+ lsim, step, impulse
1283+
1284+ Examples
1285+ --------
1286+ >>> T, yout = initial(sys, T, X0)
1287+ '''
11411288 T , yout = timeresp .InitialResponse (sys , T , X0 , input , output ,
11421289 transpose = True , ** keywords )
11431290 return T , yout
11441291
11451292def lsim (sys , U = 0. , T = None , X0 = 0. , ** keywords ):
1293+ '''
1294+ Simulate the output of a linear system.
1295+
1296+ As a convenience for parameters `U`, `X0`:
1297+ Numbers (scalars) are converted to constant arrays with the correct shape.
1298+ The correct shape is inferred from arguments `sys` and `T`.
1299+
1300+ Parameters
1301+ ----------
1302+ sys: Lti (StateSpace, or TransferFunction)
1303+ LTI system to simulate
1304+
1305+ U: array-like or number, optional
1306+ Input array giving input at each time `T` (default = 0).
1307+
1308+ If `U` is ``None`` or ``0``, a special algorithm is used. This special
1309+ algorithm is faster than the general algorithm, which is used otherwise.
1310+
1311+ T: array-like
1312+ Time steps at which the input is defined, numbers must be (strictly
1313+ monotonic) increasing.
1314+
1315+ X0: array-like or number, optional
1316+ Initial condition (default = 0).
1317+
1318+ **keywords:
1319+ Additional keyword arguments control the solution algorithm for the
1320+ differential equations. These arguments are passed on to the function
1321+ :func:`scipy.integrate.odeint`. See the documentation for
1322+ :func:`scipy.integrate.odeint` for information about these
1323+ arguments.
1324+
1325+ Returns
1326+ -------
1327+ T: array
1328+ Time values of the output.
1329+ yout: array
1330+ Response of the system.
1331+ xout: array
1332+ Time evolution of the state vector.
1333+
1334+ See Also
1335+ --------
1336+ step, initial, impulse
1337+
1338+ Examples
1339+ --------
1340+ >>> T, yout, xout = lsim(sys, U, T, X0)
1341+ '''
11461342 T , yout , xout = timeresp .ForcedResponse (sys , T , U , X0 ,
11471343 transpose = True , ** keywords )
11481344 return T , yout , xout
0 commit comments