Code Monkey home page Code Monkey logo

dmd-2's Introduction

Dynamic Mode Decomposition in MATLAB

MATLAB Function to perform the dynamic mode decomposition (DMD) on spatio-temporal data spaced evenly in time.

In simple terms, it decomposes the data into oscillating spatio-temporal patterns, with a fixed frequency and growth/decay rate.

Sources

This script is based on the techniques and codes presented in the book 'Data-Driven Science and Engineering' by Steven L. Brunton and J. Nathan Kutz, as well as codes available on their DMD book website.

See Steve's video below for an excellent description of the method. Link to Youtube video describing Dynamic Mode Decomposition

The script for finding the optimal threshold for the modes is developed by D. L. Donoho and M. Gavish in "The Optimal Hard Threshold for Singular Values is 4/sqrt(3)"

Usage:

This example shows how to compute DMD on 2D velocity field data. Assume you have velocities uxand uy stored on grids of size (NX,NY) at times 1 through m+1, equally spaced in time. The data matrix would be of size (n,m+1) with n=2*n0, and n0=NX*NY, with data(1:n0,k) being ux at time t_k, flattened as a vector, and similarly data(n0+1:2*n0,k) being uy. Then, the DMD can be computed using:

X = data(:,1:end-1) % Size (n,m)   
Xprime = data(:,2:end) % Size (n,m)

% If all the optimal thresholded modes are desired

[U,Sigma,V,Phi,Lambda,b,r_optimal] = DMD(X,Xprime)

% If only r modes are desired

r = 21; % Set desired value

[U,Sigma,V,Phi,Lambda,b,r_optimal] = DMD(X,Xprime,r)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.