merge
Description
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].xPODm
= merge(xPOD1,xPOD2,...,xPODn
)
Examples
Analyze Incremental Proper Orthogonal Decomposition Object
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 of the snapshot matrix .
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 , use the svd
function.
[Ur,Sr] = svd(xPODm); [Ur2,Sr2] = svd(xPOD);
This provides the approximation . Here, is the state snapshot data processed by incremental proper orthogonal decomposition (POD), matrix contains the dominant singular values, and columns of 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
xPOD1,xPOD2,...,xPODn
— Incremental PODs to combine
incrementalPOD
object
Incremental PODs to combine, specified as incrementalPOD
objects.
Output Arguments
xPODm
— Merged POD result
incrementalPOD
object
Merged incremental POD result, returned as an incrementalPOD
object.
Version History
Introduced in R2024b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)