DMD with control¶
Derived module from dmdbase.py for dmd with control.
Reference: - Proctor, J.L., Brunton, S.L. and Kutz, J.N., 2016. Dynamic mode decomposition with control. SIAM Journal on Applied Dynamical Systems, 15(1), pp.142-161.
- class DMDc(svd_rank=0, tlsq_rank=0, opt=False, svd_rank_omega=-1, lag=1)[source]
Bases:
DMDBase
Dynamic Mode Decomposition with control. This version does not allow to manipulate the temporal window within the system is reconstructed.
- Parameters:
svd_rank (int or float) – the rank for the truncation; If 0, the method computes the optimal rank and uses it for truncation; if positive interger, the method uses the argument for the truncation; if float between 0 and 1, the rank is the number of the biggest singular values that are needed to reach the ‘energy’ specified by svd_rank; if -1, the method does not compute truncation.
tlsq_rank (int) – rank truncation computing Total Least Square. Default is 0, that means no truncation.
opt (bool or int) – argument to control the computation of DMD modes amplitudes. See
DMDBase
. Default is False.svd_rank_omega (int or float) – the rank for the truncation of the aumented matrix omega composed by the left snapshots matrix and the control. Used only for the _fit_B_unknown method of this class. It should be greater or equal than svd_rank. For the possible values please refer to the svd_rank parameter description above.
lag (int) – the time lag for the snapshots. Used in fit method to generate X and Y.
- property B
Get the operator B.
- Returns:
the operator B.
- Return type:
- property basis
Get the basis used to reduce the linear operator to the low dimensional space.
- Returns:
the matrix which columns are the basis vectors.
- Return type:
- fit(X, I, B=None)[source]
Compute the Dynamic Modes Decomposition with control given the original snapshots and the control input data. The matrix B that controls how the control input influences the system evolution can be provided by the user; otherwise, it is computed by the algorithm.
- Parameters:
X (numpy.ndarray or iterable) – the input snapshots.
I (numpy.ndarray or iterable) – the control input.
B (numpy.ndarray or iterable) – matrix that controls the control input influences the system evolution.
- reconstructed_data(control_input=None)[source]
Return the reconstructed data, computed using the control_input argument. If the control_input is not passed, the original input (in the fit method) is used. The input dimension has to be consistent with the dynamics.
- Parameters:
control_input (numpy.ndarray) – the input control matrix.
- Returns:
the matrix that contains the reconstructed snapshots.
- Return type:
- property svd_rank_omega