|On this page…|
The LTI Viewer is a GUI for viewing and manipulating the response plots of linear models. You can display the following plot types for linear models using the LTI Viewer:
Step and impulse responses
Bode and Nyquist plots
Singular values of the frequency response
Response to a general input signal
Unforced response starting from given initial states (only for state-space models)
Note that time responses and pole/zero plots are not available for FRD models.
Note The LTI Viewer displays up to six different plot types simultaneously. You can also analyze the response plots of several linear models at once.
The LTI Viewer with Step and Impulse Response Plots
The next section presents an example that shows you how to import a system into the LTI Viewer and how to customize the viewer to fit your requirements.
SISO Example: The DC Motor presents a DC motor example. If you have not yet built that example, type
at the MATLAB® prompt. This loads several LTI models, including a state-space representation of the DC motor called sys_dc.
This opens an LTI Viewer with an empty step response plot window by default.
To import the DC motor model, select Import under the File menu. This opens the Import System Data dialog box, which lists all the models available in your MATLAB workspace.
Import System Data Dialog Box with the DC Motor Model Selected
Select sys_dc from the list of available models and click OK to close the browser. This imports the DC motor model into the LTI Viewer.
To select more than one model at a time, do the following:
To select individual (noncontiguous) models, select one model and hold down the Ctrl key while selecting additional models. To clear any models, hold down the Ctrl key while you click the highlighted model names.
To select a list of contiguous models, select the first model and hold down the Shift key while selecting the last model you want in the list.
The figure below shows the LTI Viewer with a step response for the DC motor example.
Step Response for the DC Motor Example in the LTI Viewer
Alternatively, you can open the LTI Viewer and import the DC motor example directly from the MATLAB prompt.
See the ltiview reference page for a complete list of options.
Plot Types — Change the plot type. Available types include step, impulse, Bode, Bode magnitude, Nichols, Nyquist, and singular values plots.
Systems — Select or clear any models that you included when you created the response plot.
Characteristics — Add information about the plot. The characteristics available change from plot to plot. For example, Bode plots have stability margins available, but step responses have rise time and steady-state values available.
Grid — Add grids to your plots.
Normalize — Scale responses to fit the view (only available for time-domain plot types).
Full View — Use automatic limits to make the entire curve visible.
Properties — Open the Property Editor.
You can use this editor to customize various attributes of your plot. See Customizing Plot Properties and Preferences for a full description of the Property Editor.
Alternatively, you can open the Property Editor by double-clicking in an empty region of the response plot.
For example, to see the rise time for the DC motor step response, right-click and select Characteristics > Rise Time.
Using Right-Click Menus to Display the Rise Time for a Step Response
By default, the rise time is defined as the amount of time it takes the step response to go from 10% to 90% of the steady-state value. You can change this range in the options tab of the property editor. For more information on the property editor, see Customizing Plot Properties and Preferences.
The LTI Viewer calculates and displays the rise time for the step response.
DC Motor Step Response with the Rise Time Displayed
To display the values of any plot characteristic marked on a plot, place your mouse on the blue dot that marks the characteristic. This opens a data marker with the relevant information displayed. To make the marker persistent, left-click the blue dot.
For example, this figure shows the rise time value for the DC motor step response.
Using Your Mouse to Get the Rise Time Values
Note that you can left-click anywhere on a particular plot line to see the response values of that plot at that point. You must either place your cursor over the blue dot or left-click, however, if you want to see the rise time value.
For more information about data markers, see Data Markers.
You can view other plots using the right-click menus in the LTI Viewer. For example, if you want to see the open loop Bode plots for the DC motor model, select Plot Type and then Bode from the right-click menu.
Changing the Step Response to a Bode Plot
Selecting Bode changes the step response to a Bode plot for the DC motor model.
Bode Plot for the DC Motor Model
If you want to see, for example, both a step response and a Bode plot at the same time, you have to reconfigure the LTI Viewer. To view different response types in a single LTI Viewer, select Plot Configurations under the Edit menu. This opens the Plot Configurations dialog box.
Using the Plot Configurations Dialog Box to Reconfigure the LTI Viewer
You can select up to six plots in one viewer. Choose the Response type for each plot area from the right-side menus. There are nine available plot types:
Bode (magnitude and phase)
Bode Magnitude (only)
This section shows you how to import and manipulate multiple models in one LTI Viewer. For example, if you have designed a set of compensators to control a system, you can compare the closed-loop step responses and Bode plots using the LTI Viewer.
A sample set of closed-loop transfer function models is included (along with some other models) in the MAT-file ltiexamples.mat. Type
to load the provided transfer functions. The three closed-loop transfer function models, Gcl1, Gcl2, and Gcl3, are for a satellite attitude controller.
In this example, you analyze the response plots of the Gcl1 and Gcl2 transfer functions.
To load the two models Gcl1 and Gcl2 into the LTI Viewer, select Import under the File menu and select the desired models in the LTI Browser. See Importing Models into the LTI Viewer for a description of how to select groups of models. If necessary, you can reconfigure the viewer to display both the step responses and the Bode plots of the two systems using the Viewer Configuration dialog box. See Showing Multiple Response Types for a discussion of this feature.
Alternatively, you can open an LTI Viewer with both systems and both the step responses and Bode plots displayed. To do this, type
Either approach opens the following LTI Viewer.
Multiple Response Plots in a Single LTI Viewer
To mark the settling time on the step responses presented in this example, do the following:
Right-click anywhere in the plot region of the step response plots. This opens the right-click menu list in the plot region.
Select Characteristics > Settling Time.
To mark the stability margins of the Bode plot in this example, right-click and select Characteristics > Minimum Stability Margins.
Your LTI Viewer should now look like this.
Multiple Plots with Response Characteristics Added
The minimum stability margins, meaning the smallest magnitude phase and gain margins, are displayed as green and blue markers on the Bode phase diagram. If you want to see all the gain and phase margins of a system, right-click and select Characteristics > Minimum Stability Margins.
If you have imported more than one model, you can select and clear which models to plot in the LTI Viewer using right-click menus. For example, if you import the following three models into the viewer, you can choose to view any combination of the three you want.
s=tf('s'); sys1=1/(s^2+s+1); sys2=1/(s^2+s+2); sys3=1/(s^2+s+3);
This figure shows how to clear the second of the three models using right-click menu options.
Using Right-Click Menus to Select/Clear Plotted Systems
The Systems menu lists all the imported models. A system is selected if a check mark is visible to the left of the system name.