Main Content

getUR

Obtain U and R factors from incremental proper orthogonal decomposition

Since R2024b

    Description

    [U,R] = getUR(xPOD) returns the U and R factors for the snapshot collection X processed by xPOD.

    example

    Examples

    collapse all

    This example shows how to obtain the U and R factors of the snapshot collection X processed by an incrementalPOD object. These factors provide a low-rank approximation of the data XXT=(UR)(UR)T.

    Create a random state-space model and run a simulation to collect state data.

    rng(0)
    sys = drss(50);
    t = 0:1:100; 
    u = zeros(size(t)); 
    u(1) = 1;
    [~,~,x] = lsim(sys,u,t);
    X = x';

    Now, perform an incremental POD for the same system using lsim.

    xPOD = incrementalPOD;
    [~,~,~,~,xPOD] = lsim(sys,u,t,xPOD);

    Obtain the factors from the POD object.

    [U,R] = getUR(xPOD);
    size(U)
    ans = 1×2
    
        50    22
    
    

    This provides an approximation of rank 22 of XXT with size 50-by-50. You can verify that error percentage of the original state date with this approximation is less than the value specified in the RankTol property of xPOD.

    sqrt(norm(X*X'-(U*R)*(U*R)',"fro"))/norm(X,"fro")
    ans = 
    5.7146e-07
    

    Input Arguments

    collapse all

    Incremental proper orthogonal decomposition result, specified as an incrementalPOD object.

    Output Arguments

    collapse all

    Factors of the snapshot collection, returned as matrices. The matrix U is tall and orthogonal, R is square, and (UR)(UR)T is a low-rank approximation of XXT.

    Version History

    Introduced in R2024b