How do I shift the phase offset of the Bode plot generated from the Model Linearizer?

I’m using the Model Linearizer app from Simulink Control Design to linearize and compute the frequency responses for my model. I am following the steps in the tutorial Linearize Simulink Model at Model Operating Point. However, when I generate the Bode plot, it has a phase offset that I would like to change, but I can’t find any options to change this.
How can I shift the phase offset of my Bode plot from within the app?

 Accepted Answer

When viewing a Bode plot in the Model Linearizer App, you can navigate to the "Bode Plot #" tab, and select "Plot Properties". This will open a Property Editor menu with plot settings. Go to the "Options" tab and check "Adjust phase offsets". Specify values for "At frequency" and "Keep phase close to". The will shift the phase plot by 360*N deg, where N is an integer, to keep the phase value at the frequency you specified close to the value you specified. 
In this example, the phase at 1 rad/s was originally -90 deg. We specify to keep the phase value close to 250 deg. The phase plot shifts by +360 deg, so the new phase at 1 rad/s is now 270 deg.
The bode plot properties can also be customized by exporting the linear system to the MATLAB workspace.
 
Then, for MATLAB R2024b and newer, you can change the BodePlot Properties to customize a Bode plot. The following code gives the same phase matching settings as before.
bp = bodeplot(linsys1);
bp.PhaseMatchingEnabled = true;
bp.PhaseMatchingFrequency = 1;
bp.PhaseMatchingValue = 250;
The code sample gives the following figure:
Please see bodeplot and BodePlot Properties for more information on phase matching and the other Bode plot properties. 
For MATLAB R2024a and earlier, the same functionality can be achieved using bodeoptions. The following code gives the same plot using 'bodeoptions'.
plotoptions = bodeoptions("cstprefs");
plotoptions.PhaseMatching = 'on';
plotoptions.PhaseMatchingFreq = 1;
plotoptions.PhaseMatchingValue = 250;
bodeplot(linsys1,plotoptions)

More Answers (0)

Products

Release

R2026a

Community Treasure Hunt

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

Start Hunting!