Skip to content

Commit a0d26bf

Browse files
committed
Bug and documentation fixes
The clean_tf function was not making use of the input, output, and precision values passed to it. Fixed this issue. Also extended the documentation to include that the fival function returns None if an unstable system is checked for stability
1 parent d34b8f3 commit a0d26bf

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

control/statesp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,8 +977,9 @@ def fival(self, forcing="step", input=1, output=1, stabilityCheck=False, precisi
977977
978978
Returns
979979
-------
980-
out : float or inf
981-
The final value of the system. inf has the correct sign
980+
out : float, inf or None
981+
The final value of the system. inf has the correct sign. None is returned
982+
if stabilityCheck=True and the system is unstable
982983
983984
Raises
984985
------

control/timeresp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,9 @@ def fival(sys, forcing="step", input=1, output=1, stabilityCheck=False, precisio
910910
911911
Returns
912912
-------
913-
out : float or inf
914-
The final value of the system. inf has the correct sign
913+
out : float, inf or None
914+
The final value of the system. inf has the correct sign. None is returned
915+
if stabilityCheck=True and the system is unstable
915916
916917
Raises
917918
------

control/xferfcn.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,8 +1160,9 @@ def fival(self, forcing="step", input=1, output=1, stabilityCheck=False, precisi
11601160
11611161
Returns
11621162
-------
1163-
out : float or inf
1164-
The final value of the system. inf has the correct sign
1163+
out : float, inf or None
1164+
The final value of the system. inf has the correct sign. None is returned
1165+
if stabilityCheck=True and the system is unstable
11651166
11661167
Raises
11671168
------
@@ -1680,7 +1681,7 @@ def clean_tf(sys, input=None, output=None, precision=10):
16801681
raise TypeError("Neither a StateSpace nor TransferFunction was passed to 'sys'")
16811682
if (type(sys) is not TransferFunction):
16821683
sys = tf(sys).minreal()
1683-
return sys.clean()
1684+
return sys.clean(input = input, output = output, precision = precision)
16841685

16851686

16861687
# Define constants to represent differentiation, unit delay

0 commit comments

Comments
 (0)