Skip to content

[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

Closed

Conversation

don4get
Copy link
Contributor

@don4get don4get commented Apr 13, 2019

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.

don4get added 2 commits April 13, 2019 16:25
- 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
@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 78.36% when pulling eb6b0d0 on don4get:feature/add-weight-function into 1254ccb on python-control:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 78.36% when pulling eb6b0d0 on don4get:feature/add-weight-function into 1254ccb on python-control:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 78.36% when pulling eb6b0d0 on don4get:feature/add-weight-function into 1254ccb on python-control:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 78.36% when pulling eb6b0d0 on don4get:feature/add-weight-function into 1254ccb on python-control:master.

# elif isDisc():
# dico = 'D'
# else:
# TODO: Check for continous or discrete, only continuous supported right now
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

Copy link
Member

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.

@murrayrm murrayrm added the onhold Waiting for changes or input label May 27, 2019
@murrayrm
Copy link
Member

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.

@murrayrm murrayrm closed this Dec 30, 2019
@murrayrm murrayrm added this to the 0.8.3 milestone Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
onhold Waiting for changes or input
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants