Split real and imag part in jacobian

This commit is contained in:
2024-03-11 23:54:11 +01:00
parent 9059a24c23
commit 198867751d
3 changed files with 89 additions and 70 deletions

View File

@ -382,62 +382,81 @@ The enstrophy is defined as
To compute the Lyapunov exponents, we must first compute the Jacobian of $\hat u^{(n)}\mapsto\hat u^{(n+1)}$.
This map is always of Runge-Kutta type, that is,
\begin{equation}
\hat u^{(n+1)}=\hat u^{(n)}+\delta\sum_{i=1}^q w_i\mathfrak F(\hat u^{(n)})
\end{equation}
(see\-~(\ref{ins_k})), so
\begin{equation}
D\hat u^{(n+1)}=\mathds 1+\delta\sum_{i=1}^q w_iD\mathfrak F(\hat u^{(n)})
\hat u(t_{n+1})=\mathfrak F_{t_n}(\hat u(t_n))
.
\end{equation}
We then compute
Let $D\mathfrak F_{t_{n}}$ be the Jacobian of this map, in which we split the real and imaginary parts: if
\begin{equation}
(D\mathfrak F(\hat u))_{k,\ell}
=
-\frac{4\pi^2}{L^2}\nu k^2\delta_{k,\ell}
+\frac{4\pi^2}{L^2|k|}\partial_{\hat u_\ell}T(\hat u,k)
\hat u_k(t_n)=:\rho_k+i\iota_k
,\quad
\mathfrak F_{t_n}(\hat u(t_n))_k=:\phi_k+i\psi_k
\end{equation}
and, by\-~(\ref{T}),
then
\begin{equation}
\partial_{\hat u_\ell}T(\hat u,k)
=
\sum_{\displaystyle\mathop{\scriptstyle q\in\mathbb Z^2}_{\ell+q=k}}
\left(
\frac{(q\cdot \ell^\perp)|q|}{|\ell|}
+
\frac{(\ell\cdot q^\perp)|\ell|}{|q|}
\right)\hat u_q
=
(k\cdot \ell^\perp)\left(
\frac{|k-\ell|}{|\ell|}
-
\frac{|\ell|}{|k-\ell|}
\right)\hat u_{k-\ell}
(D\mathfrak F_{t_n})_{k,p}:=\left(\begin{array}{cc}
\partial_{\rho_p}\phi_k&\partial_{\iota_p}\phi_k\\
\partial_{\rho_p}\psi_k&\partial_{\iota_p}\psi_k
\end{array}\right)
\end{equation}
We compute this Jacobian numerically using a finite difference, by computing
\begin{equation}
(D\mathfrak F_{t_n})_{k,p}:=\frac1\epsilon
\left(\begin{array}{cc}
\phi_k(\hat u+\epsilon\delta_p)-\phi_k(\hat u)&\phi_k(\hat u+i\epsilon\delta_p)-\phi_k(\hat u)\\
\psi_k(\hat u+\epsilon\delta_p)-\psi_k(\hat u)&\psi_k(\hat u+i\epsilon\delta_p)-\psi_k(\hat u)
\end{array}\right)
.
\end{equation}
The parameter $\epsilon$ can be set using the parameter {\tt D\_epsilon}.
%, so
%\begin{equation}
% D\hat u^{(n+1)}=\mathds 1+\delta\sum_{i=1}^q w_iD\mathfrak F(\hat u^{(n)})
% .
%\end{equation}
%We then compute
%\begin{equation}
% (D\mathfrak F(\hat u))_{k,\ell}
% =
% -\frac{4\pi^2}{L^2}\nu k^2\delta_{k,\ell}
% +\frac{4\pi^2}{L^2|k|}\partial_{\hat u_\ell}T(\hat u,k)
%\end{equation}
%and, by\-~(\ref{T}),
%\begin{equation}
% \partial_{\hat u_\ell}T(\hat u,k)
% =
% \sum_{\displaystyle\mathop{\scriptstyle q\in\mathbb Z^2}_{\ell+q=k}}
% \left(
% \frac{(q\cdot \ell^\perp)|q|}{|\ell|}
% +
% \frac{(\ell\cdot q^\perp)|\ell|}{|q|}
% \right)\hat u_q
% =
% (k\cdot \ell^\perp)\left(
% \frac{|k-\ell|}{|\ell|}
% -
% \frac{|\ell|}{|k-\ell|}
% \right)\hat u_{k-\ell}
% .
%\end{equation}
\bigskip
\indent
The Lyapunov exponents are then defined as
\begin{equation}
\frac1n\log\mathrm{spec}(\pi_i)
\frac1{t_n}\log\mathrm{spec}(\pi_{t_n})
,\quad
\pi_i:=\prod_{i=1}^nD\hat u^{(i)}
\pi_{t_n}:=\prod_{i=1}^nD\hat u(t_i)
.
\end{equation}
However, the product of $D\hat u$ may become quite large or quite small (if the exponents are not all 1).
To avoid this, we periodically rescale the product.
We set $\mathfrak L_r\in\mathbb N_*$ (set by adjusting the {\tt lyanpunov\_reset} parameter), and, when $n$ is a multiple of $\mathfrak L_r$, we rescale the eigenvalues of $\pi_i$ to 1.
We set $\mathfrak L_r>0$ (set by adjusting the {\tt lyanpunov\_reset} parameter), and, when $t_n$ crosses a multiple of $\mathfrak L_r$, we rescale the eigenvalues of $\pi_i$ to 1.
To do so, we perform a $QR$ decomposition:
\begin{equation}
\pi_{\alpha\mathfrak L_r}
=Q^{(\alpha)}R^{(\alpha)}
\end{equation}
where $Q^{(\alpha)}$ is diagonal and $R^{(\alpha)}$ is an orthogonal matrix, and we divide by $Q^{(\alpha)}$ (thus only keeping $R^{(\alpha)}$).
Thus, we replace
\begin{equation}
\pi_{\alpha\mathfrak L_r+i}\mapsto R^{(\alpha)}\prod_{j=1}^iD\hat u^{(j)}
.
=R^{(\alpha)}Q^{(\alpha)}
\end{equation}
where $Q^{(\alpha)}$ is orthogonal and $R^{(\alpha)}$ is a diagonal matrix, and we divide by $R^{(\alpha)}$ (thus only keeping $Q^{(\alpha)}$).
The Lyapunov exponents at time $\alpha\mathfrak L_r$ are then
\begin{equation}
\frac1{\alpha\mathfrak L_r}\sum_{\beta=1}^\alpha\log\mathrm{spec}(Q^{(\beta)})