Skip to content

Commit 8211905

Browse files
committed
fix complex -> real error messages
1 parent a2c3b4c commit 8211905

File tree

3 files changed

+27
-69
lines changed

3 files changed

+27
-69
lines changed

control/xferfcn.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,6 @@ def _common_den(self, imag_tol=None, allow_nonproper=False):
991991
992992
denorder: array of int, orders of den, one per input
993993
994-
995-
996994
Examples
997995
--------
998996
>>> num, den, denorder = sys._common_den() # doctest: +SKIP
@@ -1076,7 +1074,7 @@ def _common_den(self, imag_tol=None, allow_nonproper=False):
10761074
# create the denominator matching this input
10771075
# coefficients should be padded on right, ending at maxindex
10781076
maxindex = len(poles[j])
1079-
den[j, :maxindex+1] = poly(poles[j])
1077+
den[j, :maxindex+1] = poly(poles[j]).real
10801078
denorder[j] = maxindex
10811079

10821080
# now create the numerator, also padded on the right
@@ -1106,7 +1104,8 @@ def _common_den(self, imag_tol=None, allow_nonproper=False):
11061104

11071105
# numerator polynomial should be padded on left and right
11081106
# ending at maxindex to line up with what td04ad expects.
1109-
num[i, j, maxindex+1-len(numpoly):maxindex+1] = numpoly
1107+
num[i, j, maxindex+1-len(numpoly):maxindex+1] = \
1108+
numpoly.real
11101109
# print(num[i, j])
11111110

11121111
if havenonproper:

examples/cruise.ipynb

Lines changed: 11 additions & 43 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)