Is there a Bode Plot block in Simulink?

23 views (last 30 days)
I would like to see the bode plot for my system in Simulink. However, I am not sure how to do this. I would also like to know how I can do this for a nonlinear Simulink model.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 2 Mar 2010
The bode plot draws the frequency response of a system, which is only defined for linear time-invariant systems. Therefore, a bode plot does not exist for nonlinear systems. However, you can linearize the system around some operating point and look at the response of the linearized model.
If you have Simulink, Simulink Control Design and the Control System Toolbox, you can
use the Tools -> Control Design -> Linear Analysis option from the model editor. This launches a window that allows you to specify input and output points for your model and find the equivalent LTI system. The linearize model option then launches the LTI viewer where you can view the responses in the Simulink LTI Viewer. More information with examples can be found on this in the "Getting Started" section of Simulink Control Design product documentation.
In early versions of Simulink (Simulink 1.3), where this feature was not implemented, there are two other ways that you can view the frequency response of your system:
1.You can use the Averaging Spectrum Analyzer block found in the Extras -> Sinks library. There is a modified version of the Spectrum Analyzer block which plots in log frequency scale. This file, sfuntf2.m, is available at the bottom of the page.
Both the x and y axes are log scale with the Magnitude in dB. The output now corresponds more closely to a standard Bode plot. Note this SFUNTF2.m was developed for Simulink 1.3 (R...), and will not work in Simulink 2.x (R....) or later versions.
2. You can also use the LINMOD command to linearize your model into a state space representation, and then use the BODE command from the Control Systems Toolbox. For example,
[A,B,C,D] = linmod('my_model');
sys = ss(A,B,C,D)
bode(sys)
For more information on this function, execute the following command at the MATLAB Command Prompt.
doc linmod

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!