Askham et al. introduced the
variable projection for Dynamic Mode Decomposition (DMD).
This repository compares two implementations of the variable projection method for
DMD (BOPDMD originally
introduced by Sashidar and Kutz,
VarProDMD)
w.r.t. overall optimization runtime and signal reconstruction capabilities. BOPDMD
reduces to the classic variable projection
if only one model is considered. The preselection
Note that in Python the execution times vary, due to system calls or waiting for
resources.
The easiest way to run the scripts is to use VSCode's devcontainer capability. The project was tested on Ubuntu 22.04 (which also served as a host system for the dev containers) with the Python3.11 and Python3.12 interpreters.
To visualize the results some prerequisites are necessary.
First, download this repository and execute the following commands
cd /path/to/repository
pip --user install -e .
For proper visualization of the results make sure LaTex is installed.
For a minimal installation open another command line window and execute
sudo apt update
sudo apt upgrade -y
sudo apt install texlive-xetex cm-super dvipng -y
Open the repository, press CTRL + SHIFT + P
, and type
Devcontainers: Rebuild and Reopen in Container
.
After everything is ready to run.
After the setup phase execute
run_mrse -o /path/to/output/
for running the spatiotemporal signal experiment. For further information, please type
run_mrse -h
For the more complex experiments e.g. type
run_ssim -f moving_points -o /path/to/output
For detailed information type
run_ssim -h
You may also modify the optimizer within the experiments. Within your specified
path a subfolder with the name of the optimizer used for the experiment is
created. Note that some of the experiments require a lot of time.
The experiments also artificially corrupt the original signal with noise. Further,
different compression rates (library selection) are considered. The results are stored
in a .pkl file.
After the experiments were run you can easily visualize the runtime statistics.
Here is an example of how to visualize the sea surface temperature experiment
visualize_stats -p experiments/output/lm/MRSE_highdim_100_linear.pkl
Here is a visualization of how the QR decomposition with Column Pivoting
(greedily) selects samples of a spatiotemporal signal
in the original (high-dimensional) space. The spatiotemporal signal is also utilized
in the experiments (cf. section Spatiotemporal Dynamics).
Within the experiments, the library selection in general is performed in the
projected
low dimensional space:
The formula on how to generate the spatiotemporal dynamics is described in
section Spatiotemporal Dynamics.
The signal consists of
The compression is set to
Spatiotemporal signal: Real- and imaginary part of the signal. Dashed lines indicate library selection in high dimensional space. |
Spatiotemporal signal: Reconstructed real- and imaginary parts of the signal. The reconstruction is performed with VarProDMD |
All experiments consider different compressions and varying (zero-mean Gaussian)
noise corruption with a standard deviation
Each experiment is executed 100 times. The optimization is performed in the projected
(low-dimensional) space. The parameters used for the experiments are the default
values of the different scripts (run_mrse, run_ssim
).
Depending on the experiment either the mean/expected mean root squared error
(
For
The formula for generating the spatiotemporal dynamics (taken from here):
The oscillation experiment (taken from
here)
consists of
The formula for generating the time-dependent complex images:
Oscillations: The top row denotes the original real (noisy) signal. The bottom rows are the reconstructions of the different approaches. |
Oscillations: The top row denotes the original imaginary signal. The bottom rows are the reconstructions of the different approaches. |
The moving point experiments consider
The formula for generating the images was taken from here:
Moving Points experiment: The top row denotes the original (noisy) signal. The bottom rows are the reconstructions of the different approaches. |
The 3D Vorticity experiment relies on a dataset provided by
PDEBench. Within this experiment we
investigate the extrapolation capability on a very high-dimensional problem.
Each trial of the dataset (100 recordings in total) consists of a trajectory of
dimension of visualization/visualize_3dcfd_volume.py
for replicating the following figure.
You might need to run the script on your host OS.
PyVista is used for rendering the vorticity
fields; it requires additional drivers, which are currently not supported within
the devcontainer.
3D Vorticity experiment: 3D Vorticity field evolving over time. |
Ensure that jax with cuda is installed. Either install manually
pip install -jax[cuda12]
or just install the the package with optional
dependency pip install --user -e .[cuda]
Download the datasets executepdebench_dl --pde_name 3d_cfd
This will download
different and store large datasets (>200GB) in the experiments
folder. Please
ensure you have enough space on your machine.
After the download you should see additional folder structure experiments/data/3D/Train
.
Now the data needs to be converted from velocity
For approximating the vorticity, we rely on spectral derivatives. In this case,
we utilize the Fourier Transform
where
To perform conversion, execute
velocity2vorticity -d experiments/3D/Train/3D_CFD_Rand_M1.0_Eta1e-08_Zeta1e-08_periodic_Train.hdf5
Now an additional file
3D_CFD_Rand_M1.0_Eta1e-08_Zeta1e-08_periodic_Train_vorticity.hdf5
should appear.
To replicate the experiment run
run_3dcfd -d experiments/3D/Train/3D_CFD_Rand_M1.0_Eta1e-08_Zeta1e-08_periodic_Train.hdf5 -s 0.5
To visualize the result run
visualize_3dcfd_results experiments/output/trf/experiments/output/trf/3D_CFD_Turb_M1.0_Eta1e-08_Zeta1e-08_periodic_Train_vorticity/nRMSE_100_runs_0.5_split_0.0_comp.pkl