Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix complex -> real error messages #1086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions control/xferfcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,6 @@ def _common_den(self, imag_tol=None, allow_nonproper=False):

denorder: array of int, orders of den, one per input



Examples
--------
>>> num, den, denorder = sys._common_den() # doctest: +SKIP
Expand Down Expand Up @@ -1076,7 +1074,7 @@ def _common_den(self, imag_tol=None, allow_nonproper=False):
# create the denominator matching this input
# coefficients should be padded on right, ending at maxindex
maxindex = len(poles[j])
den[j, :maxindex+1] = poly(poles[j])
den[j, :maxindex+1] = poly(poles[j]).real
denorder[j] = maxindex

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

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

if havenonproper:
Expand Down
54 changes: 11 additions & 43 deletions examples/cruise.ipynb

Large diffs are not rendered by default.

Loading
Loading