statescale.kernels#
|
A surrogate kernel. |
|
A griddata kernel. |
Detailed API Description
- class statescale.kernels.SurrogateKernel(snapshots, point_data, cell_data, field_data, **kwargs)[source]#
A surrogate kernel.
- Parameters:
point_data (dict) – A dict of point data.
cell_data (dict) – A dict of cell data.
field_data (dict) – A dict of field data.
**kwargs –
Additional keyword arguments for the calibration of the kernel.
- modes2-tuple of int or None, optional
Mode-range for the surrogate model. Default is (2, 10). If None, the modes are chosen in such a way that cumsum(S) / S >= threshold of the singular values are included.
- thresholdfloat, optional
Default threshold to evaluate the number of modes for the surrogate model. Default is 0.995.
Notes
The surrogate kernel is a snapshot-based proper orthogonal decomposition (POD) surrogate with interpolation of modal coefficients and is based on [1], with a selection of the maximum number of modes as outlined in [2].
Naming conventions# Symbol
Description
x_siSnapshots
d_s...Time-dependent data at snapshots with arbitrary trailing axes
mean(d)_...Mean over all snapshots of data
Δd_s...Centered data at snapshots
U_...mUnitary matrix of U S Vh = svd(Δd_…s)
α_smFactors at snapshots to obtain the centered data
x_aiSignal
α_amFactors for the signal to obtain the centered data
Δd_a...Centered data for the signal
d_a...Data for the signal (with arbitrary trailing axes)
Indices# Index
Description
ss-th snapshot
ii-th vector component of snapshot / signal
mj-th vector component of flattened data
mm-th mode of surrogate model
aa-th timestep of signal
First, the centered data at the snapshots is computed by subtracting the mean over all snapshots.
\[\Delta d_{sj} = d_{sj} - \operatorname{mean}(d)_j\]Then, a singular value decomposition (SVD) of the centered data is performed to obtain the principal components (modes) of the data. The number of modes to be used in the surrogate model is determined based on the provided mode range and the threshold for the cumulative sum of singular values.
\[\Delta d_{js} = U_{jm}\ S_{mm}\ V^H_{ms}\]\[ \begin{align}\begin{aligned}\alpha_{sm} &= \Delta d_{sj}\ U_{jm}\\\bar{\alpha}_{sm} &= \bar{d}_{sj}\ U_{jm}\end{aligned}\end{align} \]Next, the factors at the signal points are obtained by interpolating the modal coefficients from the snapshots to the signal points using the provided upscale function.
\[ \begin{align}\begin{aligned}\alpha_{am} &= \text{upscale}(x_{si}, \alpha_{sm}, x_{ai})\\\beta_{am} &= \alpha_{am} + \bar{\alpha}_{am}\end{aligned}\end{align} \]The factors at the snapshots are computed by projecting the data onto the selected modes.
\[d_{aj} = \beta_{am}\ U_{mj}\]Finally, the kernel parameters are stored in
SurrogateKernelParametersfor later use in the surrogate model.See also
statescale.SnapshotModelA model with point-, cell- and field-data at snapshots and with methods to interpolate the data at points of interest.
statescale.kernels.GriddataKernelA griddata kernel.
References
- class statescale.kernels.GriddataKernel(snapshots, point_data, cell_data, field_data, **kwargs)[source]#
A griddata kernel.
- Parameters:
See also
statescale.SnapshotModelA model with point-, cell- and field-data at snapshots and with methods to interpolate the data at points of interest.
statescale.kernels.SurrogateKernelA surrogate kernel.