Skip to content

Stability margins for discrete time systems#469

Merged
bnavigator merged 4 commits intopython-control:masterfrom
bnavigator:discrete-margins
Dec 21, 2020
Merged

Stability margins for discrete time systems#469
bnavigator merged 4 commits intopython-control:masterfrom
bnavigator:discrete-margins

Conversation

@bnavigator
Copy link
Copy Markdown
Contributor

My attempt to fix #465

If someone has an idea how to solve min |1 + num(z) / den(z) | with z=exp(i w dt) analytically, that would be great. I opted for a numerical optimization instead.

Copy link
Copy Markdown
Contributor

@sawyerbfuller sawyerbfuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, Looks good to me. Not sure why the previous author used an arcane incantation rather than just numpy.polyval in _poly_iw(), but maybe there is a numeric justification when working with imaginary arguments that I don’t know about.

I don’t have any good ideas for an analytic solution to the optimization problem.

@bnavigator
Copy link
Copy Markdown
Contributor Author

Not sure why the previous author used an arcane incantation rather than just numpy.polyval in _poly_iw(),

Both yours / @repagh's and @swaldherr's (is there a more current GitHub handle?) implementations are very similar. They split the polynomials up into real and imaginary parts after applying , and just store the result in a different variable structure. I just refactored to remove the "duplicate" code.

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 17, 2020

Coverage Status

Coverage increased (+0.2%) to 86.319% when pulling d0f333e on bnavigator:discrete-margins into 2d7aad0 on python-control:master.

@python-control python-control deleted a comment from coveralls Nov 18, 2020
@bnavigator
Copy link
Copy Markdown
Contributor Author

I think this should go into 0.8.4. It enhances functionality, but does not change the API and it fixes the bug that it returns wrong results with discrete input.

@bnavigator bnavigator added this to the 0.8.4 milestone Nov 19, 2020
@bnavigator bnavigator merged commit e525ff6 into python-control:master Dec 21, 2020
@bnavigator bnavigator deleted the discrete-margins branch January 5, 2021 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

control.margin() gives wrong result

4 participants