POD
Each method returns a tuple containing the pod basis of type PODBasis{T}
and the corresponding singular values. The singular values are related to each modes importance to the dataset.
Method of snapshots
The eigen-decomposition based method of snapshots is the most commonly used method for fluid flow analysis where the number of datapoints is larger than the number of snapshots.
ProperOrthogonalDecomposition.PODeigen
— MethodPODeigen(X)
Uses the eigenvalue method of snapshots to calculate the POD basis of X. Method of snapshots is efficient when number of data points n
> number of snapshots m
.
ProperOrthogonalDecomposition.PODeigen!
— MethodPODeigen!(X)
Same as PODeigen(X)
but overwrites memory.
Singular Value Decomposition based method
The SVD based approach is also available and is more robust against roundoff errors.
ProperOrthogonalDecomposition.PODsvd
— MethodPODsvd(X)
Uses the SVD based decomposition technique to calculate the POD basis of X.
ProperOrthogonalDecomposition.PODsvd!
— MethodPODsvd!(X)
Same as PODsvd(X)
but overwrites memory.
Example
Here we will artifically create data which is PODed and then extract the first mode.
t, x = range(0, stop=30, length=50), range(-10, stop=30, length=120)
Xgrid = [i for i in x, j in t]
tgrid = [j for i in x, j in t]
f1 = sech.(Xgrid.-3.5) .* 10.0 .* cos.(0.5 .*tgrid)
f2 = cos.(Xgrid) .* 1.0 .* cos.(2.5 .*tgrid)
f3 = sech.(Xgrid.+5.0) .* 4.0 .* cos.(1.0 .*tgrid)
Y = f1+f2+f3
Our data Y
looks like this
Now we POD the data and reconstruct the dataset using only the first mode.
res, singularvals = POD(Y)
reconstructFirstMode = res.modes[:,1:1]*res.coefficients[1:1,:]
Note that the above used POD(Y)
which defaults to the SVD based apparoch. The first mode over the time series looks like this