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
+50-27Lines changed: 50 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,8 +47,8 @@
47
47
## Table of contents
48
48
*[Description](#description)
49
49
*[Dependencies and installation](#dependencies-and-installation)
50
+
*[Quickstart guide](#quickstart-guide)
50
51
*[Examples and Tutorials](#examples-and-tutorials)
51
-
*[Using PyDMD](#using-pydmd)
52
52
*[Awards](#awards)
53
53
*[References](#references)
54
54
*[Developers and contributors](#developers-and-contributors)
@@ -91,6 +91,54 @@ and then install the package in [development mode](https://setuptools.pypa.io/en
91
91
### Dependencies
92
92
The core features of **PyDMD** depend on `numpy` and `scipy`. In order to use the plotting functionalities you will also need `matplotlib`.
93
93
94
+
## Quickstart Guide
95
+
To perform DMD, simply begin by initializing a PyDMD module that implements your DMD method of choice. Models may then be fitted by calling the `fit()` method and passing in the necessary data. This step performs the DMD algorithm, after which users may use PyDMD plotting tools in order to visualize their results.
96
+
97
+
```python3
98
+
from pydmd importDMD
99
+
from pydmd.plotter import plot_summary
100
+
101
+
# Build an exact DMD model with 15 spatiotemporal modes.
102
+
dmd = DMD(svd_rank=15)
103
+
104
+
# Fit the DMD model.
105
+
# X = (n, m) numpy array of time-varying snapshot data.
106
+
dmd.fit(X)
107
+
108
+
# Plot a summary of the key spatiotemporal modes.
109
+
plot_summary(dmd)
110
+
```
111
+
112
+
PyDMD modules can also be wrapped with data preprocessors if desired. These wrappers will preprocess the data and postprocess data reconstructions automatically.
113
+
```python3
114
+
from pydmd.preprocessing import zero_mean_preprocessing
115
+
116
+
# Build and fit an exact DMD model with data centering.
Users may also build highly complex DMD models with PyDMD. Below is an example of how one might build and fit a customized Optimized DMD model with bagging, eigenvalue constraints, and custom variable projection arguments.
122
+
```python3
123
+
from pydmd importBOPDMD
124
+
125
+
# Build a bagging, optimized DMD (BOP-DMD) model.
126
+
bopdmd = BOPDMD(
127
+
svd_rank=15, # Rank of the DMD fit.
128
+
num_trials=100, # Number of bagging trials to perform.
129
+
trial_size=0.5, # Use 50% of the total number of snapshots per trial.
130
+
eig_constraints={"imag", "conjugate_pairs"}, # Eigenvalues must be imaginary and conjugate pairs.
131
+
varpro_opts_dict={"tol":0.2, "verbose":True}, # Set convergence tolerance and use verbose updates.
132
+
)
133
+
134
+
# Fit the BOP-DMD model.
135
+
# X = (n, m) numpy array of time-varying snapshot data
136
+
# t = (m,) numpy array of times of data collection
137
+
bopdmd.fit(X, t)
138
+
```
139
+
140
+
Note that modules and functions may be parameterized by a variety of inputs for added customization, so we generally recommend that new users refer to our [module documentation](https://pydmd.github.io/PyDMD/code.html), [plotting tool documentation](https://pydmd.github.io/PyDMD/plotter.html), and to our module-specific [tutorials](tutorials/README.md) for more information.
141
+
94
142
## Examples and Tutorials
95
143
You can find useful tutorials on how to use the package in the [tutorials](tutorials/README.md) folder.
96
144
@@ -105,31 +153,6 @@ Here we show a simple application (taken from [tutorial 2](tutorials/tutorial2/t
105
153
<em>The system evolution reconstructed with dynamic mode decomposition</em>
106
154
</p>
107
155
108
-
## Using PyDMD
109
-
To perform DMD, simply begin by initializing a PyDMD module that implements your DMD method of choice. Here, we demonstrate how a user might build a customized BOP-DMD model. Models may then be fitted by calling the `fit()` method and passing in the necessary data. This step performs the DMD algorithm, after which users may use PyDMD plotting tools in order to visualize their results.
110
-
```python3
111
-
from pydmd importBOPDMD
112
-
from pydmd.plotter import plot_summary
113
-
114
-
# Build a bagging, optimized DMD (BOP-DMD) model.
115
-
dmd = BOPDMD(
116
-
svd_rank=15, # rank of the DMD fit
117
-
num_trials=100, # number of bagging trials to perform
118
-
trial_size=0.5, # use 50% of the total number of snapshots per trial
119
-
eig_constraints={"imag", "conjugate_pairs"}, # constrain the eigenvalue structure
120
-
varpro_opts_dict={"tol":0.2, "verbose":True}, # set variable projection parameters
121
-
)
122
-
123
-
# Fit the DMD model.
124
-
# X = (n, m) numpy array of time-varying snapshot data
125
-
# t = (m,) numpy array of times of data collection
126
-
dmd.fit(X, t)
127
-
128
-
# Display a summary of the DMD results.
129
-
plot_summary(dmd)
130
-
```
131
-
Note that modules and functions may be parameterized by a variety of inputs for added customization, so we generally recommend that new users refer to module documentation, plotting tool documentation, and to our module-specific [tutorials](tutorials/README.md) for more information.
132
-
133
156
For users who are unsure of which DMD method is best for them, we provide the following flow chart, which outlines how one might choose an appropriate DMD variant based on specific problem types or data sets.
134
157
135
158
<palign="center">
@@ -214,4 +237,4 @@ Beyond this, PyDMD has also been supported by some dedicated projects that have
0 commit comments