Main Content

update

Update URV approximation given new snapshots for POD

Since R2024b

    Description

    Use this function to update the incremental proper orthogonal decomposition (POD) stored in an incrementalPOD object. When you provide a new column of state data, this function updates the U and R matrices of the factorization.

    xPODOut = update(xPOD,xNew) takes the incremental POD result xPOD applied to the snapshot data X and adds new snapshots to X and updates the U,R factors accordingly. Here, xNew is a single column or a batch of columns.

    example

    xPODOut = update(xPOD,xNew,wx) also specifies a scalar weight for each new snapshot. The weights are typically a function of step size.

    Examples

    collapse all

    This example shows how to update an incrementalPOD object with new state data.

    To start an incremental POD, initialize an object.

    xPOD1 = incrementalPOD;

    Typically, you a run a simulation using lsim function and provide the xPOD object to perform the POD directly during the simulation. Create a random state-space and run a simulation to update the POD object.

    rng(0)
    sys = rss(20,1,1);
    xinit = randn(20,1);
    t = 0:0.02:5;  
    u = randn(1,numel(t));
    [~,~,~,~,xPOD1] = lsim(sys,u,t,xinit,xPOD1)
    xPOD1 = 
      incrementalPOD with properties:
    
        Snapshots: 251
          MaxRank: 18
          RankTol: 1.0000e-06
        Transform: []
    
    

    Alternatively, if you have state data available through another source, you can use update function to perform POD. For example, the following code is equivalent to the results in the previous section.

    xPOD2 = incrementalPOD;
    [~,~,x] = lsim(sys,u,t,xinit);
    h = t(2)-t(1) ;
    xPOD2 = update(xPOD2,x',sqrt(h))
    xPOD2 = 
      incrementalPOD with properties:
    
        Snapshots: 251
          MaxRank: 18
          RankTol: 1.0000e-06
        Transform: []
    
    

    You can also process single column of the state vector data at a time.

    xPOD3 = incrementalPOD;
    for ct=1:size(x,1)
         xPOD3 = update(xPOD3,x(ct,:)',sqrt(h));
    end
    xPOD3
    xPOD3 = 
      incrementalPOD with properties:
    
        Snapshots: 251
          MaxRank: 20
          RankTol: 1.0000e-06
        Transform: []
    
    

    All three workflows described in this example provide equivalent results.

    Input Arguments

    collapse all

    Incremental POD result, specified as an incrementalPOD object. xPOD can be an empty incrementalPOD object to start a new analysis or you can update a previous analysis with more snapshots.

    New state snapshots, specified as a vector or matrix. If you are updating a previous analysis, the state snapshots must be of compatible sizes.

    Weight for snapshot, specified as a scalar or vector.

    Output Arguments

    collapse all

    Incremental POD with the updated U and R factors, returned as an incrementalPOD object.

    Version History

    Introduced in R2024b