  Dynamic mode decomposition (DMD) is a popular technique for modal
decomposition, flow analysis, and reduced-order modeling. In situations where a
system is time varying, one would like to update the system's description
online as time evolves. This work provides an efficient method for computing
DMD in real time, updating the approximation of a system's dynamics as new data
becomes available. The algorithm does not require storage of past data, and
computes the exact DMD matrix using rank-1 updates. A weighting factor that
places less weight on older data can be incorporated in a straightforward
manner, making the method particularly well suited to time-varying systems. A
variant of the method may also be applied to online computation of "windowed
DMD", in which only the most recent data are used. The efficiency of the method
is compared against several existing DMD algorithms: for problems in which the
state dimension is less than about~200, the proposed algorithm is the most
efficient for real-time computation, and it can be orders of magnitude more
efficient than the standard DMD algorithm. The method is demonstrated on
several examples, including a time-varying linear system and a more complex
example using data from a wind tunnel experiment. In particular, we show that
the method is effective at capturing the dynamics of surface pressure
measurements in the flow over a flat plate with an unsteady separation bubble.
