You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,47 @@ Here we show a simple application (taken from [tutorial 2](tutorials/tutorial2/t
98
98
<em>The system evolution reconstructed with dynamic mode decomposition</em>
99
99
</p>
100
100
101
+
## Quickstart Tutorial
102
+
As a simple example, we examine fluid flow past a cylinder vorticity data with Reynolds number $Re = 100$, available [here](dmdbook.com/DATA.zip).
103
+
```python3
104
+
# Import vorticity data and frame dimensions.
105
+
import numpy as np
106
+
import scipy.io as sio
107
+
108
+
mat = sio.loadmat("CYLINDER_ALL.mat")
109
+
X = mat["VORTALL"] # (89351, 151) numpy array of snapshot data
110
+
t = np.arange(X.shape[-1]) # (151,) numpy array of times of data collection
111
+
nx = mat["nx"][0][0]
112
+
ny = mat["ny"][0][0]
113
+
```
114
+
Users can perform DMD by initializing a PyDMD module that implements their DMD method of choice. Users may also pass a variety of parameters to their DMD models for added customization. Here, we show how a user might build an optimized DMD model with bagging.
115
+
```python3
116
+
from pydmd importBOPDMD
117
+
118
+
# Build and fit a bagging, optimized DMD model.
119
+
dmd = BOPDMD(
120
+
svd_rank=15, # rank of the DMD fit
121
+
num_trials=100, # number of bagging trials to perform
122
+
trial_size=0.5, # use half the total number of snapshots each trial
123
+
eig_constraints={"imag", "conjugate_pairs"}, # optional: constrain the eigenvalue structure
124
+
varpro_opts_dict={"tol":0.2, "verbose":True}, # optional: set variable projection parameters
125
+
)
126
+
dmd.fit(X, t)
127
+
```
128
+
129
+
```python3
130
+
from pydmd.plotter import plot_summary
131
+
132
+
# Display a summary of the DMD results.
133
+
plot_summary(
134
+
dmd,
135
+
index_modes=[0, 1, 3],
136
+
snapshots_shape=(nx, ny),
137
+
order="F",
138
+
figsize=(12, 6),
139
+
)
140
+
```
141
+
101
142
Here we also provide a flow chart that outlines how one might choose an appropriate DMD optimization or methodological variant based on their specific problem type or data set. Note that the color-coding of this flowchart follows that of the PyDMD Capabilities diagram.
0 commit comments