Skip to content

Freqplot improvements introduced warning messages in tests #538

Description

@murrayrm

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?

Activity

  1. sawyerbfuller commented on Feb 8, 2021

    @sawyerbfuller
    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.

  2. murrayrm commented on Feb 8, 2021

    @murrayrm
    MemberAuthor

    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.

  3. sawyerbfuller commented on Feb 9, 2021

    @sawyerbfuller
    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).

  4. linked a pull request that will close this issueeliminate warnings in freqresp_test.py #543on Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions