|
44 | 44 | #
|
45 | 45 |
|
46 | 46 | '''
|
47 |
| -#Trial space overview |
| 47 | +___ |
| 48 | +##**Notes** |
| 49 | +
|
| 50 | +Like the snapshot data, the basis and the affine offset for a trial space are viewed as tensors, |
| 51 | +$$\\mathcal{\Phi} \\in \mathbb{R}^{ N_{\\mathrm{vars}} \\times N_{\\mathrm{x}} \\times K},$$ |
| 52 | +$$\\mathcal{u}_{\\mathrm{shift}} \\in \mathbb{R}^{ N_{\\mathrm{vars}} \\times N_{\\mathrm{x}}}.$$ |
| 53 | +Here, $N_{\\mathrm{vars}}$ is the number of PDE variables (e.g., 5 for the compressible Navier-Stokes |
| 54 | + equations in 3D), $N_{\\mathrm{x}}$ is the number of spatial DOFs, and $K$ is the number of basis |
| 55 | +vectors. We emphasize that all tensors are reshaped into 2D matrices, |
| 56 | +e.g., when performing SVD. |
| 57 | +___ |
| 58 | +##**Theory** |
| 59 | +
|
48 | 60 |
|
49 | 61 | A trial space is foundational to reduced-order models.
|
50 | 62 | In a ROM, we restrict a high-dimensional state to live within a low-dimensional trial space.
|
51 |
| -Mathematically, for a "FOM" vector $\\mathbf{u} \\in \\mathbb{R}^N$, we represent this as |
52 |
| -$$\\mathbf{u} \\approx \\tilde{\\mathbf{u}} \\in \\mathcal{V}$$ |
| 63 | +Mathematically, for a "FOM" vector $\\mathbf{u} \\in \\mathbb{R}^{N_{\\mathrm{vars}} N_{\\mathrm{x}}}$, we represent this as |
| 64 | +$$\\mathbf{u} \\approx \\tilde{\\mathbf{u}} \\in \\mathcal{V} + \\mathbf{u}_{\\mathrm{shift}}$$ |
53 | 65 | where $\\mathcal{V}$ with
|
54 |
| -$\\text{dim}(\\mathcal{V}) = K \\le N$ |
| 66 | +$\\text{dim}(\\mathcal{V}) = K \\le N_{\\mathrm{vars}} N_{\\mathrm{x}}$ |
55 | 67 | is the trial space. Formally, we can describe this low-dimensional representation with a basis and an affine offset,
|
56 | 68 | $$\\tilde{\\mathbf{u}} = \\boldsymbol \\Phi \\hat{\\mathbf{u}} + \\mathbf{u}_{\\mathrm{shift}}$$
|
57 |
| -where $\\boldsymbol \\Phi \\in \\mathbb{R}^{N \\times K}$ is the basis matrix, |
| 69 | +where $\\boldsymbol \\Phi \\in \\mathbb{R}^{ N_{\\mathrm{vars}} N_{\\mathrm{x}} \\times K}$ is the basis matrix, |
58 | 70 | $\\hat{\\mathbf{u}} \\in \\mathbb{R}^{K}$ are the reduced, or generalized coordinates,
|
59 |
| -$\\mathbf{u}_{\\mathrm{shift}} \\in \\mathbb{R}^N$ is the shift vector (or affine offset), and, by definition, |
60 |
| -$\\mathcal{V} \\equiv \\mathrm{range}(\\boldsymbol \\Phi) + \\mathbf{u}_{\\mathrm{shift}}$. |
| 71 | +$\\mathbf{u}_{\\mathrm{shift}} \\in \\mathbb{R}^{ N_{\\mathrm{vars}} N_{\\mathrm{x}}}$ is the shift vector (or affine offset), and, by definition, |
| 72 | +$\\mathcal{V} \\equiv \\mathrm{range}(\\boldsymbol \\Phi)$. |
61 | 73 |
|
62 | 74 | The trial_space class encapsulates the information of an affine trial space, $\\mathcal{V}$,
|
63 | 75 | by virtue of providing access to a basis matrix, a shift vector, and the dimensionality of the trial space.
|
| 76 | +Note that, like the snapshot data, we view the basis as a tensor. |
| 77 | +
|
| 78 | +___ |
| 79 | +##**API** |
64 | 80 | '''
|
65 | 81 |
|
| 82 | + |
66 | 83 | import abc
|
67 | 84 | import numpy as np
|
68 | 85 | from romtools.trial_space_utils.truncater import Truncater, NoOpTruncater
|
|
0 commit comments