Skip to content

Freqplot improvements introduced warning messages in tests #538

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
murrayrm opened this issue Feb 8, 2021 · 3 comments · Fixed by #543
Closed

Freqplot improvements introduced warning messages in tests #538

murrayrm opened this issue Feb 8, 2021 · 3 comments · Fixed by #543

Comments

@murrayrm
Copy link
Member

murrayrm commented Feb 8, 2021

It looks like PR #522 introduced some warning messages in our GitHub Action tests:

control/tests/freqresp_test.py::test_discrete[tf-0.1]
control/tests/freqresp_test.py::test_discrete[tf-0.1]
control/tests/freqresp_test.py::test_discrete[tf-True]
control/tests/freqresp_test.py::test_discrete[tf-True]
  /home/runner/work/python-control/python-control/control/xferfcn.py:310: RuntimeWarning: divide by zero encountered in true_divide
    out[i][j] = (polyval(self.num[i][j], x) /

control/tests/freqresp_test.py::test_discrete[tf-0.1]
control/tests/freqresp_test.py::test_discrete[tf-0.1]
control/tests/freqresp_test.py::test_discrete[tf-True]
control/tests/freqresp_test.py::test_discrete[tf-True]
  /home/runner/work/python-control/python-control/control/xferfcn.py:310: RuntimeWarning: invalid value encountered in true_divide
    out[i][j] = (polyval(self.num[i][j], x) /

I'm not quite sure what is generating the warnings, but it would be good to get rid of them if we can.

Test results here: https://github.com/python-control/python-control/pull/522/checks

@sawyerbfuller Any ideas?

@sawyerbfuller
Copy link
Contributor

Hadn’t seen that. Not at my computer so I can’t yet confirm, but I think that if those are all DT systems, a possible explanation is that I changed the code to evaluate all the way up to and including the nyquist frequency. A pole at -1 might cause such a warning.

@murrayrm
Copy link
Member Author

murrayrm commented Feb 8, 2021

It looks like they are all discrete time systems, so that's probably it.

I'm working on some code for issue #532 and will be adding some flags to turn off warnings, so that is one possible fix. But probably worth thinking about what the right approach is in terms of the evaluating/plotting the frequency response at those values.

@sawyerbfuller
Copy link
Contributor

Yep, confirmed the system has a pole at -1 and that's what causes a warning when running bode. Thinking about what to do about it. Bode plot still works but it has a gap in the line near the nyquist plot (from the nan's).

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 a pull request may close this issue.

2 participants