Skip to content

Commit 0836ad8

Browse files
committed
Removed redundant if condition
1 parent 2f982bb commit 0836ad8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

control/statefbk.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ def gram(sys, type):
11191119
if type not in ['c', 'o', 'cf', 'of']:
11201120
raise ValueError("That type is not supported!")
11211121

1122-
# Check for continuous or discrete
1122+
# Check if system is continuous or discrete
11231123
if sys.isctime():
11241124
dico = 'C'
11251125

@@ -1128,15 +1128,13 @@ def gram(sys, type):
11281128
if np.any(np.linalg.eigvals(sys.A).real >= 0.0):
11291129
raise ValueError("Oops, the system is unstable!")
11301130

1131-
elif sys.isdtime():
1131+
else:
1132+
assert sys.isdtime()
11321133
dico = 'D'
11331134

11341135
if np.any(np.abs(sys.poles()) >= 1.):
11351136
raise ValueError("Oops, the system is unstable!")
11361137

1137-
else:
1138-
raise ValueError("sys")
1139-
11401138
if type == 'c' or type == 'o':
11411139
# Compute Gramian by the Slycot routine sb03md
11421140
# make sure Slycot is installed

0 commit comments

Comments
 (0)