Main Content

merge

Combine incremental proper orthogonal decomposition results

Since R2024b

    Description

    xPODm = merge(xPOD1,xPOD2,...,xPODn) combines the results of several incremental PODs applied to the snapshot collections X1, X2, and so on. This is equivalent to applying one incremental POD to the columns of X = [X1,X2,…,Xn].

    example

    Examples

    collapse all

    This example shows how create an incremental proper orthogonal decomposition (POD) and analyze the snapshot data stored in the object. An incrementalPOD object computes a low-rank approximation X=URVT of the snapshot matrix X.

    To start an incremental POD, initialize the object.

    xPOD1 = incrementalPOD;

    In POD-based model reduction, you provide the snapshots of state data. To generate state data, you typically run custom simulations with lsim. The lsim function also supports populating the xPOD object directly during the simulation. Create a random state-space and run a simulation to update the POD object.

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

    lsim generates the state data and the incrementalPOD object performs on-the-fly POD by updating the URV decomposition for each simulation step.

    You can also run more simulations to enrich the incremental POD with more data. As the new data becomes available, the object updates the URV approximation.

    xPOD2 = incrementalPOD;
    t2 = 5:0.02:8;  
    u2 = randn(1,numel(t2));
    [~,~,~,~,xPOD2] = lsim(sys,u2,t2,xinit,xPOD2)
    xPOD2 = 
      incrementalPOD with properties:
    
        Snapshots: 151
          MaxRank: 10
          RankTol: 1.0000e-06
        Transform: []
    
    

    You can combine multiple incremental PODs of state data from different simulations of a model. The state data must be of compatible sizes.

    xPODm = merge(xPOD1,xPOD2)
    xPODm = 
      incrementalPOD with properties:
    
        Snapshots: 402
          MaxRank: 10
          RankTol: 1.0000e-06
        Transform: []
    
    

    Merging these two PODs is equivalent to running sequential simulations on the same POD object.

    xPOD = incrementalPOD;
    [~,~,~,~,xPOD] = lsim(sys,u1,t1,xinit,xPOD);
    [~,~,~,~,xPOD] = lsim(sys,u2,t2,xinit,xPOD)
    xPOD = 
      incrementalPOD with properties:
    
        Snapshots: 402
          MaxRank: 10
          RankTol: 1.0000e-06
        Transform: []
    
    

    Compute a truncated SVD of XXT, use the svd function.

    [Ur,Sr] = svd(xPODm);
    [Ur2,Sr2] = svd(xPOD);

    This provides the approximation XXTUrΣrUrT. Here, X is the state snapshot data processed by incremental proper orthogonal decomposition (POD), Σr matrix contains the dominant singular values, and columns of Ur are the corresponding dominant left singular vectors.

    XXt = Ur*diag(Sr.^2)*Ur';
    XXt2 = Ur2*diag(Sr2.^2)*Ur2';
    norm(XXt-XXt2,"fro")
    ans = 
    1.9016e-14
    

    You can see that sequential simulations with the same POD or merging two PODs is equivalent.

    Input Arguments

    collapse all

    Incremental PODs to combine, specified as incrementalPOD objects.

    Output Arguments

    collapse all

    Merged incremental POD result, returned as an incrementalPOD object.

    Version History

    Introduced in R2024b