<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing with OASIS Tables v3.0 20080202//EN" "journalpub-oasis3.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:oasis="http://docs.oasis-open.org/ns/oasis-exchange/table" xml:lang="en" dtd-version="3.0" article-type="research-article">
  <front>
    <journal-meta><journal-id journal-id-type="publisher">GMD</journal-id><journal-title-group>
    <journal-title>Geoscientific Model Development</journal-title>
    <abbrev-journal-title abbrev-type="publisher">GMD</abbrev-journal-title><abbrev-journal-title abbrev-type="nlm-ta">Geosci. Model Dev.</abbrev-journal-title>
  </journal-title-group><issn pub-type="epub">1991-9603</issn><publisher>
    <publisher-name>Copernicus Publications</publisher-name>
    <publisher-loc>Göttingen, Germany</publisher-loc>
  </publisher></journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.5194/gmd-14-5957-2021</article-id><title-group><article-title>SymPKF (v1.0): a symbolic and computational toolbox for the design of
parametric Kalman filter dynamics</article-title><alt-title>SymPKF (v1.0)</alt-title>
      </title-group><?xmltex \runningtitle{SymPKF (v1.0)}?><?xmltex \runningauthor{O. Pannekoucke and P. Arbogast}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1 aff2 aff3">
          <name><surname>Pannekoucke</surname><given-names>Olivier</given-names></name>
          <email>olivier.pannekoucke@meteo.fr</email>
        <ext-link>https://orcid.org/0000-0002-3249-2818</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff4">
          <name><surname>Arbogast</surname><given-names>Philippe</given-names></name>
          
        </contrib>
        <aff id="aff1"><label>1</label><institution>INPT-ENM, Toulouse, France</institution>
        </aff>
        <aff id="aff2"><label>2</label><institution>CNRM, Université de Toulouse, Météo-France, CNRS, Toulouse, France</institution>
        </aff>
        <aff id="aff3"><label>3</label><institution>CERFACS, Toulouse, France</institution>
        </aff>
        <aff id="aff4"><label>4</label><institution>Météo-France, Toulouse, France</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Olivier Pannekoucke (olivier.pannekoucke@meteo.fr)</corresp></author-notes><pub-date><day>4</day><month>October</month><year>2021</year></pub-date>
      
      <volume>14</volume>
      <issue>10</issue>
      <fpage>5957</fpage><lpage>5976</lpage>
      <history>
        <date date-type="received"><day>22</day><month>March</month><year>2021</year></date>
           <date date-type="rev-request"><day>23</day><month>April</month><year>2021</year></date>
           <date date-type="rev-recd"><day>29</day><month>July</month><year>2021</year></date>
           <date date-type="accepted"><day>16</day><month>August</month><year>2021</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2021 Olivier Pannekoucke</copyright-statement>
        <copyright-year>2021</copyright-year>
      <license license-type="open-access"><license-p>This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this licence, visit <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link></license-p></license></permissions><self-uri xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021.html">This article is available from https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021.pdf</self-uri>
      <abstract><title>Abstract</title>
    <p id="d1e110">Recent research in data assimilation has led to the introduction of the parametric
Kalman filter (PKF): an implementation of the Kalman filter, whereby the
covariance matrices are approximated by a parameterized covariance model.
In the PKF, the dynamics of the covariance during the forecast step rely on
the prediction of the covariance parameters. Hence, the design of the parameter
dynamics is crucial, while it can be tedious to do this by hand.
This contribution introduces a Python package, SymPKF, able to compute PKF dynamics
for univariate statistics and when the covariance model is parameterized from the
variance and the local anisotropy of the correlations. The ability of SymPKF to
produce the PKF dynamics is shown on a nonlinear diffusive advection (the Burgers equation)
over a 1D domain and the linear advection over a 2D domain. The computation of the PKF
dynamics is performed at a symbolic level, but an automatic code generator is also
introduced to perform numerical simulations. A final multivariate example
illustrates the potential of SymPKF to go beyond the univariate case.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d1e122">The Kalman filter (KF) <xref ref-type="bibr" rid="bib1.bibx12" id="paren.1"/> is one of the backbones of data assimilation.
This filter represents the dynamics of a Gaussian
distribution all along the analysis and forecast cycles and takes the form of two equations representing the
evolution of the mean and of the covariance of the Gaussian distribution.</p>
      <p id="d1e128"><?xmltex \hack{\newpage}?>While the equations of the KF are simple linear algebra, the large dimension of linear space encountered in the
realm of data assimilation makes the KF impossible to handle, and this is particularly true for the forecast step.
This limitation has motivated some approximation of covariance matrix to make the KF possible. For instance, in the
ensemble method <xref ref-type="bibr" rid="bib1.bibx7" id="paren.2"/>, the covariance matrix is approximated by a sample estimation, whereby the
time evolution of the covariance matrix is then deduced from the forecast of each individual sample.
In the parametric Kalman filter (PKF) <xref ref-type="bibr" rid="bib1.bibx26 bib1.bibx28 bib1.bibx27" id="paren.3"/>,
the covariance matrix is approximated by a parametric
covariance model; the time evolution of the matrix is deduced from the time integration of the parameters' evolution equations.</p>
      <p id="d1e138">One of the major limitations for the PKF is the design of the parameter evolution equations.
Although not difficult from a mathematical point of view, this step requires
the calculation of many terms that are difficult to calculate by hand and
may involve errors in the calculation. To facilitate the derivation of
the parametric dynamics and certify the correctness of the resulting system a
symbolic derivation of the dynamics would be welcome.</p>
      <p id="d1e141">The goal of the package SymPKF 1.0<fn id="Ch1.Footn1"><p id="d1e144"><uri>https://github.com/opannekoucke/sympkf</uri>, last access: 22 September 2021.​​​​​​​</p></fn>
is to facilitate the computation of
the PKF dynamics for a particular class of covariance model, the VLATcov model,
which is parameterized by the variance and the anisotropy.
The symbolic computation of the PKF dynamics relies on a
computer algebra system (CAS) able to handle abstract mathematical expressions.
A preliminary version has been implemented with
Maxima<fn id="Ch1.Footn2"><p id="d1e150"><uri>https://maxima.sourceforge.io/</uri>, last access: 22 September 2021.</p></fn> <xref ref-type="bibr" rid="bib1.bibx20" id="paren.4"/>. However,
in order to create an integrated framework that would include the design
of the parametric system, as well as its numerical evaluation, the
symbolic Python package SymPy <xref ref-type="bibr" rid="bib1.bibx16" id="paren.5"/> has been preferred for the
present implementation. In particular, SymPKF comes with an automatic code generator
to provide an end-to-end exploration of the PKF approach from the computation
of the PKF dynamics to their numerical integration.</p>
      <p id="d1e163">The paper is organized as follows. The next section provides the background
on data assimilation and introduces the PKF. Section <xref ref-type="sec" rid="Ch1.S3"/> focuses on the
PKF for univariate VLATcov models in the perspective of  symbolic computation by
a CAS. Then, the package SymPKF is introduced in Sect. <xref ref-type="sec" rid="Ch1.S4"/>
from its use on the nonlinear diffusive advection (the Burgers equation) over a
1D domain. A numerical example illustrates the use of the automatic code generator provided
in SymPKF. Then, the example of the linear advection over a 2D domain shows
the ability of SymPKF to handle 2D and 3D domains.
The section ends with a simple illustration of a multivariate situation, which also
shows that SymPKF applies to a system of prognostic equations.
The conclusion is given in Sect. <xref ref-type="sec" rid="Ch1.S5"/>.</p>
</sec>
<?pagebreak page5958?><sec id="Ch1.S2">
  <label>2</label><title>Description of the PKF</title>
<sec id="Ch1.S2.SS1">
  <label>2.1</label><title>Context of the numerical prediction</title>
      <p id="d1e187">Dynamics encountered in geosciences are given as a system of partial differential equations (PDEs):
            <disp-formula id="Ch1.E1" content-type="numbered"><label>1</label><mml:math id="M1" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="script">X</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="script">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M2" display="inline"><mml:mrow><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the state of the system and denotes either a scalar
field or multivariate fields in a coordinate system <inline-formula><mml:math id="M3" display="inline"><mml:mrow><mml:mi mathvariant="bold">x</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msup><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msup><mml:msub><mml:mo>)</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>,
where <inline-formula><mml:math id="M4" display="inline"><mml:mi>d</mml:mi></mml:math></inline-formula> is the dimension the geographical space, <inline-formula><mml:math id="M5" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="script">X</mml:mi></mml:mrow></mml:math></inline-formula> represents the
partial derivatives with respect to the coordinate system at any order,
with the convention that order zero denotes the field <inline-formula><mml:math id="M6" display="inline"><mml:mi mathvariant="script">X</mml:mi></mml:math></inline-formula> itself, and
<inline-formula><mml:math id="M7" display="inline"><mml:mi mathvariant="script">M</mml:mi></mml:math></inline-formula> denotes the trend of the dynamics.
A spatial discretization (e.g.,  by using finite differences, finite elements,
finite volumes, spectral decomposition) transforms Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) into
            <disp-formula id="Ch1.E2" content-type="numbered"><label>2</label><mml:math id="M8" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="script">X</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="script">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where, this time, <inline-formula><mml:math id="M9" display="inline"><mml:mrow><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is a vector, and <inline-formula><mml:math id="M10" display="inline"><mml:mi mathvariant="script">M</mml:mi></mml:math></inline-formula> denotes the discretization of
the trend in Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>).
Thereafter, <inline-formula><mml:math id="M11" display="inline"><mml:mi mathvariant="script">X</mml:mi></mml:math></inline-formula> can be seen either as a collection of continuous fields
with dynamics given by Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) or a discrete vector of dynamics as in Eq. (<xref ref-type="disp-formula" rid="Ch1.E2"/>).</p>
      <p id="d1e372">Because of the sparsity and the error of the observations,
the forecast <inline-formula><mml:math id="M12" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">X</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> is only an estimation of the true state <inline-formula><mml:math id="M13" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">X</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula>, which
is known to within a forecast error
defined by <inline-formula><mml:math id="M14" display="inline"><mml:mrow><mml:msup><mml:mi>e</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msup><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="script">X</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msup><mml:mo>-</mml:mo><mml:msup><mml:mi mathvariant="script">X</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula>. This error is often modeled as an unbiased random
variable, <inline-formula><mml:math id="M15" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msup><mml:mi>e</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>. In the discrete formulation of the dynamics in Eq. (<xref ref-type="disp-formula" rid="Ch1.E2"/>),
the forecast error covariance matrix is given by
<inline-formula><mml:math id="M16" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">P</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msup><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:msup><mml:mi>e</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msup><mml:mo>(</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msup><mml:msup><mml:mo>)</mml:mo><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>, where the superscript <inline-formula><mml:math id="M17" display="inline"><mml:msup><mml:mi/><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:math></inline-formula>
denotes the transpose operator. Since this contribution is focused on the
forecast step, hereafter the upper script <inline-formula><mml:math id="M18" display="inline"><mml:msup><mml:mi/><mml:mi mathvariant="normal">f</mml:mi></mml:msup></mml:math></inline-formula> is removed for the sake of simplicity.</p>
      <p id="d1e496">We now detail how the error covariance matrix evolves during the forecast
by considering the formalism of the second-order nonlinear Kalman filter.</p>
</sec>
<sec id="Ch1.S2.SS2">
  <label>2.2</label><title>Second-order nonlinear Kalman filter</title>
      <p id="d1e507">A second-order nonlinear Kalman filter (KF2) is a filter that extends the Kalman filter (KF)
to nonlinear situations in which the error covariance matrix evolves tangent-linearly
along the trajectory of the mean state and  the dynamics of this mean are governed
by the fluctuation–mean interacting dynamics <xref ref-type="bibr" rid="bib1.bibx11 bib1.bibx4" id="paren.6"/>.
Hence, we first state the dynamics of the mean under the fluctuation–mean interaction,
then the dynamics of the error covariance.
Note that the choice of the following presentation
is motivated by the perspective of using a computer algebra system to perform
the computation.</p>
<sec id="Ch1.S2.SS2.SSS1">
  <label>2.2.1</label><title>Computation of the fluctuation–mean interaction dynamics</title>
      <p id="d1e520">Because of the uncertainty in the initial condition, the state
<inline-formula><mml:math id="M19" display="inline"><mml:mi mathvariant="script">X</mml:mi></mml:math></inline-formula> is modelized as a Markov process <inline-formula><mml:math id="M20" display="inline"><mml:mrow><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="italic">ω</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M21" display="inline"><mml:mi mathvariant="italic">ω</mml:mi></mml:math></inline-formula> stands for
the stochasticity, while <inline-formula><mml:math id="M22" display="inline"><mml:mi mathvariant="script">X</mml:mi></mml:math></inline-formula> evolves by Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>). Hence, <inline-formula><mml:math id="M23" display="inline"><mml:mi mathvariant="italic">ω</mml:mi></mml:math></inline-formula> lies within a
certain probability space <inline-formula><mml:math id="M24" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="script">F</mml:mi><mml:mo>,</mml:mo><mml:mi>P</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M25" display="inline"><mml:mi mathvariant="script">F</mml:mi></mml:math></inline-formula> is <inline-formula><mml:math id="M26" display="inline"><mml:mi mathvariant="italic">σ</mml:mi></mml:math></inline-formula> algebra on <inline-formula><mml:math id="M27" display="inline"><mml:mi mathvariant="normal">Ω</mml:mi></mml:math></inline-formula>
(a family of subsets of <inline-formula><mml:math id="M28" display="inline"><mml:mi mathvariant="normal">Ω</mml:mi></mml:math></inline-formula>, which contains <inline-formula><mml:math id="M29" display="inline"><mml:mi mathvariant="normal">Ω</mml:mi></mml:math></inline-formula> and which is stable for the
complement and the countable union) and <inline-formula><mml:math id="M30" display="inline"><mml:mi>P</mml:mi></mml:math></inline-formula> is a probability measure (see, e.g.,
<xref ref-type="bibr" rid="bib1.bibx18" id="altparen.7"><named-content content-type="post">chap.2</named-content></xref>).
<inline-formula><mml:math id="M31" display="inline"><mml:mrow><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mo>⋅</mml:mo><mml:mo>)</mml:mo><mml:mo>:</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="script">F</mml:mi><mml:mo>)</mml:mo><mml:mo>→</mml:mo><mml:mo>(</mml:mo><mml:msup><mml:mi mathvariant="double-struck">R</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:mo>,</mml:mo><mml:msub><mml:mi mathvariant="script">B</mml:mi><mml:mrow><mml:msup><mml:mi mathvariant="double-struck">R</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is an
<inline-formula><mml:math id="M32" display="inline"><mml:mi mathvariant="script">F</mml:mi></mml:math></inline-formula>-measurable function wherein <inline-formula><mml:math id="M33" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="script">B</mml:mi><mml:mrow><mml:msup><mml:mi mathvariant="double-struck">R</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> denotes the
Borel <inline-formula><mml:math id="M34" display="inline"><mml:mi mathvariant="italic">σ</mml:mi></mml:math></inline-formula> algebra on <inline-formula><mml:math id="M35" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="double-struck">R</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula>, where the integer <inline-formula><mml:math id="M36" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> is either the dimension of the
multivariate field <inline-formula><mml:math id="M37" display="inline"><mml:mrow><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> or the dimension of its discretized version <inline-formula><mml:math id="M38" display="inline"><mml:mrow><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.
The connection between the Markov process and the parameter dynamics is
obtained using the Reynolds averaging technique <xref ref-type="bibr" rid="bib1.bibx14" id="paren.8"><named-content content-type="post">chap. 4</named-content></xref>.</p>
      <?pagebreak page5959?><p id="d1e786">To perform the Reynolds averaging of Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>), the first step is to replace
the random field by its Reynolds decomposition
<inline-formula><mml:math id="M39" display="inline"><mml:mrow><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="italic">ω</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:mi>e</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="italic">ω</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. In this modeling
of the random state, <inline-formula><mml:math id="M40" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> is the ensemble average or the mean state; <inline-formula><mml:math id="M41" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> is an error
or a fluctuation to the mean, and it is an unbiased random field, <inline-formula><mml:math id="M42" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>.
Then, Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) reads as
              <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M43" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="script">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
            where <inline-formula><mml:math id="M44" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> is a control of magnitude introduced to facilitate Taylor's expansion
when using a computer algebra system.
At the second order, the Taylor's expansion in <inline-formula><mml:math id="M45" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> of Eq. (<xref ref-type="disp-formula" rid="Ch1.E3"/>) reads<?xmltex \setcounter{equation}{3}?>
              <disp-formula id="Ch1.E4.5" content-type="subnumberedon"><label>4a</label><mml:math id="M46" display="block"><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>e</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mi mathvariant="script">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:msup><mml:mi mathvariant="script">M</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>(</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:msup><mml:mi mathvariant="script">M</mml:mi><mml:mrow><mml:mo>′</mml:mo><mml:mo>′</mml:mo></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>(</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>⊗</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
            where <inline-formula><mml:math id="M47" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">M</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M48" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">M</mml:mi><mml:mrow><mml:mo>′</mml:mo><mml:mo>′</mml:mo></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> are two linear operators; the former (the latter)
refers to the tangent-linear model (the Hessian), and both are computed with respect
to the mean state <inline-formula><mml:math id="M49" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.
The first-order expansion is deduced from Eq. (<xref ref-type="disp-formula" rid="Ch1.E4.5"/>) by setting <inline-formula><mml:math id="M50" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">η</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>,
which then reads as
              <disp-formula id="Ch1.E4.6" content-type="subnumberedoff"><label>4b</label><mml:math id="M51" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="script">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:msup><mml:mi mathvariant="script">M</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>(</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e1276">By setting <inline-formula><mml:math id="M52" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> to 1, the dynamics of the ensemble average are calculated at
the second order from the expectation of Eq. (<xref ref-type="disp-formula" rid="Ch1.E4.5"/>) that reads as
              <disp-formula id="Ch1.E7" content-type="numbered"><label>5</label><mml:math id="M53" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="script">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="script">M</mml:mi><mml:mrow><mml:mo>′</mml:mo><mml:mo>′</mml:mo></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>⊗</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
            where <inline-formula><mml:math id="M54" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>⊗</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi></mml:mrow></mml:math></inline-formula> denotes the tensor product of the partial derivatives with respect to
the spatial coordinates, i.e.,  terms such as <inline-formula><mml:math id="M55" display="inline"><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mi>k</mml:mi></mml:msup><mml:mi>e</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi>m</mml:mi></mml:msup><mml:mi>e</mml:mi></mml:mrow></mml:math></inline-formula> for any positive integers <inline-formula><mml:math id="M56" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. Here, we have
used the assumption that the partial derivative commutes with the expectation, <inline-formula><mml:math id="M57" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>,
and that <inline-formula><mml:math id="M58" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>.
Because the expectation is a projector, <inline-formula><mml:math id="M59" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mo>⋅</mml:mo><mml:mo>]</mml:mo><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mo>⋅</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, the expectation of
<inline-formula><mml:math id="M60" display="inline"><mml:mrow><mml:mi mathvariant="script">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is itself.
The second term of the right-hand side makes the retro-action of the error
appear in the ensemble-averaged dynamics. Hence, Eq. (<xref ref-type="disp-formula" rid="Ch1.E7"/>) gives the dynamics of the
error–mean interaction (or fluctuation–mean interaction).</p>
      <p id="d1e1540">Note that the tangent-linear dynamics along the ensemble-averaged dynamics in Eq. (<xref ref-type="disp-formula" rid="Ch1.E7"/>)
are obtained as the difference between the first-order Taylor's
expansion in Eq. (<xref ref-type="disp-formula" rid="Ch1.E4.6"/>) and its expectation, and they read as
              <disp-formula id="Ch1.E8" content-type="numbered"><label>6</label><mml:math id="M61" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="script">M</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>(</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d1e1596">Now it is possible to detail the dynamics of the error covariance from the
dynamics of the error, which tangent-linearly evolve along the mean state <inline-formula><mml:math id="M62" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
</sec>
<sec id="Ch1.S2.SS2.SSS2">
  <label>2.2.2</label><title>Computation of the error covariance dynamics</title>
      <p id="d1e1621">In the discretized form, the dynamics of the error in Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>) read as the ordinary differential equation (ODE):
              <disp-formula id="Ch1.E9" content-type="numbered"><label>7</label><mml:math id="M63" display="block"><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">d</mml:mi><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mi mathvariant="bold">M</mml:mi><mml:mi>e</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
            where <inline-formula><mml:math id="M64" display="inline"><mml:mi mathvariant="bold">M</mml:mi></mml:math></inline-formula> stands for the tangent-linear (TL) model <inline-formula><mml:math id="M65" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">M</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> evaluated
at the mean state <inline-formula><mml:math id="M66" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.
So the dynamics of the error covariance matrix, <inline-formula><mml:math id="M67" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mi>e</mml:mi><mml:msup><mml:mi>e</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>, are given by the ODE:<?xmltex \setcounter{equation}{7}?>
              <disp-formula id="Ch1.E10.11" content-type="subnumberedon"><label>8a</label><mml:math id="M68" display="block"><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">d</mml:mi><mml:mi mathvariant="bold">P</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mi mathvariant="bold">MP</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="bold">PM</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:math></disp-formula>
            (<inline-formula><mml:math id="M69" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">M</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> is the adjoint of <inline-formula><mml:math id="M70" display="inline"><mml:mi mathvariant="bold">M</mml:mi></mml:math></inline-formula>)
or its integrated version
              <disp-formula id="Ch1.E10.12" content-type="subnumberedoff"><label>8b</label><mml:math id="M71" display="block"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="bold">M</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>←</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:msub><mml:msub><mml:mi mathvariant="bold">P</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:msub><mml:mi mathvariant="bold">M</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>←</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
            where <inline-formula><mml:math id="M72" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">M</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>←</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is the propagator
associated with the time integration of Eq. (<xref ref-type="disp-formula" rid="Ch1.E9"/>), initiated from the covariance <inline-formula><mml:math id="M73" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">P</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>.</p><?xmltex \hack{\newpage}?>
</sec>
<?pagebreak page5960?><sec id="Ch1.S2.SS2.SSS3">
  <label>2.2.3</label><title>Setting of the KF2</title>
      <p id="d1e1860">Gathering the dynamics of the ensemble mean given by the fluctuation–mean interaction in
Eq. (<xref ref-type="disp-formula" rid="Ch1.E7"/>) and the covariance dynamics in Eq. (8) leads to the second-order closure
approximation of the extended KF, which is the forecast step
equations of the KF2.</p>
      <p id="d1e1865">Similarly to the KF, the principal limitation of the KF2 is the numerical
cost associated with the covariance dynamics in Eq. (8):
living in a discrete world, the numerical cost of Eq. (8)
dramatically increases with the size of the problem.
As an example, for the dynamics of a simple scalar field discretized
with <inline-formula><mml:math id="M74" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> grid points, the dimension of its vector representation is <inline-formula><mml:math id="M75" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>,
while the size of the error covariance matrix scales as
<inline-formula><mml:math id="M76" display="inline"><mml:mrow><mml:msup><mml:mi>n</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, leading to a numerical cost of Eq. (8) between <inline-formula><mml:math id="M77" display="inline"><mml:mrow><mml:mi mathvariant="script">O</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>n</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M78" display="inline"><mml:mrow><mml:mi mathvariant="script">O</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>n</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e1927">We now introduce the parametric approximation of covariance
matrices, which aims to reduce the cost of the covariance dynamics in Eq. (8).</p>
</sec>
</sec>
<sec id="Ch1.S2.SS3">
  <label>2.3</label><title>Formulation of the PKF prediction</title>
      <p id="d1e1939">The parametric formulation of covariance evolution stands as follows.
If <inline-formula><mml:math id="M79" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="script">P</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> denotes a covariance model featured by
a set of parameters <inline-formula><mml:math id="M80" display="inline"><mml:mrow><mml:mi mathvariant="script">P</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mo>)</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mi>I</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, then there is a set
<inline-formula><mml:math id="M81" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> featuring the forecast  error covariance
matrix so that <inline-formula><mml:math id="M82" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:msubsup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> approximates the forecast error covariance
<inline-formula><mml:math id="M83" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold">P</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>, i.e., <inline-formula><mml:math id="M84" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:msubsup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup><mml:mo>)</mml:mo><mml:mo>≈</mml:mo><mml:msubsup><mml:mi mathvariant="bold">P</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>. Note that a parameter
<inline-formula><mml:math id="M85" display="inline"><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> can be a scalar or a field, e.g.,  a variance field.</p>
      <p id="d1e2068">Hence, starting from the initial condition
<inline-formula><mml:math id="M86" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msup><mml:mo>=</mml:mo><mml:msubsup><mml:mi mathvariant="script">P</mml:mi><mml:mn mathvariant="normal">0</mml:mn><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> so that <inline-formula><mml:math id="M87" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:msubsup><mml:mi mathvariant="script">P</mml:mi><mml:mn mathvariant="normal">0</mml:mn><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup><mml:mo>)</mml:mo><mml:mo>≈</mml:mo><mml:msubsup><mml:mi mathvariant="bold">P</mml:mi><mml:mn mathvariant="normal">0</mml:mn><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>,
if the dynamics of the parameters <inline-formula><mml:math id="M88" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> are known,
then it is possible to approximately determine <inline-formula><mml:math id="M89" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold">P</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> by <inline-formula><mml:math id="M90" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:msubsup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>
without solving Eq. (8) explicitly.
This approach constitutes the so-called parametric
Kalman filter (PKF) approximation introduced by
<xref ref-type="bibr" rid="bib1.bibx26 bib1.bibx27" id="text.9"/> (P16, P18).</p>
      <p id="d1e2168">In practice, the parametric covariance models considered in the PKF are such that
the number of parameters in <inline-formula><mml:math id="M91" display="inline"><mml:mi mathvariant="script">P</mml:mi></mml:math></inline-formula> is much lower than the number of coefficients
required to represent the full covariance <inline-formula><mml:math id="M92" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="script">P</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.
For instance, for the dynamics of a scalar field discretized with <inline-formula><mml:math id="M93" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> grid points,
as introduced in Sect. <xref ref-type="sec" rid="Ch1.S2.SS2.SSS3"/>, the total number of parameters in <inline-formula><mml:math id="M94" display="inline"><mml:mi mathvariant="script">P</mml:mi></mml:math></inline-formula>
should be of same order as <inline-formula><mml:math id="M95" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>, e.g.,  <inline-formula><mml:math id="M96" display="inline"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi>n</mml:mi></mml:mrow></mml:math></inline-formula> or <inline-formula><mml:math id="M97" display="inline"><mml:mrow><mml:mn mathvariant="normal">3</mml:mn><mml:mi>n</mml:mi></mml:mrow></mml:math></inline-formula>, so that the
cost to predict the evolution of the parameters would represent <inline-formula><mml:math id="M98" display="inline"><mml:mn mathvariant="normal">2</mml:mn></mml:math></inline-formula> or <inline-formula><mml:math id="M99" display="inline"><mml:mn mathvariant="normal">3</mml:mn></mml:math></inline-formula>
times the cost to predict the evolution of the scalar field.
Said differently, the cost to predict the parameters should scale in <inline-formula><mml:math id="M100" display="inline"><mml:mrow><mml:mi mathvariant="script">O</mml:mi><mml:mo>(</mml:mo><mml:mi>n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, which
is much lower than the computation of Eq. (8) in <inline-formula><mml:math id="M101" display="inline"><mml:mrow><mml:mi mathvariant="script">O</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>n</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> - <inline-formula><mml:math id="M102" display="inline"><mml:mrow><mml:mi mathvariant="script">O</mml:mi><mml:mo>(</mml:mo><mml:msup><mml:mi>n</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e2299">The cost of the PKF can be compared with other low-rank methods such as
the reduced-rank Kalman filter <xref ref-type="bibr" rid="bib1.bibx8" id="paren.10"/> or the ensemble Kalman filter
<xref ref-type="bibr" rid="bib1.bibx7" id="paren.11"/>, for which an ensemble size of <inline-formula><mml:math id="M103" display="inline"><mml:mn mathvariant="normal">100</mml:mn></mml:math></inline-formula> members is often encountered
depending on the dimension of the unstable subspace and to limit the amount of
sampling noise. Hence, when each forecast is made at full resolution  the cost
of these approaches is <inline-formula><mml:math id="M104" display="inline"><mml:mn mathvariant="normal">100</mml:mn></mml:math></inline-formula> times the cost of a prediction, which is larger than the
cost we expect for the PKF (see P16, P18).
Note that low-rank and ensemble methods often consider
the computation of the dynamics at a lower resolution, which leads to a lower cost
than the <inline-formula><mml:math id="M105" display="inline"><mml:mn mathvariant="normal">100</mml:mn></mml:math></inline-formula> forecast at full resolution. The PKF is computed at the full resolution
and  is free from sampling noise.</p>
      <p id="d1e2330">But the frugality of the covariance model is not the only criterion. For instance,
the first variational data assimilation systems considered a covariance model
based on the spectral diagonal assumption in spectral space
<xref ref-type="bibr" rid="bib1.bibx5 bib1.bibx2" id="paren.12"/>. This covariance model reads as
<inline-formula><mml:math id="M106" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">P</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msup><mml:mo>(</mml:mo><mml:msup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msup><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="bold">Σ</mml:mi><mml:msup><mml:mi mathvariant="bold">S</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mi mathvariant="bold">D</mml:mi><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:msup><mml:mi mathvariant="bold">S</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfenced><mml:mo>*</mml:mo></mml:msup><mml:msup><mml:mi mathvariant="bold">Σ</mml:mi><mml:mo>*</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula>,
where <inline-formula><mml:math id="M107" display="inline"><mml:mi mathvariant="bold">S</mml:mi></mml:math></inline-formula>
denotes the spectral transform with <inline-formula><mml:math id="M108" display="inline"><mml:msup><mml:mi/><mml:mo>*</mml:mo></mml:msup></mml:math></inline-formula> the conjugate transpose operator, and
<inline-formula><mml:math id="M109" display="inline"><mml:mi mathvariant="bold">Σ</mml:mi></mml:math></inline-formula> is the diagonal matrix of standard deviation, i.e.,  the square root
of the variance field <inline-formula><mml:math id="M110" display="inline"><mml:mi>V</mml:mi></mml:math></inline-formula>. In this model, the set of parameters <inline-formula><mml:math id="M111" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> is given by
the grid points and the spectral variances, <inline-formula><mml:math id="M112" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msup><mml:mo>=</mml:mo><mml:mfenced close=")" open="("><mml:mrow><mml:mi>V</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">diag</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">D</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>.
If the shape of <inline-formula><mml:math id="M113" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">P</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msup><mml:mo>(</mml:mo><mml:msup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is <inline-formula><mml:math id="M114" display="inline"><mml:mrow><mml:msup><mml:mi>n</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, the number of parameters <inline-formula><mml:math id="M115" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">P</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula>
for this covariance model is <inline-formula><mml:math id="M116" display="inline"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi>n</mml:mi></mml:mrow></mml:math></inline-formula> (<inline-formula><mml:math id="M117" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> variances in grid points,
stored as the standard deviation in the diagonal of <inline-formula><mml:math id="M118" display="inline"><mml:mi mathvariant="bold">Σ</mml:mi></mml:math></inline-formula>; <inline-formula><mml:math id="M119" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>
variances in spectral, stored in the diagonal of <inline-formula><mml:math id="M120" display="inline"><mml:mi mathvariant="bold">D</mml:mi></mml:math></inline-formula>), which is quite economical.
However, the resulting correlation functions are homogeneous (there is the same
correlation function in each point), which is enough to represent climatologically
stationary background error statistics but not the flow-dependent
statistics as existing in the KF. While it is possible to write the equations for the
dynamics of the spectral variances (e.g.,  for the linear waves), the limitation that
the spectral diagonal approach can only model homogeneous correlations motivated the
introduction of other covariance models. For example, the covariance model based on the
diagonal assumption in wavelet space <xref ref-type="bibr" rid="bib1.bibx9 bib1.bibx25" id="paren.13"/>
can model heterogeneous correlations at a low memory cost.
However, the dynamics of the wavelet variances
are much more difficult to develop because of the redundancy of the wavelet
transform on the sphere.</p>
      <p id="d1e2541">Hence, a covariance model adapted for the PKF should be able
to represent realistic correlations and be such that the dynamics of
the parameters can be computed, e.g.,  a covariance model defined by parameters in grid points.
To do so, we now focus on the PKF applied to a particular family of covariance models,
whose parameters are defined in grid points by the variance and the anisotropy fields:
<inline-formula><mml:math id="M121" display="inline"><mml:mrow><mml:mi mathvariant="script">P</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">g</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M122" display="inline"><mml:mi mathvariant="bold">g</mml:mi></mml:math></inline-formula> will denotes the local anisotropy tensor of the local
correlation function.</p>
</sec>
</sec>
<sec id="Ch1.S3">
  <label>3</label><title>PKF for VLATcov models</title>
      <p id="d1e2580">This part introduces a particular family of covariance models parameterized by
the fields of variances and of the local anisotropy tensor: the VLATcov  models
<xref ref-type="bibr" rid="bib1.bibx21" id="paren.14"/>.
What makes this covariance model interesting is that its parameters are related
to the error field, and thus it is possible to determine the dynamics of the parameters.
To introduce VLATcov models, we first present the diagnosis of the variance
and of the local anisotropy tensor; then we present<?pagebreak page5961?> two examples of VLATcov models, and
we end the section with a description of the dynamics of the parameters.</p>
<sec id="Ch1.S3.SS1">
  <label>3.1</label><title>Definition of the fields of variance and of local anisotropy tensor</title>
      <p id="d1e2593">From now, we will focus on the forecast error statistics, so the upper script <inline-formula><mml:math id="M123" display="inline"><mml:msup><mml:mi/><mml:mi mathvariant="normal">f</mml:mi></mml:msup></mml:math></inline-formula> is
removed for the sake of simplicity. Moreover, for a function <inline-formula><mml:math id="M124" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula>, when there
is no confusion, the value of <inline-formula><mml:math id="M125" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula> at a point <inline-formula><mml:math id="M126" display="inline"><mml:mi mathvariant="bold">x</mml:mi></mml:math></inline-formula> is written either as <inline-formula><mml:math id="M127" display="inline"><mml:mrow><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> or
as <inline-formula><mml:math id="M128" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="bold">x</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e2652">The forecast error being unbiased, <inline-formula><mml:math id="M129" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>, its variance at a point <inline-formula><mml:math id="M130" display="inline"><mml:mi mathvariant="bold">x</mml:mi></mml:math></inline-formula> is defined as
            <disp-formula id="Ch1.E13" content-type="numbered"><label>9</label><mml:math id="M131" display="block"><mml:mrow><mml:mi>V</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:msup><mml:mo>)</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>]</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          When the error is a random differentiable field, the anisotropy of the two-point correlation function
<inline-formula><mml:math id="M132" display="inline"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:msqrt><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi mathvariant="bold">x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi mathvariant="bold">y</mml:mi></mml:msub></mml:mrow></mml:msqrt></mml:mfrac></mml:mstyle><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>e</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mi>e</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>
is featured from the second-order expansion,
            <disp-formula id="Ch1.E14" content-type="numbered"><label>10</label><mml:math id="M133" display="block"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>≈</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi mathvariant="bold">x</mml:mi><mml:mo>|</mml:mo><mml:msubsup><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mi mathvariant="bold">x</mml:mi></mml:msub></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          by the local metric tensor <inline-formula><mml:math id="M134" display="inline"><mml:mrow><mml:mi mathvariant="bold">g</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and defined as
            <disp-formula id="Ch1.E15" content-type="numbered"><label>11</label><mml:math id="M135" display="block"><mml:mrow><mml:mi mathvariant="bold">g</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">x</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M136" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">x</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, e.g.,
            <disp-formula id="Ch1.Ex1"><mml:math id="M137" display="block"><mml:mrow><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mfenced open="(" close=")"><mml:mrow><mml:msubsup><mml:mo>∂</mml:mo><mml:mrow><mml:msup><mml:mi>y</mml:mi><mml:mi>i</mml:mi></mml:msup><mml:msup><mml:mi>y</mml:mi><mml:mi>j</mml:mi></mml:msup></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">x</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced><mml:mrow><mml:mi mathvariant="bold">y</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="bold">x</mml:mi></mml:mrow></mml:msub><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          The metric tensor is a symmetric positive definite matrix, and it is a
<inline-formula><mml:math id="M138" display="inline"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula> (<inline-formula><mml:math id="M139" display="inline"><mml:mrow><mml:mn mathvariant="normal">3</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula>) matrix in a 2D (3D) domain.</p>
      <p id="d1e3000">Note that it is useful to introduce the local aspect tensor <xref ref-type="bibr" rid="bib1.bibx29" id="paren.15"/>, defined as the inverse of the metric tensor:
            <disp-formula id="Ch1.E16" content-type="numbered"><label>12</label><mml:math id="M140" display="block"><mml:mrow><mml:mi mathvariant="bold">s</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="bold">g</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:msup><mml:mo>)</mml:mo><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where the superscript <inline-formula><mml:math id="M141" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula> denotes the matrix inverse. The aspect tensor at the point <inline-formula><mml:math id="M142" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula> is geometrically interpreted as an ellipse whose shape coincides with that of the local correlation function.</p>
      <p id="d1e3057">What makes the metric tensor attractive, either at a theoretical or at a practical level,
is that it is closely related to the normalized error
<inline-formula><mml:math id="M143" display="inline"><mml:mrow><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi>e</mml:mi><mml:msqrt><mml:mi>V</mml:mi></mml:msqrt></mml:mfrac></mml:mstyle></mml:mrow></mml:math></inline-formula> by
            <disp-formula id="Ch1.E17" content-type="numbered"><label>13</label><mml:math id="M144" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mrow><mml:msup><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msup></mml:mrow></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>)</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mrow><mml:msup><mml:mi>x</mml:mi><mml:mi>j</mml:mi></mml:msup></mml:mrow></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:math></disp-formula>
          (see, e.g.,  <xref ref-type="bibr" rid="bib1.bibx21" id="altparen.16"/>, for details).</p>
      <p id="d1e3137">Hence, using the notation introduced in Sect. <xref ref-type="sec" rid="Ch1.S2.SS3"/>,
a VLATcov model is a covariance model, <inline-formula><mml:math id="M145" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="script">P</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, characterized by the
set of two parameter fields, <inline-formula><mml:math id="M146" display="inline"><mml:mrow><mml:mi mathvariant="script">P</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, given by the variance field
and by the anisotropy field – the latter being defined either by the metric tensor
field <inline-formula><mml:math id="M147" display="inline"><mml:mi mathvariant="bold">g</mml:mi></mml:math></inline-formula> or by the aspect tensor field <inline-formula><mml:math id="M148" display="inline"><mml:mi mathvariant="bold">s</mml:mi></mml:math></inline-formula> – i.e., <inline-formula><mml:math id="M149" display="inline"><mml:mrow><mml:mi mathvariant="script">P</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">g</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>
or <inline-formula><mml:math id="M150" display="inline"><mml:mrow><mml:mi mathvariant="script">P</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">s</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.
Said differently, any VLATcov model reads as <inline-formula><mml:math id="M151" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">g</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> or <inline-formula><mml:math id="M152" display="inline"><mml:mrow><mml:mi mathvariant="bold">P</mml:mi><mml:mo>(</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">s</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e3273">To put some flesh on the bones, two examples of VLATcov models are now presented.</p>
</sec>
<sec id="Ch1.S3.SS2">
  <label>3.2</label><title>Examples of VLATcov models</title>
      <p id="d1e3284">We first consider the covariance model based on the heterogeneous diffusion operator of
<xref ref-type="bibr" rid="bib1.bibx31" id="text.17"/>, which is used in variational data assimilation
to model heterogeneous correlation functions, e.g.,  for the ocean or for air quality.
This model has the property that, under the local homogenous assumption
(when the spatial derivatives are negligible),
the local aspect tensors of the correlation functions are twice the local diffusion tensors
<xref ref-type="bibr" rid="bib1.bibx24 bib1.bibx17" id="paren.18"/>.
Hence, by defining the local diffusion tensors as half the local aspect tensors,
the covariance model based on the heterogeneous diffusion equation is a VLATcov model.</p>
      <p id="d1e3293">Another example of a heterogeneous covariance model is the
heterogeneous Gaussian covariance model:
            <disp-formula id="Ch1.E18" content-type="numbered"><label>14</label><mml:math id="M153" display="block"><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="bold">P</mml:mi><mml:mrow><mml:mi mathvariant="normal">he</mml:mi><mml:mo>.</mml:mo><mml:mi mathvariant="normal">g</mml:mi></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mo>)</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:msqrt><mml:mrow><mml:mi>V</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mi>V</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:msqrt><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mfenced open="|" close="|"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi mathvariant="bold">x</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:msup><mml:msup><mml:mfenced close="|" open="|"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi mathvariant="bold">y</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:msup><mml:mfenced close="|" open="|"><mml:mrow><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi mathvariant="bold">x</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi mathvariant="bold">y</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mfenced><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>×</mml:mo><mml:mi>exp⁡</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mo>-</mml:mo><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>-</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>|</mml:mo><mml:msubsup><mml:mo>|</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi mathvariant="bold">x</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi mathvariant="bold">y</mml:mi></mml:msub><mml:msup><mml:mo>)</mml:mo><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          where <inline-formula><mml:math id="M154" display="inline"><mml:mi mathvariant="italic">ν</mml:mi></mml:math></inline-formula> is a field of symmetric positive definite matrices, and
<inline-formula><mml:math id="M155" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula> denotes the matrix determinant.
<inline-formula><mml:math id="M156" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">P</mml:mi><mml:mrow><mml:mi mathvariant="normal">he</mml:mi><mml:mo>.</mml:mo><mml:mi mathvariant="normal">g</mml:mi></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is a particular case of the class of covariance models
deduced from Theorem 1 of  <xref ref-type="bibr" rid="bib1.bibx19" id="text.19"/>. Again, this covariance
model has the property that, under local homogenous assumptions,
the local aspect tensor is approximately given by <inline-formula><mml:math id="M157" display="inline"><mml:mi mathvariant="italic">ν</mml:mi></mml:math></inline-formula>, i.e.,  for any point <inline-formula><mml:math id="M158" display="inline"><mml:mi mathvariant="bold">x</mml:mi></mml:math></inline-formula>,
            <disp-formula id="Ch1.E19" content-type="numbered"><label>15</label><mml:math id="M159" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>≈</mml:mo><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          Hence, as for the covariance model based on the diffusion equation,
by defining the field <inline-formula><mml:math id="M160" display="inline"><mml:mi mathvariant="italic">ν</mml:mi></mml:math></inline-formula> as the aspect tensor field, the heterogeneous
Gaussian covariance model is a VLATcov model <xref ref-type="bibr" rid="bib1.bibx21" id="paren.20"/>.</p>
      <p id="d1e3570">At this stage, all the pieces of the puzzle are put together to build the PKF dynamics.
We have covariance models parameterized from the variance and the local anisotropy,
which are both related to the error field: knowing the dynamics of the error leads
to the dynamics of the VLATcov parameters. This is now detailed.</p>
</sec>
<sec id="Ch1.S3.SS3">
  <label>3.3</label><title>PKF prediction step for VLATcov models</title>
      <?pagebreak page5962?><p id="d1e3581">When the dynamics of the error <inline-formula><mml:math id="M161" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> are well approximated from the
tangent-linear evolution in Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>), the connection between the covariance
parameters and the error, represented in Eqs. (<xref ref-type="disp-formula" rid="Ch1.E13"/>) and (<xref ref-type="disp-formula" rid="Ch1.E17"/>),
makes it possible to establish the prediction step of the PKF
<xref ref-type="bibr" rid="bib1.bibx27" id="paren.21"/>, which reads as
the dynamics of the ensemble average (at the second-order closure),<?xmltex \setcounter{equation}{15}?>
            <disp-formula id="Ch1.E20.21" content-type="subnumberedon"><label>16a</label><mml:math id="M162" display="block"><mml:mrow><?xmltex \hack{\hbox\bgroup\fontsize{9.5}{9.5}\selectfont$\displaystyle}?><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="script">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="script">M</mml:mi><mml:mrow><mml:mo>′</mml:mo><mml:mo>′</mml:mo></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>⊗</mml:mo><mml:mo>∂</mml:mo><mml:mi>e</mml:mi><mml:mo>]</mml:mo><mml:mo>)</mml:mo><mml:mo>,</mml:mo><?xmltex \hack{$\egroup}?></mml:mrow></mml:math></disp-formula>
          coupled with the dynamics of the variance and the metric,

                <disp-formula specific-use="align" content-type="subnumberedoff"><mml:math id="M163" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E20.22"><mml:mtd><mml:mtext>16b</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>V</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mi>e</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>e</mml:mi></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E20.23"><mml:mtd><mml:mtext>16c</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mrow><mml:msup><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msup></mml:mrow></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>)</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mrow><mml:msup><mml:mi>x</mml:mi><mml:mi>j</mml:mi></mml:msup></mml:mrow></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced><mml:mo>]</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            where it remains to replace the dynamics of the error (and its normalized version
<inline-formula><mml:math id="M164" display="inline"><mml:mrow><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>=</mml:mo><mml:mi>e</mml:mi><mml:mo>/</mml:mo><mml:msqrt><mml:mi>V</mml:mi></mml:msqrt></mml:mrow></mml:math></inline-formula>)
from Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>) and where the property that the expectation operator and the temporal
derivative commutes, <inline-formula><mml:math id="M165" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mo>⋅</mml:mo><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mo>⋅</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>,
has been used to obtain Eq. (<xref ref-type="disp-formula" rid="Ch1.E20.22"/>) and (<xref ref-type="disp-formula" rid="Ch1.E20.23"/>).</p>
      <p id="d1e3889">Following the discussion in Sect. <xref ref-type="sec" rid="Ch1.S2.SS3"/>, the set of Eq. (16)
is at the heart of the numerical sobriety of the parametric approach since the
cost of the prediction of the parameter scales like <inline-formula><mml:math id="M166" display="inline"><mml:mrow><mml:mi mathvariant="script">O</mml:mi><mml:mo>(</mml:mo><mml:mi>n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.
In contrast to the matrix dynamics of the KF, the PKF approach is designed for the
continuous world, leading to PDEs for the parameter dynamics
in place of  ODEs in Eq. (8) for the full matrix dynamics.
Moreover, the dynamics of the parameters shed light on the nature
of the processes governing the dynamics of covariances,
and it does not require any adjoint of the dynamics
<xref ref-type="bibr" rid="bib1.bibx26 bib1.bibx27" id="paren.22"/>.</p>
      <p id="d1e3911">Note that Eq. (16) can be formulated in terms of
aspect tensors thanks to the definition in Eq. (<xref ref-type="disp-formula" rid="Ch1.E16"/>):
since <inline-formula><mml:math id="M167" display="inline"><mml:mrow><mml:mi mathvariant="bold">sg</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="bold">I</mml:mi></mml:mrow></mml:math></inline-formula>, its
time derivative <inline-formula><mml:math id="M168" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mo>)</mml:mo><mml:mi mathvariant="bold">g</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="bold">s</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> leads to the dynamics
<inline-formula><mml:math id="M169" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:msup><mml:mi mathvariant="bold">g</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mo>)</mml:mo><mml:mi mathvariant="bold">s</mml:mi></mml:mrow></mml:math></inline-formula>, and then
            <disp-formula id="Ch1.E24" content-type="numbered"><label>17</label><mml:math id="M170" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="bold">s</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mo>)</mml:mo><mml:mi mathvariant="bold">s</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where it remains to replace occurrences of <inline-formula><mml:math id="M171" display="inline"><mml:mi mathvariant="bold">g</mml:mi></mml:math></inline-formula> by <inline-formula><mml:math id="M172" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> in the resulting
dynamics of the mean, the variance, and the aspect tensor.</p>
      <p id="d1e4061">Hence, the PKF forecast step for a VLATcov model is given by either the system in
Eq. (16) (in metric) or by its aspect tensor formulation thanks to
Eq. (<xref ref-type="disp-formula" rid="Ch1.E24"/>).
Whatever the formulation considered, it is possible to carry out the calculations using a
formal calculation language. However, even for simple physical processes, the number of
terms in formal expressions can become very large; e.g.,  it is common to have to manipulate
expressions with more than 100 terms.
Thus, any strategy that simplifies the assessment of PKF systems in advance can quickly become a significant advantage.</p>
      <p id="d1e4067">In the following section, we present the splitting method that allows the PKF dynamics to be expressed by bringing together the dynamics of each of the physical processes, calculated individually.</p>
</sec>
<sec id="Ch1.S3.SS4">
  <label>3.4</label><title>The splitting strategy</title>
      <p id="d1e4079">When there are several processes in the dynamics in Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>),
the calculation of the parametric dynamics can be tedious even when
using a computer algebra system. To better use digital resources, a splitting strategy
can be introduced <xref ref-type="bibr" rid="bib1.bibx26 bib1.bibx27" id="paren.23"/>.</p>
      <p id="d1e4087">While the theoretical background is provided by
the Lie–Trotter formula for Lie derivatives, the well-known idea of
time splitting is easily taken from a first-order Taylor expansion of an Euler numerical scheme.</p>
      <p id="d1e4090">The computation of dynamics,
            <disp-formula id="Ch1.E25" content-type="numbered"><label>18</label><mml:math id="M173" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="script">X</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          over a single time step <inline-formula><mml:math id="M174" display="inline"><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula>
can be done in two steps following the numerical scheme
            <disp-formula id="Ch1.E26" content-type="numbered"><label>19</label><mml:math id="M175" display="block"><mml:mrow><mml:mfenced open="{" close=""><mml:mtable class="array" columnalign="left"><mml:mtr><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="script">X</mml:mi><mml:mo>⋆</mml:mo></mml:msup><mml:mo>=</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>t</mml:mi><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="script">X</mml:mi><mml:mo>⋆</mml:mo></mml:msup><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>t</mml:mi><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:msup><mml:mi mathvariant="script">X</mml:mi><mml:mo>⋆</mml:mo></mml:msup><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced></mml:mrow></mml:math></disp-formula>
          where at order <inline-formula><mml:math id="M176" display="inline"><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula>, this scheme is equivalent to
<inline-formula><mml:math id="M177" display="inline"><mml:mrow><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>t</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>, which is the Euler step of
Eq. (<xref ref-type="disp-formula" rid="Ch1.E25"/>). Because <inline-formula><mml:math id="M178" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M179" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> can be viewed as vector fields,
the fractional scheme, joining the starting point (at <inline-formula><mml:math id="M180" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula>) to the end point (at <inline-formula><mml:math id="M181" display="inline"><mml:mrow><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula>),
remains to go through the parallelogram formed by the sum of the two vectors along its sides.
Since there are two paths joining the extreme points, starting the computation by <inline-formula><mml:math id="M182" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>
is equivalent to starting by <inline-formula><mml:math id="M183" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> (at order <inline-formula><mml:math id="M184" display="inline"><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula>); this corresponds to the commutativity
of the diagram formed by the parallelogram.</p>
      <p id="d1e4409">Appendix <xref ref-type="sec" rid="App1.Ch1.S1"/> shows that the dynamics given by Eq. (<xref ref-type="disp-formula" rid="Ch1.E25"/>) imply dynamics of the error, the variance, the metric,
and the aspect written as a sum of trends. Hence, it is possible to apply a splitting for all these dynamics.</p>
      <p id="d1e4417">As a consequence of the calculation of the parametric dynamics, calculating the parametric dynamics of
Eq. (<xref ref-type="disp-formula" rid="Ch1.E25"/>) is equivalent to separately calculating the parametric dynamics of <inline-formula><mml:math id="M185" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="script">X</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>
and <inline-formula><mml:math id="M186" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="script">X</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, then bringing together the two parametric dynamics into a single
one by summing the trends for the mean, the variance, the metric, or the aspect dynamics.
This splitting applies when there are more than two processes and
appears to be a general method to reduce the complexity of the calculation.</p>
</sec>
<sec id="Ch1.S3.SS5">
  <label>3.5</label><title>Discussion and intermediate conclusion</title>
      <p id="d1e4482">However, although the calculation of the system in Eq. (16) is straightforward,
as it is similar to the calculation of Reynolds equations <xref ref-type="bibr" rid="bib1.bibx27" id="paren.24"/>,
it is tedious because of the many terms involved, and there is a risk of introducing
errors during the calculation by hand.</p>
      <p id="d1e4488">Then, once the dynamics of the parameters are established, it remains to design a numerical
code to test whether the uncertainty is effectively well represented by the PKF
dynamics. Again, the design of a numerical code is not necessarily difficult,
but with numerous terms the risk of introducing an error is important.</p>
      <p id="d1e4491">To facilitate the design of the PKF dynamics and the numerical evaluation, the
package SymPKF
has been introduced to perform the VLATcov parameter dynamics and
to generate a numerical code used for the investigations <xref ref-type="bibr" rid="bib1.bibx22" id="paren.25"/>.
The next section introduces and details this tool.</p><?xmltex \hack{\newpage}?>
</sec>
</sec>
<?pagebreak page5963?><sec id="Ch1.S4">
  <label>4</label><title>Symbolic computation of the PKF for VLATcov</title>
      <p id="d1e4507">In order to introduce the symbolic computation of the PKF for the VLATcov model,
we consider an example: the diffusive nonlinear advection in
the Burgers equation, which reads
          <disp-formula id="Ch1.E27" content-type="numbered"><label>20</label><mml:math id="M187" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>u</mml:mi><mml:mo>+</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>u</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="italic">κ</mml:mi><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mi>u</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M188" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> stands for the velocity field and corresponds to a function of the time
<inline-formula><mml:math id="M189" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula> and the space of coordinate <inline-formula><mml:math id="M190" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula>
and where <inline-formula><mml:math id="M191" display="inline"><mml:mi mathvariant="italic">κ</mml:mi></mml:math></inline-formula> is a diffusion coefficient (constant here).
This example illustrates the workflow leading to the PKF dynamics.
It consists of defining the system of equations in SymPy, then computing the
dynamics with Eq. (16); we now detail these two steps.</p>
<sec id="Ch1.S4.SS1">
  <label>4.1</label><title>Definition of the dynamics</title>
      <p id="d1e4584">The definition of the dynamics relies on the formalism of SymPy as shown in
Fig. <xref ref-type="fig" rid="Ch1.F1"/>. The coordinate system is first defined as instances of the
class <monospace>Symbols</monospace>. Note that the time is defined as <monospace>sympkf.t</monospace>, while
the spatial coordinate is left to the choice of the user, here <inline-formula><mml:math id="M192" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula>.
Then, the function <inline-formula><mml:math id="M193" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> is defined as an instance of the class <monospace>Function</monospace> as a
function of <inline-formula><mml:math id="M194" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F1" specific-use="star"><?xmltex \currentcnt{1}?><?xmltex \def\figurename{Figure}?><label>Figure 1</label><caption><p id="d1e4631">Sample of code and Jupyter notebook outputs for the definition of the Burgers dynamics using
SymPKF.</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f01.png"/>

        </fig>

      <p id="d1e4640">In this example, the dynamics consist of a single equation defined as an instance of
the class <monospace>Eq</monospace>, but in the general situation in which the dynamics are
given as a system of equations, the dynamics have to be represented as a Python list
of equations.</p>
      <p id="d1e4647">A preprocessing of the dynamics is then performed to determine several important quantities
to handle the dynamics: the prognostic fields
(functions for which a time derivative is present), the diagnostic fields (functions
for which there is no time derivative in the dynamics), the constant functions (functions
that only depend on the spatial coordinates), and the constants (pure scalar terms that
are not a function of any coordinate). This preprocessing is performed when
transforming the dynamics as an instance of the class <monospace>PDESystem</monospace>
and whose default string output delivers a summary of the dynamics:
for the Burgers equation, there is only one prognostic function, <inline-formula><mml:math id="M195" display="inline"><mml:mrow><mml:mi>u</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>,
and one constant, <inline-formula><mml:math id="M196" display="inline"><mml:mi mathvariant="italic">κ</mml:mi></mml:math></inline-formula>.</p>
      <p id="d1e4678">The prognostic quantities being known, it is then possible to perform the
computation of the PKF dynamics, as discussed now.</p>
</sec>
<sec id="Ch1.S4.SS2">
  <label>4.2</label><title>Computation of the VLATcov PKF dynamics</title>
      <p id="d1e4689">Thanks to the preprocessing, we are able to determine the VLATcov parameters
needed to compute the PKF dynamics, which are the variance and the anisotropy tensor
associated with the prognostic fields. For the Burgers equation, the VLATcov parameters
are the variance <inline-formula><mml:math id="M197" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and the metric tensor <inline-formula><mml:math id="M198" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> or its associated
aspect tensor <inline-formula><mml:math id="M199" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. Note that, in SymPKF, the VLATcov parameters
are labeled by their corresponding prognostic fields to facilitate their identification.
This labeling is achieved when the dynamics are transformed as an instance of the class
<monospace>SymbolicPKF</monospace>. This class is at the core of the computation of the PKF dynamics from
Eq. (16).</p>
      <p id="d1e4764">As discussed in Sect. <xref ref-type="sec" rid="Ch1.S2.SS2.SSS1"/>, the PKF dynamics rely on the second-order
fluctuation–mean interaction dynamics wherein each prognostic function is replaced by
a stochastic counterpart. Hence, the constructor of <monospace>SymbolicPKF</monospace>
converts each prognostic function as a function of an additional
coordinate, <inline-formula><mml:math id="M200" display="inline"><mml:mrow><mml:mi mathvariant="italic">ω</mml:mi><mml:mo>∈</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:math></inline-formula>. For the Burgers equation, <inline-formula><mml:math id="M201" display="inline"><mml:mrow><mml:mi>u</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> becomes <inline-formula><mml:math id="M202" display="inline"><mml:mrow><mml:mi>u</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="italic">ω</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e4824">Since the computation of the second-order fluctuation–mean interaction dynamics relies
on the expectation operator, an implementation of this expectation operator has been
introduced in SymPKF: it is defined as the class <monospace>Expectation</monospace> built
by inheritance from the class <monospace>sympy.Function</monospace> to leverage the computational
facilities of SymPy. The implementation of the class <monospace>Expectation</monospace>
is based on the linearity of the mathematical expectation operator with respect
to deterministic quantities and its commutativity
with partial derivatives and integrals with respect to coordinates different from <inline-formula><mml:math id="M203" display="inline"><mml:mi mathvariant="italic">ω</mml:mi></mml:math></inline-formula>,
e.g.,  for the Burgers equation <inline-formula><mml:math id="M204" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>u</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="italic">ω</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>u</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="italic">ω</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.
Note that <inline-formula><mml:math id="M205" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>u</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="italic">ω</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> is a function of <inline-formula><mml:math id="M206" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> only: the expectation operator
converts a random variable into a deterministic variable.</p>
      <p id="d1e4952">Then, the symbolic computation of the second-order fluctuation–mean interaction dynamics
in Eq. (<xref ref-type="disp-formula" rid="Ch1.E20.21"/>) is performed, thanks to SymPy, by following the steps as described in
Sect. <xref ref-type="sec" rid="Ch1.S2.SS2.SSS1"/>. In particular, the computation also leads to the tangent-linear
dynamics of the error in Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>), from which it is possible to compute the dynamics of
the variance in Eq. (<xref ref-type="disp-formula" rid="Ch1.E20.22"/>) and of the metric tensor in Eq. (<xref ref-type="disp-formula" rid="Ch1.E20.23"/>)
(or its associated aspect tensor version).
Applying these steps and the appropriate substitutions, this is achieved
when calling the <monospace>in_metric</monospace> or <monospace>in_aspect</monospace> Python property
of an instance of the class <monospace>SymbolicPKF</monospace>. This is shown for the Burgers equation
in Fig. <xref ref-type="fig" rid="Ch1.F2"/>, where the background computation of the PKF dynamics
leads to a list of the three coupled equations corresponding to the mean,
the variance, and the aspect tensor, similar to the system in Eq. (22) first obtained
by <xref ref-type="bibr" rid="bib1.bibx27" id="text.26"/>.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F2" specific-use="star"><?xmltex \currentcnt{2}?><?xmltex \def\figurename{Figure}?><label>Figure 2</label><caption><p id="d1e4983">Sample of code and Jupyter notebook outputs:
systems of partial differential equations given in metric and in aspect forms
produced by SymPKF when applied to the Burgers equation (Eq. <xref ref-type="disp-formula" rid="Ch1.E27"/>).</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f02.png"/>

        </fig>

      <?pagebreak page5964?><p id="d1e4994">Hence, from SymPKF, for the Burgers equation, the VLATcov PKF dynamics given in the aspect tensor read as
            <disp-formula id="Ch1.E28" content-type="numbered"><label>21</label><mml:math id="M207" display="block"><mml:mrow><mml:mfenced close="" open="{"><mml:mtable class="array" columnalign="left left left"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>u</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mi>u</mml:mi><mml:mo>-</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>u</mml:mi><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">κ</mml:mi><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle><mml:mo>+</mml:mo><mml:mi mathvariant="italic">κ</mml:mi><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>u</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">κ</mml:mi><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="(" close=")"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn><mml:mi mathvariant="italic">κ</mml:mi><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">κ</mml:mi><mml:mo>+</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mn mathvariant="normal">6</mml:mn><mml:mi mathvariant="italic">κ</mml:mi><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">κ</mml:mi><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle><mml:mo>+</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">κ</mml:mi><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msubsup><mml:mi>V</mml:mi><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>u</mml:mi></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M208" display="inline"><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is the single component of the aspect tensor <inline-formula><mml:math id="M209" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> in 1D domains.
Note that in the output of the PKF equations, as reproduced in Eq. (<xref ref-type="disp-formula" rid="Ch1.E28"/>),
the expectation in the dynamics of the mean is replaced by the
prognostic field; for the Burgers equation,  <inline-formula><mml:math id="M210" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>u</mml:mi><mml:mo>]</mml:mo><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is simply denoted by <inline-formula><mml:math id="M211" display="inline"><mml:mrow><mml:mi>u</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e5589">While the Burgers equation only contains two physical processes, i.e.,  the
nonlinear advection and the diffusion, the resulting PKF dynamics
in Eq. (<xref ref-type="disp-formula" rid="Ch1.E28"/>) make numerous terms appear, which justifies the use of
symbolic computation, as mentioned above.
The computation of the PKF dynamics
leading to the metric and to the aspect tensor formulation takes about <inline-formula><mml:math id="M212" display="inline"><mml:mn mathvariant="normal">1</mml:mn></mml:math></inline-formula> s of
computation (Intel Core i7-7820HQ CPU at 2.90 GHz <inline-formula><mml:math id="M213" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 8).</p>
      <p id="d1e5608">In this example, the splitting strategy has not been considered to simplify
the computation of the PKF dynamics. However, it can be done by considering the
PKF dynamics for the advection <inline-formula><mml:math id="M214" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>u</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>u</mml:mi></mml:mrow></mml:math></inline-formula> and the diffusion
<inline-formula><mml:math id="M215" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>u</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="italic">κ</mml:mi><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mi>u</mml:mi></mml:mrow></mml:math></inline-formula>, and computed separately, then merged to find the PKF dynamics
of the full Burgers equation. For instance,  Fig. <xref ref-type="fig" rid="Ch1.F3"/> shows the
PKF dynamics for the advection (first cell) and for the diffusion (second cell);
the output can be traced back in Eq. (<xref ref-type="fig" rid="Ch1.F2"/>), e.g.,
by the terms in <inline-formula><mml:math id="M216" display="inline"><mml:mi mathvariant="italic">κ</mml:mi></mml:math></inline-formula> for the diffusion.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F3" specific-use="star"><?xmltex \currentcnt{3}?><?xmltex \def\figurename{Figure}?><label>Figure 3</label><caption><p id="d1e5676">Illustration of the splitting strategy that can be used to compute the PKF
dynamics and applied here for the Burgers equation: PKF dynamics of
the Burgers equation can be obtained from the PKF dynamics of the advection (first cell)
and of the diffusion (second cell).</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f03.png"/>

        </fig>

      <p id="d1e5686">Thanks to the symbolic computation using the expectation operator, as implemented
by the class <monospace>Expectation</monospace>, it is possible to handle terms such as
<inline-formula><mml:math id="M217" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> during the computation of the PKF dynamics.
The next section details how these terms are handled during the computation and
the closure issue they bring.</p>
</sec>
<sec id="Ch1.S4.SS3">
  <label>4.3</label><title>Comments on the computation of the VLATcov PKF dynamics and the closure issue</title>
<sec id="Ch1.S4.SS3.SSS1">
  <label>4.3.1</label><?xmltex \opttitle{Computation of terms $\mathbb{E}{[}\partial^{\alpha}\varepsilon\partial^{\beta}\varepsilon{]}$ and their connection to the
correlation function}?><title>Computation of terms <inline-formula><mml:math id="M218" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> and their connection to the
correlation function</title>
      <p id="d1e5763">An important point is that terms such as <inline-formula><mml:math id="M219" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>,
e.g.,  <inline-formula><mml:math id="M220" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> in Eq. (<xref ref-type="disp-formula" rid="Ch1.E28"/>)
are directly connected to the correlation function <inline-formula><mml:math id="M221" display="inline"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">y</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> whose Taylor expansion is written as
              <disp-formula id="Ch1.E29" content-type="numbered"><label>22</label><mml:math id="M222" display="block"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>k</mml:mi></mml:munder><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mi>k</mml:mi><mml:mi mathvariant="normal">!</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo><mml:msup><mml:mo>∂</mml:mo><mml:mi>k</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced><mml:mi mathvariant="italic">δ</mml:mi><mml:msup><mml:mi mathvariant="bold">x</mml:mi><mml:mi>k</mml:mi></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
            However, during their computation, the VLATcov PKF dynamics make the terms
<inline-formula><mml:math id="M223" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> appear, with
<inline-formula><mml:math id="M224" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>≤</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula>,
where  for any <inline-formula><mml:math id="M225" display="inline"><mml:mi mathvariant="italic">α</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M226" display="inline"><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula>
denotes the derivative with respect to the multi-index
<inline-formula><mml:math id="M227" display="inline"><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mo>)</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>n</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, with <inline-formula><mml:math id="M228" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> denoting the derivative order with respect to
the <inline-formula><mml:math id="M229" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula>th coordinate <inline-formula><mml:math id="M230" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> of the coordinate system and
where the sum of all derivative order is denoted by <inline-formula><mml:math id="M231" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mo>∑</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>.
The issue it that these terms in <inline-formula><mml:math id="M232" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>
are not directly connected to the Taylor expansion in Eq. (<xref ref-type="disp-formula" rid="Ch1.E29"/>).</p>
      <?pagebreak page5965?><p id="d1e6114">The interesting property of these terms is that they can be reworded as
spatial derivatives of terms in the form <inline-formula><mml:math id="M233" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">γ</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>.
More precisely, any term <inline-formula><mml:math id="M234" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> can be written
from derivative of terms in <inline-formula><mml:math id="M235" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">γ</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M236" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>|</mml:mo><mml:mo>&lt;</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>+</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula>,
and the term <inline-formula><mml:math id="M237" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> (see Appendix <xref ref-type="sec" rid="App1.Ch1.S2"/> for
the proof).
So, to replace any term in <inline-formula><mml:math id="M238" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> by
terms in <inline-formula><mml:math id="M239" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">γ</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M240" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>|</mml:mo><mml:mo>&lt;</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>+</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula>,
a substitution dictionary is computed in SymPKF and stored as the variable
<monospace>subs_tree</monospace>. The computation of this substitution dictionary is performed
thanks to a dynamical programming strategy. Thereafter, the integer <inline-formula><mml:math id="M241" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>+</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula>
is called the order of the term <inline-formula><mml:math id="M242" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>.
Figure <xref ref-type="fig" rid="Ch1.F4"/> shows the substitution dictionary computed for
the Burgers equation. It appears that terms of order lower than <inline-formula><mml:math id="M243" display="inline"><mml:mn mathvariant="normal">3</mml:mn></mml:math></inline-formula> can be explicitly
written from the metric (or its derivatives), while terms of order larger than <inline-formula><mml:math id="M244" display="inline"><mml:mn mathvariant="normal">4</mml:mn></mml:math></inline-formula> cannot: this is known as the closure issue <xref ref-type="bibr" rid="bib1.bibx27" id="paren.27"/>.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F4" specific-use="star"><?xmltex \currentcnt{4}?><?xmltex \def\figurename{Figure}?><label>Figure 4</label><caption><p id="d1e6376">Substitution dictionary computed in
SymPKF to replace terms such as <inline-formula><mml:math id="M245" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>
by terms in <inline-formula><mml:math id="M246" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">γ</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M247" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>|</mml:mo><mml:mo>&lt;</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>+</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula>.</p></caption>
            <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f04.png"/>

          </fig>

      <p id="d1e6461">The term <inline-formula><mml:math id="M248" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, which features long-range correlations,
cannot be related to the variance or to the metric and
has to be closed. We detail this point in the next section.</p>
</sec>
<sec id="Ch1.S4.SS3.SSS2">
  <label>4.3.2</label><title>Analytical and data-driven closure</title>
      <p id="d1e6495">A naïve closure for the PKF dynamics in Eq. (<xref ref-type="disp-formula" rid="Ch1.E28"/>) would be to replace
the unknown term <inline-formula><mml:math id="M249" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> by zero.
However, in the third equation that corresponds to the aspect tensor dynamics,
the coefficient <inline-formula><mml:math id="M250" display="inline"><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn><mml:mi mathvariant="italic">κ</mml:mi></mml:mrow></mml:math></inline-formula> of the diffusion term <inline-formula><mml:math id="M251" display="inline"><mml:mrow><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>s</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> being
negative, it follows that the dynamics of <inline-formula><mml:math id="M252" display="inline"><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> numerically explode
at an exponential rate.
Of course, because the system represents the uncertainty dynamics of the Burgers equation in
Eq. (<xref ref-type="disp-formula" rid="Ch1.E27"/>) that is well posed, the parametric dynamics should not explode.
Hence, the unknown term <inline-formula><mml:math id="M253" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> is crucial:
it can balance the negative diffusion to stabilize the parametric dynamics.</p>
      <?pagebreak page5967?><p id="d1e6598">For the Burgers equation, a closure for <inline-formula><mml:math id="M254" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> has been previously proposed <xref ref-type="bibr" rid="bib1.bibx27" id="paren.28"/>, given by
              <disp-formula id="Ch1.E30" content-type="numbered"><label>23</label><mml:math id="M255" display="block"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>∼</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">2</mml:mn><mml:mrow><mml:msubsup><mml:mi>s</mml:mi><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>s</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">3</mml:mn><mml:mrow><mml:msubsup><mml:mi>s</mml:mi><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>-</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msubsup><mml:mi>s</mml:mi><mml:mi>u</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
            where the symbol <inline-formula><mml:math id="M256" display="inline"><mml:mo>∼</mml:mo></mml:math></inline-formula> is used to indicate that this is not an equality but a proposal
of closure for the term in the left-hand side
and that leads to the closed system
              <disp-formula id="Ch1.E31" content-type="numbered"><label>24</label><mml:math id="M257" display="block"><mml:mrow><mml:mfenced close="" open="{"><mml:mtable class="array" columnalign="center center left"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>u</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>u</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">κ</mml:mi><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mi>u</mml:mi><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>u</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="italic">κ</mml:mi><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi mathvariant="italic">κ</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle></mml:mstyle><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msup><mml:mo>)</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">κ</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>u</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi mathvariant="italic">κ</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msubsup><mml:mi>V</mml:mi><mml:mi>u</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msup><mml:mo>)</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mi mathvariant="italic">κ</mml:mi><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="italic">κ</mml:mi><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">κ</mml:mi><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:msup><mml:mo>)</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced></mml:mrow></mml:math></disp-formula>
            The closure in Eq. (<xref ref-type="disp-formula" rid="Ch1.E30"/>) results from a local Gaussian approximation of the
correlation function. Previous numerical experiments have shown that this closure
is well adapted to the Burgers equation <xref ref-type="bibr" rid="bib1.bibx27" id="paren.29"/>.
But the approach that has been followed to find this closure
is quite specific, and it would be interesting to design a general way to find such
a closure.</p>
      <p id="d1e7252">In particular, it would be interesting to search for a generic way to design closures that leverage  the symbolic computation, which could be plugged with the PKF dynamics
computed from SymPKF at a symbolic level. To do so, we propose an
empirical closure
that leverages a data-driven strategy to hybridize machine learning
with physics, as proposed by <xref ref-type="bibr" rid="bib1.bibx23" id="text.30"/> with their neural network
generator <monospace>PDE-NetGen</monospace>.</p>
      <p id="d1e7261">The construction of the proposal relies on the symbolic computation shown in
Fig. <xref ref-type="fig" rid="Ch1.F5"/>.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F5" specific-use="star"><?xmltex \currentcnt{5}?><?xmltex \def\figurename{Figure}?><label>Figure 5</label><caption><p id="d1e7269">Example of a symbolic computation leading to a proposal for the closure of the unknown terms of order <inline-formula><mml:math id="M258" display="inline"><mml:mn mathvariant="normal">4</mml:mn></mml:math></inline-formula> and <inline-formula><mml:math id="M259" display="inline"><mml:mn mathvariant="normal">5</mml:mn></mml:math></inline-formula>.</p></caption>
            <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f05.png"/>

          </fig>

      <p id="d1e7292">The first step is to consider an analytical approximation for the correlation function.
For the illustration, we consider the local correlation function
to be well approximated by the quasi-Gaussian function
              <disp-formula id="Ch1.E32" content-type="numbered"><label>25</label><mml:math id="M260" display="block"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>≈</mml:mo><mml:mi>exp⁡</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:msup><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mfenced><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
            Then, the second step is to perform the computation of the Taylor's expansion
of Eq. (<xref ref-type="disp-formula" rid="Ch1.E29"/>) at a symbolic level. This is done thanks to SymPy
with the method <monospace>series</monospace> applied to Eq. (<xref ref-type="disp-formula" rid="Ch1.E32"/>) for
<inline-formula><mml:math id="M261" display="inline"><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:math></inline-formula> near the value <inline-formula><mml:math id="M262" display="inline"><mml:mn mathvariant="normal">0</mml:mn></mml:math></inline-formula> and at a given order; e.g.,  for the illustration
expansion is computed as the sixth order in Fig. <xref ref-type="fig" rid="Ch1.F5"/>.</p>
      <p id="d1e7399">Then, the identification with the Taylor's expansion in Eq. (<xref ref-type="disp-formula" rid="Ch1.E29"/>)
leads to the closure
              <disp-formula id="Ch1.E33" content-type="numbered"><label>26</label><mml:math id="M263" display="block"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>∼</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">3</mml:mn><mml:mrow><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">3</mml:mn><mml:mrow><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow><mml:mn mathvariant="normal">3</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
            While it looks like the closure in Eq. (<xref ref-type="disp-formula" rid="Ch1.E30"/>), the coefficients are not
the same. But this suggests that the closure of <inline-formula><mml:math id="M264" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> can be expanded  as
              <disp-formula id="Ch1.E34" content-type="numbered"><label>27</label><mml:math id="M265" display="block"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>∼</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup></mml:mrow><mml:mrow><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msubsup><mml:mi>a</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup></mml:mrow><mml:mrow><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:msubsup><mml:mi>a</mml:mi><mml:mn mathvariant="normal">3</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow><mml:mn mathvariant="normal">3</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
            where <inline-formula><mml:math id="M266" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">a</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msubsup><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi>a</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi>a</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msubsup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> represents three unknown reals. A data-driven strategy can be considered
to find an appropriate value of <inline-formula><mml:math id="M267" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">a</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> from experiments. This has been
investigated by using the automatic generator of a neural network <monospace>PDE-NetGen</monospace>,
which bridges the gap between the physics and the machine learning
<xref ref-type="bibr" rid="bib1.bibx23" id="paren.31"/> and with which the training has led to the value
<inline-formula><mml:math id="M268" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">a</mml:mi><mml:mn mathvariant="normal">4</mml:mn></mml:msup><mml:mo>≈</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1.86</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">3.0</mml:mn><mml:mo>,</mml:mo><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">3.6</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. Since this proposal is deduced from
symbolic computation, it is easy to build some proposals for higher-order unknown terms
as is shown in Fig. <xref ref-type="fig" rid="Ch1.F5"/> for the term
<inline-formula><mml:math id="M269" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:msubsup><mml:mo>∂</mml:mo><mml:mi>x</mml:mi><mml:mn mathvariant="normal">5</mml:mn></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e7841">Whatever closure has been obtained in an analytical or an empirical way,
it remains to compute the closed PKF dynamics to assess their performance. To
do so a numerical implementation of the system of partial
differential equations has to be introduced.
As for the computation of the PKF dynamics, the design of a numerical code
can be tedious, with a risk of introducing errors in the implementation due to
the numerous terms occurring in the PKF dynamics.
To facilitate the research on the PKF, SymPKF comes with a Python numerical
code generator, which provides an end-to-end investigation of the PKF dynamics.
This code generator is now detailed.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F6" specific-use="star"><?xmltex \currentcnt{6}?><?xmltex \def\figurename{Figure}?><label>Figure 6</label><caption><p id="d1e7846">Introduction of a closure and automatic generation of
a numerical code in SymPKF.</p></caption>
            <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f06.png"/>

          </fig>

</sec>
</sec>
<sec id="Ch1.S4.SS4">
  <label>4.4</label><title>Automatic code generation for numerical simulations</title>
      <p id="d1e7865">While compiled language with appropriate optimization should be important for
industrial applications, we chose to implement a pure Python code generator,
which offers a simple research framework for exploring the design of PKF
dynamics.
It would have been possible to use a code generator already based
on SymPy (see, e.g.,  <xref ref-type="bibr" rid="bib1.bibx15" id="altparen.32"/>), but with such code generators being
domain-specific, it was less adapted to the investigation of the PKF for arbitrary
dynamics.
Instead, we consider a finite-difference implementation of partial derivatives
with respect to spatial coordinates. The default domain to perform the
computation is the periodic unit square with the dimension of the number of spatial coordinates.
The length of the domain can be specified along each direction.
The domain is regularly discretized along each direction, while the number of
grid points can be specified for each direction.</p>
      <?pagebreak page5968?><p id="d1e7871">The finite difference takes the form of an operator <inline-formula><mml:math id="M270" display="inline"><mml:mi mathvariant="script">F</mml:mi></mml:math></inline-formula> that approximates any
partial derivate at a second order of consistency:
for any multi-index <inline-formula><mml:math id="M271" display="inline"><mml:mi mathvariant="italic">α</mml:mi></mml:math></inline-formula>,
<inline-formula><mml:math id="M272" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="script">F</mml:mi><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi>u</mml:mi><mml:munder><mml:mo>=</mml:mo><mml:mi>0</mml:mi></mml:munder><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi>u</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="script">O</mml:mi><mml:mo>(</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mtext mathvariant="bold">x</mml:mtext><mml:msup><mml:mo>|</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>,
where <inline-formula><mml:math id="M273" display="inline"><mml:mi mathvariant="script">O</mml:mi></mml:math></inline-formula> is Landau's big O notation. For any <inline-formula><mml:math id="M274" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula>, the notation
<inline-formula><mml:math id="M275" display="inline"><mml:mrow><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:munder><mml:mo>=</mml:mo><mml:mi>0</mml:mi></mml:munder><mml:mi mathvariant="script">O</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:msup><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> means that
<inline-formula><mml:math id="M276" display="inline"><mml:mrow><mml:msub><mml:mo>lim⁡</mml:mo><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>x</mml:mi><mml:mo>→</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:msub><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:msup><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:math></inline-formula> is finite.
The operator <inline-formula><mml:math id="M277" display="inline"><mml:mi mathvariant="script">F</mml:mi></mml:math></inline-formula> computed with respect to independent coordinates commutes,
e.g.,  <inline-formula><mml:math id="M278" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mrow><mml:mi>x</mml:mi><mml:mi>y</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>∘</mml:mo><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>∘</mml:mo><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mi>x</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M279" display="inline"><mml:mo>∘</mml:mo></mml:math></inline-formula> denotes the
composition, but it does not commute for dependent coordinates, e.g.,
<inline-formula><mml:math id="M280" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="script">F</mml:mi><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mo>≠</mml:mo><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>∘</mml:mo><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mi>x</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>. The finite difference of the partial derivative with
respect to the multi-index is computed sequentially, e.g.,
<inline-formula><mml:math id="M281" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mrow><mml:mi>x</mml:mi><mml:mi>x</mml:mi><mml:mi>y</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msubsup><mml:mi mathvariant="script">F</mml:mi><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mo>∘</mml:mo><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="script">F</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>∘</mml:mo><mml:msubsup><mml:mi mathvariant="script">F</mml:mi><mml:mi>x</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:math></inline-formula>. The finite difference
of order <inline-formula><mml:math id="M282" display="inline"><mml:mi mathvariant="italic">α</mml:mi></mml:math></inline-formula> with respect to a single spatial coordinate is the centered
finite difference based on <inline-formula><mml:math id="M283" display="inline"><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> points.</p>
      <p id="d1e8172">For instance, Fig. <xref ref-type="fig" rid="Ch1.F6"/> shows how to close the PKF dynamics for
the Burgers equation following P18 and how to build a
code from an instance of the class <monospace>sympkf.FDModelBuilder</monospace>: it creates the class
<monospace>ClosedPKFBurgers</monospace>.
In this example, the code is rendered from templates thanks to Jinja<fn id="Ch1.Footn3"><p id="d1e8183"><uri>https://jinja.palletsprojects.com/en/2.11.x/</uri>, last access: 22 September 2021.​​​​​​​</p></fn>;
then it is executed at runtime.
Note that the code can also be written in an appropriate Python module for adapting the
code to a particular situation or to check the correctness of the generated code.
At the end, the instance <monospace>closed_pkf_burgers</monospace> of the class
<monospace>ClosedPKFBurgers</monospace> is created, raising a warning to indicate that the
value of constant <inline-formula><mml:math id="M284" display="inline"><mml:mi mathvariant="italic">κ</mml:mi></mml:math></inline-formula> has to be specified before performing a numerical simulation.
Note that it is possible to set the value of kappa as a keyword argument in the
class <monospace>ClosedPKFBurgers</monospace>.
Figure <xref ref-type="fig" rid="Ch1.F6"/> also shows a sample of the generated code
with the implementation of the computation of the first-order partial derivative
<inline-formula><mml:math id="M285" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>u</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, which appears as a centered finite difference.
Then, the sample of code shows how the partial derivatives are used to compute the
trend of the system of partial differential equations in Eq. (<xref ref-type="disp-formula" rid="Ch1.E31"/>).</p>
      <p id="d1e8226">The numerical integration is handled through the inheritance
mechanism: the class <monospace>ClosedPKFBurgers</monospace> inherits the integration
time loop from the class <monospace>sympkf.Model</monospace> as described by the unified modeling language (UML) diagram shown in Fig. <xref ref-type="fig" rid="Ch1.F7"/>.
In particular, the class <monospace>Model</monospace> contains several time schemes, e.g.,  a fourth-order
Runge–Kutta scheme.
Note that in the present implementation of SymPKF,<?pagebreak page5969?> only explicit time schemes are considered,
but it could be possible to leverage  the symbolic computation to implement other
schemes more adapted to a given PDE, e.g.,  an implicit scheme for the transport or
the diffusion or a high-order exponential time-diﬀerencing method <xref ref-type="bibr" rid="bib1.bibx13" id="paren.33"/>
with which the linear and the nonlinear parts would be automatically determined
from the symbolic computation.
The details of the instance <monospace>closed_pkf_burgers</monospace>
of the class <monospace>ClosedPKFBurgers</monospace> make it appear that
the closed system in Eq. (<xref ref-type="disp-formula" rid="Ch1.E31"/>) will be integrated by using a RK4 time scheme
on the segment <inline-formula><mml:math id="M286" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:mi>D</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> (here <inline-formula><mml:math id="M287" display="inline"><mml:mrow><mml:mi>D</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>) with periodic boundaries and discretized by <inline-formula><mml:math id="M288" display="inline"><mml:mn mathvariant="normal">241</mml:mn></mml:math></inline-formula>
points.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F7"><?xmltex \currentcnt{7}?><?xmltex \def\figurename{Figure}?><label>Figure 7</label><caption><p id="d1e8290">UML diagram showing the inheritance mechanism implemented in
SymPKF: the class
<monospace>ClosedPKFBurgers</monospace> inherits from the class <monospace>Model</monospace>,
which implements several time schemes. Here, <monospace>closed_pkf_burgers</monospace>
is an instance of the class <monospace>ClosedPKFBurgers</monospace>.</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f07.png"/>

        </fig>

      <?pagebreak page5970?><p id="d1e8311">Thanks to the end-to-end framework proposed in SymPKF, it is possible to perform
a numerical simulation based on the PKF dynamics in Eq. (<xref ref-type="disp-formula" rid="Ch1.E30"/>).
To do so, we set <inline-formula><mml:math id="M289" display="inline"><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.0025</mml:mn></mml:mrow></mml:math></inline-formula> and consider the simulation starting from the
Gaussian distribution <inline-formula><mml:math id="M290" display="inline"><mml:mrow><mml:mi mathvariant="script">N</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="bold">P</mml:mi><mml:mi>h</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> of mean
<inline-formula><mml:math id="M291" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>U</mml:mi><mml:mi mathvariant="normal">max</mml:mi></mml:msub><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>+</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>-</mml:mo><mml:mi>D</mml:mi><mml:mo>/</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mi>D</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula> with <inline-formula><mml:math id="M292" display="inline"><mml:mrow><mml:msub><mml:mi>U</mml:mi><mml:mi mathvariant="normal">max</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.5</mml:mn></mml:mrow></mml:math></inline-formula> and
of covariance matrix
<?xmltex \hack{\newpage}?>
            <disp-formula id="Ch1.E35" content-type="numbered"><label>28</label><mml:math id="M293" display="block"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold">P</mml:mi><mml:mi>h</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>h</mml:mi></mml:msub><mml:mi>exp⁡</mml:mi><mml:mfenced open="(" close=")"><mml:mrow><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>-</mml:mo><mml:mi>y</mml:mi><mml:msup><mml:mo>)</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:msubsup><mml:mi>l</mml:mi><mml:mi>h</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M294" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>h</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.01</mml:mn><mml:msub><mml:mi>U</mml:mi><mml:mi mathvariant="normal">max</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M295" display="inline"><mml:mrow><mml:msub><mml:mi>l</mml:mi><mml:mi>h</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.02</mml:mn><mml:mi>D</mml:mi><mml:mo>≈</mml:mo><mml:mn mathvariant="normal">5</mml:mn><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:math></inline-formula>. The time step of the fourth-order
Runge–Kutta scheme is <inline-formula><mml:math id="M296" display="inline"><mml:mrow><mml:mi mathvariant="normal">d</mml:mi><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.002</mml:mn></mml:mrow></mml:math></inline-formula>.
The evolution predicted from the PKF is shown in
Fig. <xref ref-type="fig" rid="Ch1.F8"/> (solid lines). This simulation illustrates
the time evolution of the mean (panel a) and of the variance (panel b);
panel (c) represents the evolution of the correlation length scale defined
from the aspect tensor as <inline-formula><mml:math id="M297" display="inline"><mml:mrow><mml:mi>L</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msqrt><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:msqrt></mml:mrow></mml:math></inline-formula>. Note that at time <inline-formula><mml:math id="M298" display="inline"><mml:mn mathvariant="normal">0</mml:mn></mml:math></inline-formula>,
the length scale field is <inline-formula><mml:math id="M299" display="inline"><mml:mrow><mml:mi>L</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>l</mml:mi><mml:mi>h</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>.
For the illustrations, the variance (the length scale) is normalized by its initial
value <inline-formula><mml:math id="M300" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>h</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> (<inline-formula><mml:math id="M301" display="inline"><mml:mrow><mml:msub><mml:mi>l</mml:mi><mml:mi>h</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>).</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F8" specific-use="star"><?xmltex \currentcnt{8}?><?xmltex \def\figurename{Figure}?><label>Figure 8</label><caption><p id="d1e8652">Illustration of a numerical simulation of the PKF dynamics in
Eq. (<xref ref-type="disp-formula" rid="Ch1.E30"/>) (solid line), with the mean <bold>(a)</bold>, the variance <bold>(b)</bold>,
and the correlation length scale <bold>(c)</bold>, which is defined
from the component <inline-formula><mml:math id="M302" display="inline"><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> of the aspect tensor by <inline-formula><mml:math id="M303" display="inline"><mml:mrow><mml:mi>L</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msqrt><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:msqrt></mml:mrow></mml:math></inline-formula>.
An ensemble-based validation of the PKF dynamics is shown as a dashed line.
<xref ref-type="bibr" rid="bib1.bibx23" id="paren.34"><named-content content-type="post">see their Fig. 7</named-content></xref></p></caption>
          <?xmltex \igopts{width=455.244094pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f08.png"/>

        </fig>

      <p id="d1e8731">In order to show the skill of the PKF applied to the
Burgers equation, when using the closure of P18, an ensemble validation is now performed.
Note that the code generator of SymPKF can be used for arbitrary dynamics, e.g.,
the Burgers equation itself. Hence, a numerical code solving the Burgers equation is
rendered from its symbolic definition. Then an ensemble of <inline-formula><mml:math id="M304" display="inline"><mml:mn mathvariant="normal">1600</mml:mn></mml:math></inline-formula> forecasts is computed
starting from an ensemble of initial errors at time <inline-formula><mml:math id="M305" display="inline"><mml:mn mathvariant="normal">0</mml:mn></mml:math></inline-formula>. The ensemble of initial
errors is sampled from the Gaussian distribution <inline-formula><mml:math id="M306" display="inline"><mml:mrow><mml:mi mathvariant="script">N</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="bold">P</mml:mi><mml:mi>h</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>
of zero mean and covariance matrix <inline-formula><mml:math id="M307" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="bold">P</mml:mi><mml:mi>h</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>.
Note that the ensemble forecasting implemented in SymPKF as the method
<monospace>Model.ensemble_forecast</monospace> (see Fig. <xref ref-type="fig" rid="Ch1.F7"/>)
leverages  the multiprocessing tools of Python
to use the multiple cores of the CPU when present. On the computer used for the
simulation, the forecasts are performed in parallel on eight cores.
The ensemble estimation of the mean, the variance, and the length scale is shown in
Fig. <xref ref-type="fig" rid="Ch1.F8"/> (dashed lines). Since the ensemble is finite, sampling
noise is visible, e.g.,  in the variance at the initial time that is not strictly equal
to <inline-formula><mml:math id="M308" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mi>h</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>. In this simulation, it appears that
the PKF (solid line) coincides with the ensemble estimation (dashed lines), which shows
the ability of the PKF to predict the forecast error covariance dynamics.
Note that the notebook corresponding to the Burgers experiment is available in
the example directory of SymPKF.</p>
      <p id="d1e8801">While this example shows an illustration of SymPKF in a 1D domain,
the package also applies in 2D and 3D domains, as presented now.</p>
</sec>
<sec id="Ch1.S4.SS5">
  <label>4.5</label><title>Illustration of dynamics in a 2D domain</title>
      <p id="d1e8812">In order to illustrate the ability of SymPKF to apply in a 2D or  3D domain, we
consider the linear advection of a scalar field <inline-formula><mml:math id="M309" display="inline"><mml:mrow><mml:mi>c</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> by a stationary velocity
field <inline-formula><mml:math id="M310" display="inline"><mml:mrow><mml:mi mathvariant="bold">u</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:mi>v</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, which reads as the partial differential equation
            <disp-formula id="Ch1.E36" content-type="numbered"><label>29</label><mml:math id="M311" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>c</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="bold">u</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          As for the Burgers equation, the definition of the dynamics relies on SymPy
(not shown but similar to the definition of the Burgers equation as given in
Fig. <xref ref-type="fig" rid="Ch1.F1"/>).
This leads to preprocessing the dynamics by creating the instance <italic>advection</italic>
of the class <monospace>PDESystem</monospace>,
which transforms the equation into a system of partial differential equations.
In particular, the procedure will diagnose the prognostic functions of dynamics, here the function <inline-formula><mml:math id="M312" display="inline"><mml:mi>c</mml:mi></mml:math></inline-formula>. Then it identifies the constant functions, which can depend on space but not on time: here, these are the components of the velocity (<inline-formula><mml:math id="M313" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M314" display="inline"><mml:mi>v</mml:mi></mml:math></inline-formula>). The process also identifies exogenous functions and constants, of which there are none here.</p>
      <?pagebreak page5971?><p id="d1e8935">The calculation of the parametric dynamics is handled by the class <monospace>SymbolicPKF</monospace>
as shown in the first cell in Fig. <xref ref-type="fig" rid="Ch1.F9"/>.
The parametric dynamics are a property of the instance <italic>pkf_advection</italic> of the
class <monospace>SymbolicPKF</monospace>, and when it is called, the parametric dynamics are computed
once and for all.
The parametric dynamics formulated in terms of metric are first computed;
see the second cell.
For the 2D linear advection, the parametric dynamics are a system of
five partial differential equations, as  is shown in the output of the second cell:
the dynamics of the ensemble average <inline-formula><mml:math id="M315" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi>c</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, which outputs as <inline-formula><mml:math id="M316" display="inline"><mml:mi>c</mml:mi></mml:math></inline-formula> for the
sake of simplicity (first equation), the dynamics of the variance
(second equation), and the dynamics of the local metric tensor (last three equations).
In compact form, the dynamics are given by the system<?xmltex \setcounter{equation}{29}?>

                <disp-formula id="Ch1.E37" specific-use="align" content-type="subnumberedsingle"><mml:math id="M317" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E37.38"><mml:mtd><mml:mtext>30a</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>c</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="bold">u</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E37.39"><mml:mtd><mml:mtext>30b</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="bold">u</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi>V</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E37.40"><mml:mtd><mml:mtext>30c</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="bold">u</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold">u</mml:mi></mml:mrow></mml:mfenced><mml:mo>-</mml:mo><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold">u</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            which corresponds to the 2D extension of the 1D dynamics
first found by <xref ref-type="bibr" rid="bib1.bibx4" id="text.35"/> <xref ref-type="bibr" rid="bib1.bibx26" id="paren.36"/>
and validates the computation performed in SymPKF.
Due to the linearity of the linear advection in Eq. (<xref ref-type="disp-formula" rid="Ch1.E36"/>),
the ensemble average in Eq. (<xref ref-type="disp-formula" rid="Ch1.E37.38"/>) is governed by the same dynamics as in
Eq. (<xref ref-type="disp-formula" rid="Ch1.E36"/>). While both the variance in
Eq. (<xref ref-type="disp-formula" rid="Ch1.E37.39"/>) and the metric are advected by the flow, the metric is also deformed by the
shear in Eq. (<xref ref-type="disp-formula" rid="Ch1.E37.40"/>).
This deformation more commonly appears in the dynamics written in aspect tensor form,
which is given by<?xmltex \setcounter{equation}{30}?>

                <disp-formula id="Ch1.E41" specific-use="align" content-type="subnumberedsingle"><mml:math id="M318" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E41.42"><mml:mtd><mml:mtext>31a</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>c</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="bold">u</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E41.43"><mml:mtd><mml:mtext>31b</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="bold">u</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi>V</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E41.44"><mml:mtd><mml:mtext>31c</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="bold">u</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold">u</mml:mi></mml:mrow></mml:mfenced><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold">u</mml:mi></mml:mrow></mml:mfenced><mml:mi>T</mml:mi></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            where Eq. (<xref ref-type="disp-formula" rid="Ch1.E41.44"/>) is similar to the dynamics of the conformation
tensor in viscoelastic flow <xref ref-type="bibr" rid="bib1.bibx3 bib1.bibx10" id="paren.37"/>.</p>

      <?xmltex \floatpos{p}?><fig id="Ch1.F9" specific-use="star"><?xmltex \currentcnt{9}?><?xmltex \def\figurename{Figure}?><label>Figure 9</label><caption><p id="d1e9270">Sample of code and Jupyter notebook outputs:
system of partial differential equations produced by SymPKF
when applied to the linear advection in Eq. (<xref ref-type="disp-formula" rid="Ch1.E36"/>).</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f09.png"/>

        </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F10" specific-use="star"><?xmltex \currentcnt{10}?><?xmltex \def\figurename{Figure}?><label>Figure 10</label><caption><p id="d1e9284">Output of the computation by SymPKF of the PKF dynamics for
the simple multivariate periodic chemical reaction, corresponding to the
right-hand side of Eq. (<xref ref-type="disp-formula" rid="Ch1.E45"/>).</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/5957/2021/gmd-14-5957-2021-f10.png"/>

        </fig>

      <p id="d1e9295">We do not introduce any numerical simulation of the PKF dynamics in Eq. (<xref ref-type="disp-formula" rid="Ch1.E37"/>) or Eq. (<xref ref-type="disp-formula" rid="Ch1.E41"/>),
but interested readers are referred to the 2D numerical PKF assimilation cycles of
<xref ref-type="bibr" rid="bib1.bibx21" id="text.38"/>, which have been made thanks to SymPKF.</p>
      <p id="d1e9305">This example illustrates a 2D situation and shows the multidimensional capabilities of SymPKF.
Similarly to the simulation conducted for the Burgers equation, it is possible to
automatically generate a numerical code able to perform numerical simulations of the dynamics
in Eq. (<xref ref-type="disp-formula" rid="Ch1.E41"/>) (not shown here).
Hence, this 2D domain example showed the ability of SymPKF to apply in dimensions
larger than 1D.</p>
      <p id="d1e9310">Before concluding, we would like to present a preliminary application of SymPKF
in a multivariate situation.</p>
</sec>
<sec id="Ch1.S4.SS6">
  <label>4.6</label><title>Towards the PKF for multivariate dynamics</title>
      <p id="d1e9321">SymPKF can be used to compute the prediction of the variance and the anisotropy
in a multivariate situation.</p>
      <p id="d1e9324">Note that one of the difficulties with the multivariate situation is that the number
of equations increases linearly with the number of fields and the dimension of
the domain; e.g.,  for a 1D (2D) domain and two multivariate physical fields,
there are two ensemble-averaged fields, two variance fields, and two (six)
metric fields. Of course this is no not a problem when using a computer
algebra system as done in SymPKF.</p>
      <p id="d1e9327">To illustrate the multivariate situation, only a very simple example is introduced.
Inspired from chemical transport models encountered in air quality, we
consider the transport over a 1D domain of two chemical species, whose concentrations
are denoted by <inline-formula><mml:math id="M319" display="inline"><mml:mrow><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M320" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>B</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>,  advected by the wind <inline-formula><mml:math id="M321" display="inline"><mml:mrow><mml:mi>u</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.
For the sake of simplicity, the two species interact following periodic dynamics
as defined by the coupled system<?xmltex \setcounter{equation}{31}?>

                <disp-formula id="Ch1.E45" specific-use="align" content-type="subnumberedsingle"><mml:math id="M322" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E45.46"><mml:mtd><mml:mtext>32a</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>A</mml:mi><mml:mo>+</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>A</mml:mi><mml:mo>=</mml:mo><mml:mi>B</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E45.47"><mml:mtd><mml:mtext>32b</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>B</mml:mi><mml:mo>+</mml:mo><mml:mi>u</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:mi>B</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mi>A</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            Thanks to the splitting strategy, the PKF dynamics due to the advection
have already been detailed in the previous section (see Sect. <xref ref-type="sec" rid="Ch1.S4.SS5"/>),
so we can focus on the chemical part of the dynamics, which is given by the
processes on the right-hand side of Eq. (<xref ref-type="disp-formula" rid="Ch1.E45"/>).
The PKF of the chemical part is computed thanks to SymPKF and shown
in Fig. <xref ref-type="fig" rid="Ch1.F10"/>.
This time, and as expected, multivariate statistics appear in the dynamics.
Here, the dynamics of the cross-covariance <inline-formula><mml:math id="M323" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mrow><mml:mi>A</mml:mi><mml:mi>B</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:msub><mml:mi>e</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>
are given by the fifth equation.
The coupling brings up unknown terms, e.g.,  the term
<inline-formula><mml:math id="M324" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:msub><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> in the sixth equation of the output shown in
Fig. <xref ref-type="fig" rid="Ch1.F10"/>. Note that by taking into account the multivariate situation
with the dynamics of the cross-covariance, the multivariate PKF hybridizes the
continuous nature of the multivariate fields with the matrix form in Eq. (<xref ref-type="disp-formula" rid="Ch1.E10.11"/>),
which corresponds here to the dynamics of the variances <inline-formula><mml:math id="M325" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>
and the cross-covariance <inline-formula><mml:math id="M326" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mrow><mml:mi>A</mml:mi><mml:mi>B</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>.</p>
      <?pagebreak page5973?><p id="d1e9570">To go further, some research is still needed to explore the
dynamics and the modeling of the multivariate cross-covariances.
A possible
direction is to take advantage of the multivariate covariance model based on
the balance operator as often introduced in variational data assimilation
<xref ref-type="bibr" rid="bib1.bibx6 bib1.bibx30" id="paren.39"/>. Note that such multivariate covariance models
have recently been considered for the design of the multivariate PKF analysis step
<xref ref-type="bibr" rid="bib1.bibx21" id="paren.40"/>. Another way is to consider a data-driven strategy to learn the
physics of the unknown terms from a training based on ensembles of forecasts
<xref ref-type="bibr" rid="bib1.bibx23" id="paren.41"/>.</p>
      <p id="d1e9583">To conclude, this example shows the potential of SymPKF
to tackle the multivariate situation. Moreover, the example also shows that
SymPKF is able to perform the PKF computation for a system of partial differential
equations. However, all the equations should be prognostic; SymPKF is not
able to handle diagnostic equations.</p>
</sec>
</sec>
<sec id="Ch1.S5" sec-type="conclusions">
  <label>5</label><title>Conclusions</title>
      <p id="d1e9596">This contribution introduced the package SymPKF that can be used to conduct the
research on the parametric Kalman filter prediction step for
covariance models parameterized by the variance and the anisotropy (VLATcov models).
SymPKF provides an end-to-end framework: from the equations of
dynamics to the development of a numerical code.</p>
      <p id="d1e9599">The package has been first introduced by considering the
nonlinear diffusive advection dynamics in the Burgers equation. In particular,
this example shows the ability of SymPKF to handle abstract terms, e.g.,
the unclosed terms formulated with the expectation operator. The expectation
operator implemented in SymPKF is a key tool for the computation of the
PKF dynamics. Moreover, we showed how to handle a closure and how to automatically
render numerical codes.</p>
      <p id="d1e9602">For univariate situations, SymPKF applies in a 1D domain as well as in
2D and 3D domains. This has been shown by considering the computation of the
PKF dynamics for the linear advection equation on a 2D domain.</p>
      <?pagebreak page5974?><p id="d1e9605"><?xmltex \hack{\newpage}?>A preliminary illustration with multivariate dynamics showed the potential of SymPKF to handle the
dynamics of multivariate covariance. But this point has to be further
investigated, and this constitutes the main perspective of development.
Moreover, to perform a multivariate assimilation cycle with the PKF, the
multivariate formulation of the PKF analysis state is needed. A first investigation
of the multivariate PKF assimilation has been proposed by <xref ref-type="bibr" rid="bib1.bibx21" id="text.42"/>.</p>
      <p id="d1e9613">In its present implementation, SymPKF is limited to computation with
prognostic equations. It is not possible to consider dynamics based on diagnostic
equations, while these are often encountered in atmospheric fluid dynamics, e.g.,
the geostrophic balance. This constitutes another topic of research development
for the PKF, facilitated by the use of symbolic exploration.</p>
      <p id="d1e9616">Note that the expectation operator as introduced here can be used to compute
Reynolds equations encountered in turbulence. This opens new perspectives
for the use of SymPKF for other applications that could be interesting, especially
for automatic code generation.</p><?xmltex \hack{\clearpage}?>
</sec>

      
      </body>
    <back><app-group>

<?pagebreak page5975?><app id="App1.Ch1.S1">
  <?xmltex \currentcnt{A}?><label>Appendix A</label><title>Splitting for the computation of the parametric dynamics</title>
      <p id="d1e9631">In this section we show that using a splitting strategy is possible for the design of
the parametric dynamics. For this, it is enough to show that given dynamics written
as
          <disp-formula id="App1.Ch1.S1.E48" content-type="numbered"><label>A1</label><mml:math id="M327" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="script">X</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        the dynamics of the error, the variance, the metric, and the aspect all write
as a sum of trends depending on each process <inline-formula><mml:math id="M328" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M329" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>. We show this starting
from the dynamics of the error.</p>
      <p id="d1e9698">Due to the linearity of the derivative operator, the TL dynamics resulting from Eq. (<xref ref-type="disp-formula" rid="App1.Ch1.S1.E48"/>)
are written as
          <disp-formula id="App1.Ch1.S1.E49" content-type="numbered"><label>A2</label><mml:math id="M330" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M331" display="inline"><mml:mrow><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>′</mml:mo></mml:msubsup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M332" display="inline"><mml:mrow><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mo>′</mml:mo></mml:msubsup></mml:mrow></mml:math></inline-formula> denote the differential of the two functions,
which can be written as the sum of two trends <inline-formula><mml:math id="M333" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>e</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M334" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>e</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>,
depending exclusively on <inline-formula><mml:math id="M335" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M336" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, respectively.
For the variance's dynamics, <inline-formula><mml:math id="M337" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>V</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi>e</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>e</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>, substitution by Eq. (<xref ref-type="disp-formula" rid="App1.Ch1.S1.E49"/>) leads to
          <disp-formula id="App1.Ch1.S1.E50" content-type="numbered"><label>A3</label><mml:math id="M338" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>V</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M339" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi>e</mml:mi><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M340" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mi>e</mml:mi><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>
depend exclusively on <inline-formula><mml:math id="M341" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M342" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, respectively.
Then the standard deviation dynamics, obtained by differentiating <inline-formula><mml:math id="M343" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">σ</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mi>V</mml:mi></mml:mrow></mml:math></inline-formula> as
<inline-formula><mml:math id="M344" display="inline"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">σ</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="italic">σ</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>V</mml:mi></mml:mrow></mml:math></inline-formula>,
          <disp-formula id="App1.Ch1.S1.E51" content-type="numbered"><label>A4</label><mml:math id="M345" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="italic">σ</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mfrac></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mfrac></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        read as the sum of two trends <inline-formula><mml:math id="M346" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">σ</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mfrac></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and
<inline-formula><mml:math id="M347" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">σ</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mfrac></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, depending exclusively on <inline-formula><mml:math id="M348" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M349" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, respectively.
It results that the dynamics of the normalized error <inline-formula><mml:math id="M350" display="inline"><mml:mrow><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mfrac></mml:mstyle><mml:mi>e</mml:mi></mml:mrow></mml:math></inline-formula>, deduced from the time derivative of
<inline-formula><mml:math id="M351" display="inline"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="italic">σ</mml:mi><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M352" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="italic">σ</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">σ</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:math></inline-formula>, read as
          <disp-formula id="App1.Ch1.S1.E52" content-type="numbered"><label>A5</label><mml:math id="M353" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mfrac></mml:mstyle><mml:mfenced open="[" close="]"><mml:mrow><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mi mathvariant="italic">ε</mml:mi><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mfrac></mml:mstyle><mml:mfenced close="]" open="["><mml:mrow><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mi mathvariant="italic">ε</mml:mi><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:math></disp-formula>
        and also expand as the sum of two trends <inline-formula><mml:math id="M354" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mfrac></mml:mstyle><mml:mo>[</mml:mo><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi mathvariant="italic">ε</mml:mi><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>
and <inline-formula><mml:math id="M355" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mfrac></mml:mstyle><mml:mo>[</mml:mo><mml:msubsup><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mo>′</mml:mo></mml:msubsup><mml:mo>(</mml:mo><mml:mi>e</mml:mi><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi mathvariant="italic">ε</mml:mi><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">σ</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>, again depending exclusively on <inline-formula><mml:math id="M356" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>
and <inline-formula><mml:math id="M357" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, respectively.
For the metric terms <inline-formula><mml:math id="M358" display="inline"><mml:mrow><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>j</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>,
we deduce that the dynamics <inline-formula><mml:math id="M359" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>)</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>j</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>
expand as
          <disp-formula id="App1.Ch1.S1.E53" content-type="numbered"><label>A6</label><mml:math id="M360" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        with <inline-formula><mml:math id="M361" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>j</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>
and <inline-formula><mml:math id="M362" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>j</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:msub><mml:mo>∂</mml:mo><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ε</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>
where each partial trend depends exclusively on <inline-formula><mml:math id="M363" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M364" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, respectively.
To this end, the dynamics of the aspect tensor <inline-formula><mml:math id="M365" display="inline"><mml:mi mathvariant="bold">s</mml:mi></mml:math></inline-formula> are deduced from Eq. (<xref ref-type="disp-formula" rid="Ch1.E24"/>),
which expands as
          <disp-formula id="App1.Ch1.S1.E54" content-type="numbered"><label>A7</label><mml:math id="M366" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where
<inline-formula><mml:math id="M367" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="bold">s</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mi mathvariant="bold">s</mml:mi></mml:mrow></mml:math></inline-formula>
and
<inline-formula><mml:math id="M368" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold">s</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="bold">s</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold">g</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>)</mml:mo><mml:mi mathvariant="bold">s</mml:mi></mml:mrow></mml:math></inline-formula>
only depend on <inline-formula><mml:math id="M369" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M370" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, respectively.</p>
      <p id="d1e11063">To conclude, the computation of the parametric dynamics for Eq. (<xref ref-type="disp-formula" rid="App1.Ch1.S1.E48"/>) can be performed
from the parametric dynamics of <inline-formula><mml:math id="M371" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="script">X</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M372" display="inline"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">t</mml:mi></mml:msub><mml:mi mathvariant="script">X</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="script">X</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>
calculated separately, then merged together to obtain the dynamics of the variance in Eq. (<xref ref-type="disp-formula" rid="App1.Ch1.S1.E50"/>),
of the metric in Eq. (<xref ref-type="disp-formula" rid="App1.Ch1.S1.E53"/>), and of the aspect tensors in Eq. (<xref ref-type="disp-formula" rid="App1.Ch1.S1.E54"/>).</p>
</app>

<app id="App1.Ch1.S2">
  <?xmltex \currentcnt{B}?><label>Appendix B</label><?xmltex \opttitle{Computation of terms $\mathbb{E}{[}\partial^{\alpha}\varepsilon\partial^{\beta}\varepsilon{]}$}?><title>Computation of terms <inline-formula><mml:math id="M373" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula></title>
      <p id="d1e11161">In this section we proof the property.
<list list-content="plainlist" list-type="simple"><list-item>
      <p id="d1e11166"><italic>Property 1</italic>.
Any term <inline-formula><mml:math id="M374" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> with
<inline-formula><mml:math id="M375" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>≤</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula>
can be related to the correlation
expansion term <inline-formula><mml:math id="M376" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">γ</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>,
where <inline-formula><mml:math id="M377" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>|</mml:mo><mml:mo>&lt;</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>+</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula>, and the term <inline-formula><mml:math id="M378" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>.
<list list-type="bullet"><list-item>
      <p id="d1e11293"><italic>Proof</italic>.
The derivative with respect to a zero <inline-formula><mml:math id="M379" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>
is the identity operator. Note that the multi-index forms a semi-group since
for two multi-indexes <inline-formula><mml:math id="M380" display="inline"><mml:mi mathvariant="italic">α</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M381" display="inline"><mml:mi mathvariant="italic">β</mml:mi></mml:math></inline-formula> we can form the multi-index
<inline-formula><mml:math id="M382" display="inline"><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">β</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mo>)</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>n</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e11369">Now Property 1 can be proven considering the following recurrent process,
when assuming that the property is true for all patterns of degree strictly lower than
the degree <inline-formula><mml:math id="M383" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>+</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e11392">Without loss of generality we assume  <inline-formula><mml:math id="M384" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&gt;</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> and denote <inline-formula><mml:math id="M385" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mo>)</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>∈</mml:mo><mml:mo>[</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi>n</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M386" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is the Kronecker symbol
(<inline-formula><mml:math id="M387" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M388" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mtext> for </mml:mtext><mml:mi>j</mml:mi><mml:mo>≠</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:math></inline-formula>). From the formula<disp-formula id="App1.Ch1.S2.E55" content-type="numbered"><label>B1</label><mml:math id="M389" display="block"><mml:mrow><mml:msub><mml:mo>∂</mml:mo><mml:mrow><mml:msup><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msup></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">β</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:math></disp-formula>and from the commutativity of the expectation operator and the partial derivative with respect to the coordinate system, the result is that<disp-formula id="App1.Ch1.S2.E56" content-type="numbered"><label>B2</label><mml:math id="M390" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">α</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mo>∂</mml:mo><mml:mrow><mml:msup><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msup></mml:mrow></mml:msub><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi mathvariant="double-struck">E</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">β</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>considering the terms of the left-hand side. On one hand, we observe that the
degree of the first term is decreasing to <inline-formula><mml:math id="M391" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>+</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>; from the recurrence assumption,
<inline-formula><mml:math id="M392" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> can be expanded as terms of the form
<inline-formula><mml:math id="M393" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">γ</mml:mi></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>. On the other hand, the degree of the
second term remains the same, <inline-formula><mml:math id="M394" display="inline"><mml:mrow><mml:mo>|</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mo>|</mml:mo><mml:mo>+</mml:mo><mml:mo>|</mml:mo><mml:mi mathvariant="italic">β</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:math></inline-formula>, but with a shift of the derivative order.
This shift of the order can be done again following the same process, leading after iterations to
the term <inline-formula><mml:math id="M395" display="inline"><mml:mrow><mml:mi mathvariant="double-struck">E</mml:mi><mml:mo>[</mml:mo><mml:mi mathvariant="italic">ε</mml:mi><mml:msup><mml:mo>∂</mml:mo><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">β</mml:mi></mml:mrow></mml:msup><mml:mi mathvariant="italic">ε</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula>.</p></list-item></list></p></list-item></list></p><?xmltex \hack{\clearpage}?>
</app>
  </app-group><notes notes-type="codedataavailability"><title>Code and data availability</title>

      <p id="d1e11837">The SymPKF package is free and open-source. It is distributed under the CeCILL-B free software license.
The source code is provided through a GitHub repository at
<uri>https://github.com/opannekoucke/sympkf</uri> (last access:
22 March 2021). A snapshot of SymPKF is available at
<uri>https://doi.org/10.5281/zenodo.4608514</uri> <xref ref-type="bibr" rid="bib1.bibx22" id="paren.43"/>. The data
used for the simulations presented here are generated at runtime when using
the Jupyter notebooks.</p>
  </notes><notes notes-type="authorcontribution"><title>Author contributions</title>

      <p id="d1e11852">OP introduced the symbolic computation of the PKF dynamics, and
OP and PA imagined an end-to-end framework for the design of the PKF dynamics from the
equation of the dynamics to the numerical simulation thanks to an automatic code generation.
OP developed the codes.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d1e11858">The authors declare that they have no conflict
of interest.</p>
  </notes><notes notes-type="disclaimer"><title>Disclaimer</title>

      <p id="d1e11864">Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.</p>
  </notes><ack><title>Acknowledgements</title><p id="d1e11870">We would like to thank Sylwester Arabas and the two
anonymous referees for their fruitful comments, which have
contributed to improving the paper.
The UML class diagram has been generated from UMLlet <xref ref-type="bibr" rid="bib1.bibx1" id="paren.44"/>.</p></ack><notes notes-type="financialsupport"><title>Financial support</title>

      <p id="d1e11878">This research has been supported by the French national
program LEFE/INSU (Étude du filtre de KAlman PAramétrique,
KAPA).</p>
  </notes><notes notes-type="reviewstatement"><title>Review statement</title>

      <p id="d1e11884">This paper was edited by Sylwester Arabas and reviewed by two anonymous referees.</p>
  </notes><ref-list>
    <title>References</title>

      <ref id="bib1.bibx1"><?xmltex \def\ref@label{{Auer et~al.(2003)Auer, Tschurtschenthaler, and
Biffl}}?><label>Auer et al.(2003)Auer, Tschurtschenthaler, and
Biffl</label><?label Auer2003inproc?><mixed-citation>Auer, M., Tschurtschenthaler, T., and Biffl, S.: A Flyweight UML Modelling Tool
for Software Development in Heterogeneous Environments, in: Proceedings of
the 29th Conference on EUROMICRO, EUROMICRO '03, pp. 267–272​​​​​​​, IEEE Computer
Society, Washington, DC, USA,  1–6 September 2003, <ext-link xlink:href="https://doi.org/10.1109/EURMIC.2003.1231600" ext-link-type="DOI">10.1109/EURMIC.2003.1231600</ext-link>​​​​​​​, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx2"><?xmltex \def\ref@label{{Berre(2000)}}?><label>Berre(2000)</label><?label Berre2000MWR?><mixed-citation>
Berre, L.: Estimation of Synoptic and Mesoscale Forecast Error Covariances in a
Limited-Area Model, Mon. Weather Rev., 128, 644–667, 2000.</mixed-citation></ref>
      <ref id="bib1.bibx3"><?xmltex \def\ref@label{{Bird and Wiest(1995)}}?><label>Bird and Wiest(1995)</label><?label Bird1995FM?><mixed-citation>Bird, R. B. and Wiest, J. M.: Constitutive Equations for Polymeric Liquids,
Annu. Rev. Fluid Mech., 27, 169–193,
<ext-link xlink:href="https://doi.org/10.1146/annurev.fl.27.010195.001125" ext-link-type="DOI">10.1146/annurev.fl.27.010195.001125</ext-link>, 1995.</mixed-citation></ref>
      <ref id="bib1.bibx4"><?xmltex \def\ref@label{{Cohn(1993)}}?><label>Cohn(1993)</label><?label Cohn1993MWR?><mixed-citation>Cohn, S.: Dynamics of Short-Term Univariate Forecast Error Covariances, Mon.
Weather Rev., 121, 3123–3149,
<ext-link xlink:href="https://doi.org/10.1175/1520-0493(1993)121&lt;3123:DOSTUF&gt;2.0.CO;2" ext-link-type="DOI">10.1175/1520-0493(1993)121&lt;3123:DOSTUF&gt;2.0.CO;2</ext-link>, 1993.</mixed-citation></ref>
      <ref id="bib1.bibx5"><?xmltex \def\ref@label{{Courtier et~al.(1998)Courtier, Andersson, ans J.~Pailleux,
Vasiljevi\'{c}, Hamrud, Hollingsworth, Rabier, and Fisher}}?><label>Courtier et al.(1998)Courtier, Andersson, ans J. Pailleux,
Vasiljević, Hamrud, Hollingsworth, Rabier, and Fisher</label><?label Courtier1998QJRMS?><mixed-citation>
Courtier, P., Andersson, E., Pailleux, J., Vasiljević, W. H.,  Hamrud, D.,
Hollingsworth, M., Rabier, A. F., and Fisher, M.​​​​​​​​​​​​​​: The ECMWF implementation
of three-dimensional variational assimilation (3D-Var). I: Formulation,
Q. J. Roy. Meteor. Soc., 124, 1783–1807, 1998.</mixed-citation></ref>
      <ref id="bib1.bibx6"><?xmltex \def\ref@label{{Derber and Bouttier(1999)}}?><label>Derber and Bouttier(1999)</label><?label Derber1999TA?><mixed-citation>Derber, J. and Bouttier, F.: A reformulation of the background error covariance
in the ECMWF global data assimilation system, Tellus A, 51, 195–221,
<ext-link xlink:href="https://doi.org/10.3402/tellusa.v51i2.12316" ext-link-type="DOI">10.3402/tellusa.v51i2.12316</ext-link>, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx7"><?xmltex \def\ref@label{{Evensen(2009)}}?><label>Evensen(2009)</label><?label Evensen2009book?><mixed-citation>Evensen, G.: Data Assimilation: The Ensemble Kalman Filter, Springer-Verlag
Berlin Heidelberg, <ext-link xlink:href="https://doi.org/10.1007/978-3-642-03711-5" ext-link-type="DOI">10.1007/978-3-642-03711-5</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx8"><?xmltex \def\ref@label{{Fisher(1998)}}?><label>Fisher(1998)</label><?label Fisher1998E?><mixed-citation>Fisher, M.: Development of a simplified Kalman filter, Tech. Rep., 260, ECMWF,
<ext-link xlink:href="https://doi.org/10.21957/vz40cqca4" ext-link-type="DOI">10.21957/vz40cqca4</ext-link>, 1998.</mixed-citation></ref>
      <ref id="bib1.bibx9"><?xmltex \def\ref@label{{Fisher(2004)}}?><label>Fisher(2004)</label><?label Fisher2004inproc?><mixed-citation>
Fisher, M.: Generalized frames on the sphere, with application to background
error covariance modelling, in: Proc. ECMWF Seminar on ”Recent developments
in numerical methods for atmospheric and ocean modelling”, edited by ECMWF,
pp. 87–102, Reading, UK, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx10"><?xmltex \def\ref@label{{Hameduddin et~al.(2018)Hameduddin, Meneveau, Zaki, and
Gayme}}?><label>Hameduddin et al.(2018)Hameduddin, Meneveau, Zaki, and
Gayme</label><?label Hameduddin2018JFM?><mixed-citation>Hameduddin, I., Meneveau, C., Zaki, T. A., and Gayme, D. F.: Geometric
decomposition of the conformation tensor in viscoelastic turbulence, J. Fluid Mech., 842, 395–427, <ext-link xlink:href="https://doi.org/10.1017/jfm.2018.118" ext-link-type="DOI">10.1017/jfm.2018.118</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx11"><?xmltex \def\ref@label{{Jazwinski(1970)}}?><label>Jazwinski(1970)</label><?label Jazwinski1970book?><mixed-citation>
Jazwinski, A.: Stochastic Processes and Filtering Theory, Academic Press,  New York, 1970.</mixed-citation></ref>
      <ref id="bib1.bibx12"><?xmltex \def\ref@label{{Kalman(1960)}}?><label>Kalman(1960)</label><?label Kalman1960JBE?><mixed-citation>Kalman, R. E.: A New Approach to Linear Filtering and Prediction Problems,
Journal of Basic Engineering​​​​​​​, 82, 35–45, <ext-link xlink:href="https://doi.org/10.1115/1.3662552" ext-link-type="DOI">10.1115/1.3662552</ext-link>, 1960.</mixed-citation></ref>
      <ref id="bib1.bibx13"><?xmltex \def\ref@label{{Kassam and Trefethen(2005)}}?><label>Kassam and Trefethen(2005)</label><?label Kassam2005SJSC?><mixed-citation>
Kassam, A.-K. and Trefethen, L.: Fourth-order time-stepping for stiff PDEs,
SIAM J. Sci. Comput., 26, 1214–1233, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx14"><?xmltex \def\ref@label{{Lesieur(2007)}}?><label>Lesieur(2007)</label><?label Lesieur2007book?><mixed-citation>
Lesieur, M.: Turbulence in Fluids, Springer, p. 558, ISBN 978-1-4020-6434-0, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx15"><?xmltex \def\ref@label{{Louboutin et~al.(2019)Louboutin, Lange, Luporini, Kukreja, Witte,
Herrmann, Velesko, and Gorman}}?><label>Louboutin et al.(2019)Louboutin, Lange, Luporini, Kukreja, Witte,
Herrmann, Velesko, and Gorman</label><?label Louboutin2019GMD?><mixed-citation>Louboutin, M., Lange, M., Luporini, F., Kukreja, N., Witte, P. A., Herrmann, F. J., Velesko, P., and Gorman, G. J.: Devito (v3.1.0): an embedded domain-specific language for finite differences and geophysical exploration, Geosci. Model Dev., 12, 1165–1187, <ext-link xlink:href="https://doi.org/10.5194/gmd-12-1165-2019" ext-link-type="DOI">10.5194/gmd-12-1165-2019</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx16"><?xmltex \def\ref@label{{Meurer et~al.(2017)Meurer, Smith, Paprocki, {\v{C}}ert{\'{\i}}k,
Kirpichev, Rocklin, Kumar, Ivanov, Moore, Singh, Rathnayake, Vig, Granger,
Muller, Bonazzi, Gupta, Vats, Johansson, Pedregosa, Curry, Terrel,
Rou{\v{c}}ka, Saboo, Fernando, Kulal, Cimrman, and Scopatz}}?><label>Meurer et al.(2017)Meurer, Smith, Paprocki, Čertík,
Kirpichev, Rocklin, Kumar, Ivanov, Moore, Singh, Rathnayake, Vig, Granger,
Muller, Bonazzi, Gupta, Vats, Johansson, Pedregosa, Curry, Terrel,
Roučka, Saboo, Fernando, Kulal, Cimrman, and Scopatz</label><?label Meurer2017PCS?><mixed-citation>Meurer, A., Smith, C. P., Paprocki, M., Čertík, O., Kirpichev,
S. B., Rocklin, M., Kumar, A., Ivanov, S., Moore, J. K., Singh, S.,
Rathnayake, T., Vig, S., Granger, B. E., Muller, R. P., Bonazzi, F., Gupta,
H., Vats, S., Johansson, F., Pedregosa, F., Curry, M. J., Terrel, A. R.,
Roučka, Š., Saboo, A., Fernando, I., Kulal, S., Cimrman, R., and
Scopatz, A.: SymPy: symbolic computing in Python, PeerJ Computer Science,
3, e103, <ext-link xlink:href="https://doi.org/10.7717/peerj-cs.103" ext-link-type="DOI">10.7717/peerj-cs.103</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx17"><?xmltex \def\ref@label{{Mirouze and Weaver(2010)}}?><label>Mirouze and Weaver(2010)</label><?label Mirouze2010QJRMS?><mixed-citation>Mirouze, I. and Weaver, A. T.: Representation of correlation functions in
variational assimilation using an implicit diffusion operator, Q.
J. Roy. Meteor. Soc., 136, 1421–1443,
<ext-link xlink:href="https://doi.org/10.1002/qj.643" ext-link-type="DOI">10.1002/qj.643</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx18"><?xmltex \def\ref@label{{{\O}ksendal(2003)}}?><label>Øksendal(2003)</label><?label Oksendal2003book?><mixed-citation>Øksendal, B.: Stochastic Differential Equations, Springer Berlin Heidelberg,
<ext-link xlink:href="https://doi.org/10.1007/978-3-642-14394-6" ext-link-type="DOI">10.1007/978-3-642-14394-6</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx19"><?xmltex \def\ref@label{{Paciorek and Schervish(2004)}}?><label>Paciorek and Schervish(2004)</label><?label Paciorek2004ANIPS?><mixed-citation>Paciorek, C. and Schervish, M.: Nonstationary Covariance Functions for Gaussian
Process Regression, Advances Neural Information Processing Systems, 16,
273–280, <uri>https://proceedings.neurips.cc/paper/2003/file/326a8c055c0d04f5b06544665d8bb3ea-Paper.pdf</uri> (last access: 22 September 2021)​​​​​​​, 2004.</mixed-citation></ref>
      <?pagebreak page5977?><ref id="bib1.bibx20"><?xmltex \def\ref@label{{Pannekoucke(2021{\natexlab{a}})}}?><label>Pannekoucke(2021a)</label><?label Pannekoucke2021?><mixed-citation>Pannekoucke, O.: CAC-PKF-M (v0.1): Computer-aided calculation of PKF dynamics
with Maxima, Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/ZENODO.4708316" ext-link-type="DOI">10.5281/ZENODO.4708316</ext-link>, 2021a.</mixed-citation></ref>
      <ref id="bib1.bibx21"><?xmltex \def\ref@label{{Pannekoucke(2021{\natexlab{b}})}}?><label>Pannekoucke(2021b)</label><?label Pannekoucke2021TA?><mixed-citation>Pannekoucke, O.: An anisotropic formulation of the parametric Kalman filter
assimilation, Tellus A, 73, 1–27​​​​​​​,
<ext-link xlink:href="https://doi.org/10.1080/16000870.2021.1926660" ext-link-type="DOI">10.1080/16000870.2021.1926660</ext-link>, 2021b.</mixed-citation></ref>
      <ref id="bib1.bibx22"><?xmltex \def\ref@label{{Pannekoucke(2021{\natexlab{c}})}}?><label>Pannekoucke(2021c)</label><?label Pannekoucke2021Z?><mixed-citation>Pannekoucke, O.: SymPKF: a symbolic and computational toolbox for the design of
parametric Kalman filter dynamics, Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.4608514" ext-link-type="DOI">10.5281/zenodo.4608514</ext-link>,
2021c.</mixed-citation></ref>
      <ref id="bib1.bibx23"><?xmltex \def\ref@label{{Pannekoucke and Fablet(2020)}}?><label>Pannekoucke and Fablet(2020)</label><?label Pannekoucke2020GMD?><mixed-citation>Pannekoucke, O. and Fablet, R.: PDE-NetGen 1.0: from symbolic partial differential equation (PDE) representations of physical processes to trainable neural network representations, Geosci. Model Dev., 13, 3373–3382, <ext-link xlink:href="https://doi.org/10.5194/gmd-13-3373-2020" ext-link-type="DOI">10.5194/gmd-13-3373-2020</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx24"><?xmltex \def\ref@label{{Pannekoucke and Massart(2008)}}?><label>Pannekoucke and Massart(2008)</label><?label Pannekoucke2008QJRMSa?><mixed-citation>Pannekoucke, O. and Massart, S.: Estimation of the local diffusion tensor and
normalization for heterogeneous correlation modelling using a diffusion
equation, Q. J. Roy. Meteor. Soc.., 134,
1425–1438, <ext-link xlink:href="https://doi.org/10.1002/qj.288" ext-link-type="DOI">10.1002/qj.288</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx25"><?xmltex \def\ref@label{{Pannekoucke et~al.(2007)Pannekoucke, Berre, and
Desroziers}}?><label>Pannekoucke et al.(2007)Pannekoucke, Berre, and
Desroziers</label><?label Pannekoucke2007QJRMS?><mixed-citation>
Pannekoucke, O., Berre, L., and Desroziers, G.: Filtering properties of
wavelets for local background-error correlations, Q. J. Roy.
Meteor. Soc., 133, 363–379, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx26"><?xmltex \def\ref@label{{Pannekoucke et~al.(2016)Pannekoucke, Ricci, Barthelemy, M\'{e}nard, and
Thual}}?><label>Pannekoucke et al.(2016)Pannekoucke, Ricci, Barthelemy, Ménard, and
Thual</label><?label Pannekoucke2016T?><mixed-citation>Pannekoucke, O., Ricci, S., Barthelemy, S., Ménard, R., and Thual, O.:
Parametric Kalman Filter for chemical transport model, Tellus, 68, 31547​​​​​​​,
<ext-link xlink:href="https://doi.org/10.3402/tellusa.v68.31547" ext-link-type="DOI">10.3402/tellusa.v68.31547</ext-link>, 2016.
</mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bibx27"><?xmltex \def\ref@label{{Pannekoucke et~al.(2018{\natexlab{a}})Pannekoucke, Bocquet, and
M\'{e}nard}}?><label>Pannekoucke et al.(2018a)Pannekoucke, Bocquet, and
Ménard</label><?label Pannekoucke2018NPG?><mixed-citation>Pannekoucke, O., Bocquet, M., and Ménard, R.: Parametric covariance dynamics for the nonlinear diffusive Burgers equation, Nonlin. Processes Geophys., 25, 481–495, <ext-link xlink:href="https://doi.org/10.5194/npg-25-481-2018" ext-link-type="DOI">10.5194/npg-25-481-2018</ext-link>, 2018a.</mixed-citation></ref>
      <ref id="bib1.bibx28"><?xmltex \def\ref@label{{Pannekoucke et~al.(2018{\natexlab{b}})Pannekoucke, Ricci, Barthelemy,
M\'{e}nard, and Thual.}}?><label>Pannekoucke et al.(2018b)Pannekoucke, Ricci, Barthelemy,
Ménard, and Thual.</label><?label Pannekoucke2018T?><mixed-citation>Pannekoucke, O., Ricci, S., Barthelemy, S., Ménard, R., and Thual., O.:
Parametric Kalman filter for chemical transport models – Corrigendum, Tellus
A, 70, 1–2​​​​​​​,
<ext-link xlink:href="https://doi.org/10.1080/16000870.2018.1472954" ext-link-type="DOI">10.1080/16000870.2018.1472954</ext-link>, 2018b.</mixed-citation></ref>
      <ref id="bib1.bibx29"><?xmltex \def\ref@label{{Purser et~al.(2003)Purser, Wu, D.Parrish, and
Roberts}}?><label>Purser et al.(2003)Purser, Wu, D.Parrish, and
Roberts</label><?label Purser2003MWRa?><mixed-citation>Purser, R., Wu, W.-S., Parrish, D., and Roberts, N.: Numerical aspects of the
application of recursive filters to variational statistical analysis. Part
II: Spatially inhomogeneous and anisotropic general covariances, Mon.
Weather Rev., 131, 1536–1548, <ext-link xlink:href="https://doi.org/10.1175//2543.1" ext-link-type="DOI">10.1175//2543.1</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx30"><?xmltex \def\ref@label{{Ricci et~al.(2005)Ricci, Weaver, Vialard, and Rogel}}?><label>Ricci et al.(2005)Ricci, Weaver, Vialard, and Rogel</label><?label Ricci2005MWR?><mixed-citation>Ricci, S., Weaver, A. T., Vialard, J., and Rogel, P.: Incorporating
State-Dependent Temperature–Salinity Constraints in the
Background Error Covariance of Variational Ocean Data Assimilation, Mon.
Weather Rev., 133, 317–338, <ext-link xlink:href="https://doi.org/10.1175/mwr2872.1" ext-link-type="DOI">10.1175/mwr2872.1</ext-link>, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx31"><?xmltex \def\ref@label{{Weaver and Courtier(2001)}}?><label>Weaver and Courtier(2001)</label><?label Weaver2001QJRMS?><mixed-citation>Weaver, A. and Courtier, P.: Correlation modelling on the sphere using a
generalized diffusion equation, Q.
J. Roy. Meteor. Soc., 127, 1815–1846,
<ext-link xlink:href="https://doi.org/10.1002/qj.49712757518" ext-link-type="DOI">10.1002/qj.49712757518</ext-link>, 2001.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html>SymPKF (v1.0): a symbolic and computational toolbox for the design of parametric Kalman filter dynamics</article-title-html>
<abstract-html><p>Recent research in data assimilation has led to the introduction of the parametric
Kalman filter (PKF): an implementation of the Kalman filter, whereby the
covariance matrices are approximated by a parameterized covariance model.
In the PKF, the dynamics of the covariance during the forecast step rely on
the prediction of the covariance parameters. Hence, the design of the parameter
dynamics is crucial, while it can be tedious to do this by hand.
This contribution introduces a Python package, SymPKF, able to compute PKF dynamics
for univariate statistics and when the covariance model is parameterized from the
variance and the local anisotropy of the correlations. The ability of SymPKF to
produce the PKF dynamics is shown on a nonlinear diffusive advection (the Burgers equation)
over a 1D domain and the linear advection over a 2D domain. The computation of the PKF
dynamics is performed at a symbolic level, but an automatic code generator is also
introduced to perform numerical simulations. A final multivariate example
illustrates the potential of SymPKF to go beyond the univariate case.</p></abstract-html>
<ref-html id="bib1.bib1"><label>Auer et al.(2003)Auer, Tschurtschenthaler, and
Biffl</label><mixed-citation>
Auer, M., Tschurtschenthaler, T., and Biffl, S.: A Flyweight UML Modelling Tool
for Software Development in Heterogeneous Environments, in: Proceedings of
the 29th Conference on EUROMICRO, EUROMICRO '03, pp. 267–272​​​​​​​, IEEE Computer
Society, Washington, DC, USA,  1–6 September 2003, <a href="https://doi.org/10.1109/EURMIC.2003.1231600" target="_blank">https://doi.org/10.1109/EURMIC.2003.1231600</a>​​​​​​​, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>Berre(2000)</label><mixed-citation>
Berre, L.: Estimation of Synoptic and Mesoscale Forecast Error Covariances in a
Limited-Area Model, Mon. Weather Rev., 128, 644–667, 2000.
</mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>Bird and Wiest(1995)</label><mixed-citation>
Bird, R. B. and Wiest, J. M.: Constitutive Equations for Polymeric Liquids,
Annu. Rev. Fluid Mech., 27, 169–193,
<a href="https://doi.org/10.1146/annurev.fl.27.010195.001125" target="_blank">https://doi.org/10.1146/annurev.fl.27.010195.001125</a>, 1995.
</mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>Cohn(1993)</label><mixed-citation>
Cohn, S.: Dynamics of Short-Term Univariate Forecast Error Covariances, Mon.
Weather Rev., 121, 3123–3149,
<a href="https://doi.org/10.1175/1520-0493(1993)121&lt;3123:DOSTUF&gt;2.0.CO;2" target="_blank">https://doi.org/10.1175/1520-0493(1993)121&lt;3123:DOSTUF&gt;2.0.CO;2</a>, 1993.
</mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>Courtier et al.(1998)Courtier, Andersson, ans J. Pailleux,
Vasiljević, Hamrud, Hollingsworth, Rabier, and Fisher</label><mixed-citation>
Courtier, P., Andersson, E., Pailleux, J., Vasiljević, W. H.,  Hamrud, D.,
Hollingsworth, M., Rabier, A. F., and Fisher, M.​​​​​​​​​​​​​​: The ECMWF implementation
of three-dimensional variational assimilation (3D-Var). I: Formulation,
Q. J. Roy. Meteor. Soc., 124, 1783–1807, 1998.
</mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>Derber and Bouttier(1999)</label><mixed-citation>
Derber, J. and Bouttier, F.: A reformulation of the background error covariance
in the ECMWF global data assimilation system, Tellus A, 51, 195–221,
<a href="https://doi.org/10.3402/tellusa.v51i2.12316" target="_blank">https://doi.org/10.3402/tellusa.v51i2.12316</a>, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>Evensen(2009)</label><mixed-citation>
Evensen, G.: Data Assimilation: The Ensemble Kalman Filter, Springer-Verlag
Berlin Heidelberg, <a href="https://doi.org/10.1007/978-3-642-03711-5" target="_blank">https://doi.org/10.1007/978-3-642-03711-5</a>, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>Fisher(1998)</label><mixed-citation>
Fisher, M.: Development of a simplified Kalman filter, Tech. Rep., 260, ECMWF,
<a href="https://doi.org/10.21957/vz40cqca4" target="_blank">https://doi.org/10.21957/vz40cqca4</a>, 1998.
</mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>Fisher(2004)</label><mixed-citation>
Fisher, M.: Generalized frames on the sphere, with application to background
error covariance modelling, in: Proc. ECMWF Seminar on ”Recent developments
in numerical methods for atmospheric and ocean modelling”, edited by ECMWF,
pp. 87–102, Reading, UK, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>Hameduddin et al.(2018)Hameduddin, Meneveau, Zaki, and
Gayme</label><mixed-citation>
Hameduddin, I., Meneveau, C., Zaki, T. A., and Gayme, D. F.: Geometric
decomposition of the conformation tensor in viscoelastic turbulence, J. Fluid Mech., 842, 395–427, <a href="https://doi.org/10.1017/jfm.2018.118" target="_blank">https://doi.org/10.1017/jfm.2018.118</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>Jazwinski(1970)</label><mixed-citation>
Jazwinski, A.: Stochastic Processes and Filtering Theory, Academic Press,  New York, 1970.
</mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>Kalman(1960)</label><mixed-citation>
Kalman, R. E.: A New Approach to Linear Filtering and Prediction Problems,
Journal of Basic Engineering​​​​​​​, 82, 35–45, <a href="https://doi.org/10.1115/1.3662552" target="_blank">https://doi.org/10.1115/1.3662552</a>, 1960.
</mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>Kassam and Trefethen(2005)</label><mixed-citation>
Kassam, A.-K. and Trefethen, L.: Fourth-order time-stepping for stiff PDEs,
SIAM J. Sci. Comput., 26, 1214–1233, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>Lesieur(2007)</label><mixed-citation>
Lesieur, M.: Turbulence in Fluids, Springer, p. 558, ISBN 978-1-4020-6434-0, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>Louboutin et al.(2019)Louboutin, Lange, Luporini, Kukreja, Witte,
Herrmann, Velesko, and Gorman</label><mixed-citation>
Louboutin, M., Lange, M., Luporini, F., Kukreja, N., Witte, P. A., Herrmann, F. J., Velesko, P., and Gorman, G. J.: Devito (v3.1.0): an embedded domain-specific language for finite differences and geophysical exploration, Geosci. Model Dev., 12, 1165–1187, <a href="https://doi.org/10.5194/gmd-12-1165-2019" target="_blank">https://doi.org/10.5194/gmd-12-1165-2019</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>Meurer et al.(2017)Meurer, Smith, Paprocki, Čertík,
Kirpichev, Rocklin, Kumar, Ivanov, Moore, Singh, Rathnayake, Vig, Granger,
Muller, Bonazzi, Gupta, Vats, Johansson, Pedregosa, Curry, Terrel,
Roučka, Saboo, Fernando, Kulal, Cimrman, and Scopatz</label><mixed-citation>
Meurer, A., Smith, C. P., Paprocki, M., Čertík, O., Kirpichev,
S. B., Rocklin, M., Kumar, A., Ivanov, S., Moore, J. K., Singh, S.,
Rathnayake, T., Vig, S., Granger, B. E., Muller, R. P., Bonazzi, F., Gupta,
H., Vats, S., Johansson, F., Pedregosa, F., Curry, M. J., Terrel, A. R.,
Roučka, Š., Saboo, A., Fernando, I., Kulal, S., Cimrman, R., and
Scopatz, A.: SymPy: symbolic computing in Python, PeerJ Computer Science,
3, e103, <a href="https://doi.org/10.7717/peerj-cs.103" target="_blank">https://doi.org/10.7717/peerj-cs.103</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>Mirouze and Weaver(2010)</label><mixed-citation>
Mirouze, I. and Weaver, A. T.: Representation of correlation functions in
variational assimilation using an implicit diffusion operator, Q.
J. Roy. Meteor. Soc., 136, 1421–1443,
<a href="https://doi.org/10.1002/qj.643" target="_blank">https://doi.org/10.1002/qj.643</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>Øksendal(2003)</label><mixed-citation>
Øksendal, B.: Stochastic Differential Equations, Springer Berlin Heidelberg,
<a href="https://doi.org/10.1007/978-3-642-14394-6" target="_blank">https://doi.org/10.1007/978-3-642-14394-6</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>Paciorek and Schervish(2004)</label><mixed-citation>
Paciorek, C. and Schervish, M.: Nonstationary Covariance Functions for Gaussian
Process Regression, Advances Neural Information Processing Systems, 16,
273–280, <a href="https://proceedings.neurips.cc/paper/2003/file/326a8c055c0d04f5b06544665d8bb3ea-Paper.pdf" target="_blank"/> (last access: 22 September 2021)​​​​​​​, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>Pannekoucke(2021a)</label><mixed-citation>
Pannekoucke, O.: CAC-PKF-M (v0.1): Computer-aided calculation of PKF dynamics
with Maxima, Zenodo [code], <a href="https://doi.org/10.5281/ZENODO.4708316" target="_blank">https://doi.org/10.5281/ZENODO.4708316</a>, 2021a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>Pannekoucke(2021b)</label><mixed-citation>
Pannekoucke, O.: An anisotropic formulation of the parametric Kalman filter
assimilation, Tellus A, 73, 1–27​​​​​​​,
<a href="https://doi.org/10.1080/16000870.2021.1926660" target="_blank">https://doi.org/10.1080/16000870.2021.1926660</a>, 2021b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>Pannekoucke(2021c)</label><mixed-citation>
Pannekoucke, O.: SymPKF: a symbolic and computational toolbox for the design of
parametric Kalman filter dynamics, Zenodo [code], <a href="https://doi.org/10.5281/zenodo.4608514" target="_blank">https://doi.org/10.5281/zenodo.4608514</a>,
2021c.
</mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>Pannekoucke and Fablet(2020)</label><mixed-citation>
Pannekoucke, O. and Fablet, R.: PDE-NetGen 1.0: from symbolic partial differential equation (PDE) representations of physical processes to trainable neural network representations, Geosci. Model Dev., 13, 3373–3382, <a href="https://doi.org/10.5194/gmd-13-3373-2020" target="_blank">https://doi.org/10.5194/gmd-13-3373-2020</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>Pannekoucke and Massart(2008)</label><mixed-citation>
Pannekoucke, O. and Massart, S.: Estimation of the local diffusion tensor and
normalization for heterogeneous correlation modelling using a diffusion
equation, Q. J. Roy. Meteor. Soc.., 134,
1425–1438, <a href="https://doi.org/10.1002/qj.288" target="_blank">https://doi.org/10.1002/qj.288</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>Pannekoucke et al.(2007)Pannekoucke, Berre, and
Desroziers</label><mixed-citation>
Pannekoucke, O., Berre, L., and Desroziers, G.: Filtering properties of
wavelets for local background-error correlations, Q. J. Roy.
Meteor. Soc., 133, 363–379, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>Pannekoucke et al.(2016)Pannekoucke, Ricci, Barthelemy, Ménard, and
Thual</label><mixed-citation>
Pannekoucke, O., Ricci, S., Barthelemy, S., Ménard, R., and Thual, O.:
Parametric Kalman Filter for chemical transport model, Tellus, 68, 31547​​​​​​​,
<a href="https://doi.org/10.3402/tellusa.v68.31547" target="_blank">https://doi.org/10.3402/tellusa.v68.31547</a>, 2016.

</mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>Pannekoucke et al.(2018a)Pannekoucke, Bocquet, and
Ménard</label><mixed-citation>
Pannekoucke, O., Bocquet, M., and Ménard, R.: Parametric covariance dynamics for the nonlinear diffusive Burgers equation, Nonlin. Processes Geophys., 25, 481–495, <a href="https://doi.org/10.5194/npg-25-481-2018" target="_blank">https://doi.org/10.5194/npg-25-481-2018</a>, 2018a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>Pannekoucke et al.(2018b)Pannekoucke, Ricci, Barthelemy,
Ménard, and Thual.</label><mixed-citation>
Pannekoucke, O., Ricci, S., Barthelemy, S., Ménard, R., and Thual., O.:
Parametric Kalman filter for chemical transport models – Corrigendum, Tellus
A, 70, 1–2​​​​​​​,
<a href="https://doi.org/10.1080/16000870.2018.1472954" target="_blank">https://doi.org/10.1080/16000870.2018.1472954</a>, 2018b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib29"><label>Purser et al.(2003)Purser, Wu, D.Parrish, and
Roberts</label><mixed-citation>
Purser, R., Wu, W.-S., Parrish, D., and Roberts, N.: Numerical aspects of the
application of recursive filters to variational statistical analysis. Part
II: Spatially inhomogeneous and anisotropic general covariances, Mon.
Weather Rev., 131, 1536–1548, <a href="https://doi.org/10.1175//2543.1" target="_blank">https://doi.org/10.1175//2543.1</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib30"><label>Ricci et al.(2005)Ricci, Weaver, Vialard, and Rogel</label><mixed-citation>
Ricci, S., Weaver, A. T., Vialard, J., and Rogel, P.: Incorporating
State-Dependent Temperature–Salinity Constraints in the
Background Error Covariance of Variational Ocean Data Assimilation, Mon.
Weather Rev., 133, 317–338, <a href="https://doi.org/10.1175/mwr2872.1" target="_blank">https://doi.org/10.1175/mwr2872.1</a>, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib31"><label>Weaver and Courtier(2001)</label><mixed-citation>
Weaver, A. and Courtier, P.: Correlation modelling on the sphere using a
generalized diffusion equation, Q.
J. Roy. Meteor. Soc., 127, 1815–1846,
<a href="https://doi.org/10.1002/qj.49712757518" target="_blank">https://doi.org/10.1002/qj.49712757518</a>, 2001.
</mixed-citation></ref-html>--></article>
