Skip to content

Class Koopman

The class Koopman is a mapping \(K: \mathrm{span}(\Psi) \rightarrow \mathrm{span}(\Psi)\), which acts as the finite-dimensional approximation of the Koopman operator \(\mathcal{K}\), i.e.,

\[ \mathcal{K} \Psi \approx K \Psi. \]

Given \(\phi = \mathbf{a}^T \Psi\), where \(\mathbf{a} \in \mathbb{R}^{N_{\psi}}\), then the application of \(\mathcal{K}\) satisfies

\[ \mathcal{K} \phi = \mathcal{K} \mathbf{a}^T \Psi \approx \mathbf{a}^T K \Psi. \]

Info

Understanding the __call__ method of Koopman: Given the data set \(\{x^{(n)}\}_{n = 1}^N\), it represents a mapping:

\[ \left[ \begin{array}{cccc} \psi_1(x^{(1)})&\psi_2(x^{(1)})&\cdots&\psi_{N_{\psi}}(x^{(1)})\\ \psi_1(x^{(2)})&\psi_2(x^{(2)})&\cdots&\psi_{N_{\psi}}(x^{(2)})\\ \vdots&\vdots&\ddots&\vdots\\ \psi_1(x^{(N)})&\psi_2(x^{(N)})&\cdots&\psi_{N_{\psi}}(x^{(N)})\\ \end{array} \right] \rightarrow \left[ \begin{array}{cccc} \mathcal{K}\psi_1(x^{(1)})&\mathcal{K}\psi_2(x^{(1)})&\cdots&\mathcal{K}\psi_{N_{\psi}}(x^{(1)})\\ \mathcal{K}\psi_1(x^{(2)})&\mathcal{K}\psi_2(x^{(2)})&\cdots&\mathcal{K}\psi_{N_{\psi}}(x^{(2)})\\ \vdots&\vdots&\ddots&\vdots\\ \mathcal{K}\psi_1(x^{(N)})&\mathcal{K}\psi_2(x^{(N)})&\cdots&\mathcal{K}\psi_{N_{\psi}}(x^{(N)})\\ \end{array} \right]\]

API Documentation

__call__(x, u)

Apply the Koopman operator \(K(x)\), here the input \(u\) is ignored.

Parameters:

Name Type Description Default
x Tensor

The input dictionary basis of the size \((N, N_{\psi})\).

required
u Tensor

Ignored

required

Returns:

Type Description
Tensor

Applied the Koopman operator, it's of the size \((N, N_{\psi})\).

__init__(K)

Initialize the Koopman instance.

Parameters:

Name Type Description Default
K Tensor

The Koopman matrix of the size \((N_{\psi}, N_{\psi})\)

required

load(path)

Load the Koopman operator from a file.

Parameters:

Name Type Description Default
path str

The path to load the Koopman operator.

required

save(path)

Save the Koopman operator to a file.

Parameters:

Name Type Description Default
path str

The path to save the Koopman operator.

required

step(x, u)

Consider the Koopman operator as a step function \Psi_{n+1} = K \Psi_n.

Parameters:

Name Type Description Default
x Tensor

The input dictionary basis of the size \((N, N_{\psi})\).

required
u Tensor

Ignored

required

Returns:

Type Description
Tensor

Applied the Koopman operator, it's of the size \((N, N_{\psi})\).