- Notifications
You must be signed in to change notification settings - Fork441
fixed prewarp not working in c2d and sample_system, margin docstring improvements#669
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
4 commits Select commitHold shift + click to select a range
ca8e670
misc bugfixes: fixed prewarp not working in c2d and sample_system, in…
sawyerbfullerbc5079b
reverted mistaken margin argument rearrangement and clarified definit…
sawyerbfullercfb6e86
clarified docstring in stability-margins
sawyerbfuller4c66fb1
test prewarp in c2d and sample_system
sawyerbfullerFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
31 changes: 18 additions & 13 deletionscontrol/dtime.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -5,6 +5,7 @@ | ||
Routines in this module: | ||
sample_system() | ||
c2d() | ||
""" | ||
"""Copyright (c) 2012 by California Institute of Technology | ||
@@ -58,16 +59,19 @@ def sample_system(sysc, Ts, method='zoh', alpha=None, prewarp_frequency=None): | ||
Parameters | ||
---------- | ||
sysc : LTI (:class:`StateSpace` or:class:`TransferFunction`) | ||
Continuous time system to be converted | ||
Ts :float > 0 | ||
Sampling period | ||
method : string | ||
Method to use for conversion, e.g. 'bilinear', 'zoh' (default) | ||
alpha : float within [0, 1] | ||
The generalized bilinear transformation weighting parameter, which | ||
should only be specified with method="gbt", and is ignored | ||
otherwise. See :func:`scipy.signal.cont2discrete`. | ||
prewarp_frequency : float within [0, infinity) | ||
The frequency [rad/s] at which to match with the input continuous- | ||
time system's magnitude and phase (only valid for method='bilinear') | ||
Returns | ||
------- | ||
@@ -76,7 +80,7 @@ def sample_system(sysc, Ts, method='zoh', alpha=None, prewarp_frequency=None): | ||
Notes | ||
----- | ||
See :meth:`StateSpace.sample` or :meth:`TransferFunction.sample` for | ||
further details. | ||
Examples | ||
@@ -89,7 +93,8 @@ def sample_system(sysc, Ts, method='zoh', alpha=None, prewarp_frequency=None): | ||
if not isctime(sysc): | ||
raise ValueError("First argument must be continuous time system") | ||
return sysc.sample(Ts, | ||
method=method, alpha=alpha, prewarp_frequency=prewarp_frequency) | ||
sawyerbfuller marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
def c2d(sysc, Ts, method='zoh', prewarp_frequency=None): | ||
@@ -98,20 +103,19 @@ def c2d(sysc, Ts, method='zoh', prewarp_frequency=None): | ||
Parameters | ||
---------- | ||
sysc : LTI (:class:`StateSpace` or:class:`TransferFunction`) | ||
Continuous time system to be converted | ||
Ts :float > 0 | ||
Sampling period | ||
method : string | ||
Method to use for conversion, e.g. 'bilinear', 'zoh' (default) | ||
prewarp_frequency : real within [0, infinity) | ||
The frequency [rad/s] at which to match with the input continuous- | ||
time system's magnitude and phase (only valid for method='bilinear') | ||
Returns | ||
------- | ||
sysd :LTI of the same class | ||
Discrete time system, with sampling rate Ts | ||
Notes | ||
@@ -126,6 +130,7 @@ def c2d(sysc, Ts, method='zoh', prewarp_frequency=None): | ||
""" | ||
# Call the sample_system() function to do the work | ||
sysd = sample_system(sysc, Ts, | ||
method=method, prewarp_frequency=prewarp_frequency) | ||
sawyerbfuller marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
return sysd |
20 changes: 12 additions & 8 deletionscontrol/margins.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
18 changes: 14 additions & 4 deletionscontrol/tests/discrete_test.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletionscontrol/tests/matlab_test.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletionscontrol/xferfcn.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.