-
Notifications
You must be signed in to change notification settings - Fork 441
[Robust control] Add makeweight function #289
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
[Robust control] Add makeweight function #289
Conversation
- makeweight matches Matlab API, otherwise it would have been called make_weight. - As in Matlab, it returns the inverse of a performance weight as described in Skojestad book. I did not mention it in the code to limit confusion. - Robust mimo example updated. - Unit tests added. - Add __all__ list in robust.py - Update doc TODO: implement discrete behavior
3 similar comments
# elif isDisc(): | ||
# dico = 'D' | ||
# else: | ||
# TODO: Check for continous or discrete, only continuous supported right now |
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.
We should raise an exception if a discrete time system is passed as an argument. Use isdtime(P, strict=True)
to check.
High frequency gain of 1/W; should be > 1 | ||
order : int strictly positive scalar - optional | ||
Order of the output transfer function | ||
Ts : double strictly positive scalar - optional |
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.
Shouldn't the sampling time come from the system (sys.dt
)? What happens if they are not compatible?
|
||
Parameters | ||
---------- | ||
dcgain : double positive scalar |
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.
Incorrect indentation; should line up with Parameters
. See numpydocs.
Order of the output transfer function | ||
Ts : double strictly positive scalar - optional | ||
Sampling time in case W is discrete | ||
W - SISO LTI object |
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.
Should be in a section titled Returns
. See numpydoc.
return k,cl,info | ||
def makeweight(dcgain, wc, hfgain, order=1, Ts=None): | ||
""" Compute a weight transfer function, noted W | ||
|
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.
Need more documentation about the functionality that is implemented. Add a few sentences (and maybe an equation?) describing what the function does.
Also, this function needs to be added to doc/control.rst
and doc/matlab.rst
.
PR has been idle for > 6 months => stale. @don4get I will close this PR in a few days unless you will have time to work on it soon. No worries if not; just re-open when you have responded to the comments above. |
To be merged after #270
I wanted to add this functionality to the library:
https://ch.mathworks.com/help/robust/ref/makeweight.html
Above the Matlab behavior, I added the possibility to compute higher orders weight functions.
The discrete behavior is not implemented yet as I don't know how to deal with it.
I tried the naive approach, creating the laplace variable as follows: s = tf([1, 0], [1], Ts).
However, the DC gain of the resulted weight function is not correct, as one could have expected.
If someone knows how to solve this problem, I would be glad to help him.