<?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"><?xmltex \makeatother\@nolinetrue\makeatletter?>
  <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-15-3417-2022</article-id><title-group><article-title>Conservation laws in a neural network architecture: enforcing the atom
balance of a Julia-based photochemical model (v0.2.0)</article-title><alt-title>Conservation laws in a neural network architecture</alt-title>
      </title-group><?xmltex \runningtitle{Conservation laws in a neural network architecture}?><?xmltex \runningauthor{P.~O.~Sturm and A.~S.~Wexler}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1">
          <name><surname>Sturm</surname><given-names>Patrick Obin</given-names></name>
          <email>posturm@ucdavis.edu</email>
        <ext-link>https://orcid.org/0000-0001-7361-9590</ext-link></contrib>
        <contrib contrib-type="author" corresp="yes" rid="aff1 aff2 aff3 aff4">
          <name><surname>Wexler</surname><given-names>Anthony S.</given-names></name>
          <email>aswexler@ucdavis.edu</email>
        </contrib>
        <aff id="aff1"><label>1</label><institution>Air Quality Research Center, University of California, Davis, Davis,
California 95616, USA</institution>
        </aff>
        <aff id="aff2"><label>2</label><institution>Department of Mechanical and Aerospace Engineering, University of
California, Davis, Davis, California 95616, USA</institution>
        </aff>
        <aff id="aff3"><label>3</label><institution>Department of Civil and
Environmental Engineering, University of
California, Davis, Davis, California 95616, USA</institution>
        </aff>
        <aff id="aff4"><label>4</label><institution>Department of Land, Air and Water Resources, University of
California, Davis, Davis, California 95616, USA</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Patrick Obin Sturm (posturm@ucdavis.edu) and Anthony S. Wexler (aswexler@ucdavis.edu)</corresp></author-notes><pub-date><day>28</day><month>April</month><year>2022</year></pub-date>
      
      <volume>15</volume>
      <issue>8</issue>
      <fpage>3417</fpage><lpage>3431</lpage>
      <history>
        <date date-type="received"><day>30</day><month>November</month><year>2021</year></date>
           <date date-type="rev-request"><day>16</day><month>December</month><year>2021</year></date>
           <date date-type="rev-recd"><day>17</day><month>March</month><year>2022</year></date>
           <date date-type="accepted"><day>29</day><month>March</month><year>2022</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2022 Patrick Obin Sturm</copyright-statement>
        <copyright-year>2022</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/15/3417/2022/gmd-15-3417-2022.html">This article is available from https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022.pdf</self-uri>
      <abstract><title>Abstract</title>

      <p id="d1e112">Models of atmospheric phenomena provide insight into
climate, air quality, and meteorology and provide a mechanism for
understanding the effect of future emissions scenarios. To accurately
represent atmospheric phenomena, these models consume vast quantities of
computational resources. Machine learning (ML) techniques such as neural
networks have the potential to emulate computationally intensive components of these
models to reduce their computational burden. However, such ML surrogate
models may lead to nonphysical predictions that are difficult to uncover.
Here we present a neural network architecture that enforces conservation
laws to numerical precision. Instead of simply predicting properties of
interest, a physically interpretable hidden layer within the network
predicts fluxes between properties which are subsequently related to the
properties of interest. This approach is readily generalizable to physical
processes where flux continuity is an essential governing equation. As an
example application, we demonstrate our approach on a neural network
surrogate model of photochemistry, trained to emulate a reference model that
simulates formation and reaction of ozone. We design a physics-constrained
neural network surrogate model of photochemistry using this approach and
find that it conserves atoms as they flow between molecules while
outperforming two other neural network architectures in terms of accuracy,
physical consistency, and non-negativity of concentrations.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

      <?xmltex \hack{\newpage}?>
<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d1e126">One approach for increasing the computational efficiency of air quality and
climate models is to replace the physical and chemical representation of
atmospheric processes with machine learning surrogate models. Machine
learning approaches for surrogate models of phenomena in the atmospheric
sciences emerged in the 1990s (Gardner and Dorling, 1998; Potukuchi and
Wexler, 1997). However, these surrogate models might not necessarily (1) be
faster than the reference model (Keller and Evans, 2019); (2) behave in a
numerically stable way (Kelp et al., 2018; Brenowitz and Bretherton, 2018);
or (3) make physical sense, for example by respecting deterministic
constraints such as conservation laws (Keller and Evans, 2019; Kashinath et
al., 2021). Recent efforts have taken steps towards the first two points,
notably Kelp et al. (2020), who demonstrate stability in recurrent,
long-term predictions of gas-phase chemistry with a recurrent neural network
architecture. Their recurrent neural network is orders of magnitude faster
than the reference model MOSAIC/CBM-Z (Zaveri et al., 2008).</p>
      <p id="d1e129">Point 3 is an active area of research and the focus of this work. Complex
machine learning (ML) tools, including neural networks, can be criticized as
being “black box” methods that have opaque inner workings: this criticism
motivates the development of interpretable ML methods, or in the physical
sciences, more <italic>physically</italic> interpretable ML (McGovern et al., 2019). Physics-informed
neural networks exploiting automatic differentiation can reproduce numerical
solutions to partial differential equations (Raissi et al., 2019). In the
atmospheric sciences, physical information has been incorporated into
machine learning models via balancing approaches after prediction
(Krasnopolsky et al., 2010), a cost function penalizing nonphysical behavior
(Beucler et al., 2021; Zhao et al., 2019), including additional physically
relevant information as input (Silva et al., 2021b), or incorporating hard
constraints on a subset of the output in the neural network architecture
(Beucler et al., 2019, 2021).</p>
      <p id="d1e135">Incorporating fundamental knowledge into ML algorithms will ensure adherence
to the physical and chemical laws underpinning these representations and
likely improve the accuracy and stability of these algorithms. This work
introduces a method to incorporate fundamental scientific laws in neural
network surrogate models in a way that ensures conservation of important
quantities (for example mass, atoms, or energy) by imposing flux continuity
constraints within the neural network architecture. Atom conservation is
fundamental to atmospheric photochemistry, and photochemistry is a
computationally intensive component of air quality and climate models, so
this work employs as an example inherently conserving atoms in a neural
network model of atmospheric photochemistry.</p>
      <p id="d1e138">Recent efforts in machine learning methods for atmospheric chemistry have
indicated physically informed ML as a future research direction (Keller and
Evans, 2019; Kelp et al., 2020). Kelp et al. (2020) motivate exploring ML
architectures that are customized with information about the systems they
aim to model and the potential for this to improve predictions of the large
concentration changes that frequently occur at the start of atmospheric
chemistry simulations. Keller and Evans (2019) point out that incorporating
physical information in ML, such as conservation laws, can help ensure point 2, numerical stability of ML, by keeping predictions within the solution
space of the reference model. Keller and Evans (2019) also provide the
example of atom conservation and propose inclusion of stoichiometric
information as a possible solution and a future direction to explore. In
this work, we focus on this latter goal: conserving atoms, much in line with
the suggestions outlined in Keller and Evans (2019), as well as the
framework introduced by our prior work (Sturm and Wexler, 2020). More
specifically, we utilize the weight matrix multiplication structure of a
neural network (NN) to incorporate stoichiometric information in its
architecture. The architecture of this physics-constrained model ensures
conservation of atoms by including a constraint layer that has
non-optimizable weights representing the stoichiometry of the reactions. The
physics-constrained NN is trained to emulate a reference photochemical model
simulating production and loss of ozone with 11 species and 10 reactions. A
secondary benefit of the physics-constrained NN architecture is increased
physical interpretability of the neural network: the output of the hidden
layer before these constraints can be interpreted as the net flux of atoms
between molecules, or in terms of chemical kinetics, the extent of reaction.</p>
</sec>
<sec id="Ch1.S2">
  <label>2</label><title>Derivation and model configuration</title>
<sec id="Ch1.S2.SS1">
  <label>2.1</label><title>Physical constraints in the neural network architecture</title>
      <p id="d1e156">Our prior work (Sturm and Wexler, 2020) introduced a framework that could be
used with any machine learning algorithm to introduce conservation laws. In
the case of atmospheric chemistry, most ML surrogate model approaches have
estimated future concentrations <inline-formula><mml:math id="M1" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> from current
concentrations <inline-formula><mml:math id="M2" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and other parameters <inline-formula><mml:math id="M3" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, which
can include meteorological conditions such as zenith angle, temperature, and
humidity.
            <disp-formula id="Ch1.E1" content-type="numbered"><label>1</label><mml:math id="M4" display="block"><mml:mrow><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="bold">F</mml:mi><mml:mi>C</mml:mi></mml:msub><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:mi mathvariant="bold-italic">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          Rather than estimate the future value for the concentration (or more
generally, the property of interest), we proposed training a machine
learning algorithm to estimate fluxes <italic>between</italic> the properties of interest: for the
photochemistry example, these are atom fluxes as they are between flow molecules in a
stoichiometrically balanced way. These fluxes are also interpretable as
rates of reaction or, when integrated over a certain time step, extents of
reaction. The fluxes are related to the tendencies or change in
concentrations of species <inline-formula><mml:math id="M5" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> in a way that is
stoichiometrically balanced. The stoichiometric information is contained in
a matrix <inline-formula><mml:math id="M6" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> that relates fluxes, <inline-formula><mml:math id="M7" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula>, to change
in concentrations such that <inline-formula><mml:math id="M8" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="bold">A</mml:mi><mml:mi mathvariant="bold-italic">S</mml:mi></mml:mrow></mml:math></inline-formula>. This framework leads to prediction of
these fluxes using an ML algorithm that emulates
            <disp-formula id="Ch1.E2" content-type="numbered"><label>2</label><mml:math id="M9" display="block"><mml:mrow><mml:mi mathvariant="bold-italic">S</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="bold">F</mml:mi><mml:mi mathvariant="bold-italic">S</mml:mi></mml:msub><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:mi mathvariant="bold-italic">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          wherein <inline-formula><mml:math id="M10" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> is a vector of the time-integrated flux of atoms
between model species due to photochemistry. Future concentrations can then
be calculated via
            <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M11" display="block"><mml:mrow><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mfenced open="(" close=")"><mml:mrow><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mfenced open="(" close=")"><mml:mi>t</mml:mi></mml:mfenced><mml:mo>+</mml:mo><mml:mi mathvariant="bold">A</mml:mi><mml:mi mathvariant="bold-italic">S</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          Typically, the reference model is used to generate training and test data
sets to be used to develop the ML algorithm. However, <inline-formula><mml:math id="M12" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> values are not always standard output of such models: in some cases, the
reference model can be altered to calculate and output <inline-formula><mml:math id="M13" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> values for the ML algorithm, for example calculating subgrid fluxes to
train a physically consistent NN in a climate model (Yuval et al., 2021) or
using explicit Euler integration in a simplified photochemical mechanism
(Sturm and Wexler, 2020). Unfortunately <inline-formula><mml:math id="M14" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> values often cannot be
readily gleaned from the reference model for training a machine learning
tool, especially when more sophisticated integrators are used. Our prior
work focused on a way to invert <inline-formula><mml:math id="M15" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> in order to
calculate the target values <inline-formula><mml:math id="M16" display="inline"><mml:mi mathvariant="bold">S</mml:mi></mml:math></inline-formula> (Sturm and Wexler, 2020). For the
example of a surrogate model of condensation and evaporation in a sectional
aerosol model, <inline-formula><mml:math id="M17" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> is overdetermined, and a left
pseudoinverse exists (see Appendix A1). However, where there are more
reactions than species of interest, such as in a photochemical system, or
more generally when there are many different phenomena contributing to fewer
quantities of interest, <inline-formula><mml:math id="M18" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> will be
underdetermined. This looks like <inline-formula><mml:math id="M19" display="inline"><mml:mrow><mml:mi mathvariant="bold">A</mml:mi><mml:mo>∈</mml:mo><mml:msup><mml:mi>R</mml:mi><mml:mrow><mml:mi>m</mml:mi><mml:mo>,</mml:mo><mml:mi>n</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>, where
<inline-formula><mml:math id="M20" display="inline"><mml:mrow><mml:mi>m</mml:mi><mml:mo>&lt;</mml:mo><mml:mi>n</mml:mi></mml:mrow></mml:math></inline-formula>. For underdetermined systems, we applied a generalized inverse,
restricted to lie in the space of all possible <inline-formula><mml:math id="M21" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">S</mml:mi><mml:mo>∈</mml:mo><mml:msup><mml:mi>R</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula>, that
would calculate <inline-formula><mml:math id="M22" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> from <inline-formula><mml:math id="M23" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>∈</mml:mo><mml:msup><mml:mi>R</mml:mi><mml:mi>m</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula>. This
approach does not guarantee that <inline-formula><mml:math id="M24" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> values would be realistic:
sometimes predicted extents of reaction were erroneously negative in a
photochemistry application.</p>
      <p id="d1e521">This work explores the effects of implementing the <inline-formula><mml:math id="M25" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="bold">A</mml:mi><mml:mi mathvariant="bold-italic">S</mml:mi></mml:mrow></mml:math></inline-formula> step directly in the last layer of a neural
network as shown by Fig. 1. Each node in a layer has an inner product
between its weight and input vectors, <inline-formula><mml:math id="M26" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mi>T</mml:mi></mml:msup><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow></mml:math></inline-formula>. For the
penultimate layer, the weight vector <inline-formula><mml:math id="M27" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mi>T</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> of each node
corresponds to rows of <inline-formula><mml:math id="M28" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula>. This can be thought of as the
“constraint layer”. The constraint layer has a zero bias vector and the
linear activation function <inline-formula><mml:math id="M29" display="inline"><mml:mrow><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:math></inline-formula> such that the layer is simply a matrix
operation equivalent to the <inline-formula><mml:math id="M30" display="inline"><mml:mrow><mml:mi mathvariant="bold">A</mml:mi><mml:mi mathvariant="bold-italic">S</mml:mi></mml:mrow></mml:math></inline-formula> product
in Eq. (3). With this architecture, the inputs to this constraint layer
are the time-integrated fluxes <inline-formula><mml:math id="M31" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula>, providing insight into the inner
workings of the network as a side benefit. The activation function of the
layer before should be chosen based on application. A rectified linear unit
application that only outputs non-negative terms is appropriate for a
photochemistry application, where integrated fluxes only have a positive sign.</p>
      <p id="d1e607">Including the <inline-formula><mml:math id="M32" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix representing the chemical system
in the last layer of a neural network captures the coupling and
interdependence of the different chemical species with custom,
non-optimizable weights. Our approach resembles the Beucler et al. (2021)
approach in that hard constraints are built into a neural network, with
several key differences.
<list list-type="order"><list-item>
      <p id="d1e619">Our entire output vector represents a coupled system where all elements are
subject to the constraints. This formulation is more restrictive than the
approach in Beucler et al. (2021), which constrains a chosen subset of the
output and allows some output to be unconstrained.</p></list-item><list-item>
      <p id="d1e623">This approach maintains our flux continuity constraint embodied in Eq. (3) (Sturm and Wexler, 2020).</p></list-item><list-item>
      <p id="d1e627">Our approach does not require relating elements in the input to the output.
Instead, the fluxes in the penultimate layer are related to the output such
that tendencies are balanced.</p></list-item></list>
Training the NN with <inline-formula><mml:math id="M33" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> built into the last layer
ultimately skips the computationally intensive and input-sensitive strategy of
calculating the restricted inverse when the <inline-formula><mml:math id="M34" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix is
underdetermined or rank-deficient (Sturm and Wexler, 2020). This results in
a neural network that conserves atoms in every prediction while also
predicting the fluxes in the penultimate layer. This architecture adds
physical interpretability to the last hidden layer of the neural network.</p>
</sec>
<sec id="Ch1.S2.SS2">
  <label>2.2</label><title>Additional input to the neural network</title>
      <p id="d1e653">Physical information can be given as input to machine learning tools to
improve predictions, for example when estimating aerosol activation fraction
(Silva et al., 2021b). For our application, the complexity of the chemical
system arises from the coupling of species, which interact with each other
through chemical reactions. Bimolecular reactions (or generally reactions
that involve two species) are often represented with rate laws of the form
            <disp-formula id="Ch1.E4" content-type="numbered"><label>4</label><mml:math id="M35" display="block"><mml:mrow><mml:mi>r</mml:mi><mml:mo>=</mml:mo><mml:mi>k</mml:mi><mml:msub><mml:mi>C</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M36" display="inline"><mml:mi>r</mml:mi></mml:math></inline-formula> is the reaction rate for compounds <inline-formula><mml:math id="M37" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M38" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> (the case <inline-formula><mml:math id="M39" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:math></inline-formula> is
allowed), and <inline-formula><mml:math id="M40" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> is an often empirically determined reaction rate constant.
In addition to the concentrations themselves, <inline-formula><mml:math id="M41" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> can be calculated
from the input concentrations and given as additional input to the neural
network. Inclusion of this additional input, along with the methods
described in Sect. 2.1, leads to our physics-constrained neural network
model shown in Fig. 1. We avoid use of physically informed input to
describe this approach to prevent confusion with the physics-informed NN
approach as introduced by Raissi et al. (2019). We do not call this approach
“reactivity-informed” input to keep the generalizability of this approach
in mind. This additional input is informed by knowledge of bimolecular rate
reactions: however, for other applications, additional input can take other
forms. For the example of evaporation or condensation, the driving force of
a concentration gradient could be supplied as additional input.</p>
      <p id="d1e745">What follows is an assessment of the accuracy of the physics-constrained
neural network compared to a neural network with a “naïve” structure:
neither a constraint layer nor additional input layer. To assess the
relative contributions of each knowledge-guided adjustment to the neural
network, we also construct an intermediate neural network, which contains
the additional knowledge-guided input but not the hard constraints built
into the penultimate layer. Each network is trained to emulate the behavior
of a reference model of chemistry modeling ozone production with 11 species
and 10 reactions. All three are feedforward neural networks implemented in
Python with the Keras library (Chollet, 2015) using a TensorFlow
back end (Abadi et al., 2015).</p>
      <p id="d1e748">Though the physics-constrained NN technically has two hidden layers,
incorporating the flux-based balance in the second hidden layer as a set of
fixed weights with zero biases and linear activation functions adds no
trainable parameters. This means that the penultimate layer is mapped to the
output by a purely linear matrix operation. All three networks thus have
only one hidden layer where parameters are adjusted during training. The
width of this trainable hidden layer was chosen to contain 40 nodes. Each NN
predicts an 11-element target vector of concentration tendencies
<inline-formula><mml:math id="M42" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula>. The naïve NN takes a 13-element input vector, 11
concentrations, and 2 additional inputs <inline-formula><mml:math id="M43" display="inline"><mml:mi mathvariant="bold-italic">M</mml:mi></mml:math></inline-formula> based on
meteorological conditions (sun angle). The additional input of 5 bimolecular
reactions to the intermediate and physics-constrained NNs results in
18-element input vectors. Increasing the size of the input layer adds 200
trainable parameters, so the intermediate and physics-constrained NNs are
significantly larger than the naïve NN. The intermediate and
physics-constrained NNs are comparable in terms of parameter space, with
1211 and 1170 trainable parameters, respectively.</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="d1e771">Two neural network model architectures. The naïve neural
network <bold>(a)</bold> takes as input concentrations for each of the 11 species
<inline-formula><mml:math id="M44" display="inline"><mml:mi mathvariant="bold-italic">C</mml:mi></mml:math></inline-formula> as well as additional parameters <inline-formula><mml:math id="M45" display="inline"><mml:mi mathvariant="bold-italic">M</mml:mi></mml:math></inline-formula>: in the photochemical surrogate model,
<inline-formula><mml:math id="M46" display="inline"><mml:mi mathvariant="bold-italic">M</mml:mi></mml:math></inline-formula> is the cosine of the zenith angle and change in cosine of the zenith
angle. This input layer is fed to a hidden layer <inline-formula><mml:math id="M47" display="inline"><mml:mi>H</mml:mi></mml:math></inline-formula>, comprised of 40 nodes,
each with weights, biases, and a rectified linear unit (ReLU) activation
function. This is fed to a final output layer with a linear activation
function and target values <inline-formula><mml:math id="M48" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> for the 11 species tracked in the
reference photochemical model. The physics-constrained neural network <bold>(b)</bold> includes additional input: five products of concentrations which
resemble the rate law form of five bimolecular reactions. This is fed to a
hidden layer the same size as that of the naïve NN: 40 nodes. The
hidden layer is then fed to another layer <inline-formula><mml:math id="M49" display="inline"><mml:mi>S</mml:mi></mml:math></inline-formula>, which is chosen to have as many
nodes as reactions in the chemical system (10) and ReLU activation
functions to enforce non-negative output. This is subsequently fed via
non-optimizable weights (denoted as <inline-formula><mml:math id="M50" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula>) and a linear activation function to the output
vector <inline-formula><mml:math id="M51" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula>. The intermediate neural network (not pictured) contained
the additional input informed by the rate laws but is otherwise identical
to the naïve neural network.</p></caption>
          <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022-f01.png"/>

        </fig>

</sec>
<sec id="Ch1.S2.SS3">
  <label>2.3</label><title>Reference photochemical model</title>
      <p id="d1e857">To demonstrate the methods developed above, we used a simplified model for
production of ozone used by Michael Kleeman at the University of
California, Davis, for the course ECI 241 Air Quality Modeling. Our reference
model focuses solely on gas-phase chemistry, including 10 reactions and 11
species. Table 1 includes the full list of reactions. Table 2 includes the
full list of species, including whether they are active (reactants that
influence reaction rates), steady-state, or buildup species. This
simplified model still represents important features of ozone photochemical
production, including NO<inline-formula><mml:math id="M52" display="inline"><mml:msub><mml:mi/><mml:mi>x</mml:mi></mml:msub></mml:math></inline-formula> chemistry, volatile organic compound (VOC) chemistry, peroxy radical, and
hydroxyl radical. The limitations of this simple model mean that the
subsequent neural networks will at best maintain these limitations. However,
this simple example demonstrates conservation properties readily
generalizable to larger, more sophisticated models of gas-phase chemistry,
such as CBM-Z (Zaveri and Peters, 1999), CBM-IV (Gery et al., 1989), and
SAPRC (Carter, 1990; Carter and Heo, 2013).</p>
      <p id="d1e869">We ported the reference model over from Fortran to Julia and adapted the
model for use in this work, including varying cosine of the zenith angle and other
parameters, discussed further in Sect. 2.4. The source code is available
on Zenodo: <ext-link xlink:href="https://doi.org/10.5281/zenodo.5736487" ext-link-type="DOI">10.5281/zenodo.5736487</ext-link> (Sturm, 2021). Julia was designed for
its flexibility and ease of use, which is comparable to dynamic programming
languages like Python while allowing for computational performance
approaching that of compiled languages like C or Fortran (Julia
documentation:
<uri>https://julia-doc.readthedocs.io/en/latest/manual/introduction</uri>, last access: 17 March 2022). These
aspects of the Julia programming language have also motivated the recent
development of JlBox, an atmospheric 0D box model written fully in Julia
with gas-phase chemistry and aerosol microphysics (Huang and Topping, 2021).</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T1"><?xmltex \currentcnt{1}?><label>Table 1</label><caption><p id="d1e881">Reactions.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="2">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="right"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Reaction</oasis:entry>
         <oasis:entry colname="col2">Reaction number</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M53" display="inline"><mml:mrow><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">NO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow><mml:mo>+</mml:mo><mml:mi>h</mml:mi><mml:mi>v</mml:mi><mml:mo>→</mml:mo><mml:mrow class="chem"><mml:mi mathvariant="normal">NO</mml:mi></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:mi mathvariant="normal">O</mml:mi></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R1)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M54" display="inline"><mml:mrow><mml:mrow class="chem"><mml:mi mathvariant="normal">O</mml:mi></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">O</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow><mml:mo>→</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">O</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R2)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M55" display="inline"><mml:mrow><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">O</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:mi mathvariant="normal">NO</mml:mi></mml:mrow><mml:mo>→</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">NO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">O</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R3)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M56" display="inline"><mml:mrow><mml:mrow class="chem"><mml:mi mathvariant="normal">HCHO</mml:mi></mml:mrow><mml:mo>+</mml:mo><mml:mi>h</mml:mi><mml:mi>v</mml:mi><mml:mo>→</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mrow class="chem"><mml:msubsup><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="normal" class="Radical">⚫</mml:mi></mml:msubsup></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R4)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M57" display="inline"><mml:mrow><mml:mrow class="chem"><mml:mi mathvariant="normal">HCHO</mml:mi></mml:mrow><mml:mo>+</mml:mo><mml:mi>h</mml:mi><mml:mi>v</mml:mi><mml:mo>→</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">H</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R5)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M58" display="inline"><mml:mrow><mml:mrow class="chem"><mml:mi mathvariant="normal">HCHO</mml:mi></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:msup><mml:mi mathvariant="normal">HO</mml:mi><mml:mi class="Radical" mathvariant="normal">⚫</mml:mi></mml:msup></mml:mrow><mml:mo>→</mml:mo><mml:mrow class="chem"><mml:msubsup><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mi class="Radical" mathvariant="normal">⚫</mml:mi></mml:msubsup></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">H</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mi mathvariant="normal">O</mml:mi></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R6)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M59" display="inline"><mml:mrow><mml:mrow class="chem"><mml:msubsup><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mi class="Radical" mathvariant="normal">⚫</mml:mi></mml:msubsup></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:mi mathvariant="normal">NO</mml:mi></mml:mrow><mml:mo>→</mml:mo><mml:mrow class="chem"><mml:msup><mml:mi mathvariant="normal">OH</mml:mi><mml:mi class="Radical" mathvariant="normal">⚫</mml:mi></mml:msup></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">NO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R7)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M60" display="inline"><mml:mrow><mml:mrow class="chem"><mml:msup><mml:mi mathvariant="normal">OH</mml:mi><mml:mi mathvariant="normal" class="Radical">⚫</mml:mi></mml:msup></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">NO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow><mml:mo>→</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">HNO</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R8)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M61" display="inline"><mml:mrow><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mi mathvariant="normal">H</mml:mi></mml:mrow><mml:mo>+</mml:mo><mml:mi>h</mml:mi><mml:mi>v</mml:mi><mml:mo>→</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mrow class="chem"><mml:msup><mml:mi mathvariant="normal">OH</mml:mi><mml:mi class="Radical" mathvariant="normal">⚫</mml:mi></mml:msup></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R9)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M62" display="inline"><mml:mrow><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mi mathvariant="normal">H</mml:mi></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:msup><mml:mi mathvariant="normal">OH</mml:mi><mml:mi mathvariant="normal" class="Radical">⚫</mml:mi></mml:msup></mml:mrow><mml:mo>→</mml:mo><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">H</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mi mathvariant="normal">O</mml:mi></mml:mrow><mml:mo>+</mml:mo><mml:mrow class="chem"><mml:msubsup><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn><mml:mi class="Radical" mathvariant="normal">⚫</mml:mi></mml:msubsup></mml:mrow></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">(R10)</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T2"><?xmltex \currentcnt{2}?><label>Table 2</label><caption><p id="d1e1306">Species.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="3">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:colspec colnum="3" colname="col3" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Name</oasis:entry>
         <oasis:entry colname="col2">Symbol</oasis:entry>
         <oasis:entry colname="col3">Species role</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">Ozone</oasis:entry>
         <oasis:entry colname="col2">O<inline-formula><mml:math id="M63" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">Active</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Nitric oxide</oasis:entry>
         <oasis:entry colname="col2">NO</oasis:entry>
         <oasis:entry colname="col3">Active</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Nitrogen dioxide</oasis:entry>
         <oasis:entry colname="col2">NO<inline-formula><mml:math id="M64" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">Active</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Formaldehyde</oasis:entry>
         <oasis:entry colname="col2">HCHO</oasis:entry>
         <oasis:entry colname="col3">Active</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Hydroperoxyl radical</oasis:entry>
         <oasis:entry colname="col2">HO<inline-formula><mml:math id="M65" display="inline"><mml:mrow><mml:msubsup><mml:mi/><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="normal" class="Radical">⚫</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">Active</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Hydrogen peroxide</oasis:entry>
         <oasis:entry colname="col2">HO<inline-formula><mml:math id="M66" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula>H</oasis:entry>
         <oasis:entry colname="col3">Active</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Hydroxyl radical</oasis:entry>
         <oasis:entry colname="col2">OH<inline-formula><mml:math id="M67" display="inline"><mml:msup><mml:mi/><mml:mi mathvariant="normal" class="Radical">⚫</mml:mi></mml:msup></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">Pseudo-steady-state</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Atomic oxygen</oasis:entry>
         <oasis:entry colname="col2">O</oasis:entry>
         <oasis:entry colname="col3">Pseudo-steady-state</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Nitric acid</oasis:entry>
         <oasis:entry colname="col2">HNO<inline-formula><mml:math id="M68" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">Buildup</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Carbon monoxide</oasis:entry>
         <oasis:entry colname="col2">CO</oasis:entry>
         <oasis:entry colname="col3">Buildup</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Hydrogen</oasis:entry>
         <oasis:entry colname="col2">H<inline-formula><mml:math id="M69" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">Buildup</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e1531">To fully represent the atom balance, the multitarget vector of tendencies
<inline-formula><mml:math id="M70" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> for both the naïve NN and physics-constrained NN
includes species that are not defined as “active species” in the reference
model, including quickly reacting species that are modeled as pseudo-steady-state and species that are only produced, called buildup species. These are
summarized in Table 2. Active species are defined in the original reference
model as species that contribute to reaction rates, but have nonzero net
rates of formation. Both NNs as depicted by Fig. 1 take concentrations of
all 11 species as inputs as well as cosine of the zenith angle and change in
cosine of the zenith angle. The physics-constrained NN additionally takes five products of concentrations corresponding to the bimolecular reactions: (R3)
(<inline-formula><mml:math id="M71" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">O</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">NO</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>), (R6) (<inline-formula><mml:math id="M72" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">HCHO</mml:mi></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">OH</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>), (R7) (<inline-formula><mml:math id="M73" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">NO</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>), (R8)
(<inline-formula><mml:math id="M74" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">NO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">OH</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, and (R10) (<inline-formula><mml:math id="M75" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mi mathvariant="normal">H</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">OH</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>). Though Reaction (R2) is also a
bimolecular reaction, concentration of diatomic oxygen is assumed constant
in the reference model at a mixing ratio of 209 000 ppm, so the concentration product
of the two reactants in Reaction (R2) is proportional to the concentration of atomic
oxygen. Assumption of diatomic oxygen as constant and a pseudo-infinite
source and sink makes it a special case: for this reason, oxygen is not included
in Table 2 or in the stoichiometric balance in the following
<inline-formula><mml:math id="M76" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix.</p>
      <p id="d1e1652">In both neural networks, the input layer is fed to a hidden layer of 40
nodes. While the naïve NN feeds this hidden layer to the output vector,
the physics-constrained NN contains a subsequent layer of 10 nodes
corresponding to the fluxes of the 10 reactions: this penultimate layer is
then connected to the output layer with non-optimizable weights
corresponding to the <inline-formula><mml:math id="M77" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix to properly emulate the
system of reactions. Within the framework outlined in Sect. 2.1 and in
Sturm and Wexler (2020), this system of reactions can be modeled by an <inline-formula><mml:math id="M78" display="inline"><mml:mrow><mml:mn mathvariant="normal">11</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">10</mml:mn></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M79" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix:
            <disp-formula id="Ch1.Ex1"><mml:math id="M80" display="block"><mml:mrow><?xmltex \hack{\hbox\bgroup\fontsize{5.5}{5.5}\selectfont$\displaystyle}?><mml:mi mathvariant="bold">A</mml:mi><mml:mo>=</mml:mo><mml:mfenced close="]" open="["><mml:mtable class="array" columnalign="left right right right right right right right right right right"><mml:mtr><mml:mtd><mml:mrow/></mml:mtd><mml:mtd><mml:mtext>(R1)</mml:mtext></mml:mtd><mml:mtd><mml:mtext>(R2)</mml:mtext></mml:mtd><mml:mtd><mml:mtext>(R3)</mml:mtext></mml:mtd><mml:mtd><mml:mtext>(R4)</mml:mtext></mml:mtd><mml:mtd><mml:mtext>(R5)</mml:mtext></mml:mtd><mml:mtd><mml:mtext>(R6)</mml:mtext></mml:mtd><mml:mtd><mml:mtext>(R7)</mml:mtext></mml:mtd><mml:mtd><mml:mtext>(R8)</mml:mtext></mml:mtd><mml:mtd><mml:mtext>(R9)</mml:mtext></mml:mtd><mml:mtd><mml:mtext>(R10)</mml:mtext></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">O</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:mi mathvariant="normal">NO</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">NO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:mi mathvariant="normal">HCHO</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">2</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mi mathvariant="normal">H</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:mi mathvariant="normal">OH</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">2</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:mi mathvariant="normal">O</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="normal">−</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">HNO</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:mi mathvariant="normal">CO</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow class="chem"><mml:msub><mml:mi mathvariant="normal">H</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><?xmltex \hack{$\egroup}?><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          This rectangular matrix is rank-deficient and obtaining extents of reactions
<inline-formula><mml:math id="M81" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> from <inline-formula><mml:math id="M82" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M83" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> is
a nontrivial inverse problem (Sturm and Wexler, 2020). <inline-formula><mml:math id="M84" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrices of larger models, such as the version of
CBM-Z implemented in the box model version of MOSAIC (Zaveri et al., 2008),
are also rank-deficient. Our simplified reference model shares this property
with more sophisticated models, making it a good contender for a
proof-of-concept implementation within a neural network.</p>
      <p id="d1e2213">Within modeling of chemical mechanisms, <inline-formula><mml:math id="M85" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> is sometimes
called the stoichiometry matrix. However, it can also be interpreted as the
weighted, directed incidence matrix of the species–reaction graph of the
chemical system. The species–reaction graph is a type of directed bipartite
network that can give insight into a chemical system (Silva et al., 2021a).
The species–reaction graph has two distinct sets of vertices corresponding
to the reactions in Table 1 and species in Table 2: these vertices are
connected by directed edges, corresponding to the values in the
<inline-formula><mml:math id="M86" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix. Edges leaving a species vertex and going to a
reaction vertex show that the species is a reactant and correspond to
negative values in the <inline-formula><mml:math id="M87" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix. Similarly, edges
leaving a reaction vertex and going to a species vertex show that the
species is produced by that reaction: these edges correspond to positive
values in the <inline-formula><mml:math id="M88" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix.</p>
      <p id="d1e2244">One metric of bipartite networks is the number of edges leaving nodes,
called out-degree centrality. The out-degree centrality of a species vertex
represents how many reactions the reactant participates in, and its value is
the opposite sign of row sums of negative entries in the
<inline-formula><mml:math id="M89" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix. The two species vertices with the highest out-degree, 3, are formaldehyde (the sole reactive organic compound) and
hydroxyl radical. Silva et al. (2021a) found that hydroxyl radical had the
highest out-degree centrality in species–reaction graphs of three other chemical
mechanisms. As in the other mechanisms, the out-degree centrality for the
reactive nitrogen species, NO and NO<inline-formula><mml:math id="M90" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula>, is higher than for other
species. This indicates that, though simple, the reference model is a
relevant case study, and the methods developed in this work show potential to
be extended to other more sophisticated models of atmospheric chemistry.</p>
</sec>
<sec id="Ch1.S2.SS4">
  <label>2.4</label><title>Training, validation, and test data</title>
      <p id="d1e2271">Often, box model chemistry is an operator within a larger 3D transport
model, which includes other operators modeling processes such as advection,
emissions, and deposition. A good surrogate model should be able to emulate
the input–output relationship of the reference model. If the context of
machine learning surrogate modeling is operator replacement in larger
chemical transport models (CTMs) or earth system models (ESMs), accurate
short-term predictions on the order of the operator splitting time step are
required. This context informs the strategy of emulating short-term
behavior. We set up the reference model to write concentrations of the
species every 6 min and train the neural network surrogate models to
predict <inline-formula><mml:math id="M91" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> after this time step. The time step of 6 min is on the
order of a common operator splitting time step in a 3D chemical transport
model: for example, the sectional aerosol model MOSAIC has a default
time step of 5 min (Zaveri et al., 2008). The operator splitting time step
in the 3D chemical transport model LOTOS-EUROS is chosen dynamically based
on wind conditions to satisfy the Courant–Friedrichs–Lewy criterion but
ranges between 1 and 10 min (Manders et al., 2017).</p>
      <p id="d1e2284">We used the reference model to generate 5000 independent days of output,
with concentrations of the 11 species reported every hour: 0.12 million
11-dimensional samples. For each day, concentrations were randomly
initialized for active species, documented in Table C1. The reference model
was also adjusted to vary sunlight intensity, as measured by cosine of the
zenith angle multiplied by a random factor associated with a full-day
simulation. This variable, as well as its change from the previous time step,
was chosen to be the additional parameters <inline-formula><mml:math id="M92" display="inline"><mml:mi mathvariant="bold-italic">M</mml:mi></mml:math></inline-formula> supplied to the
neural network.</p>
      <p id="d1e2294">Of the 5000 independent days, 4800 were selected to be used as training and validation
data for optimizing the neural network weights. A portion of these data
(10 %) were designated as validation data: rather than optimizing the
neural network parameters on these data, the model was evaluated on the
validation data during training, with early stopping if no improvement was
measured on this set. As in previous work (Kelp et al., 2020) we remove all
samples from the training and validation data where ozone concentration
exceeds 200 ppb. We additionally remove all days from the test data where
ozone exceeds 200 ppb at any point, resulting in 126 full days used to
evaluate the accuracy of the neural networks.</p>
      <p id="d1e2297">For supervised machine learning, the inputs <inline-formula><mml:math id="M93" display="inline"><mml:mi>X</mml:mi></mml:math></inline-formula> (<inline-formula><mml:math id="M94" display="inline"><mml:mi mathvariant="bold-italic">C</mml:mi></mml:math></inline-formula> and
<inline-formula><mml:math id="M95" display="inline"><mml:mi mathvariant="bold-italic">M</mml:mi></mml:math></inline-formula> concatenated, as well as concentration products for the second
neural network) are different from the targets <inline-formula><mml:math id="M96" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula>. With a
similar transformation, the inputs can be normalized on a scale from 0 to 1.
This can be done by scaling each input feature <inline-formula><mml:math id="M97" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula> in <inline-formula><mml:math id="M98" display="inline"><mml:mi mathvariant="bold">X</mml:mi></mml:math></inline-formula> by its
corresponding maximum and minimum in the training data:
            <disp-formula id="Ch1.E5" content-type="numbered"><label>5</label><mml:math id="M99" display="block"><mml:mrow><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi>x</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi mathvariant="normal">min</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi mathvariant="normal">max</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi mathvariant="normal">min</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          This information can be put into a diagonal matrix
<inline-formula><mml:math id="M100" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">N</mml:mi><mml:mrow><mml:mi>X</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">maxmin</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> whose elements are
<inline-formula><mml:math id="M101" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi mathvariant="normal">max</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi mathvariant="normal">min</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> for each input. Representing the input minimums for
each element as a vector <inline-formula><mml:math id="M102" display="inline"><mml:mrow><mml:msub><mml:mi>X</mml:mi><mml:mi mathvariant="normal">min</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, the normalized feature space in this case
looks like
            <disp-formula id="Ch1.E6" content-type="numbered"><label>6</label><mml:math id="M103" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="bold">X</mml:mi><mml:mi mathvariant="normal">norm</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msubsup><mml:mi mathvariant="bold">N</mml:mi><mml:mrow><mml:mi>X</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">maxmin</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:mo>(</mml:mo><mml:mi mathvariant="bold">X</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="bold">X</mml:mi><mml:mi mathvariant="normal">min</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          This is implemented in Python using the sci-kit learn preprocessing tool
MinMaxScaler (Pedregosa et al., 2011).</p>
</sec>
</sec>
<sec id="Ch1.S3">
  <label>3</label><title>Results</title>
<sec id="Ch1.S3.SS1">
  <label>3.1</label><title>Comparing neural networks with and without physical constraints</title>
      <p id="d1e2487">Figure 2 shows predictions of <inline-formula><mml:math id="M104" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> compared to the reference
model for the first four species by the naïve NN (orange, top row), the
intermediate NN (purple, middle row), and the physics-constrained NN (green,
bottom row). These tendencies were more accurately predicted when
incorporating physical information into the neural network, showing <inline-formula><mml:math id="M105" display="inline"><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>
values of 0.95 or higher when evaluated on the test data.</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="d1e2513">Scatterplots of target values to predicted values, for the
naïve NN (orange, top row), the intermediate NN (purple, middle row),
and the physics-constrained NN (green, bottom row), on 126 test days – data
the NNs did not see during training. The diagonal dashed line in red is the
<inline-formula><mml:math id="M106" display="inline"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> line.</p></caption>
          <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022-f02.png"/>

        </fig>

      <p id="d1e2534">The scatterplots of tendencies for the other active species and the buildup
species are shown in Figs. B1 and B2 in Appendix B. Both the naïve
and physics-constrained architectures show poor accuracy (negative <inline-formula><mml:math id="M107" display="inline"><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> values) in predictions of <inline-formula><mml:math id="M108" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> for hydrogen
peroxide. This can be attributed partially to the tendency range for
hydrogen peroxide, which is 2 orders of magnitude smaller than those for other compounds. Error for species with smaller changes in concentration
might be improved with the choice of a different loss function than mean squared
error (MSE) between predictions and targets, but a normalized MSE loss
function heavily biased towards zero values for the tendency vector
<inline-formula><mml:math id="M109" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> led the neural network to only predict zero values for
all species: this approach was ruled out early on. The intermediate NN has
an <inline-formula><mml:math id="M110" display="inline"><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> value of 0.82 for hydrogen peroxide but also overestimates the
magnitudes of hydrogen peroxide tendency (in both negative and positive
directions). The physics-constrained NN demonstrates improved predictions of
tendency for hydroperoxyl radical, with an <inline-formula><mml:math id="M111" display="inline"><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> value of 0.86, better
than those of the naïve NN (0.42) and intermediate NN (0.65).</p>
      <p id="d1e2591">Of the buildup species, only hydrogen predictions do not improve with the
intermediate and physics-constrained architectures: <inline-formula><mml:math id="M112" display="inline"><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> values for the
naïve, intermediate, and physics-constrained NNs are comparable at
0.87, 0.85, and 0.86, respectively. The other two buildup species, nitric
acid and carbon monoxide, are better predicted by the other two NNs, as shown
in Fig. B2. Nitric acid and carbon monoxide are two compounds necessary
for the conservation of nitrogen and carbon in the overall system.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T3" specific-use="star"><?xmltex \currentcnt{3}?><label>Table 3</label><caption><p id="d1e2608">Comparison of NN models.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="6">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="right"/>
     <oasis:colspec colnum="3" colname="col3" align="right"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:colspec colnum="5" colname="col5" align="right"/>
     <oasis:colspec colnum="6" colname="col6" align="right"/>
     <oasis:thead>
       <oasis:row>
         <oasis:entry colname="col1">Neural network</oasis:entry>
         <oasis:entry colname="col2">Mean</oasis:entry>
         <oasis:entry colname="col3">RMSE</oasis:entry>
         <oasis:entry colname="col4">Normalized</oasis:entry>
         <oasis:entry colname="col5">Maximum</oasis:entry>
         <oasis:entry colname="col6">99th percentile</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"/>
         <oasis:entry colname="col2">absolute</oasis:entry>
         <oasis:entry colname="col3">[ppb]</oasis:entry>
         <oasis:entry colname="col4">mean absolute</oasis:entry>
         <oasis:entry colname="col5">absolute</oasis:entry>
         <oasis:entry colname="col6">absolute</oasis:entry>
       </oasis:row>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1"/>
         <oasis:entry colname="col2">error [ppb]</oasis:entry>
         <oasis:entry colname="col3"/>
         <oasis:entry colname="col4">error</oasis:entry>
         <oasis:entry colname="col5">error [ppb]</oasis:entry>
         <oasis:entry colname="col6">error [ppb]</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">Naïve NN</oasis:entry>
         <oasis:entry colname="col2">0.18</oasis:entry>
         <oasis:entry colname="col3">0.33</oasis:entry>
         <oasis:entry colname="col4">0.868</oasis:entry>
         <oasis:entry colname="col5">10.7</oasis:entry>
         <oasis:entry colname="col6">1.32</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Intermediate NN</oasis:entry>
         <oasis:entry colname="col2">0.11</oasis:entry>
         <oasis:entry colname="col3">0.22</oasis:entry>
         <oasis:entry colname="col4">0.547</oasis:entry>
         <oasis:entry colname="col5">11.6</oasis:entry>
         <oasis:entry colname="col6">0.84</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Physics NN</oasis:entry>
         <oasis:entry colname="col2">0.07</oasis:entry>
         <oasis:entry colname="col3">0.20</oasis:entry>
         <oasis:entry colname="col4">0.337</oasis:entry>
         <oasis:entry colname="col5">10.6</oasis:entry>
         <oasis:entry colname="col6">0.76</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e2764">The naïve NN demonstrated <inline-formula><mml:math id="M113" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> predictions outside of
the solution space of the reference model. Though more accurate than the
naïve NN, the intermediate NN also demonstrates <inline-formula><mml:math id="M114" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula>
predictions that are outside of the solution space of the reference model.
Figure 2 shows that some of the predictions for formaldehyde tendency using
the naïve and intermediate NNs are positive, despite there being no
source for formaldehyde in the reference model: all reactions including
formaldehyde are sinks, where it either reacts with another species or
undergoes photolysis. The physics-constrained NN restricts all predictions
of formaldehyde tendency to be at most zero, which is in line with it being
only a reactant. Similarly, some naïve and intermediate NN predictions
of <inline-formula><mml:math id="M115" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> for the buildup species (species that are only
products) are negative: this can be seen in Fig. B2 in Appendix B. The
reference model has no sinks for these buildup species, which are strictly
products of reactions, hence the term “buildup”. The physics-constrained
NN restricts the elements of <inline-formula><mml:math id="M116" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> corresponding to buildup
species to a positive half-space.</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="d1e2809">Scatterplots of target values to predicted values, for the
naïve NN (orange, top row), the intermediate NN (purple, middle row),
and the physics-constrained NN (green, bottom row), on 126 test days for 23 h runs excluding the first hour of simulation.</p></caption>
          <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022-f03.png"/>

        </fig>

      <p id="d1e2818">Evaluated on overall metrics using a test data set, the physics-constrained
NN outperforms both other NN architectures. The maximum absolute errors in
<inline-formula><mml:math id="M117" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> in the test data set for the naïve, intermediate,
and physics-constrained NNs are 10.7, 11.6, and 10.6 ppb,
respectively. For all species, the naïve NN predicted <inline-formula><mml:math id="M118" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> within 1.31 ppb, the intermediate NN predicted <inline-formula><mml:math id="M119" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula>
within 0.84 ppb, and the physics-constrained NN predicted <inline-formula><mml:math id="M120" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> within 0.76 ppb for 99 % of cases. Error metrics evaluated with all
active and buildup species for the 126 independent test days are given in
Table 3. The physics-constrained NN is more accurate than both other NN
architectures in these overall metrics, despite having a slightly smaller
trainable parameter space than the intermediate NN.</p>
</sec>
<sec id="Ch1.S3.SS2">
  <label>3.2</label><title>Performance over varying concentration scales</title>
      <p id="d1e2869">At the beginning of simulations, steep changes in concentration occur when
the chemical system is initialized in a state far from pseudo-equilibrium.
Chemical operators within larger models approach this pseudo-equilibrium,
but in each operator splitting time step other operators such as advection
and emission perturb these concentrations back away from the pseudo-equilibrium state. This informs the focus on short-term accuracy and the
target vector of tendencies <inline-formula><mml:math id="M121" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> after time steps of 6 min.</p>
      <p id="d1e2882">Kelp et al. (2020) found that the most long-term stable models came at the
price of diminished accuracy in predictions of the extreme <inline-formula><mml:math id="M122" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> at the beginning of simulations and motivated further research of ML
models with specialized architectures. Our approach is only used for short-term predictions. However, the two architectures with additional input
informed by the reactivity show an ability to predict the <inline-formula><mml:math id="M123" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> at the beginning of each full-day simulation while also remaining
accurate relative to the naïve neural network in conditions that have
smaller changes in concentration; those that occur after the initial
transient return to the pseudo-equilibrium condition.</p>
      <p id="d1e2905">The large <inline-formula><mml:math id="M124" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> values resulting from randomly initialized
states far from equilibrium are well modeled by both the intermediate NN and
the physics-constrained NN: this can be seen, for example, by ozone in
Fig. 2. Figure 3 shows scatterplots of <inline-formula><mml:math id="M125" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> as predicted
by the three NN models, when only evaluated on 23 h runs after the first hour
of simulation that includes the transient return to pseudo-equilibrium.
Figure 3 and its reported <inline-formula><mml:math id="M126" display="inline"><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> metrics are analogous to Fig. 2, with
the difference being that Fig. 3 repeats the analysis with the first hour
of each day removed from the test data. With the first hour removed, the
changes in ozone concentration shrink by a factor of <inline-formula><mml:math id="M127" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:math></inline-formula>.
While the naïve NN shows a substantial drop in accuracy of
<inline-formula><mml:math id="M128" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> for reactive nitrogen species, the physics-constrained
NN shows a smaller change in its <inline-formula><mml:math id="M129" display="inline"><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> metric.</p>
      <p id="d1e2971">Silva et al. (2021b) found that a physically regularized NN emulator of
aerosol activation fraction outperformed its naïve counterpart,
especially in the edge case of prediction values falling within the lower
10 % of the possible range. Similarly, we find that our NNs that have
additional chemically relevant input (the intermediate and
physics-constrained NNs) are much more accurate for <inline-formula><mml:math id="M130" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> of
NO and NO<inline-formula><mml:math id="M131" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula> than the naïve NN when only evaluated on cases falling
within the lower <inline-formula><mml:math id="M132" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">25</mml:mn></mml:mrow></mml:math></inline-formula> % of the range of test data: Fig. 3
illustrates this improvement. Though both the intermediate and
physics-constrained NNs better predict tendencies of the species than the
naïve NN, this improvement is magnified when disregarding large
concentration changes that occur at the beginning of simulations.</p>
</sec>
<sec id="Ch1.S3.SS3">
  <label>3.3</label><title>Steady-state species</title>
      <p id="d1e3011">Under the pseudo-steady-state assumption that certain species have near-zero
net rates of change in concentration, their concentrations become algebraic
expressions of the concentrations of other species in the system. In our
reference model, these steady-state species are hydroxyl radical OH and
atomic oxygen O. Approximating the rates of change for each steady-state
species to be zero and isolating their concentrations as expressions of
other concentrations and rate constants, we obtain the following equations
for <inline-formula><mml:math id="M133" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">OH</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M134" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">O</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>:
            <disp-formula id="Ch1.E7" content-type="numbered"><label>7</label><mml:math id="M135" display="block"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">OH</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">7</mml:mn></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">NO</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">9</mml:mn></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mi mathvariant="normal">H</mml:mi></mml:mrow></mml:msub><mml:mo>⋅</mml:mo><mml:mi>h</mml:mi><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">6</mml:mn></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">HCHO</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">8</mml:mn></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">NO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">10</mml:mn></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">HO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mi mathvariant="normal">H</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:math></disp-formula>
          and
            <disp-formula id="Ch1.E8" content-type="numbered"><label>8</label><mml:math id="M136" display="block"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">O</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">NO</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:msub><mml:mo>⋅</mml:mo><mml:mi>h</mml:mi><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">O</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M137" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> corresponds to rate constants for reactions <inline-formula><mml:math id="M138" display="inline"><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>,
2, …, 10, and <inline-formula><mml:math id="M139" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">O</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is assumed constant at <inline-formula><mml:math id="M140" display="inline"><mml:mrow><mml:mn mathvariant="normal">2.09</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> ppm. Information on <inline-formula><mml:math id="M141" display="inline"><mml:mrow><mml:mi>h</mml:mi><mml:mi>v</mml:mi></mml:mrow></mml:math></inline-formula> is included in <inline-formula><mml:math id="M142" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">M</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e3281">The physics-constrained NN predicts <inline-formula><mml:math id="M143" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula>, which is added to
<inline-formula><mml:math id="M144" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mfenced open="(" close=")"><mml:mi>t</mml:mi></mml:mfenced></mml:mrow></mml:math></inline-formula> to calculate <inline-formula><mml:math id="M145" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>. Then the steady-state concentrations at time <inline-formula><mml:math id="M146" display="inline"><mml:mrow><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula> are
determined by the concentrations of active species using Eqs. (10) and
(11). Figure 4 shows the scatterplots of concentrations using predictions
from the physics-constrained NN versus the reference model.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F4"><?xmltex \currentcnt{4}?><?xmltex \def\figurename{Figure}?><label>Figure 4</label><caption><p id="d1e3339">Predictions of steady-state species using NN predictions
for all other species concentrations.</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022-f04.png"/>

        </fig>

      <p id="d1e3349">The concentration of atomic oxygen is a function of only one variable
influenced by NN predictions, NO<inline-formula><mml:math id="M147" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula> concentration, and is nearly
perfectly predicted. The concentration of the hydroxyl radical is dependent
on concentrations of five other species and is very sensitive to small errors
in some of the species: HO<inline-formula><mml:math id="M148" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula>, NO, and to some extent formaldehyde. The
limitation of the physics-constrained NN to predict OH indicates that
additional physical information might need to be included in order to
optimize the physics-constrained NN to predict OH accurately, e.g. including
Eq. (10) in the objective function when optimizing NN parameters.</p>
</sec>
<sec id="Ch1.S3.SS4">
  <label>3.4</label><title>Atom conservation in the physics-constrained neural network</title>
      <p id="d1e3378">The balance imposed on species by the physics-constrained neural network
results in conservation of the total carbon and nitrogen. The atom balance
for carbon and nitrogen can be demonstrated by summing up the mixing ratios
of species these atoms occur in multiplied by the number of atoms within
that species. Figure 5 shows that there is a net zero change in total carbon
and nitrogen in the system when using the physics-constrained NN. Balances
of oxygen and hydrogen are not shown: oxygen is not conserved because of
the treatment within the reference model of diatomic oxygen as an infinite
source and sink. Hydrogen is not conserved because H<inline-formula><mml:math id="M149" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula>O is not
explicitly tracked.</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="d1e3392">Net tendency of carbon-containing species <bold>(a)</bold> and
nitrogen-containing species <bold>(b)</bold>, as predicted by the naïve NN
(orange, squiggly line with textured points), the intermediate NN (purple,
squiggly line), and the physics-constrained NN (green, flat line). While the
naïve neural network predictions lead to fluctuations in the overall
carbon and nitrogen budget of the system, the physics-constrained neural
network conserves the total amount of both.</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022-f05.png"/>

        </fig>

      <p id="d1e3407">With every prediction, the naïve and intermediate NNs remove or add
some carbon and nitrogen to the system. Though errors are small in the
representative day shown in Fig. 5, this error occurs every 6 min.
Summed up over the day, the naïve NN predictions lead to a net addition
of 0.4 ppb of carbon-containing species and net addition of
147 ppb of nitrogen-containing species; the intermediate NN
predictions lead to a net addition of 1.2 ppb of carbon-containing species
and a net removal of 39.5 ppb of nitrogen-containing species.</p>
</sec>
<sec id="Ch1.S3.SS5">
  <label>3.5</label><title>Preventing negative concentrations</title>
      <p id="d1e3419">Though the physics-constrained neural network inherently balances mass,
there is no built-in constraint to ensure nonzero concentrations: predicted
tendencies might exceed the magnitude of their corresponding concentrations
in the previous time step. However, the number of negative concentrations was
reduced by a factor of more than 17 when using the physics-constrained NN
compared to the naïve NN. The naïve NN predictions led to 44 017
negative concentrations, and the physics-constrained NN predictions led to
2489 negative concentrations in the test data set containing 272 160 values
(including active and buildup species but excluding pseudo-steady-state
species whose concentrations are not calculated by adding their
corresponding tendencies). Put another way, predictions by the naïve NN
led to 13.2 % of the values becoming negative, with the most negative
concentration at <inline-formula><mml:math id="M150" display="inline"><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">7.5</mml:mn></mml:mrow></mml:math></inline-formula> ppb. Predictions by the intermediate NN led to
11.7 % of the values becoming negative, with the most negative
concentration at <inline-formula><mml:math id="M151" display="inline"><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">4.4</mml:mn></mml:mrow></mml:math></inline-formula> ppb. In contrast, predictions by the
physics-constrained NN led to approximately 0.7 % of concentrations
becoming negative, with the most negative concentration at <inline-formula><mml:math id="M152" display="inline"><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3.7</mml:mn></mml:mrow></mml:math></inline-formula> ppb. Despite
not being explicitly enforced, the physics-constrained NN still performed
much better than both other NNs, predicting over an order of magnitude fewer
nonphysical negative concentrations on the test data set. Predictions from
the naïve and intermediate NNs also led to negative values for some of
the buildup compounds, which is outside of the solution space of the
reference model: buildup species are initialized at zero concentration and
are only products of reactions. The architecture of the physics-constrained
NN enforces non-negativity of the penultimate layer corresponding to fluxes
and positive coefficients in the stoichiometric weight matrix <inline-formula><mml:math id="M153" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula>
corresponding to buildup species: this ensures that all <inline-formula><mml:math id="M154" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula>
predictions for buildup species are positive, and therefore all
concentrations remain positive.</p><?xmltex \hack{\newpage}?>
</sec>
</sec>
<sec id="Ch1.S4" sec-type="conclusions">
  <label>4</label><title>Conclusions</title>
      <p id="d1e3480">Machine learning algorithms have potential to efficiently emulate complex
models of atmospheric processes, but purely data-driven methods may not
respect important physical symmetries that are built into the classical
models, such as conservation of mass or energy. Prior efforts (Sturm and
Wexler, 2020) developed a framework for building in conservation laws to
machine learning algorithms: by using the relationship between fluxes and
tendencies in systems, the fluxes can be posed as learning targets for the
ML algorithms, and then tendencies can be predicted in a balanced manner.
This work builds on that framework and proposes implementing the
flux–tendency relationship directly into the architecture of a neural
network so that the neural network will inherently respect the conservation
laws, much like the reference model it emulates. As an example of how this
framework can be implemented, we design a physics-constrained neural network
surrogate model of photochemistry with input resembling bimolecular reaction
rates and a penultimate hidden layer enforcing an atom balance. The weights
for the penultimate layer are hard stoichiometric constraints and can be
obtained via the approach in Sturm and Wexler (2020) relating tendencies of
molecular species to atom fluxes between them.</p>
      <p id="d1e3483">Adding additional parameters based on physical information (in this case
chemical reaction rates) improves predictions, as demonstrated by the
intermediate NN and the physics-constrained NN. Like previous work (Silva et
al., 2021b) these NNs more accurately predict edge cases than the naïve
NN: in our case, lower-<inline-formula><mml:math id="M155" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> conditions after the first hour
of simulation approaching pseudo-equilibrium. However, improved accuracy of
the intermediate NN does not correspond to an adherence to physical laws.
Both the naïve and intermediate NNs deliver solutions outside of the
solution space of the reference model, including negative tendencies for
purely buildup species and positive formation of species that were purely
reactants. Their predictions also lead to high numbers of negative
concentrations, which are nonphysical. Most importantly, material is not
conserved by either the naïve NN or intermediate NN: only the
physics-constrained NN obeys the stoichiometric atom balance that is a
fundamental property of chemical reactions. The results of this study show
promise for hybrid models that combine our knowledge of physical processes
with data-driven machine learning approaches and motivate future
exploration of other physically interpretable machine learning techniques
that can incorporate additional prior information such as pseudo-steady-state approximations.</p>
      <p id="d1e3496">The reference model used in this work shares important chemical properties
with more sophisticated models, making this approach readily extendable to
detailed chemical mechanisms. In extension to larger models, the effect of
varying hyperparameters, including input and output dimensionality, network
depth (number of layers), and layer width (number of nodes in the layers),
will have to be assessed. Such a study may be better suited for application
to a more sophisticated reference model that has a higher dimensionality and
more realistic inputs, such as varying temperature. This approach also has
potential to be integrated into work studying the speedup potential of
neural networks versus their reference models, also better suited for
studies of larger, more sophisticated, and computationally intensive
reference models. The primary purpose of this work is to illustrate the atom
balance enforced by the architecture of the physics-constrained neural
network. We observe a secondary effect: that by including built-in
information about the chemical system, both the atom balance and the input
proportional to the instantaneous reaction rates of the bimolecular
reactions, accuracy of the neural network is improved.</p>
</sec>

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

<app id="App1.Ch1.S1">
  <?xmltex \currentcnt{A}?><label>Appendix A</label><title>Calculating a left pseudoinverse for
condensation and evaporation in a sectional aerosol model</title>
      <p id="d1e3510">This framework has been demonstrated for photochemistry but can be
generalized to other applications, such as change in concentrations of
condensable species in a sectional aerosol model, for example MOSAIC (Zaveri
et al., 2008). Recent work has been published on machine learning surrogate
models for cloud microphysics with resolved size bins (Gettelman et al.,
2021) and aerosol microphysics using a modal approach (Harder et al., 2021).
Harder et al. (2021) have indicated mass conservation as a future research
direction for ML surrogate models of aerosol microphysics and have proposed
regularization via a cost function or post-prediction mass fixers. Training
ML algorithms on target fluxes <inline-formula><mml:math id="M156" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> rather than tendencies
<inline-formula><mml:math id="M157" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula> would allow for mass conservation to numerical precision
if the tendencies are related to fluxes via an <inline-formula><mml:math id="M158" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix
as in Sturm and Wexler (2020). Studying the system of equations modeling
evaporation and condensation in a sectional model, we see that a left
pseudoinverse of the corresponding <inline-formula><mml:math id="M159" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix can be used
to obtain fluxes <inline-formula><mml:math id="M160" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> from concentrations (typical model output),
unlike the rank-deficient <inline-formula><mml:math id="M161" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix in the photochemical
application focused on in this work and Sturm and Wexler (2020).</p>
      <p id="d1e3559">Both mass transfer and thermodynamics play a role in the transport of
material between the gas and aerosol phases (Wexler and Seinfeld, 1991).
This idea can be represented by a system of equations taken directly from
Eqs. (3) and (4) in Zaveri et al. (2008), relating change in concentration
to flux between the gas and particle phases:

              <disp-formula specific-use="gather" content-type="numbered"><mml:math id="M162" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="App1.Ch1.S1.E9"><mml:mtd><mml:mtext>A1</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">d</mml:mi><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:msub></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:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:mfenced open="(" close=")"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msubsup><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo>∗</mml:mo></mml:msubsup></mml:mrow></mml:mfenced></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="App1.Ch1.S1.E10"><mml:mtd><mml:mtext>A2</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">d</mml:mi><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></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:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>m</mml:mi></mml:munder><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msubsup><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo>∗</mml:mo></mml:msubsup></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

          where <inline-formula><mml:math id="M163" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is the gas-phase bulk concentration of species <inline-formula><mml:math id="M164" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula>,
<inline-formula><mml:math id="M165" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is the aerosol-phase concentration of species <inline-formula><mml:math id="M166" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula> in size bin
<inline-formula><mml:math id="M167" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M168" display="inline"><mml:mrow><mml:msubsup><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo>∗</mml:mo></mml:msubsup></mml:mrow></mml:math></inline-formula> is the partial pressure of species <inline-formula><mml:math id="M169" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula> in bin <inline-formula><mml:math id="M170" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula>
in equilibrium with <inline-formula><mml:math id="M171" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M172" display="inline"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is a first-order mass
transfer coefficient for species <inline-formula><mml:math id="M173" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula> in bin <inline-formula><mml:math id="M174" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula>. This system of equations
can be put in matrix form, with change in concentration as a vector on the
left-hand side and column coefficients multiplying the flux values
<inline-formula><mml:math id="M175" display="inline"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msubsup><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo>∗</mml:mo></mml:msubsup></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula> on the
right-hand side of the equation.</p>
      <p id="d1e3921">Below is an illustrative example of what the <inline-formula><mml:math id="M176" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> matrix
for evaporation and condensation could look like for a single-species
(<inline-formula><mml:math id="M177" display="inline"><mml:mrow><mml:mi mathvariant="bold">i</mml:mi><mml:mo>=</mml:mo><mml:mo mathvariant="italic">{</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo mathvariant="italic">}</mml:mo></mml:mrow></mml:math></inline-formula>) example with one gas phase and by eight size bins, which is a
standard bin number used in WRF-Chem. The rates of change in concentration
are related to their fluxes by a matrix
<inline-formula><mml:math id="M178" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>
          <disp-formula id="App1.Ch1.S1.E11" content-type="numbered"><label>A3</label><mml:math id="M179" display="block"><mml:mrow><mml:mfenced close=")" open="("><mml:mtable class="array" columnalign="center"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mi>g</mml:mi></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi mathvariant="normal">⋮</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mfenced open="(" close=")"><mml:mtable class="array" columnalign="center"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi mathvariant="normal">⋮</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where
          <disp-formula id="App1.Ch1.S1.E12" content-type="numbered"><label>A4</label><mml:math id="M180" display="block"><mml:mrow><?xmltex \hack{\hbox\bgroup\fontsize{9.5}{9.5}\selectfont$\displaystyle}?><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mfenced close="]" open="["><mml:mtable class="array" columnalign="right right right right right right right right"><mml:mtr><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><?xmltex \hack{$\egroup}?><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
        This overdetermined <inline-formula><mml:math id="M181" display="inline"><mml:mrow><mml:mn mathvariant="normal">9</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> matrix accounts for fluxes from the gas phase to
each different bin. With more species, say, 23 species, the system resembles
a block matrix:
          <disp-formula id="App1.Ch1.S1.E13" content-type="numbered"><label>A5</label><mml:math id="M182" display="block"><mml:mrow><mml:mi mathvariant="bold">A</mml:mi><mml:mo>=</mml:mo><mml:mfenced close="]" open="["><mml:mtable class="array" columnalign="center center center"><mml:mtr><mml:mtd><mml:mtable class="array" columnalign="center center"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mtd><mml:mtd><mml:mi mathvariant="normal">⋯</mml:mi></mml:mtd><mml:mtd><mml:mtable class="array" columnalign="center"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi mathvariant="normal">⋮</mml:mi></mml:mtd><mml:mtd><mml:mi mathvariant="normal">⋱</mml:mi></mml:mtd><mml:mtd><mml:mi mathvariant="normal">⋮</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mtable class="array" columnalign="center center"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mtd><mml:mtd><mml:mi mathvariant="normal">⋯</mml:mi></mml:mtd><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">23</mml:mn></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        with the assumption that all species have the same number of bins,
<inline-formula><mml:math id="M183" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="normal">⋯</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mn mathvariant="normal">23</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>. <inline-formula><mml:math id="M184" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> is
overdetermined and has full column rank, meaning that there are more
equations than unknowns. This makes calculating a unique left inverse
possible:
          <disp-formula id="App1.Ch1.S1.E14" content-type="numbered"><label>A6</label><mml:math id="M185" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mi>L</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msup><mml:mi mathvariant="bold">A</mml:mi><mml:mi>T</mml:mi></mml:msup><mml:mi mathvariant="bold">A</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:msup><mml:mi mathvariant="bold">A</mml:mi><mml:mi>T</mml:mi></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
        The existence of a unique <inline-formula><mml:math id="M186" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mi>L</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is
useful because concentration values (and therefore <inline-formula><mml:math id="M187" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>
might be more easily obtainable from reference models than the
right-hand-side integrated flux values <inline-formula><mml:math id="M188" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula>. From <inline-formula><mml:math id="M189" display="inline"><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M190" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mi>L</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> can be used to obtain
<inline-formula><mml:math id="M191" display="inline"><mml:mi mathvariant="bold-italic">S</mml:mi></mml:math></inline-formula> values:
          <disp-formula id="App1.Ch1.S1.E15" content-type="numbered"><label>A7</label><mml:math id="M192" display="block"><mml:mrow><mml:mi mathvariant="bold">S</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="bold">A</mml:mi><mml:mi>L</mml:mi></mml:msub><mml:mi mathvariant="bold">Δ</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        which a supervised machine learning algorithm can be trained to predict from
concentration, temperature, and other parameters.</p><?xmltex \hack{\clearpage}?>
</app>

<app id="App1.Ch1.S2">
  <?xmltex \currentcnt{B}?><label>Appendix B</label><title>Scatterplots of active and buildup species</title>

      <?xmltex \floatpos{h!}?><fig id="App1.Ch1.S2.F6"><?xmltex \currentcnt{B1}?><?xmltex \def\figurename{Figure}?><label>Figure B1</label><caption><p id="d1e4630">Scatterplots of target values to predicted values, for the
naïve NN (orange; <bold>a, b</bold>), the intermediate NN (purple; <bold>c, d</bold>),
and the physics-constrained NN (green; <bold>e, f</bold>), for active species 5 and
6.</p></caption>
        <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022-f06.png"/>

      </fig>

<?xmltex \hack{\clearpage}?><?xmltex \floatpos{h!}?><fig id="App1.Ch1.S2.F7"><?xmltex \currentcnt{B2}?><?xmltex \def\figurename{Figure}?><label>Figure B2</label><caption><p id="d1e4651">Scatterplots of target values to predicted values, for the
naïve NN (orange; <bold>a–c</bold>), the intermediate NN (purple; <bold>d–f</bold>),
and the physics-constrained NN (green; <bold>g–i</bold>), for the buildup species.</p></caption>
        <?xmltex \hack{\hsize\textwidth}?>
        <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/3417/2022/gmd-15-3417-2022-f07.png"/>

      </fig>

</app>

<app id="App1.Ch1.S3">
  <?xmltex \currentcnt{C}?><label>Appendix C</label><title>Reference model initialization</title>
      <p id="d1e4679">The 5000 independent days include randomly initialized values for active
species concentrations at the beginning of each day of simulation. Cosine of
the zenith angle is also multiplied by a random factor between 0 and 1 for the
day to vary intensity of photolysis reactions. Steady-state concentrations
are a direct function of active species concentrations and are thus initialized
accordingly. Buildup species concentrations are initialized at zero.</p>

<?xmltex \floatpos{h!}?><table-wrap id="App1.Ch1.S3.T4"><?xmltex \currentcnt{C1}?><label>Table C1</label><caption><p id="d1e4685">Initialization of active species concentrations.</p></caption><oasis:table frame="topbot"><?xmltex \begin{scaleboxenv}{.85}[.85]?><oasis:tgroup cols="4">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:colspec colnum="3" colname="col3" align="left"/>
     <oasis:colspec colnum="4" colname="col4" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Name</oasis:entry>
         <oasis:entry colname="col2">Symbol</oasis:entry>
         <oasis:entry colname="col3">Range</oasis:entry>
         <oasis:entry colname="col4">Distribution</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">Ozone</oasis:entry>
         <oasis:entry colname="col2">O<inline-formula><mml:math id="M193" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">3</mml:mn></mml:msub></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">0.001–0.1 ppm</oasis:entry>
         <oasis:entry colname="col4">Logarithmic</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Nitric oxide</oasis:entry>
         <oasis:entry colname="col2">NO</oasis:entry>
         <oasis:entry colname="col3">0.0015–0.15 ppm</oasis:entry>
         <oasis:entry colname="col4">Logarithmic</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Nitrogen dioxide</oasis:entry>
         <oasis:entry colname="col2">NO<inline-formula><mml:math id="M194" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">0.0015–0.15 ppm</oasis:entry>
         <oasis:entry colname="col4">Logarithmic</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Formaldehyde</oasis:entry>
         <oasis:entry colname="col2">HCHO</oasis:entry>
         <oasis:entry colname="col3">0.02–2 ppm</oasis:entry>
         <oasis:entry colname="col4">Logarithmic</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Hydroperoxyl radical</oasis:entry>
         <oasis:entry colname="col2">HO<inline-formula><mml:math id="M195" display="inline"><mml:mrow><mml:msubsup><mml:mi/><mml:mn mathvariant="normal">2</mml:mn><mml:mi class="Radical" mathvariant="normal">⚫</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3">0–0.00001 ppm</oasis:entry>
         <oasis:entry colname="col4">Linear</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Hydrogen peroxide</oasis:entry>
         <oasis:entry colname="col2">HO<inline-formula><mml:math id="M196" display="inline"><mml:msub><mml:mi/><mml:mn mathvariant="normal">2</mml:mn></mml:msub></mml:math></inline-formula>H</oasis:entry>
         <oasis:entry colname="col3">0–0.01 ppm</oasis:entry>
         <oasis:entry colname="col4">Linear</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup><?xmltex \end{scaleboxenv}?></oasis:table></table-wrap>

<?xmltex \hack{\clearpage}?>
</app>
  </app-group><notes notes-type="codedataavailability"><title>Code and data availability</title>

      <p id="d1e4856">The exact version of the Julia reference model used to generate model output
for the neural networks is archived on Zenodo at <ext-link xlink:href="https://doi.org/10.5281/zenodo.5736487" ext-link-type="DOI">10.5281/zenodo.5736487</ext-link> (Sturm, 2021). To maximize accessibility, the
model output is available for download as text files without needing to run
the reference model (as <italic>S.txt</italic>, <italic>C.txt</italic>, and <italic>J.txt</italic>). These text files are used in a Python script, with the exact version used to construct, train, and evaluate the neural
networks available at <ext-link xlink:href="https://doi.org/10.5281/zenodo.6363763" ext-link-type="DOI">10.5281/zenodo.6363763</ext-link> (Sturm, 2022).
At this DOI, the neural networks are also available for download in
hierarchical data format (.h5).</p>
  </notes><notes notes-type="authorcontribution"><title>Author contributions</title>

      <p id="d1e4877">ASW initiated the project and conceptualized the flux balancing framework
and the additional input. POS created the concept of the physics-constrained
NN architecture in this work and developed the model code using Julia for
the reference model and Python for the neural networks. ASW and POS designed
the experiments and wrote the manuscript together.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d1e4883">The contact author has declared that neither they nor their co-author has any competing interests.</p>
  </notes><notes notes-type="disclaimer"><title>Disclaimer</title>

      <p id="d1e4889">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="d1e4895">Patrick Obin Sturm would like to
acknowledge financial support from UC Davis CeDAR (Center for Data Science and Artificial Intelligence
Research). We would also like to acknowledge Michael J. Kleeman at UC Davis,
who contributed the original reference model in Fortran that we later ported
to Julia and adapted for our application.</p></ack><notes notes-type="financialsupport"><title>Financial support</title>

      <p id="d1e4900">This research has been supported by the UC Davis
CeDAR (Center for Data Science and Artificial Intelligence Research) Innovative Data Science Seed Funding
Program.</p>
  </notes><notes notes-type="reviewstatement"><title>Review statement</title>

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

      <ref id="bib1.bib1"><label>1</label><?label 1?><mixed-citation>Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C.,
Corrado, G. S., Davis, A., Dean, J., Devin, M. Ghemawat, S., Goodfellow, I.,
Harp, A., Irving, G., Isard, M., Jia, Y., Jozefowicz, R., Kaiser, L.,
Kudlur, M., Levenberg, J., Mané, D., Monga, R., Moore, S., Murray, D.,
Olah, C., Schuster, M., Shlens, J., Steiner, B., Sutskever, I., Talwar, K.,
Tucker, P., Vanhoucke, V., Vasudevan, V., Viégas, F., Vinyals, O.,
Warden, P., Wattenberg, M., Wicke, M., Yu, Y., and Zheng, X.: TensorFlow:
Large-Scale Machine Learning on Heterogeneous Systems, <uri>https://www.tensorflow.org/</uri> (last access: 8 June 2021),
2015.</mixed-citation></ref>
      <ref id="bib1.bib2"><label>2</label><?label 1?><mixed-citation>Beucler, T., Rasp, S., Pritchard, M., and Gentine, P.: Achieving
Conservation of Energy in Neural Network Emulators for Climate Modeling,
arXiv, <uri>https://arxiv.org/abs/1906.06622</uri> (last
access: 17 June 2020), 2019.</mixed-citation></ref>
      <ref id="bib1.bib3"><label>3</label><?label 1?><mixed-citation>Beucler, T., Pritchard, M., Rasp, S., Ott, J., Baldi, P., and Gentine, P.:
Enforcing analytic constraints in neural networks emulating physical
systems, Phys. Rev. Lett., 126, 098302, <ext-link xlink:href="https://doi.org/10.1103/PhysRevLett.126.098302" ext-link-type="DOI">10.1103/PhysRevLett.126.098302</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bib4"><label>4</label><?label 1?><mixed-citation>Brenowitz, N. D. and Bretherton, C. S.: Prognostic Validation of a Neural
Network Unified Physics Parameterization, Geophys. Res. Lett., 45,
6289–6298, <ext-link xlink:href="https://doi.org/10.1029/2018GL078510" ext-link-type="DOI">10.1029/2018GL078510</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bib5"><label>5</label><?label 1?><mixed-citation>Carter, W. P.: A detailed mechanism for the gas-phase atmospheric reactions
of organic compounds, Atmos. Environ., 24, 481–518,
<ext-link xlink:href="https://doi.org/10.1016/0960-1686(90)90005-8" ext-link-type="DOI">10.1016/0960-1686(90)90005-8</ext-link>, 1990.</mixed-citation></ref>
      <ref id="bib1.bib6"><label>6</label><?label 1?><mixed-citation>Carter, W. P. L. and Heo, G.: Development of revised SAPRC aromatics
mechanisms, Atmos. Environ., 77, 404–414,
<ext-link xlink:href="https://doi.org/10.1016/j.atmosenv.2013.05.021" ext-link-type="DOI">10.1016/j.atmosenv.2013.05.021</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bib7"><label>7</label><?label 1?><mixed-citation>Chollet, F.: Keras, <uri>https://keras.io</uri> (last access: 8 June 2021), 2015.</mixed-citation></ref>
      <ref id="bib1.bib8"><label>8</label><?label 1?><mixed-citation>
Gardner, M. W. and Dorling, S. R.: Artificial neural networks (the
multilayer perceptron) – a review of applications in the atmospheric
sciences, Atmos. Environ., 32, 2627–2636, 1998.</mixed-citation></ref>
      <ref id="bib1.bib9"><label>9</label><?label 1?><mixed-citation>
Gery, M. W., Whitten, G. Z., Killus, J. P., and Dodge, M. C.: A
photochemical kinetics mechanism for urban and regional scale computer
modeling, J. Geophys. Res.-Atmos., 94, 12925–12956, 1989.</mixed-citation></ref>
      <ref id="bib1.bib10"><label>10</label><?label 1?><mixed-citation>Gettelman, A., Gagne, D. J., Chen, C.-C., Christensen, M. W., Lebo, Z. J.,
Morrison, H., and Gantos, G. Machine learning the warm rain process, J. Adv. Model. Earth Sy., 13, e2020MS002268. <ext-link xlink:href="https://doi.org/10.1029/2020MS002268" ext-link-type="DOI">10.1029/2020MS002268</ext-link>,
2021.</mixed-citation></ref>
      <ref id="bib1.bib11"><label>11</label><?label 1?><mixed-citation>
Harder, P., Watson-Parris, D., Strassel, D., Gauger, N., Stier, P., and
Keuper, J.: Emulating Aerosol Microphysics with Machine Learning, arXiv preprint arXiv:2109.10593, 2021.</mixed-citation></ref>
      <ref id="bib1.bib12"><label>12</label><?label 1?><mixed-citation>Huang, L. and Topping, D.: JlBox v1.1: a Julia-based multi-phase atmospheric chemistry box model, Geosci. Model Dev., 14, 2187–2203, <ext-link xlink:href="https://doi.org/10.5194/gmd-14-2187-2021" ext-link-type="DOI">10.5194/gmd-14-2187-2021</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bib13"><label>13</label><?label 1?><mixed-citation>Kashinath, K., Mustafa, M., Albert, A., Wu J. L., Jiang, C., Esmaeilzadeh,
S., Azizzadenesheli, K., Wang, R., Chattopadhyay, A., Singh, A., Manepalli,
A., Chirila, D., Yu, R., Walters, R., White, B., Xiao, H., Tchelepi, H. A.,
Marcus, P., Anandkumar, A., Hassanzadeh. P., and Prabhat: Physics-informed
machine learning: case studies for weather and climate modelling, Philos.
T. A. Math. Phys Eng Sci., 379, 20200093, <ext-link xlink:href="https://doi.org/10.1098/rsta.2020.0093" ext-link-type="DOI">10.1098/rsta.2020.0093</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bib14"><label>14</label><?label 1?><mixed-citation>Keller, C. A. and Evans, M. J.: Application of random forest regression to the calculation of gas-phase chemistry within the GEOS-Chem chemistry model v10, Geosci. Model Dev., 12, 1209–1225, <ext-link xlink:href="https://doi.org/10.5194/gmd-12-1209-2019" ext-link-type="DOI">10.5194/gmd-12-1209-2019</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bib15"><label>15</label><?label 1?><mixed-citation>
Kelp, M. M., Tessum, C. W., and Marshall, J. D.: Orders-of-magnitude speedup
in atmospheric chemistry modeling through neural network-based emulation,
arXiv preprint arXiv:1808.03874, 2018.</mixed-citation></ref>
      <ref id="bib1.bib16"><label>16</label><?label 1?><mixed-citation>Kelp, M. M., Jacob, D. J., Kutz, J. N., Marshall, J. D., and Tessum, C. W.:
Toward Stable, General Machine-Learned Models of the Atmospheric Chemical
System, J. Geophys. Res.-Atmos., 125, e2020JD032759, <ext-link xlink:href="https://doi.org/10.1029/2020JD032759" ext-link-type="DOI">10.1029/2020JD032759</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bib17"><label>17</label><?label 1?><mixed-citation>Krasnopolsky, V. M., Rabinovitz, M. S., Hou, Y. T., Lord, S. J.,
and Belochitski, A. A.: Accurate and Fast Neural Network Emulations of Model Radiation for the NCEP
Coupled Climate Forecast System: Climate Simulations and Seasonal Predictions, Mon. Weather Rev., 138,
1822–1842, <ext-link xlink:href="https://doi.org/10.1175/2009MWR3149.1" ext-link-type="DOI">10.1175/2009MWR3149.1</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bib18"><label>18</label><?label 1?><mixed-citation>Manders, A. M. M., Builtjes, P. J. H., Curier, L., Denier van der Gon, H. A. C., Hendriks, C., Jonkers, S., Kranenburg, R., Kuenen, J. J. P., Segers, A. J., Timmermans, R. M. A., Visschedijk, A. J. H., Wichink Kruit, R. J., van Pul, W. A. J., Sauter, F. J., van der Swaluw, E., Swart, D. P. J., Douros, J., Eskes, H., van Meijgaard, E., van Ulft, B., van Velthoven, P., Banzhaf, S., Mues, A. C., Stern, R., Fu, G., Lu, S., Heemink, A., van Velzen, N., and Schaap, M.: Curriculum vitae of the LOTOS–EUROS (v2.0) chemistry transport model, Geosci. Model Dev., 10, 4145–4173, <ext-link xlink:href="https://doi.org/10.5194/gmd-10-4145-2017" ext-link-type="DOI">10.5194/gmd-10-4145-2017</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bib19"><label>19</label><?label 1?><mixed-citation>
McGovern, A., Lagerquist, R., Gagne, D. J., Jergensen, G. E., Elmore, K. L.,
Homeyer, C. R., and Smith, T.: Making the black box more transparent:
Understanding the physical implications of machine learning, B. Am.
Meteorol. Soc., 100, 2175–2199, 2019.</mixed-citation></ref>
      <ref id="bib1.bib20"><label>20</label><?label 1?><mixed-citation>
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel,
O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., and Vanderplas,
J.: Scikit-learn: Machine learning in Python, J. Mach. Learn. Res., 12,
2825–2830, 2011.</mixed-citation></ref>
      <ref id="bib1.bib21"><label>21</label><?label 1?><mixed-citation>Potukuchi, S. and Wexler, A. S.: Predicting vapor pressures using neural
networks, Atmos. Environ., 31, 741–753, <ext-link xlink:href="https://doi.org/10.1016/S1352-2310(96)00203-8" ext-link-type="DOI">10.1016/S1352-2310(96)00203-8</ext-link>, 1997.</mixed-citation></ref>
      <ref id="bib1.bib22"><label>22</label><?label 1?><mixed-citation>Raissi, M., Perdikaris, P., and Karniadakis, G. E.: Physics-informed neural
networks: A deep learning framework for solving forward and inverse problems
involving nonlinear partial differential equations, J. Computat. Phys., 378,
686–707, <ext-link xlink:href="https://doi.org/10.1016/j.jcp.2018.10.045" ext-link-type="DOI">10.1016/j.jcp.2018.10.045</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bib23"><label>23</label><?label 1?><mixed-citation>Silva, S. J., Burrows, S. M., Evans, M. J., and Halappanavar, M.: A Graph
Theoretical Intercomparison of Atmospheric Chemical Mechanisms, Geophys.
Res. Lett., 48, e2020GL090481, <ext-link xlink:href="https://doi.org/10.1029/2020GL090481" ext-link-type="DOI">10.1029/2020GL090481</ext-link>, 2021a.
</mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bib24"><label>24</label><?label 1?><mixed-citation>Silva, S. J., Ma, P.-L., Hardin, J. C., and Rothenberg, D.: Physically regularized machine learning emulators of aerosol activation, Geosci. Model Dev., 14, 3067–3077, <ext-link xlink:href="https://doi.org/10.5194/gmd-14-3067-2021" ext-link-type="DOI">10.5194/gmd-14-3067-2021</ext-link>, 2021b.</mixed-citation></ref>
      <ref id="bib1.bib25"><label>25</label><?label 1?><mixed-citation>Sturm, P. O.: Photochemical Box Model in Julia (0.2.0), Zenodo [data set], <ext-link xlink:href="https://doi.org/10.5281/zenodo.5736487" ext-link-type="DOI">10.5281/zenodo.5736487</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bib26"><label>26</label><?label 1?><mixed-citation>Sturm, P. O.: Python code for Sturm and Wexler (2022): Conservation laws in a neural network architecture (0.2.0), Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.6363763" ext-link-type="DOI">10.5281/zenodo.6363763</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bib27"><label>27</label><?label 1?><mixed-citation>Sturm, P. O. and Wexler, A. S.: A mass- and energy-conserving framework for using machine learning to speed computations: a photochemistry example, Geosci. Model Dev., 13, 4435–4442, <ext-link xlink:href="https://doi.org/10.5194/gmd-13-4435-2020" ext-link-type="DOI">10.5194/gmd-13-4435-2020</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bib28"><label>28</label><?label 1?><mixed-citation>
Wexler, A. S. and Seinfeld, J. H.: Second-generation inorganic aerosol model,
Atmos. Environ., 25A, 2731–2748, 1991.</mixed-citation></ref>
      <ref id="bib1.bib29"><label>29</label><?label 1?><mixed-citation>Yuval, J., O'Gorman, P. A., and Hill, C. N.: Use of neural networks for
stable, accurate and physically consistent parameterization of subgrid
atmospheric processes with good performance at reduced
precision, Geophys. Res. Lett., 48, e2020GL091363, <ext-link xlink:href="https://doi.org/10.1029/2020gl091363" ext-link-type="DOI">10.1029/2020gl091363</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bib30"><label>30</label><?label 1?><mixed-citation>
Zaveri, R. A. and Peters, L. K.: A new lumped structure photochemical
mechanism for large-scale applications, J. Geophys. Res.-Atmos, 104,
30387–30415, 1999.</mixed-citation></ref>
      <ref id="bib1.bib31"><label>31</label><?label 1?><mixed-citation>
Zaveri, R. A., Easter, R. C., Fast, J. D., and Peters, L. K.: Model for
simulating aerosol interactions and chemistry (MOSAIC), J. Geophys.
Res.-Atmos., 113, D13204, 2008.</mixed-citation></ref>
      <ref id="bib1.bib32"><label>32</label><?label 1?><mixed-citation>
Zhao, W. L., Gentine, P., Reichstein, M., Zhang, Y., Zhou, S., Wen, Y., Lin,
C., Li, X., and Qiu, G. Y.: Physics-constrained machine learning of
evapotranspiration, Geophys. Res. Lett., 46, 14496–14507, 2019.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html>Conservation laws in a neural network architecture: enforcing the atom balance of a Julia-based photochemical model (v0.2.0)</article-title-html>
<abstract-html/>
<ref-html id="bib1.bib1"><label>1</label><mixed-citation>
Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C.,
Corrado, G. S., Davis, A., Dean, J., Devin, M. Ghemawat, S., Goodfellow, I.,
Harp, A., Irving, G., Isard, M., Jia, Y., Jozefowicz, R., Kaiser, L.,
Kudlur, M., Levenberg, J., Mané, D., Monga, R., Moore, S., Murray, D.,
Olah, C., Schuster, M., Shlens, J., Steiner, B., Sutskever, I., Talwar, K.,
Tucker, P., Vanhoucke, V., Vasudevan, V., Viégas, F., Vinyals, O.,
Warden, P., Wattenberg, M., Wicke, M., Yu, Y., and Zheng, X.: TensorFlow:
Large-Scale Machine Learning on Heterogeneous Systems, <a href="https://www.tensorflow.org/" target="_blank"/> (last access: 8 June 2021),
2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>2</label><mixed-citation>
Beucler, T., Rasp, S., Pritchard, M., and Gentine, P.: Achieving
Conservation of Energy in Neural Network Emulators for Climate Modeling,
arXiv, <a href="https://arxiv.org/abs/1906.06622" target="_blank"/> (last
access: 17 June 2020), 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>3</label><mixed-citation>
Beucler, T., Pritchard, M., Rasp, S., Ott, J., Baldi, P., and Gentine, P.:
Enforcing analytic constraints in neural networks emulating physical
systems, Phys. Rev. Lett., 126, 098302, <a href="https://doi.org/10.1103/PhysRevLett.126.098302" target="_blank">https://doi.org/10.1103/PhysRevLett.126.098302</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>4</label><mixed-citation>
Brenowitz, N. D. and Bretherton, C. S.: Prognostic Validation of a Neural
Network Unified Physics Parameterization, Geophys. Res. Lett., 45,
6289–6298, <a href="https://doi.org/10.1029/2018GL078510" target="_blank">https://doi.org/10.1029/2018GL078510</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>5</label><mixed-citation>
Carter, W. P.: A detailed mechanism for the gas-phase atmospheric reactions
of organic compounds, Atmos. Environ., 24, 481–518,
<a href="https://doi.org/10.1016/0960-1686(90)90005-8" target="_blank">https://doi.org/10.1016/0960-1686(90)90005-8</a>, 1990.
</mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>6</label><mixed-citation>
Carter, W. P. L. and Heo, G.: Development of revised SAPRC aromatics
mechanisms, Atmos. Environ., 77, 404–414,
<a href="https://doi.org/10.1016/j.atmosenv.2013.05.021" target="_blank">https://doi.org/10.1016/j.atmosenv.2013.05.021</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>7</label><mixed-citation>
Chollet, F.: Keras, <a href="https://keras.io" target="_blank"/> (last access: 8 June 2021), 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>8</label><mixed-citation>
Gardner, M. W. and Dorling, S. R.: Artificial neural networks (the
multilayer perceptron) – a review of applications in the atmospheric
sciences, Atmos. Environ., 32, 2627–2636, 1998.
</mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>9</label><mixed-citation>
Gery, M. W., Whitten, G. Z., Killus, J. P., and Dodge, M. C.: A
photochemical kinetics mechanism for urban and regional scale computer
modeling, J. Geophys. Res.-Atmos., 94, 12925–12956, 1989.
</mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>10</label><mixed-citation>
Gettelman, A., Gagne, D. J., Chen, C.-C., Christensen, M. W., Lebo, Z. J.,
Morrison, H., and Gantos, G. Machine learning the warm rain process, J. Adv. Model. Earth Sy., 13, e2020MS002268. <a href="https://doi.org/10.1029/2020MS002268" target="_blank">https://doi.org/10.1029/2020MS002268</a>,
2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>11</label><mixed-citation>
Harder, P., Watson-Parris, D., Strassel, D., Gauger, N., Stier, P., and
Keuper, J.: Emulating Aerosol Microphysics with Machine Learning, arXiv preprint arXiv:2109.10593, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>12</label><mixed-citation>
Huang, L. and Topping, D.: JlBox v1.1: a Julia-based multi-phase atmospheric chemistry box model, Geosci. Model Dev., 14, 2187–2203, <a href="https://doi.org/10.5194/gmd-14-2187-2021" target="_blank">https://doi.org/10.5194/gmd-14-2187-2021</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>13</label><mixed-citation>
Kashinath, K., Mustafa, M., Albert, A., Wu J. L., Jiang, C., Esmaeilzadeh,
S., Azizzadenesheli, K., Wang, R., Chattopadhyay, A., Singh, A., Manepalli,
A., Chirila, D., Yu, R., Walters, R., White, B., Xiao, H., Tchelepi, H. A.,
Marcus, P., Anandkumar, A., Hassanzadeh. P., and Prabhat: Physics-informed
machine learning: case studies for weather and climate modelling, Philos.
T. A. Math. Phys Eng Sci., 379, 20200093, <a href="https://doi.org/10.1098/rsta.2020.0093" target="_blank">https://doi.org/10.1098/rsta.2020.0093</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>14</label><mixed-citation>
Keller, C. A. and Evans, M. J.: Application of random forest regression to the calculation of gas-phase chemistry within the GEOS-Chem chemistry model v10, Geosci. Model Dev., 12, 1209–1225, <a href="https://doi.org/10.5194/gmd-12-1209-2019" target="_blank">https://doi.org/10.5194/gmd-12-1209-2019</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>15</label><mixed-citation>
Kelp, M. M., Tessum, C. W., and Marshall, J. D.: Orders-of-magnitude speedup
in atmospheric chemistry modeling through neural network-based emulation,
arXiv preprint arXiv:1808.03874, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>16</label><mixed-citation>
Kelp, M. M., Jacob, D. J., Kutz, J. N., Marshall, J. D., and Tessum, C. W.:
Toward Stable, General Machine-Learned Models of the Atmospheric Chemical
System, J. Geophys. Res.-Atmos., 125, e2020JD032759, <a href="https://doi.org/10.1029/2020JD032759" target="_blank">https://doi.org/10.1029/2020JD032759</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>17</label><mixed-citation>
Krasnopolsky, V. M., Rabinovitz, M. S., Hou, Y. T., Lord, S. J.,
and Belochitski, A. A.: Accurate and Fast Neural Network Emulations of Model Radiation for the NCEP
Coupled Climate Forecast System: Climate Simulations and Seasonal Predictions, Mon. Weather Rev., 138,
1822–1842, <a href="https://doi.org/10.1175/2009MWR3149.1" target="_blank">https://doi.org/10.1175/2009MWR3149.1</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>18</label><mixed-citation>
Manders, A. M. M., Builtjes, P. J. H., Curier, L., Denier van der Gon, H. A. C., Hendriks, C., Jonkers, S., Kranenburg, R., Kuenen, J. J. P., Segers, A. J., Timmermans, R. M. A., Visschedijk, A. J. H., Wichink Kruit, R. J., van Pul, W. A. J., Sauter, F. J., van der Swaluw, E., Swart, D. P. J., Douros, J., Eskes, H., van Meijgaard, E., van Ulft, B., van Velthoven, P., Banzhaf, S., Mues, A. C., Stern, R., Fu, G., Lu, S., Heemink, A., van Velzen, N., and Schaap, M.: Curriculum vitae of the LOTOS–EUROS (v2.0) chemistry transport model, Geosci. Model Dev., 10, 4145–4173, <a href="https://doi.org/10.5194/gmd-10-4145-2017" target="_blank">https://doi.org/10.5194/gmd-10-4145-2017</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>19</label><mixed-citation>
McGovern, A., Lagerquist, R., Gagne, D. J., Jergensen, G. E., Elmore, K. L.,
Homeyer, C. R., and Smith, T.: Making the black box more transparent:
Understanding the physical implications of machine learning, B. Am.
Meteorol. Soc., 100, 2175–2199, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>20</label><mixed-citation>
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel,
O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., and Vanderplas,
J.: Scikit-learn: Machine learning in Python, J. Mach. Learn. Res., 12,
2825–2830, 2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>21</label><mixed-citation>
Potukuchi, S. and Wexler, A. S.: Predicting vapor pressures using neural
networks, Atmos. Environ., 31, 741–753, <a href="https://doi.org/10.1016/S1352-2310(96)00203-8" target="_blank">https://doi.org/10.1016/S1352-2310(96)00203-8</a>, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>22</label><mixed-citation>
Raissi, M., Perdikaris, P., and Karniadakis, G. E.: Physics-informed neural
networks: A deep learning framework for solving forward and inverse problems
involving nonlinear partial differential equations, J. Computat. Phys., 378,
686–707, <a href="https://doi.org/10.1016/j.jcp.2018.10.045" target="_blank">https://doi.org/10.1016/j.jcp.2018.10.045</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>23</label><mixed-citation>
Silva, S. J., Burrows, S. M., Evans, M. J., and Halappanavar, M.: A Graph
Theoretical Intercomparison of Atmospheric Chemical Mechanisms, Geophys.
Res. Lett., 48, e2020GL090481, <a href="https://doi.org/10.1029/2020GL090481" target="_blank">https://doi.org/10.1029/2020GL090481</a>, 2021a.

</mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>24</label><mixed-citation>
Silva, S. J., Ma, P.-L., Hardin, J. C., and Rothenberg, D.: Physically regularized machine learning emulators of aerosol activation, Geosci. Model Dev., 14, 3067–3077, <a href="https://doi.org/10.5194/gmd-14-3067-2021" target="_blank">https://doi.org/10.5194/gmd-14-3067-2021</a>, 2021b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>25</label><mixed-citation>
Sturm, P. O.: Photochemical Box Model in Julia (0.2.0), Zenodo [data set], <a href="https://doi.org/10.5281/zenodo.5736487" target="_blank">https://doi.org/10.5281/zenodo.5736487</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>26</label><mixed-citation>
Sturm, P. O.: Python code for Sturm and Wexler (2022): Conservation laws in a neural network architecture (0.2.0), Zenodo [code], <a href="https://doi.org/10.5281/zenodo.6363763" target="_blank">https://doi.org/10.5281/zenodo.6363763</a>, 2022.
</mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>27</label><mixed-citation>
Sturm, P. O. and Wexler, A. S.: A mass- and energy-conserving framework for using machine learning to speed computations: a photochemistry example, Geosci. Model Dev., 13, 4435–4442, <a href="https://doi.org/10.5194/gmd-13-4435-2020" target="_blank">https://doi.org/10.5194/gmd-13-4435-2020</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>28</label><mixed-citation>
Wexler, A. S. and Seinfeld, J. H.: Second-generation inorganic aerosol model,
Atmos. Environ., 25A, 2731–2748, 1991.
</mixed-citation></ref-html>
<ref-html id="bib1.bib29"><label>29</label><mixed-citation>
Yuval, J., O'Gorman, P. A., and Hill, C. N.: Use of neural networks for
stable, accurate and physically consistent parameterization of subgrid
atmospheric processes with good performance at reduced
precision, Geophys. Res. Lett., 48, e2020GL091363, <a href="https://doi.org/10.1029/2020gl091363" target="_blank">https://doi.org/10.1029/2020gl091363</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib30"><label>30</label><mixed-citation>
Zaveri, R. A. and Peters, L. K.: A new lumped structure photochemical
mechanism for large-scale applications, J. Geophys. Res.-Atmos, 104,
30387–30415, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib31"><label>31</label><mixed-citation>
Zaveri, R. A., Easter, R. C., Fast, J. D., and Peters, L. K.: Model for
simulating aerosol interactions and chemistry (MOSAIC), J. Geophys.
Res.-Atmos., 113, D13204, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib32"><label>32</label><mixed-citation>
Zhao, W. L., Gentine, P., Reichstein, M., Zhang, Y., Zhou, S., Wen, Y., Lin,
C., Li, X., and Qiu, G. Y.: Physics-constrained machine learning of
evapotranspiration, Geophys. Res. Lett., 46, 14496–14507, 2019.
</mixed-citation></ref-html>--></article>
