Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2bd912d

Browse files
committed
added keyword arguments to xferfcn.tf and statesp.ss to set dt
1 parent606975d commit2bd912d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

‎control/statesp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def __init__(self, *args, **kwargs):
226226
eliflen(args)==5:
227227
dt=args[4]
228228
if'dt'inkwargs:
229-
warn('received multiple dt arguments, using positional arg'%dt)
229+
warn('received multiple dt arguments, using positional arg dt=%s'%dt)
230230
eliflen(args)==1:
231231
try:
232232
dt=args[0].dt
@@ -1243,7 +1243,7 @@ def _mimo2simo(sys, input, warn_conversion=False):
12431243

12441244
returnsys
12451245

1246-
defss(*args):
1246+
defss(*args,**kwargs):
12471247
"""ss(A, B, C, D[, dt])
12481248
12491249
Create a state space system.
@@ -1319,7 +1319,7 @@ def ss(*args):
13191319
"""
13201320

13211321
iflen(args)==4orlen(args)==5:
1322-
returnStateSpace(*args)
1322+
returnStateSpace(*args,**kwargs)
13231323
eliflen(args)==1:
13241324
from .xferfcnimportTransferFunction
13251325
sys=args[0]
@@ -1331,7 +1331,7 @@ def ss(*args):
13311331
raiseTypeError("ss(sys): sys must be a StateSpace or\
13321332
TransferFunction object. It is %s."%type(sys))
13331333
else:
1334-
raiseValueError("Needs 1or4 arguments; received %i."%len(args))
1334+
raiseValueError("Needs 1, 4,or5 arguments; received %i."%len(args))
13351335

13361336

13371337
deftf2ss(*args):

‎control/xferfcn.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def __init__(self, *args, **kwargs):
217217
eliflen(args)==3:
218218
# Discrete time transfer function
219219
if'dt'inkwargs:
220-
warn('received multiple dt arguments, using positional arg'%dt)
220+
warn('received multiple dt arguments, using positional arg dt=%s'%dt)
221221
eliflen(args)==1:
222222
# TODO: not sure this can ever happen since dt is always present
223223
try:
@@ -1301,7 +1301,7 @@ def _convert_to_transfer_function(sys, **kw):
13011301
raiseTypeError("Can't convert given type to TransferFunction system.")
13021302

13031303

1304-
deftf(*args):
1304+
deftf(*args,**kwargs):
13051305
"""tf(num, den[, dt])
13061306
13071307
Create a transfer function system. Can create MIMO systems.
@@ -1391,7 +1391,7 @@ def tf(*args):
13911391
"""
13921392

13931393
iflen(args)==2orlen(args)==3:
1394-
returnTransferFunction(*args)
1394+
returnTransferFunction(*args,**kwargs)
13951395
eliflen(args)==1:
13961396
# Look for special cases defining differential/delay operator
13971397
ifargs[0]=='s':
@@ -1412,7 +1412,7 @@ def tf(*args):
14121412
raiseValueError("Needs 1 or 2 arguments; received %i."%len(args))
14131413

14141414

1415-
defss2tf(*args):
1415+
defss2tf(*args,**kwargs):
14161416
"""ss2tf(sys)
14171417
14181418
Transform a state space system to a transfer function.
@@ -1477,7 +1477,7 @@ def ss2tf(*args):
14771477
from .statespimportStateSpace
14781478
iflen(args)==4orlen(args)==5:
14791479
# Assume we were given the A, B, C, D matrix and (optional) dt
1480-
return_convert_to_transfer_function(StateSpace(*args))
1480+
return_convert_to_transfer_function(StateSpace(*args,**kwargs))
14811481

14821482
eliflen(args)==1:
14831483
sys=args[0]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp