[R] unable to plot bode - phase with control package

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Thu Oct 8 16:32:19 CEST 2020

a) What is so difficult about the idea that this list is about R, not theory? There do exist forums about control theory (e.g. engineering.stackexchange.com)

b) Using [-pi,+pi) is not "wrong"... it is numerically more precise, though it may not convey what you would prefer to convey.

c) The general case with poles and zeroes is more complicated than just adding the order of your system. Do a search on

"winding number" "bode"

But if by inspection you think that shortcut will work for your system then do what you need to.

d) If implementing a more general alternative solution is your itch, I am sure the maintainer of this _contributed package_ would welcome patches to add features.

On October 8, 2020 12:08:19 AM PDT, fr1d_mail via R-help <r-help using r-project.org> wrote:
>Dear All
>I hope my question is relevant on this forum, else very sorry for the 
>I want to simply plot a bode diagram of a siso model
>using the 'bodeplot' command in the control package fail due to error
>'issiso' evaluation...
>Error in if (issiso(sys)) {:
>then I try by myself some retro-engineering :)
>the problem is when I use
>H <- freqresp(syst, w)
>mag = 20*log10(abs(H))
>phase <- atan2(Im(H), Re(H)) * 180/pi
>if the order of the system is higher than 2 it is wrong (result will be
>only between -pi / pi)
>how to proceed ? for each evaluated point take a derivative and
>the order to add the proper number of pi ?
>Thanks for the help !
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

Sent from my phone. Please excuse my brevity.

More information about the R-help mailing list