Main Content

Working with System Identification App

Starting and Managing Sessions

What Is a System Identification Session?

Asessionrepresents the total progress of your identification process, including any data sets and models in theSystem Identificationapp.

You can save a session to a file with a.sidextension. For example, you can save different stages of your progress as different sessions so that you can revert to any stage by simply opening the corresponding session.

To start a new session, seeStarting a New Session in the App.

For more information about the steps for using the System Identification app, seeSteps for Using the System Identification App.

Starting a New Session in the App

To start a new session in the System Identification app, typesystemIdentificationin the MATLAB®Command Window:

systemIdentification

Alternatively, you can start a new session by selecting theAppstab of MATLAB desktop. In theAppssection, clickSystem Identification. This action opens the System Identification app.

Note

Only one session can be open at a time.

You can also start a new session by closing the current session usingFile>Close session. This toolbox prompts you to save your current session if it is not already saved.

Description of the System Identification App Window

The following figure describes the different areas in the System Identification app.

The layout of the window organizes tasks and information from left to right. This organization follows a typical workflow, where you start in the top-left corner by importing data into the System Identification app using theImport datamenu and end in the bottom-right corner by plotting the characteristics of your estimated model on model plots. For more information about using the System Identification app, seeSteps for Using the System Identification App.

TheData Boardarea, located below theImport datamenu in the System Identification app, contains rectangular icons that represent the data you imported into the app.

The Model Board, located to the right of the<--Preprocessmenu in the System Identification app, contains rectangular icons that represent the models you estimated or imported into the app. You can drag and drop model icons in the Model Board into open dialog boxes.

Opening a Saved Session

You can open a previously saved session using the following syntax:

systemIdentification(session,path)

sessionis the file name of the session you want to open andpathis the location of the session file. Session files have the extension.sid. When the session file in on thematlabpath, you can omit thepathargument.

If the System Identification app is already open, you can open a session by selectingFile>Open session.

Note

If there is data in the System Identification app, you must close the current session before you can open a new session by selectingFile>Close session.

Saving, Merging, and Closing Sessions

The following table summarizes the menu commands for saving, merging, and closing sessions in the System Identification app.

Task Command Comment
Close the current session and start a new session. File>Close session You are prompted to save the current session before closing it.
Merge the current session with a previously saved session. File>Merge session You must start a new session and import data or models before you can select to merge it with a previously saved session. You are prompted to select the session file to merge with the current. This operation combines the data and the models of both sessions in the current session.
Save the current session. File>Save Useful for saving the session repeatedly after you have already saved the session once.
Save the current session under a new name. File>Save As Useful when you want to save your work incrementally. This command lets you revert to a previous stage, if necessary.

Deleting a Session

To delete a saved session, you must delete the corresponding session file.

Managing Models

Importing Models into the App

You can import System Identification Toolbox™ models from the MATLAB workspace into the System Identification app. If you have Control System Toolbox™ software, you can also import any models (LTI objects) you created using this toolbox.

The following procedure assumes that you begin with the System Identification app already open. If this window is not open, type the following command at the prompt:

systemIdentification

To import models into the System Identification app:

  1. SelectImportfrom theImport modelslist to open the Import Model Object dialog box.

  2. In theEnter the namefield, type the name of a model object. PressEnter.

  3. (Optional) In theNotesfield, type any notes you want to store with this model.

  4. ClickImport.

  5. ClickCloseto close the Import Model Object dialog box.

Viewing Model Properties

You can get information about each model in the System Identification app by right-clicking the corresponding model icon.

The Data/model Info dialog box opens. This dialog box describes the contents and the properties of the corresponding model. It also displays any associated notes and the command-line equivalent of the operations you used to create this model.

Tip

To view or modify properties for several models, keep this window open and right-click each model in the System Identification app. The Data/model Info dialog box updates when you select each model.

Renaming Models and Changing Display Color

You can rename a model and change its display color by double-clicking the model icon in the System Identification app.

The Data/model Info dialog box opens. This dialog box describes both the contents and the properties of the model. The object description area displays the syntax of the operations you used to create the model in the app.

To rename the model, enter a new name in theModel namefield.

You can also specify a new display color using three RGB values in theColorfield. Each value is between0to1and indicates the relative presence of red, green, and blue, respectively. For more information about specifying default data color, seeCustomizing the System Identification App.

Tip

As an alternative to using three RGB values, you can enter anyoneof the following letters in single quotes:

'y' 'r' 'b' 'c' 'g' 'm' 'k'

These represent yellow, red, blue, cyan, green, magenta, and black, respectively.

Finally, you can enter comments about the origin and state of the model in theDiary And Notesarea.

To view model properties in the MATLAB Command Window, clickPresent.

Organizing Model Icons

You can rearrange model icons in the System Identification app by dragging and dropping the icons to empty Model Board rectangles.

Note

You cannot drag and drop a model icon into the data area on the left.

When you need additional space for organizing model icons, selectOptions>Extra model/data boardin the System Identification app. This action opens an extra session window with blank rectangles. The new window is an extension of the current session and does not represent a new session.

Tip

When you import or estimate models and there is insufficient space for the icons, an additional session window opens automatically.

You can drag and drop model icons between the main System Identification app and any extra session windows.

Type comments in theNotesfield to describe the models. When you save a session, as described inSaving, Merging, and Closing Sessions, all additional windows and notes are also saved.

Deleting Models in the App

系统中删除模型识别应用,drag and drop the corresponding icon intoTrash. You can also use the删除key on your keyboard to move items to theTrash. Moving items toTrashdoes not permanently delete these items.

To restore a model fromTrash, drag its icon fromTrashto the Model Board in the System Identification app. You can view theTrashcontents by double-clicking theTrashicon.

Note

You must restore a model to the Model Board; you cannot drag model icons to the Data Board.

To permanently delete all items inTrash, selectOptions>Empty trash.

Exiting a session emptiesTrashautomatically.

Exporting Models from the App to theMATLABWorkspace

The models you create in the System Identification app are not available in the MATLAB workspace until you export them. Exporting is necessary when you need to perform an operation on the model that is only available at the command line. Exporting models to the MATLAB workspace also makes them available to the Simulink®software or another toolbox, such as the Control System Toolbox product.

To export a model to the MATLAB workspace, do one of the following:

  • Drag and drop the corresponding icon to theTo Workspacerectangle.

  • Right-click the icon to open the Data/model Info dialog box. ClickExportto export the model.

当你出口模型,以MATLAB工作区,the resulting variables have the same name as in the System Identification app.

Working with Plots

Identifying Data Sets and Models on Plots

You can identify data sets and models on a plot by color: the color of the line in the data or model icon in the System Identification app matches the line color on the plots.

You can also display data tips for each line on the plot by clicking a plot curve and holding down the mouse button.

Note

You must disable zoom by selectingStyle>Zoombefore you can display data tips. For more information about enabling zoom, seeMagnifying Plots.

The following figure shows an example of a data tip, which contains the name of the data set and the coordinates of the data point.

Data Tip on a Plot

Changing and Restoring Default Axis Limits

There are two ways to change which portion of the plot is currently in view:

  • Magnifying plots

  • Setting axis limits

Magnifying Plots.Enable zoom by selectingStyle>Zoomin the plot window. To disable zoom, selectStyle>Zoomagain.

Tip

To verify that zoom is active, click theStylemenu. A check mark should appear next toZoom.

You can adjust magnification in the following ways:

  • To zoom in default increments, left-click the portion of the plot you want to center in the plot window.

  • To zoom in on a specific region, click and drag a rectangle that identifies the region for magnification. When you release the mouse button, the selected region is displayed.

  • To zoom out, right-click on the plot.

Note

To restore the full range of the data in view, selectOptions>Autorangein the plot window.

Setting Axis Limits.You can change axis limits for the vertical and the horizontal axes of the input and output channels that are currently displayed on the plot.

  1. SelectOptions>Set axes limitsto open the Limits dialog box.

  2. Specify a new range for each axis by editing its lower and upper limits. The limits must be entered using the format[LowerLimit UpperLimit]. ClickApply. For example:

    [0.1 100]

    Note

    To restore full axis limits, select theAutocheck box to the right of the axis name, and clickApply.

  3. To plot data on a linear scale, clear theLogcheck box to the right of the axis name, and clickApply.

    Note

    To revert to base-10 logarithmic scale, select theLogcheck box to the right of the axis name, and clickApply.

  4. ClickClose.

Note

To view the entire data range, selectOptions>Autorangein the plot window.

Selecting Measured and Noise Channels in Plots

Model inputs and outputs are calledchannels. When you create a plot of a multivariable input-output data set or model, the plot only shows one input-output channel pair at a time. The selected channel names are displayed in the title bar of the plot window.

Note

When you select to plot multiple data sets, and each data set contains several input and output channels, theChannelmenu lists channel pairs from all data sets.

You can select a different input-output channel pair from theChannelmenu in any System Identification Toolbox plot window.

TheChannelmenu uses the following notation for channels:u1->y2means that the plot displays a transfer function from input channelu1to output channely2. System Identification Toolbox estimates as many noise sources as there are output channels. In general,e@ynamindicates that the noise source corresponds to the output with nameynam.

For example,e@y3->y1means that the transfer function from the noise channel (associated withy3) to output channely2is displayed. For more information about noise channels, seeSeparation of Measured and Noise Components of Models.

Tip

When you import data into the System Identification app, it is helpful to assign meaningful channel names in the Import Data dialog box. For more information about importing data, seeRepresent Data.

Grid and Line Styles in Plots

There are severalStyleoptions that are common to all plot types.

Grid Lines.To toggle showing or hiding grid lines, selectStyle>Grid.

Solid or Dashed Lines.To display currently visible lines as a combination of solid, dashed, dotted, and dash-dotted line style, selectStyle>Separate linestyles.

To display all solid lines, selectStyle>All solid lines. This choice is the default.

All line styles match the color of the corresponding data or model icon in the System Identification app.

Opening a Plot in aMATLABFigure Window

MATLAB Figure window provides editing and printing commands for plots that are not available in the System Identification Toolbox plot window. To take advantage of this functionality, you can first create a plot in the System Identification app, and then open it in a MATLAB Figure window to fine-tune the display.

After you create the plot, as described inPlot Models in the System Identification App, selectFile>Copy figurein the plot window. This command opens the plot in a MATLAB Figure window.

Printing Plots

To print a System Identification Toolbox plot, selectFile>Printin the plot window. In the Print dialog box, select the printing options and clickOK.

Customizing the System Identification App

Types of App Customization

The System Identification app lets you customize the window behavior and appearance. For example, you can set the size and position of specific dialog boxes and modify the appearance of plots.

You can save the session to save the customized app state.

You might choose to edit the file that controls default settings, as described inModifying idlayout.m(advanced usage).

Saving Session Preferences

UseOptions>Save preferencesto save the current state of the System Identification app. This command saves the following settings to a preferences file,idprefs.mat:

  • Size and position of the System Identification app

  • Sizes and positions of dialog boxes

  • Four recently used sessions

  • Plot options, such as line styles, zoom, grid, and whether the input is plotted using zero-order hold or first-order hold between samples

You can only editidprefs.matby changing preferences in the app.

Theidprefs.matfile is located in the same folder asstartup.m, by default. To change the location where your preferences are saved, use themidprefscommand with the new path as the argument. For example:

midprefs('c:\matlab\toolbox\local\')

You can also typemidprefsand browse to the desired folder.

To restore the default preferences, selectOptions>Default preferences.

Modifying idlayout.m

You might want to customize the default plot options by editingidlayout.m(advanced usage).

To customizeidlayout.mdefaults, save a copy ofidlayout.mto a folder in yourmatlabpathjust above the鉴别folder level.

Caution

Do not edit the original file to avoid overwriting theidlayout.mdefaults shipped with the product.

You can customize the following plot options inidlayout.m:

  • Order in which colors are assigned to data and model icons

  • Line colors on plots

  • Axis limits and tick marks

  • Plot options, set in the plot menus

  • Font size

Note

When you save preferences usingOptions>Save preferencestoidprefs.mat, these preferences override the defaults inidlayout.m. To giveidlayout.mprecedence every time you start a new session, selectOptions>Default preferences.