Commit 98377c8e authored by Felix Kong's avatar Felix Kong

rename to dmd_vortex

parent b6163f4f
%% Dynamic Mode Decomposition (DMD) on Vortex Data
% This example is from Kutz et. al's Dynamic Mode Decomposition book
% I have written a class to make the DMD code easier to use.
% Step 0: Load data
clear all, close all, clc
load data/VortexData.mat % loads variables VORTALL, nx, ny
% initialize DMD object
% Step 1: initialize DMD object with data
verbose = true; % print how long things take
vortex_dmd = dmd(VORTALL,verbose);
% perform DMD regression on data
% Step 2: perform DMD regression on data
truncation_rank = 21; % rank to truncate reduced dynamics to
vortex_dmd.regression(truncation_rank);
% reconstruct VORTALL(:,2:end) using DMD approximation
% Step 3: reconstruct VORTALL(:,2:end) using DMD approximation
X2hat = vortex_dmd.reconstruct(); % not used in the script
% use predict() to reconstruct the data a different way
% values may differ very slightly from X2hat
% Step 3 (alternate method):
% use predict() to reconstruct the data instead of reconstruct()
% values may differ slightly from X2hat if truncation_rank isn't full
initial_condition = VORTALL(:,1);
num_timesteps = size(VORTALL,2); % could use predict() for more timesteps too
xhat = vortex_dmd.predict(initial_condition,num_timesteps);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment