8000 Update documentation about keyword args in lsim · XiangPiCha/python-control@f498f0f · GitHub
[go: up one dir, main page]

Skip to content

Commit f498f0f

Browse files
committed
Update documentation about keyword args in lsim
Keyword arguments are no longer used in lsim (forced_response), or the routines step_response, initial_response, impulse_response, because forced_response no longer calls scipy.integrate.odeint
1 parent 2624790 commit f498f0f

File tree

2 files changed

+15
-82
lines changed

2 files changed

+15
-82
lines changed

control/matlab.py

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ def damp(sys, doprint=True):
12711271
# Simulation routines
12721272
# Call corresponding functions in timeresp, with arguments transposed
12731273

1274-
def step(sys, T=None, X0=0., input=0, output=None, **keywords):
1274+
def step(sys, T=None, X0=0., input=0, output=None):
12751275
'''
12761276
Step response of a linear system
12771277
@@ -1300,14 +1300,6 @@ def step(sys, T=None, X0=0., input=0, output=None, **keywords):
13001300
output: int
13011301
If given, index of the output that is returned by this simulation.
13021302
1303-
**keywords:
1304-
Additional keyword arguments control the solution algorithm for the
1305-
differential equations. These arguments are passed on to the function
1306-
:func:`control.forced_response`, which in turn passes them on to
1307< 10000 /code>-
:func:`scipy.integrate.odeint`. See the documentation for
1308-
:func:`scipy.integrate.odeint` for information about these
1309-
arguments.
1310-
13111303
Returns
13121304
-------
13131305
yout: array
@@ -1325,10 +1317,10 @@ def step(sys, T=None, X0=0., input=0, output=None, **keywords):
13251317
>>> yout, T = step(sys, T, X0)
13261318
'''
13271319
T, yout = timeresp.step_response(sys, T, X0, input, output,
1328-
transpose = True, **keywords)
1320+
transpose = True)
13291321
return yout, T
13301322

1331-
def impulse(sys, T=None, input=0, output=None, **keywords):
1323+
def impulse(sys, T=None, input=0, output=None):
13321324
'''
13331325
Impulse response of a linear system
13341326
@@ -1352,14 +1344,6 @@ def impulse(sys, T=None, input=0, output=None, **keywords):
13521344
output: int
13531345
Index of the output that will be used in this simulation.
13541346
1355-
**keywords:
1356-
Additional keyword arguments control the solution algorithm for the
1357-
differential equations. These arguments are passed on to the function
1358-
:func:`lsim`, which in turn passes them on to
1359-
:func:`scipy.integrate.odeint`. See the documentation for
1360-
:func:`scipy.integrate.odeint` for information about these
1361-
arguments.
1362-
13631347
Returns
13641348
-------
13651349
yout: array
@@ -1376,10 +1360,10 @@ def impulse(sys, T=None, input=0, output=None, **keywords):
13761360
>>> yout, T = impulse(sys, T)
13771361
'''
13781362
T, yout = timeresp.impulse_response(sys, T, 0, input, output,
1379-
transpose = True, **keywords)
1363+
transpose = True)
13801364
return yout, T
13811365

1382-
def initial(sys, T=None, X0=0., input=None, output=None, **keywords):
1366+
def initial(sys, T=None, X0=0., input=None, output=None):
13831367
'''
13841368
Initial condition response of a linear system
13851369
@@ -1407,15 +1391,6 @@ def initial(sys, T=None, X0=0., input=None, output=None, **keywords):
14071391
output: int
14081392
If given, index of the output that is returned by this simulation.
14091393
1410-
**keywords:
1411-
Additional keyword arguments control the solution algorithm for the
1412-
differential equations. These arguments are passed on to the function
1413-
:func:`lsim`, which in turn passes them on to
1414-
:func:`scipy.integrate.odeint`. See the documentation for
1415-
:func:`scipy.integrate.odeint` for information about these
1416-
arguments.
1417-
1418-
14191394
Returns
14201395
-------
14211396
yout: array
@@ -1433,10 +1408,10 @@ def initial(sys, T=None, X0=0., input=None, output=None, **keywords):
14331408
14341409
'''
14351410
T, yout = timeresp.initial_response(sys, T, X0, output=output,
1436-
transpose=True, **keywords)
1411+
transpose=True)
14371412
return yout, T
14381413

1439-
def lsim(sys, U=0., T=None, X0=0., **keywords):
1414+
def lsim(sys, U=0., T=None, X0=0.):
14401415
'''
14411416
Simulate the output of a linear system.
14421417
@@ -1462,13 +1437,6 @@ def lsim(sys, U=0., T=None, X0=0., **keywords):
14621437
X0: array-like or number, optional
14631438
Initial condition (default = 0).
14641439
1465-
**keywords:
1466-
Additional keyword arguments control the solution algorithm for the
1467-
differential equations. These arguments are passed on to the function
1468-
:func:`scipy.integrate.odeint`. See the documentation for
1469-
:func:`scipy.integrate.odeint` for information about these
1470-
arguments.
1471-
14721440
Returns
14731441
-------
14741442
yout: array
@@ -1486,8 +1454,7 @@ def lsim(sys, U=0., T=None, X0=0., **keywords):
14861454
--------
14871455
>>> yout, T, xout = lsim(sys, U, T, X0)
14881456
'''
1489-
T, yout, xout = timeresp.forced_response(sys, T, U, X0,
1490-
transpose = True, **keywords)
1457+
T, yout, xout = timeresp.forced_response(sys, T, U, X0, transpose = True)
14911458
return yout, T, xout
14921459

14931460
# Return state space data as a tuple

control/timeresp.py

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def shape_matches(s_legal, s_actual):
233233

234234

235235
# Forced response of a linear system
236-
def forced_response(sys, T=None, U=0., X0=0., transpose=False, **keywords):
236+
def forced_response(sys, T=None, U=0., X0=0., transpose=False):
237237
"""Simulate the output of a linear system.
238238
239239
As a convenience for parameters `U`, `X0`:
@@ -264,13 +264,6 @@ def forced_response(sys, T=None, U=0., X0=0., transpose=False, **keywords):
264264
If True, transpose all input and output arrays (for backward
265265
compatibility with MATLAB and scipy.signal.lsim)
266266
267-
**keywords:
268-
Additional keyword arguments control the solution algorithm for the
269-
differential equations. These arguments are passed on to the function
270-
:func:`scipy.integrate.odeint`. See the documentation for
271-
:func:`scipy.integrate.odeint` for information about these
272-
arguments.
273-
274267
Returns
275268
-------
276269
T: array
@@ -420,7 +413,7 @@ def _get_ss_simo(sys, input=None, output=None):
420413
return _mimo2siso(sys_ss, input, output, warn_conversion=warn)
421414

422415
def step_response(sys, T=None, X0=0., input=None, output=None,
423-
transpose=False, **keywords):
416+
transpose=False):
424417
# pylint: disable=W0622
425418
"""Step response of a linear system
426419
@@ -456,14 +449,6 @@ def step_response(sys, T=None, X0=0., input=None, output=None,
456449
If True, transpose all input and output arrays (for backward
457450
compatibility with MATLAB and scipy.signal.lsim)
458451
459-
**keywords:
460-
Additional keyword arguments control the solution algorithm for the
461-
differential equations. These arguments are passed on to the function
462-
:func:`lsim`, which in turn passes them on to
463-
:func:`scipy.integrate.odeint`. See the documentation for
464-
:func:`scipy.integrate.odeint` for information about these
465-
arguments.
466-
467452
Returns
468453
-------
469454
T: array
@@ -492,13 +477,13 @@ def step_response(sys, T=None, X0=0., input=None, output=None,
492477
U = np.ones_like(T)
493478

494479
T, yout, _xout = forced_response(sys, T, U, X0,
495-
transpose=transpose, **keywords)
480+
transpose=transpose)
496481

497482
return T, yout
498483

499484

500485
def initial_response(sys, T=None, X0=0., input=0, output=None,
501-
transpose=False, **keywords):
486+
transpose=False):
502487
# pylint: disable=W0622
503488
"""Initial condition response of a linear system
504489
@@ -534,15 +519,6 @@ def initial_response(sys, T=None, X0=0., input=0, output=None,
534519
If True, transpose all input and output arrays (for backward
535520
compatibility with MATLAB and scipy.signal.lsim)
536521
537-
**keywords:
538-
Additional keyword arguments control the solution algorithm for the
539-
differential equations. These arguments are passed on to the function
540-
:func:`lsim`, which in turn passes them on to
541-
:func:`scipy.integrate.odeint`. See the documentation for
542-
:func:`scipy.integrate.odeint` for information about these
543-
arguments.
544-
545-
546522
Returns
547523
-------
548524
T: array
@@ -566,13 +542,12 @@ def initial_response(sys, T=None, X0=0., input=0, output=None,
566542
T = _default_response_times(sys.A, 100)
567543
U = np.zeros_like(T)
568544

569-
T, yout, _xout = forced_response(sys, T, U, X0, transpose=transpose,
570-
**keywords)
545+
T, yout, _xout = forced_response(sys, T, U, X0, transpose=transpose)
571546
return T, yout
572547

573548

574549
def impulse_response(sys, T=None, X0=0., input=0, output=None,
575-
transpose=False, **keywords):
550+
transpose=False):
576551
# pylint: disable=W0622
577552
"""Impulse response of a linear system
578553
@@ -608,15 +583,6 @@ def impulse_response(sys, T=None, X0=0., input=0, output=None,
608583
If True, transpose all input and output arrays (for backward
609584
compatibility with MATLAB and scipy.signal.lsim)
610585
611-
**keywords:
612-
Additional keyword arguments control the solution algorithm for the
613-
differential equations. These arguments are passed on to the function
614-
:func:`lsim`, which in turn passes them on to
615-
:func:`scipy.integrate.odeint`. See the documentation for
616-
:func:`scipy.integrate.odeint` for information about these
617-
arguments.
618-
619-
620586
Returns
621587
-------
622588
T: array
@@ -660,5 +626,5 @@ def impulse_response(sys, T=None, X0=0., input=0, output=None,
660626

661627
T, yout, _xout = forced_response(
662628
sys, T, U, new_X0,
663-
transpose=transpose, **keywords)
629+
transpose=transpose)
664630
return T, yout

0 commit comments

Comments
 (0)
0