-
Notifications
You must be signed in to change notification settings - Fork 439
Fix minreal not returning a discrete TF #140
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot.
Could you add a test case demonstrating the fix? I think control/tests/xferfcn_test.py would be the place for it.
control/xferfcn.py
Outdated
@@ -685,7 +685,7 @@ def minreal(self, tol=None): | |||
den[i][j] = np.atleast_1d(real(poly(poles))) | |||
|
|||
# end result | |||
return TransferFunction(num, den) | |||
return TransferFunction(num, den, None if self.dt == None else self.dt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't you use self.dt
instead of None if self.dt == None else self.dt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea sure :D. Don't know what I was thinking in that moment
1 similar comment
Looks good to me, thanks. |
In case we want to use minreal on a discrete TF the returning TF is continuous and not discrete. This should fix the problem