Skip to content
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

Need for phase unwrapping. #25444

Closed
faze-geek opened this issue Jul 29, 2023 · 2 comments · Fixed by #25463
Closed

Need for phase unwrapping. #25444

faze-geek opened this issue Jul 29, 2023 · 2 comments · Fixed by #25463
Labels

Comments

@faze-geek
Copy link
Contributor

There is a discrepancy between SymPy and other control toolkits concerning the phase data generated by the bode plot for frequency response.
By definition , phase = arg(H(jw)) which is correctly implemented. The difference in value arrives due to the the principal argument of arg being (180,180].
Due to this there is a sudden change in behavior of the phase plot as values tend to -180 (sudden jump by ~360 which is not the true nature of the system). To make the phase plot continuous, we would require phase unwrapping.

Here is an example -
Sympy

>>> tf = TransferFunction(1,s**3 + 2*s**2 + s,s)
>>> bode_phase_plot(tf) # tends to -180 degree at 1
image
@faze-geek
Copy link
Contributor Author

See how other Control Toolkits offset that jump.

MATLAB

>> H = tf([1],[1 2 1 0])
>> bode(H)
image

python-control

G = (1)/(s**3 + 2*s**2 + s)
bode_plot(G)
image

@sylee957
Copy link
Member

sylee957 commented Aug 6, 2023

For nontriviality, there are fully algebraic method to compute the phase unwrapping
You may have to consult some research like in https://doi.org/10.1109/78.678480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants