Main Content

view

Plot state contributions when using proper orthogonal decomposition (POD) method

Since R2024b

    Description

    Use view to graphically analyze the model and select a model order reduction criteria from a model order reduction task created using reducespec. For ProperOrthogonalDecomposition objects, you can visualize the state contributions as either principal singular values, normalized state energies, or neglected fraction of total energy. For the full workflow, see Task-Based Model Order Reduction Workflow.

    view(R,type) creates a plot that helps you select the order of the reduced model. R specifies the model order reduction (MOR) specification object. Use the type argument to specify the plot type as either "sigma", "energy", or "loss".

    view(R) plots the default plot type for the model order reduction algorithm of R. For the POD method, this syntax plots principal singular values and associated error bounds.

    view(___,Axes=AX) plots on the Axes object in the current figure with the handle AX. Use this input argument after any of the input argument combinations in the previous syntaxes. For more information about customizing axes, see Axes Properties.

    view(___,Name=Value) specifies additional options for customizing the appearance of Hankel singular value plots. For example, view(R,"sigma",Axes=AX,YScale="Linear") plots the Hankel singular values into the axes with handle AX using a linear scale for y axis. For a list of available options, see hsvoptions.

    hsvp = view(R,___) returns an HSVPlot object. To customize your plot, modify properties of the plot object using dot notation.

    example

    view(R,"-help") returns help specific to the MOR specification object R. The returned help shows plot types and syntaxes applicable to R.

    Examples

    collapse all

    This example shows how to customize the state contribution plots obtained using the view function in the model order reduction workflow for POD method.

    For this example, create a model order reduction specification for a LTI model. Generate a random discrete-time state-space model with 40 states.

    rng(0)
    sys = drss(40);

    Create a specification object and compute the information.

    R = reducespec(sys,"pod");
    R = process(R);

    Visualize the Hankel singular values.

    view(R)

    To customize the plot, you can use properties of the HSVPlot object as input arguments.

    h = view(R,"sigma",YScale="linear")
    h = 
      HSVPlot with properties:
    
          Responses: [1×1 controllib.chart.response.HSVResponse]
    
             YScale: "linear"
    
        GridVisible: on
            Visible: on
    
      Show all properties
    
    

    Alternatively, you can set properties of the object directly using the dot notation.

    h.GridVisible = "off";

    MATLAB figure

    Additionally, you can visualize all plot types in the same figure using tiledlayout and customize them individually.

    figure
    tiledlayout("flow")
    nexttile
    view(R,Grid ="off")
    nexttile
    view(R,"energy",YScale="linear")
    nexttile
    view(R,"loss")

    MATLAB figure

    Input Arguments

    collapse all

    Model order reduction specification object created using reducespec, specified as a ProperOrthogonalDecomposition object.

    Plot type, specified as one of these strings.

    • "sigma" — Bar chart of Hankel singular values and associated error bounds.

    • "energy" — Bar chart of normalized state energies.

    • "loss" — Bar chart of neglected fraction of total energy.

    If you do not specify this argument, the functions uses "sigma".

    Output Arguments

    collapse all

    HSV plot object, returned as an HSVPlot chart object. To customize the plot, modify the properties of hsvp using dot notation.

    Version History

    Introduced in R2024b