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

How to generate frequency-response data? #677

Closed
ErikQQY opened this issue Apr 25, 2022 · 8 comments
Closed

How to generate frequency-response data? #677

ErikQQY opened this issue Apr 25, 2022 · 8 comments

Comments

@ErikQQY
Copy link
Contributor

ErikQQY commented Apr 25, 2022

Hello guys! Many thanks for your awesome works! In MATLAB, there is frd to create frequency-response data model. But how to do the same thing in ControlSystems.jl?

@baggepinnen
Copy link
Member

Hey and thanks :)
There is no FRD object in ControlSystems.jl, see ControlSystemIdentification.FRD

@ErikQQY
Copy link
Contributor Author

ErikQQY commented Apr 25, 2022

Wow! Thanks a lot! That solve my problem! BTW, I think it would be nice to have bodeplot method for FRD to generate bodeplot, is there any plan for this? @baggepinnen

@baggepinnen
Copy link
Member

Just call plot on the frd::FRD

@ErikQQY
Copy link
Contributor Author

ErikQQY commented Apr 25, 2022

Thank you for your quick response! There are complex numbers in my FRD, so if I directly call plot it would throw errors🥲

@baggepinnen
Copy link
Member

Have you tried? I'm asking because I know it works ;)

using ControlSystemIdentification, ControlSystems
w = exp10.(LinRange(-2, 2, 200))
r = freqresp(ssrand(1,1,3), w).parent
frd = FRD(w, r)
plot(frd)

image

@ErikQQY
Copy link
Contributor Author

ErikQQY commented Apr 25, 2022

Oops, the old version of ControlSystemIdentification.jl caused the problem.🤣 Anyway, thanks a lot!!

@ErikQQY ErikQQY closed this as completed Apr 25, 2022
@ErikQQY
Copy link
Contributor Author

ErikQQY commented Apr 26, 2022

@baggepinnen Hi there! The plot method of FRD only generate the Magnitude-Frequency plot, so I think it would be great to create both Magnitude-Frequency and Phase-Frequency plot like bodeplot we already have in ControlSystems.jl for FRD type :)

@ErikQQY
Copy link
Contributor Author

ErikQQY commented Apr 26, 2022

Besides, I think add nyquistplot, margin and nicholsplot method for FRD type would also be great ;)

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

No branches or pull requests

2 participants