<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />

    <title>XMLlab-1.4 Software Reference Manual</title>

    <link href="html.css" rel="stylesheet" type="text/css" />

    <meta content="DocBook XSL Stylesheets V1.67.0" name="generator" />
  </head>

  <body><div class="book" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h1 class="title"><a
  id="id826501"></a>XMLlab-1.4 Software reference manual</h1></div><div><div
  class="authorgroup"><div class="author"><h3 class="author"><span
  class="firstname">Stéphane</span> <span
  class="surname">Mottelet</span></h3><code class="email">&lt;<a
  href="mailto:stephane.mottelet@utc.fr">stephane.mottelet@utc.fr</a>&gt;</code></div><div
  class="author"><h3 class="author"><span class="firstname">André</span> <span
  class="surname">Pauss</span></h3><code class="email">&lt;<a
  href="mailto:andre.pauss@utc.fr">andre.pauss@utc.fr</a>&gt;</code></div><h3
  class="corpauthor">iode Conseil (<a href="www.iode-conseil.com"
  target="_top">www.iode-conseil.com</a>)</h3></div></div><div><p
  class="othercredit"><span class="othername">XMLlab is a projet financed by
  the regional pole STEF of Picardie and the UNIT
  consortium.</span></p></div><div><p class="othercredit"><span
  class="othername"><a href="http://www.utc.fr/" target="_top"><img
  src="images/logos/UTC.png"></img></a><img src="images/logos/point.gif"
  width="10"></img><a href="http://www.unit-c.fr/" target="_top"><img
  src="images/logos/UNIT.gif"></img></a><img src="images/logos/point.gif"
  width="10"></img><a href="http://www.cr-picardie.fr/" target="_top"><img
  src="images/logos/cr_picardie.gif"></img></a><img
  src="images/logos/point.gif" width="10"></img><a
  href="http://www.recherche.gouv.fr/drrt/drrt.htm" target="_top"><img
  src="images/logos/DRRT.gif"></img></a><img src="images/logos/point.gif"
  width="10"></img><a href="http://www.iode-conseil.com" target="_top"><img
  src="images/logos/iode.png"></img></a></span></p></div></div><hr /></div><div
  class="toc"><p><b>Table of contents</b></p><dl>
      <dt><span class="chapter"><a href="#id867431">1.
      Introduction</a></span></dt>

      <dt><span class="chapter"><a href="#id867532">2. Kinetics of prey
      predation by predators </a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id867559">. Mathematical
          description of the simulation</a></span></dt>

          <dt><span class="section"><a href="#id867859">2. Logics of the
          description in XML of the simulation</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id867883">2.1. General
              description </a></span></dt>

              <dt><span class="section"><a href="#id867930">2.2.
              Parameters</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id868004">2.2.1. Kinetic
                  parameters</a></span></dt>

                  <dt><span class="section"><a href="#id868223">2.2.2.
                  &nbsp;Initial oncentrations</a></span></dt>

                  <dt><span class="section"><a href="#id868338">2.2.3.
                  Simulation time</a></span></dt>
                </dl></dd>

              <dt><span class="section"><a href="#id868411">2.3. Mathematical
              Models</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id868439">2.3.1. <code
                  class="code" />Definition of the integration variable <code
                  class="code">time</code> and its discretization interval
                  <ns:math overflow="scroll"
                      xmlns:ns="http://www.w3.org/1998/Math/MathML">
                      <ns:semantics definitionURL="" encoding="">
                        <ns:mrow>
                          <ns:mrow>
                            <ns:mo>[</ns:mo>

                            <ns:mrow>
                              <ns:mn>0,</ns:mn>

                              <ns:mtext> </ns:mtext>

                              <ns:mtext> </ns:mtext>

                              <ns:mi mathvariant="italic">final</ns:mi>

                              <ns:mo>_</ns:mo>

                              <ns:mi mathvariant="italic">time</ns:mi>
                            </ns:mrow>

                            <ns:mo>]</ns:mo>
                          </ns:mrow>
                        </ns:mrow>

                        <ns:annotation encoding="MathType-MTEF" />
                      </ns:semantics>
                    </ns:math></a></span></dt>

                  <dt><span class="section"><a href="#ex_ode_predation">2.3.2.
                  Definition of the differential equations</a></span></dt>

                  <dt><span class="section"><a href="#id868712">2.3.3.
                  Definition of the phase picture Prey against
                  Predator</a></span></dt>
                </dl></dd>

              <dt><span class="section"><a href="#courbe_predation">2.4.
              Results display</a></span></dt>

              <dt><span class="section"><a href="#id868921">2.5. Saving
              simulation results</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id868928">2.5.1. Saving
                  simulation results</a></span></dt>
                </dl></dd>
            </dl></dd>
        </dl></dd>

      <dt><span class="chapter"><a href="#id868982">3. Simulation of
      monoacides titration</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id869009"></a></span></dt>

          <dt><span class="section"><a href="#id869009">1. Chemical
          description of the simulation</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id869015">1.1. Calculation
              principle</a></span></dt>

              <dt><span class="section"><a href="#id869605">1.2.
              Characteristics of the analyte and titrant
              species</a></span></dt>

              <dt><span class="section"><a href="#id869829">1.3.
              &nbsp;Partition coefficients </a></span></dt>

              <dt><span class="section"><a href="#id870829">1.4. Titration
              data</a></span></dt>

              <dt><span class="section"><a href="#id870959">1.5.
              Equations</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id870964">1.5.1.
                  Electric charge of the medium calculation</a></span></dt>

                  <dt><span class="section"><a href="#id871194">1.5.2.
                  Partition coefficients calculation</a></span></dt>
                </dl></dd>
            </dl></dd>

          <dt><span class="section"><a href="#id871759">2. Logics of the
          description in XML of the simulation</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id871790">2.1. General
              description </a></span></dt>

              <dt><span class="section"><a href="#id871817">2.2.
              Parameters</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id871895">2.2.1.
                  Analyte&nbsp;choice</a></span></dt>

                  <dt><span class="section"><a href="#id872114">2.2.2. Titrant
                  choice</a></span></dt>

                  <dt><span class="section"><a href="#param_titrage">2.2.3.
                  Titration &nbsp;parameters</a></span></dt>

                  <dt><span class="section"><a
                  href="#points_experimentaux">2.2.4. Experimental
                  data</a></span></dt>
                </dl></dd>

              <dt><span class="section"><a href="#id872393">2.3. Mathematical
              models</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#c_titrant">2.3.1.
                  Definition of the titrant concentration</a></span></dt>

                  <dt><span class="section"><a href="#calcul_ph">2.3.2. pH
                  calculation using the dichotomic method</a></span></dt>

                  <dt><span class="section"><a href="#id873174">2.3.3.
                  Definition of the experimental data curve</a></span></dt>
                </dl></dd>

              <dt><span class="section"><a href="#courbe_ph">2.4. Results
              display</a></span></dt>

              <dt><span class="section"><a href="#id873426">2.5.&nbsp;Session
              and results simulation saving </a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id873434">2.5.1. Saving
                  and downloading the session</a></span></dt>

                  <dt><span class="section"><a href="#id873482">2.5.2. Saving
                  the results of the simulation</a></span></dt>
                </dl></dd>
            </dl></dd>
        </dl></dd>

      <dt><span class="chapter"><a href="#id873582">4.&nbsp;Finite elements:
      simulation of the Poisson's equation</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id873608">1. Physical
          description of the simulation</a></span></dt>

          <dt><span class="section"><a href="#id892445">2. Logics of the
          description in XML of the simulation</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id892474">2.1. General
              description</a></span></dt>

              <dt><span class="section"><a href="#id892514">2.2.
              Parameters</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id892591">2.2.1.
                  Discretization parameters </a></span></dt>
                </dl></dd>

              <dt><span class="section"><a href="#id892794">2.3. Mathematical
              Models</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id892819">2.3.1.
                  Definition of the variable <code class="code">thetain</code>
                  and of its interval of discretization [0, 2π] <code
                  class="code"></code> </a></span></dt>

                  <dt><span class="section"><a href="#id892870">2.3.2.
                  Definition of the variable <code
                  class="code">thetaout</code> and of its interval of
                  discretization [0, 2π]</a></span></dt>

                  <dt><span class="section"><a href="#id892912">2.3.3.
                  &nbsp;Definition of the domaine Ω</a></span></dt>

                  <dt><span class="section"><a
                  href="#ex_stationary-pde_poisson">2.3.4. Definition of the
                  stationary partial derivatives</a></span></dt>
                </dl></dd>

              <dt><span class="section"><a href="#courbe_poisson">2.4. Results
              display</a></span></dt>
            </dl></dd>
        </dl></dd>

      <dt><span class="chapter"><a href="#id893525">5. Simulation of
      Earth-Moon system</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id893553">1. Physical
          description of the simulation</a></span></dt>

          <dt><span class="section"><a href="#id894686">2. Logics of the
          simulation description in XML</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id894712">2.1. General
              description</a></span></dt>

              <dt><span class="section"><a href="#id894735">2.2.
              Parameters</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id894822">2.2.1. System
                  parameters</a></span></dt>

                  <dt><span class="section"><a href="#id894994">2.2.2. Solving
                  parameters</a></span></dt>
                </dl></dd>

              <dt><span class="section"><a href="#id895082">2.3. Mathematical
              models </a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id895111">2.3.1.
                  Definition of the variable <code class="code">t</code> and
                  of its discretization interval [0, <span
                  class="emphasis"><em>T</em></span>]</a></span></dt>

                  <dt><span class="section"><a
                  href="#ex_ode_terre_lune">2.3.2. Definition of the
                  differential equations</a></span></dt>

                  <dt><span class="section"><a href="#id895444">2.3.3.
                  Definition of the parametric curve giving the trajectory of
                  the earth</a></span></dt>

                  <dt><span class="section"><a href="#id895506">2.3.4.
                  Definition of the parametric curve giving the trajectory of
                  the moon</a></span></dt>
                </dl></dd>

              <dt><span class="section"><a href="#courbe_terre_lune">2.4.
              Results display</a></span></dt>
            </dl></dd>
        </dl></dd>

      <dt><span class="chapter"><a href="#id895662">6. &nbsp;Reference of the
      elements participating in the description of a
      simulation</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id895904"> </a></span></dt>

          <dt><span class="section"><a href="#id895904">1. General
          description</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id895916">1.1 File and
              simulation headings </a></span></dt>

              <dt><span class="section"><a href="#balise_notes">1.2. Notes
              about the simulation</a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#balise_parameters">2.
          Parameters</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#balise_subsection">2.1.
              <code class="code">Subsection Tag</code></a></span></dt>

              <dt><span class="section"><a href="#balise_database">2.2. <code
              class="code">Database Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id896698">2.3. <code
              class="code">Group Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id896782">2.4. <code
              class="code">Scalar Tag</code></a></span></dt>

              <dt><span class="section"><a href="#balise_matrix">2.5. <code
              class="code">Matrix Tag</code></a></span></dt>

              <dt><span class="section"><a href="#balise_point">2.6. <code
              class="code">Point Tag</code></a></span></dt>

              <dt><span class="section"><a href="#balise_record">2.7. <code
              class="code">Record Tag</code></a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#balise_actions">3.
          Actions</a></span></dt>

          <dt><span class="section"><a href="#id898070">4. Script or
          mathematical models</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id898099">4.1.
              Script</a></span></dt>

              <dt><span class="section"><a href="#modeles_mathematiques">4.2.
              Mathematical models</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#def_ref_domain1d">4.2.1.
                  <code class="code">Defdomain1d</code> and <code
                  class="code">refdomain1d Tags</code></a></span></dt>

                  <dt><span class="section"><a href="#def_ref_domain2d">4.2.2.
                  <code class="code">Defdomain2d</code> and <code
                  class="code">refdomain2d Tags</code></a></span></dt>

                  <dt><span class="section"><a href="#id898514">4.2.3. <code
                  class="code">Ode Tag</code></a></span></dt>

                  <dt><span class="section"><a href="#id898825">4.2.4. <code
                  class="code">Implicitfunction Tag</code></a></span></dt>

                  <dt><span class="section"><a href="#id899263">4.2.5. <code
                  class="code">Stationary-pde Tag</code></a></span></dt>

                  <dt><span class="section"><a href="#id900089">4.2.6. <code
                  class="code">Nonparametriccurve2d Tag</code></a></span></dt>

                  <dt><span class="section"><a
                  href="#parametriccurve2d">4.2.7. <code
                  class="code">Parametriccurve2d Tag</code></a></span></dt>

                  <dt><span class="section"><a href="#id900479">4.2.8. <code
                  class="code">Parametriccurve3d Tag</code></a></span></dt>

                  <dt><span class="section"><a href="#id900727">4.2.9. <code
                  class="code">Nonparametricsurface Tag</code></a></span></dt>

                  <dt><span class="section"><a href="#id900888">4.2.10. <code
                  class="code">Parametricsurface Tag</code></a></span></dt>

                  <dt><span class="section"><a href="#id901154">4.2.11. <code
                  class="code">Polyline Tag</code></a></span></dt>
                </dl></dd>
            </dl></dd>

          <dt><span class="section"><a href="#id901273">5. Results
          display</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id901375">5.1. &nbsp;Systems
              of axes</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a href="#id901381">5.1.1. <code
                  class="code">Axis2d Tag</code></a></span></dt>

                  <dt><span class="section"><a href="#id901646">5.1.2. A<code
                  class="code">xis3d Tag</code></a></span></dt>
                </dl></dd>

              <dt><span class="section"><a href="#courbes_et_surfaces">5.2.
              Curves and surfaces</a></span></dt>

              <dd><dl>
                  <dt><span class="section"><a
                  href="#balise_drawcurve2d">5.2.1. D<code
                  class="code">rawcurve2d Tag</code></a></span></dt>

                  <dt><span class="section"><a
                  href="#balise_drawcurve3d">5.2.2. D<code
                  class="code">rawcurve3d Tag</code></a></span></dt>

                  <dt><span class="section"><a href="#drawsurface">5.2.3.
                  D<code class="code">rawsurface Tag</code></a></span></dt>

                  <dt><span class="section"><a
                  href="#balise_drawpoints">5.2.4. D<code
                  class="code">rawpoints Tag</code></a></span></dt>
                </dl></dd>
            </dl></dd>

          <dt><span class="section"><a href="#balise_save">6. Saving
          simulation results </a></span></dt>
        </dl></dd>

      <dt><span class="chapter"><a href="#id902466">7. XMLlab command and
      menus line</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id902472">1. Command
          line</a></span></dt>

          <dt><span class="section"><a href="#id902512">2. XMLlab simulation
          menu</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id902518">2.1. File
              Menu<span class="guimenu"> </span></a></span></dt>

              <dt><span class="section"><a href="#id902635">2.2. <span
              class="guimenuitem"><em class="replaceable"><i>Actions
              Menu</i></em></span></a></span></dt>

              <dt><span class="section"><a href="#id902675">2.3.<span
              class="guimenu"> Parameters Menu</span></a></span></dt>

              <dt><span class="section"><a href="#id902700">2.4. <span
              class="guimenu">XMLlab Menu</span></a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#id902754">3. Scilab XMLlab
          Menu</a></span></dt>
        </dl></dd>
    </dl></div><div class="list-of-figures"><p><b>List of figures</b></p><dl>
      <dt>2.1. Parameter entry menu for the kinetics of prey predation by
      predator<span class="guimenu"> </span>simulation</dt>

      <dt>2.2.<a href="#id868025"> Kinetic parameters data entry </a></dt>

      <dt>2.3. <a href="#id868239">Initial concentrations data entry</a></dt>

      <dt>2.4. <a href="#id868329">Simulation time data entry</a></dt>

      <dt>2.5. <a href="#id868818">Results curves</a></dt>

      <dt>3.1. <a href="#fig_menu_parametres">P<span class="guimenu">arameters
      entry menu</span> of a mono acid titration simulation</a></dt>

      <dt>3.2. <a href="#id871915">Analyte choice</a></dt>

      <dt>3.3. <a href="#id872111">Titrant choice</a></dt>

      <dt>3.4. <a href="#fig_param_titrage">Titration parameter data
      entry</a></dt>

      <dt>3.5.<a href="#id872312"> Experimental data entry</a></dt>

      <dt>3.6. <a href="#id873306">Results curves </a></dt>

      <dt>3.7. <a href="#id873531">Saving simulation results &nbsp;</a></dt>

      <dt>4.1. <a href="#id891492">Domaine Ω </a></dt>

      <dt>4.2. <a href="#id892530">&nbsp;Parameter menu entries<span
      class="guimenu"> of the</span>Poisson's equation simulation</a></dt>

      <dt>4.3. <a href="#id893410">Results curves </a></dt>

      <dt>5.1. <a href="#trajectoires_terre_lune">Earth-Moon system
      trajectories </a></dt>

      <dt>5.2. <a href="#trajectoires_terre_lune_CG">Trajectories of
      Earth-Moon system in the reference mark related to the centre of gravity
      </a></dt>

      <dt>5.3. <a href="#id894754">Parameters menu entries of the Earth-Moon
      system simulation </a></dt>

      <dt>5.4. <a href="#id894836">System parameters data entry </a></dt>

      <dt>5.5. <a href="#id895005">Solving parameters data entry</a></dt>

      <dt>5.6. <a href="#id895602">Earth and moon trajectories</a></dt>

      <dt>6.1. <a href="#id896236">IHM presentation based on tags
      &nbsp;</a></dt>

      <dt>6.2. <a href="#id896381">Subsection utilization exemple </a></dt>

      <dt>6.3. <a href="#id896403">Exemple of a subsection displayed in a
      separate window </a></dt>

      <dt>6.4. <a href="#id896469">Parameters data entry for the species to be
      titrated </a></dt>

      <dt>6.5. <a href="#id896720"><code class="code">Group Tag example
      </code></a></dt>

      <dt>6.6. <a href="#id897280">Data entry of experimental data
      &nbsp;</a></dt>

      <dt>6.7. <a href="#id897950"> Actions menu example</a></dt>
    </dl></div><div class="chapter" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h2 class="title"><a
  id="id867431"></a>Chapter&nbsp;1.&nbsp;Introduction</h2></div></div></div><p>This
  handbook supposes the reading of the document <em class="citetitle"><em
  class="citetitle">XMLlab</em> Getting started guide </em>which describes the
  installation and presents <span class="emphasis"><em>XMLlab software
  use</em></span>. It aims at :</p><div class="itemizedlist"><ul type="disc">
      <li><p>Prolonging this document by continuing the illustration of the
      description logic of a simulation in XML, and this through the step by
      step design of four simulation examples, the accent being each time put
      on the new types of the elements introduced.</p></li>

      <li><p>Describing completely all the elements that can participate in
      the simulation description.</p></li>
    </ul></div><p>Let us remind that the simulation description is based on
  the tag language <span class="emphasis"><em>XML</em></span> and contains the
  following elements :</p><div class="itemizedlist"><ul type="disc">
      <li><p>the mathematical models of objects (time dependent or not)
      describing the simulation,</p></li>

      <li><p>the physical parameters description intervening in these models,
      </p></li>

      <li><p>the IHM allowing to act on these physical parameters and to
      visualize the simulation.</p></li>
    </ul></div><p>The <span class="emphasis"><em>Scilab software
  </em></span>is used to calculate and display in real time the result of the
  generated simulation, the IHM allows to regulate the simulation parameters
  being delegated to <span
  class="emphasis"><em>Tcl/Tk</em></span>.</p></div><div class="chapter"
  lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h2
  class="title"><a id="id867532"></a>Chapter&nbsp;2.&nbsp;Kinetics of prey
  predation by predators </h2></div></div></div><div class="toc"><p><b>Table
  of contents</b></p><dl>
      <dt><span class="section"><a href="#id867559">1. Mathematical
      description of the simulation</a></span></dt>

      <dt><span class="section"><a href="#id867859">2. Logics of the
      description in XML of the simulation</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id867883">2.1. General
          description </a></span></dt>

          <dt><span class="section"><a href="#id867930">2.2.
          Parameters</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id868004">2.2.1. Kinetic
              parameters</a></span></dt>

              <dt><span class="section"><a href="#id868223">2.2.2.
              &nbsp;Initial oncentrations</a></span></dt>

              <dt><span class="section"><a href="#id868338">2.2.3. Simulation
              time</a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#id868411">2.3. Mathematical
          Models</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id868439">2.3.1.<code
              class="code" />Definition of the integration variable <code
              class="code">time</code> and its discretization interval
              <mml:math overflow="scroll"
                  xmlns:mml="http://www.w3.org/1998/Math/MathML">
                  <mml:semantics definitionURL="" encoding="">
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mn>0,</mml:mn>

                          <mml:mtext> </mml:mtext>

                          <mml:mtext> </mml:mtext>

                          <mml:mi mathvariant="italic">final</mml:mi>

                          <mml:mo>_</mml:mo>

                          <mml:mi mathvariant="italic">time</mml:mi>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>

                    <mml:annotation encoding="MathType-MTEF" />
                  </mml:semantics>
                </mml:math></a></span></dt>

              <dt><span class="section"><a href="#ex_ode_predation">2.3.2.
              Definition of the differential equations</a></span></dt>

              <dt><span class="section"><a href="#id868712">2.3.3. Definition
              of the phase picture Prey against Predator</a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#courbe_predation">2.4. Results
          display</a></span></dt>

          <dt><span class="section"><a href="#id868921">2.5. Saving simulation
          results</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id868928">2.5.1. Saving
              simulation results</a></span></dt>
            </dl></dd>
        </dl></dd>
    </dl></div><p>This example corresponds to <code
  class="filename">Predation/prey-predator.xml</code> file of the
  sub-directory <code class="filename">examples</code> of the <span
  class="emphasis"><em>XMLlab</em></span> installation directory.</p><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h2
  class="title" style="clear: both"><a id="id867559"></a>1.&nbsp;Mathematical
  description of the simulation</h2></div></div></div><p>It consists of
  bringing together a set of preys and a set of predators, each having a rate
  of reproduction and mortality, the predators arresting preys at a given
  rate.</p><p>Let us consider the following parameters intervening in the
  simulation :</p><div class="itemizedlist"><ul type="disc">
      <li><p><span class="emphasis"><em>r</em></span> : Growth rate of preys
      without predator,</p></li>

      <li><p><span class="emphasis"><em>k</em></span> : Mortality of prey,
      without predator,</p></li>

      <li><p><span class="emphasis"><em>a</em></span> : Predation rate of
      prey, per number of predator,</p></li>

      <li><p><span class="emphasis"><em>b</em></span> : Growth rate of
      predators, per number of eaten prey,</p></li>

      <li><p><span class="emphasis"><em>q</em></span> : Mortality of
      predators, without prey.</p></li>
    </ul></div><p>The following equations of Lotka-Voltera govern then the
  evolution with time of the number of prey (<span
  class="emphasis"><em>prey</em></span>) and of the number of predators (<span
  class="emphasis"><em>predator</em></span>) :</p><div
  class="equation"><mml:math display="block" overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:mrow>
            <mml:mo>{</mml:mo>

            <mml:mtable columnalign="left">
              <mml:mtr>
                <mml:mtd>
                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mi>d</mml:mi>

                      <mml:mi mathvariant="italic">prey</mml:mi>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:mi>d</mml:mi>

                      <mml:mi>t</mml:mi>
                    </mml:mrow>
                  </mml:mfrac>

                  <mml:mo>=</mml:mo>

                  <mml:mi>r</mml:mi>

                  <mml:mo>.</mml:mo>

                  <mml:mi mathvariant="italic">prey</mml:mi>

                  <mml:mo>−</mml:mo>

                  <mml:mi>k</mml:mi>

                  <mml:mo>.</mml:mo>

                  <mml:mi mathvariant="italic">prey</mml:mi>

                  <mml:mo>−</mml:mo>

                  <mml:mi>a</mml:mi>

                  <mml:mo>.</mml:mo>

                  <mml:mi mathvariant="italic">prey</mml:mi>

                  <mml:mo>.</mml:mo>

                  <mml:mi mathvariant="italic">predator</mml:mi>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mi>d</mml:mi>

                      <mml:mi mathvariant="italic">predator</mml:mi>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:mi>d</mml:mi>

                      <mml:mi>t</mml:mi>
                    </mml:mrow>
                  </mml:mfrac>

                  <mml:mo>=</mml:mo>

                  <mml:mi>b</mml:mi>

                  <mml:mo>.</mml:mo>

                  <mml:mi mathvariant="italic">prey</mml:mi>

                  <mml:mo>.</mml:mo>

                  <mml:mi mathvariant="italic">predator</mml:mi>

                  <mml:mo>−</mml:mo>

                  <mml:mi>q</mml:mi>

                  <mml:mo>.</mml:mo>

                  <mml:mi mathvariant="italic">predator</mml:mi>
                </mml:mtd>
              </mml:mtr>
            </mml:mtable>
          </mml:mrow>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h2 class="title" style="clear: both"><a
  id="id867859"></a>2.&nbsp;Logics of the description in XML of the
  simulation</h2></div></div></div><p>We will show how this simulation is
  translated into a XML file that the <span
  class="emphasis"><em>XMLlab</em></span> tool will use to generate a
  simulation executed by <span class="emphasis"><em>Scilab</em></span>. The
  XML file will be shown in its textual form.</p><div class="section"
  lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h3
  class="title"><a id="id867883"></a>2.1.&nbsp;General description
  </h3></div></div></div><p>The heading lines of the XML file always allows to
  associate to it the XMLlab DTD, the following simulation heading lines
  allowing to specify its title, its author, the keywords related to it, as
  well as an image (here the equations governing the simulation) displayed
  permanently at the bottom of the window of the parameters adjustment.
  </p><p> </p><pre class="programlisting">&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;!DOCTYPE simulation PUBLIC "-//UTC//DTD XMLlab V1.4//FR"
"http://xmllab.org/dtd/1.4/simulation.dtd"&gt;
&lt;simulation&gt;
  &lt;header&gt;
    &lt;title lang="french"&gt;Cinétique de prédation de proies par des prédateurs&lt;/title&gt;

    &lt;title lang="english"&gt;Kinetics of prey predation by predators&lt;/title&gt;

    &lt;author&gt;Pauss André, Mottelet Stéphane, UTC&lt;/author&gt;

    &lt;keywords&gt;simulation, scilab, xml, Lotka-Voltera&lt;/keywords&gt;

    &lt;image href="Lotka-Voltera.gif" /&gt;
  &lt;/header&gt;
  ...</pre><p>The lines defining multilingual notes come then. They are
  displayed during the selection of the menu entry <span
  class="guimenuitem">XMLlab-&gt;About this simulation</span> :</p><pre
  class="programlisting">  &lt;notes lang="french"&gt;
    &lt;p&gt;Cette simulation a pour objet d'illustrer l'équation de Lotka-Voltera qui décrit la dynamique des populations de proies et de prédateurs&lt;/p&gt;
  &lt;/notes&gt;

  &lt;notes lang="english"&gt;
    &lt;p&gt;This simulation aims to illustrate the kinetics of prey predation by predators, with the Lotka-Voltera expression&lt;/p&gt;
  &lt;/notes&gt;</pre></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id867930"></a>2.2.&nbsp;Parameters</h3></div></div></div><p>The
  simulation parameters are grouped in several sections, each section giving
  place to a different entry of the simulation parameter menu, as shown in the
  following figure :</p><div class="figure"><a id="id867947"></a><p
  class="title"><b>Figure&nbsp;2.1.&nbsp;Parameter entry menu for the kinetics
  of prey predation by predator<span class="guimenu">
  </span>simulation</b></p><div class="screenshot"><div align="center"
  class="mediaobject"><img align="middle"
  alt="Entrées du menu Paramètres de la simulation de cinétique de prédation de proies par des prédateurs"
  src="images/prey-predator/fen_predation_menu_param.jpg" /></div></div></div><p>The
  choice of an entry causes then the display in the window of the
  corresponding parameters. The following lines introduce and name the
  parameters sections:</p><pre class="programlisting">  &lt;parameters&gt;
    &lt;section&gt;
      &lt;title lang="french"&gt;Paramètres cinétiques&lt;/title&gt;
      &lt;title lang="english"&gt;Kinetic parameters&lt;/title&gt;
      ...
    &lt;/section&gt;
    &lt;section&gt;
      &lt;title lang="french"&gt;Concentrations initiales&lt;/title&gt;
      &lt;title lang="english"&gt;Initial concentrations&lt;/title&gt;
      ...
    &lt;/section&gt;
    &lt;section&gt;
      &lt;title lang="french"&gt;Temps de simulation&lt;/title&gt;
      &lt;title lang="english"&gt;Simulation duration&lt;/title&gt;
      ...
    &lt;/section&gt;
  &lt;/parameters&gt;</pre><p>We now will describe in detail the declaration
  of the parameters of each section, whose corresponding lines appear after
  the multilingual <code class="code">&lt;title&gt;</code> tag in question
  :</p><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id868004"></a>2.2.1.&nbsp;Kinetic
  parameters</h4></div></div></div><p>The data entry of the Lotka-Voltera
  equation parameters is realized in the window illustrated by the following
  figure :</p><div class="figure"><a id="id868025"></a><p
  class="title"><b>Figure&nbsp;2.2.&nbsp;Kinetic parameters data
  entry</b></p><div align="center" class="mediaobject"><img align="middle"
  alt="Saisie des paramètres cinétiques"
  src="images/prey-predator/fen_param_cinetique.jpg" /></div></div><p>This
  section contains the following parameters:</p><div class="itemizedlist"><ul
      type="disc">
      <li><p>Growth rate <code class="code">r</code> of preys without predator
      (j<sup>-1</sup>) :</p><pre class="programlisting">      &lt;scalar increment="0.1" label="<span
            class="bold"><strong>r</strong></span>" max="10" min="0.5"
              unit="d-1" widget="slider"&gt;
        &lt;name lang="french"&gt;
          Vitesse de reproduction des proies sans prédateurs, r (jour-1)
        &lt;/name&gt;
        &lt;name lang="english"&gt;
          Growth rate of preys without predator, r (day-1)
        &lt;/name&gt;
        &lt;value&gt;2&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Mortality <code class="code">k</code> of prey, without predator
      (j<sup>-1</sup>) :</p><pre class="programlisting">      &lt;scalar increment="0.01" label="<span
            class="bold"><strong>k</strong></span>" max="3" min="0.0001"
              unit="d-1" widget="slider"&gt;
        &lt;name lang="french"&gt;
          Mortalité des proies, sans prédateur, k (jour-1)
        &lt;/name&gt;
        &lt;name lang="english"&gt;
          Mortality of prey, without predator, k (day-1)
        &lt;/name&gt;
        &lt;value&gt;0.01&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Predation rate <code class="code">a</code> of prey, per number of
      predator (prédator<sup>-1</sup> . j<sup>-1</sup>) :</p><pre
      class="programlisting">      &lt;scalar increment="0.001" label="<span
            class="bold"><strong>a</strong></span>" max="0.01" min="0.001"
              unit="" widget="slider"&gt;
        &lt;name lang="french"&gt;
          Vitesse de capture des proies par prédateurs, a (prédateur-1 jour-1)
        &lt;/name&gt;
        &lt;name lang="english"&gt;
          Predation rate of prey, per number of predator, a (predator-1 day-1)
        &lt;/name&gt;
        &lt;value&gt;0.001&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Growth rate <code class="code">b</code> of predation, per number
      of eaten prey (prey<sup>-1</sup> . j<sup>-1</sup>) :</p><pre
      class="programlisting">      &lt;scalar increment="0.0005" label="<span
            class="bold"><strong>b</strong></span>" max="0.01" min="0.001"
              unit="" widget="slider"&gt;
        &lt;name lang="french"&gt;
          Vitesse de reproduction des prédateurs, par nombre de proies capturées, b (proie-1 jour-1)
        &lt;/name&gt;
        &lt;name lang="english"&gt;
          Growth rate of predators, per number of eaten prey, b (prey-1 day-1)
        &lt;/name&gt;
        &lt;value&gt;0.002&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Mortality <code class="code">q</code> of predator, without prey
      (j<sup>-1</sup>) :</p><pre class="programlisting">      &lt;scalar increment="0.5" label="<span
            class="bold"><strong>q</strong></span>" max="20" min="0.5"
              unit="d-1" widget="slider"&gt;
        &lt;name lang="french"&gt;
          Mortalité des prédateurs, sans proie, q (jour-1)
        &lt;/name&gt;
        &lt;name lang="english"&gt;
          Mortality of predators, without prey, q (day-1)
        &lt;/name&gt;
        &lt;value&gt;10&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id868223"></a>2.2.2.&nbsp;Initial oncentrations
  </h4></div></div></div><p>The data entry of the initial concentrations of
  preys and predators per square kilometers<sup> </sup> is made in the window
  illustrated by the following figure:</p><div class="figure"><a
  id="id868239"></a><p class="title"><b>Figure&nbsp;2.3.&nbsp;Initial
  concentrations data entry </b></p><div align="center"
  class="mediaobject"><img align="middle"
  alt="Saisie des concentrations initiales"
  src="images/prey-predator/fen_param_concent_init.jpg" /></div></div><p>This
  section contains the following parameters :</p><div class="itemizedlist"><ul
      type="disc">
      <li><p>Initial concentration <code class="code">Prey0</code> of prey
      (per km<sup>2</sup>) :</p><pre class="programlisting">      &lt;scalar increment="1000" label="<span
            class="bold"><strong>Prey0</strong></span>" max="10000" min="0"
              unit="" widget="slider"&gt;
        &lt;name lang="french"&gt;
          Concentration initiale en proie (par km2)
        &lt;/name&gt;
        &lt;name lang="english"&gt;
          Initial concentration of prey (per square km)
        &lt;/name&gt;
        &lt;value&gt;5000&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Initial concentration <code class="code">Predator0 of
      predator</code> (par km<sup>2</sup>) :</p><pre class="programlisting">      &lt;scalar increment="50" label="<span
            class="bold"><strong>Predator0</strong></span>" max="1000" min="1"
              unit="" widget="slider"&gt;
        &lt;name lang="french"&gt;
          Concentration initiale en prédateur (par km2)
        &lt;/name&gt;
        &lt;name lang="english"&gt;
          Initial concentration of predator (per square km)
        &lt;/name&gt;
        &lt;value&gt;100&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id868338"></a>2.2.3.&nbsp;Simulation
  Time</h4></div></div></div><p>Simulation time entry is done in the window
  illustrated by the following figure :</p><div class="figure"><a
  id="id868329"></a><p class="title"><b>Figure&nbsp;2.4.&nbsp;Siimulation time
  entry</b></p><div align="center" class="mediaobject"><img align="middle"
  alt="Saisie du temps de simulation"
  src="images/prey-predator/fen_tps_simulation.jpg" /></div></div><p>This
  section contains the only following parameter :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>Final time <code class="code">final_time</code> (j) :</p><pre
      class="programlisting">      &lt;scalar increment="1" label="<span
            class="bold"><strong>final_time</strong></span>" max="200" min="0.001"
              unit="d" widget="slider"&gt;
        &lt;name lang="french"&gt;Temps final (jour)&lt;/name&gt;
        &lt;name lang="english"&gt;Final time (day)&lt;/name&gt;
        &lt;value&gt;10&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>
    </ul></div></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id868411"></a>2.3.&nbsp;Mathematical
  Models</h3></div></div></div><p>This section - that follows the tag <code
  class="code">&lt;/parameters&gt;</code> - allows to define the equations to
  be solved, the curves to calculate, as well as the window of values (1D or
  2D) that certain variables can take. These different definitions are framed
  by the following tags :</p><pre class="programlisting">  &lt;compute&gt;
  ...
  &lt;/compute&gt;</pre><p>Concerning our simulation of the kinetics of prey
  predation by predators, the following elements are defined :</p><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="id868439" />2.3.1.&nbsp;Definition of the integration
  variable and its discretization interval<code class="code" /> <mml:math
      overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:mrow>
            <mml:mo>[</mml:mo>

            <mml:mrow>
              <mml:mn>0,</mml:mn>

              <mml:mtext> </mml:mtext>

              <mml:mtext> </mml:mtext>

              <mml:mi mathvariant="italic">final</mml:mi>

              <mml:mo>_</mml:mo>

              <mml:mi mathvariant="italic">time</mml:mi>
            </mml:mrow>

            <mml:mo>]</mml:mo>
          </mml:mrow>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></h4></div></div></div><p>They are used for the resolution of
  the differential equation giving the evolution with time of the number of
  preys and predators :</p><pre class="programlisting">    &lt;defdomain1d label="<span
        class="bold"><strong>time</strong></span>" unit="d"&gt;
      &lt;name&gt;Temps&lt;/name&gt;

      &lt;interval discretization="linear" steps="1000"&gt;
        &lt;initialvalue&gt;0&lt;/initialvalue&gt;
        &lt;finalvalue&gt;<span class="bold"><strong>final_time</strong></span>&lt;/finalvalue&gt;
      &lt;/interval&gt;
    &lt;/defdomain1d&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="ex_ode_predation"></a>2.3.2.&nbsp;Definition of the differential
  equations</h4></div></div></div><p>Definition of the element <code
  class="code">ode</code> (<span class="foreignphrase"><em
  class="foreignphrase">ordinary differential equation</em></span>) grouping
  together the reference to the integration variable <code
  class="code">time</code> and to its domain of variation, as well as the
  definition of the states <code class="code">Prey</code> and <code
  class="code">Predator</code>, with its derivative and its initial value for
  each one of them:</p><pre class="programlisting">    &lt;ode label="<span
        class="bold"><strong>predation</strong></span>"&gt;
      &lt;refdomain1d ref="<span class="bold"><strong>time</strong></span>" /&gt;

      &lt;states&gt;
        &lt;state label="<span class="bold"><strong>Prey</strong></span>"&gt;
          &lt;name lang="french"&gt;Concentration en proie (km-2)&lt;/name&gt;
          &lt;name lang="french"&gt;Prey concentration (km-2)&lt;/name&gt;
          &lt;derivative&gt;(<span class="bold"><strong>r</strong></span>*<span
        class="bold"><strong>Prey</strong></span>) - (<span class="bold"><strong>k</strong></span>*<span
        class="bold"><strong>Prey</strong></span>) - (<span class="bold"><strong>a</strong></span>*<span
        class="bold"><strong>Prey</strong></span>*<span class="bold"><strong>Predator</strong></span>)&lt;/derivative&gt;
          &lt;initialcondition&gt;<span class="bold"><strong>Prey0</strong></span>&lt;/initialcondition&gt;
        &lt;/state&gt;

        &lt;state label="<span class="bold"><strong>Predator</strong></span>"&gt;
          &lt;name lang="french"&gt;Concentration en prédateur (km-2)&lt;/name&gt;
          &lt;name lang="french"&gt;Predator concentration (km-2)&lt;/name&gt;
          &lt;derivative&gt;(<span class="bold"><strong>b</strong></span>*<span
        class="bold"><strong>Prey</strong></span>*<span class="bold"><strong>Predator</strong></span>) - (<span
        class="bold"><strong>q</strong></span>*<span class="bold"><strong>Predator</strong></span>)&lt;/derivative&gt;
          &lt;initialcondition&gt;<span class="bold"><strong>Predator0</strong></span>&lt;/initialcondition&gt;
        &lt;/state&gt;
      &lt;/states&gt;

    &lt;/ode&gt;</pre></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id868712"></a>2.3.3.&nbsp;Definition of the phase picture Prey against
  Predator </h4></div></div></div><p>It consists of parametric curve x =
  Prey(t), y = Predator(t) that allows to see the joint evolution of the
  number of preys and the number of predators :</p><pre
  class="programlisting">    &lt;parametriccurve2d label="<span class="bold"><strong>Prey_vs_predator</strong></span>"&gt;
      &lt;name lang="french"&gt;Portrait de phase&lt;/name&gt;
      &lt;name lang="english"&gt;Phase picture&lt;/name&gt;

      &lt;x1&gt;
        &lt;value&gt;<span class="bold"><strong>Prey</strong></span>&lt;/value&gt;
      &lt;/x1&gt;

      &lt;x2&gt;
        &lt;value&gt;<span class="bold"><strong>Predator</strong></span>&lt;/value&gt;
      &lt;/x2&gt;

    &lt;/parametriccurve2d&gt;</pre></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="courbe_predation"></a>2.4.&nbsp;Results
  display</h3></div></div></div><p>This section - wich follows the tag <code
  class="code">&lt;/compute&gt;</code> - allows to define the different
  graphic windows, a set of corresponding axes system (windows can then be
  divided horizontally or vertically) as well as the curves that must be
  respectively displayed in each system of axis. These different definitions
  are framed by the following tags :</p><pre class="programlisting">  &lt;display&gt;
  ...
  &lt;/display&gt;</pre><p>In our case, a single window is vertically divided
  into two systems of Cartesian axes containing the following curves :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>Concentrations in preys and predators per km<sup>2</sup> with
      respect to the time.</p></li>

      <li><p>Phase picture of Prey against Predator.</p></li>
    </ul></div><div class="figure"><a id="id868818"></a><p
  class="title"><b>Figure&nbsp;2.5.&nbsp;Results curves</b></p><div
  align="center" class="mediaobject"><img align="middle"
  alt="Courbes résultats"
  src="images/prey-predator/fen_concentrations.jpg" /></div></div><p>The
  corresponding code is as follows, the previously defined logical curves
  appearing in reference in the definition of the curves to display :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>Curve <code class="code">Prey</code> of the evolution of the
      concentration of preys and curve <code class="code">Predator</code> of
      the predators,</p></li>

      <li><p>Phase picture : <code class="code"><code
      class="code">Prey_vs_predator</code></code>.</p></li>
    </ul></div><pre class="programlisting">  &lt;display&gt;
    &lt;window <span class="bold"><strong>splity="2"</strong></span>&gt;
      &lt;title lang="french"&gt;Résultats&lt;/title&gt;
      &lt;title lang="english"&gt;Results&lt;/title&gt;

      &lt;axis2d&gt;
        &lt;drawcurve2d color="red" ref="<span class="bold"><strong>Prey</strong></span>" thickness="2" /&gt;
        &lt;drawcurve2d color="green" ref="<span class="bold"><strong>Predator</strong></span>" thickness="2" /&gt;
      &lt;/axis2d&gt;

      &lt;axis2d&gt;
        &lt;drawcurve2d ref="<span class="bold"><strong>Prey_vs_predator</strong></span>" /&gt;
      &lt;/axis2d&gt;

    &lt;/window&gt;
  &lt;/display&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="id868921"></a>2.5. Saving simulation results </h3></div></div></div><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="id868928"></a>2.5.1.&nbsp;Saving simulation
  results</h4></div></div></div><p>It is accessible via the menu entry <span
  class="guimenuitem">File-&gt;Save the results of the simulation for this
  simulation, thanks to the following lines specifying the default file of
  saving, as well </span>as the list of the parameters and the results to save
  :</p><pre class="programlisting">  &lt;save&gt;
    &lt;file format="csv" href="essai.csv"
          labels="r k a b q time Prey Predator" /&gt;
  &lt;/save&gt;</pre><p>Here is the appearance of an example of CSV file
  obtained , the tag <code class="code">name</code> of each parameter or
  result preceding its value :</p><pre class="programlisting">"Growth rate of preys without predator, r (jour-1) : ",2.000000,
"Mortality of prey, without predator, k (jour-1) : ",0.001000,
"Predation rate of prey, per number of predator, a (prédateur-1 jour-1) : ",0.005000,
"Growth rate of predators, per number of eaten prey,
 b (proie-1 jour-1) : ",0.002000,
"Temps : ",0.000000,0.010010,...,10.000000,
"Prey concentratione (km-2) : ",5000.000000,5096.003572,...,3358.727460,
"Predator concentration (km-2) : ",100.000000,100.095849,...,144.851043,</pre></div></div></div></div><div
  class="chapter" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h2
  class="title"><a id="id868982"></a>Chapter 3.&nbsp;Simulation of monoacides
  titration </h2></div></div></div><div class="toc"><p><b>Table of
  contents</b></p><dl>
      <dt><span class="section"><a href="#id869009">1. Chemical description of
      the simulation</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id869015">1.1. Calculation
          principle</a></span></dt>

          <dt><span class="section"><a href="#id869605">1.2. Characteristics
          of the analyte and titrant species</a></span></dt>

          <dt><span class="section"><a href="#id869829">1.3. &nbsp;Partition
          coefficients </a></span></dt>

          <dt><span class="section"><a href="#id870829">1.4. Titration
          data</a></span></dt>

          <dt><span class="section"><a href="#id870959">1.5.
          Equations</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id870964">1.5.1. Electric
              charge of the medium calculation</a></span></dt>

              <dt><span class="section"><a href="#id871194">1.5.2. Partition
              coefficients calculation</a></span></dt>
            </dl></dd>
        </dl></dd>

      <dt><span class="section"><a href="#id871759">2. Logics of the
      description in XML of the simulation</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id871790">2.1. General
          description </a></span></dt>

          <dt><span class="section"><a href="#id871817">2.2.
          Parameters</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id871895">2.2.1.
              Analyte&nbsp;choice</a></span></dt>

              <dt><span class="section"><a href="#id872114">2.2.2. Titrant
              choice</a></span></dt>

              <dt><span class="section"><a href="#param_titrage">2.2.3.
              Titration &nbsp;parameters</a></span></dt>

              <dt><span class="section"><a href="#points_experimentaux">2.2.4.
              Experimental data</a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#id872393">2.3. Mathematical
          models</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#c_titrant">2.3.1. Definition
              of the titrant concentration</a></span></dt>

              <dt><span class="section"><a href="#calcul_ph">2.3.2. pH
              calculation using the dichotomic method</a></span></dt>

              <dt><span class="section"><a href="#id873174">2.3.3. Definition
              of the experimental data curve</a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#courbe_ph">2.4. Results
          display</a></span></dt>

          <dt><span class="section"><a href="#id873426">2.5.&nbsp;Session and
          results simulation saving </a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id873434">2.5.1. Saving and
              downloading the session</a></span></dt>

              <dt><span class="section"><a href="#id873482">2.5.2. Saving the
              results of the simulation</a></span></dt>
            </dl></dd>
        </dl></dd>
    </dl></div><p>This exemple corresponds to the <code
  class="filename">Acid-equilibria/Simple_acid_alkali_titrat.xml</code> file
  of the sub-directory <code class="filename">examples</code> of the <span
  class="emphasis"><em>XMLlab</em></span> installation directory .</p><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h2
  class="title" style="clear: both"><a id="id869009"></a>1.&nbsp;Chemical
  description of the simulation</h2></div></div></div><div class="section"
  lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h3
  class="title"><a id="id869015"></a>1.1.&nbsp;Calculation
  principle</h3></div></div></div><p>The pH of the medium containing the
  analyte is calculated for an increasing concentration of the titrant, pH can
  be plotted as function of the concentration volume by titrant added (it is
  supposed that during titration there is no variation of volume), as well as
  the coefficients of partition of the analyte according to the concentration
  by titrant added.</p><p>The pH of the medium is calculated in a dichotomic
  way by cancelling the electric charge of the medium. The equation of
  electroneutrality states indeed that the positive and negative charges in
  balance aqueous media. The positive charges come from the ions <mml:math
      overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mtext>H</mml:mtext>

            <mml:mtext>3</mml:mtext>
          </mml:msub>

          <mml:msup>
            <mml:mtext>O</mml:mtext>

            <mml:mtext>+</mml:mtext>
          </mml:msup>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math> <mml:math overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msup>
            <mml:mrow>
              <mml:mtext>and possibly from certain forms of the analyte and/or
              the titrant, the negative charges come from the ions
              OH</mml:mtext>
            </mml:mrow>

            <mml:mtext>-</mml:mtext>
          </mml:msup>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math> and possibly from certain forms of the analyte and/or the
  titrant. The equations below show that the concentrations in ions <mml:math
      overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msup>
            <mml:mrow>
              <mml:mtext>OH</mml:mtext>
            </mml:mrow>

            <mml:mtext>-</mml:mtext>
          </mml:msup>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math> and the concentrations of the forms of the analyte and titrant
  can be expressed as a function of the concentrations in ions <mml:math
      overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mtext>H</mml:mtext>

            <mml:mtext>3</mml:mtext>
          </mml:msub>

          <mml:msup>
            <mml:mtext>O</mml:mtext>

            <mml:mtext>+</mml:mtext>
          </mml:msup>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math> and such as constants of acidity or initial concentrations. In
  other words, the calculation of the pH consists of determining the right
  concentration in ion <mml:math overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mtext>H</mml:mtext>

            <mml:mtext>3</mml:mtext>
          </mml:msub>

          <mml:msup>
            <mml:mtext>O</mml:mtext>

            <mml:mtext>+</mml:mtext>
          </mml:msup>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math> that satisfies the equation of electroneutrality. For memory
  the pH is equal to <mml:math overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mrow>
              <mml:mtext>-log</mml:mtext>
            </mml:mrow>

            <mml:mrow>
              <mml:mtext>10</mml:mtext>
            </mml:mrow>
          </mml:msub>

          <mml:mtext> </mml:mtext>

          <mml:mrow>
            <mml:mo>[</mml:mo>

            <mml:mrow>
              <mml:msub>
                <mml:mtext>H</mml:mtext>

                <mml:mtext>3</mml:mtext>
              </mml:msub>

              <mml:msup>
                <mml:mtext>O</mml:mtext>

                <mml:mtext>+</mml:mtext>
              </mml:msup>
            </mml:mrow>

            <mml:mo>]</mml:mo>
          </mml:mrow>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math>. The dichotomic method allows to solve this problem by
  considering that :</p><div class="itemizedlist"><ul type="disc">
      <li><p>the pH to be determined is limited in aqueous medium between 0
      and 14,</p></li>

      <li><p>if pH imposed for calculation is lower than the «true» pH , the
      charge of the medium is positive,</p></li>

      <li><p>if pH imposed for calculation is higher than the «true » pH, the
      charge of the medium is negative,</p></li>

      <li><p>the two proposals above permits to write a convergence condition
      of the imposed pH for calculation towards the « true » pH according to
      the equations below :</p><table border="0" class="simplelist"
          summary="Simple list">
          <tr>
            <td><mml:math display="block" overflow="scroll"
                xmlns:mml="http://www.w3.org/1998/Math/MathML">
                <mml:semantics definitionURL="" encoding="">
                  <mml:mrow>
                    <mml:mtext>if&nbsp;charge&nbsp;&lt;&nbsp;0</mml:mtext>

                    <mml:msub>
                      <mml:mrow>
                        <mml:mtext>,&nbsp;then&nbsp;pH</mml:mtext>
                      </mml:mrow>

                      <mml:mrow>
                        <mml:mtext>iteration_n+1</mml:mtext>
                      </mml:mrow>
                    </mml:msub>

                    <mml:msub>
                      <mml:mrow>
                        <mml:mtext>&nbsp;&nbsp;=&nbsp;&nbsp;pH</mml:mtext>
                      </mml:mrow>

                      <mml:mrow>
                        <mml:mtext>iteration_n</mml:mtext>
                      </mml:mrow>
                    </mml:msub>

                    <mml:mtext>&nbsp;-&nbsp;</mml:mtext>

                    <mml:mrow>
                      <mml:mo>(</mml:mo>

                      <mml:mrow>
                        <mml:mtext>14&nbsp;*&nbsp;0</mml:mtext>

                        <mml:msup>
                          <mml:mrow>
                            <mml:mtext>.5</mml:mtext>
                          </mml:mrow>

                          <mml:mtext>n</mml:mtext>
                        </mml:msup>
                      </mml:mrow>

                      <mml:mo>)</mml:mo>
                    </mml:mrow>
                  </mml:mrow>

                  <mml:annotation encoding="MathType-MTEF" />
                </mml:semantics>
              </mml:math></td>
          </tr>

          <tr>
            <td><mml:math display="block" overflow="scroll"
                xmlns:mml="http://www.w3.org/1998/Math/MathML">
                <mml:semantics definitionURL="" encoding="">
                  <mml:mrow>
                    <mml:mtext>if&nbsp;charge&nbsp;&gt;&nbsp;0</mml:mtext>

                    <mml:msub>
                      <mml:mrow>
                        <mml:mtext>,&nbsp;then&nbsp;pH</mml:mtext>
                      </mml:mrow>

                      <mml:mrow>
                        <mml:mtext>iteration_n+1</mml:mtext>
                      </mml:mrow>
                    </mml:msub>

                    <mml:msub>
                      <mml:mrow>
                        <mml:mtext>&nbsp;&nbsp;=&nbsp;&nbsp;pH</mml:mtext>
                      </mml:mrow>

                      <mml:mrow>
                        <mml:mtext>iteration_n</mml:mtext>
                      </mml:mrow>
                    </mml:msub>

                    <mml:mtext>&nbsp;+&nbsp;</mml:mtext>

                    <mml:mrow>
                      <mml:mo>(</mml:mo>

                      <mml:mrow>
                        <mml:mtext>14&nbsp;*&nbsp;0</mml:mtext>

                        <mml:msup>
                          <mml:mrow>
                            <mml:mtext>.5</mml:mtext>
                          </mml:mrow>

                          <mml:mtext>n</mml:mtext>
                        </mml:msup>
                      </mml:mrow>

                      <mml:mo>)</mml:mo>
                    </mml:mrow>
                  </mml:mrow>

                  <mml:annotation encoding="MathType-MTEF" />
                </mml:semantics>
              </mml:math></td>
          </tr>
        </table></li>

      <li><p>15 iterations of calculation according to above expressions are
      sufficient to obtain a pH with an accuracy of 0.005 units of
      pH.</p></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id869605"></a>1.2.&nbsp;Characteristics of the analyte and titrant
  species</h3></div></div></div><p>In this simple example, acids having only
  one function of acidity, titrated by bases having also only one function of
  acidity are considered . The user chooses among some acids and bases whose
  constants of acidity are already introduced (value at 25°C) :</p><div
  class="informaltable"><table border="1">
      <colgroup>
        <col />

        <col />
      </colgroup>

      <thead>
        <tr>
          <th align="left" class="padding-3">Name</th>

          <th align="center" class="padding-3"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:mtext>p</mml:mtext>

                  <mml:msub>
                    <mml:mi>K</mml:mi>

                    <mml:mi>a</mml:mi>
                  </mml:msub>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td align="left" class="padding-3">Hydrochloric acid</td>

          <td align="center" class="padding-3">-7</td>
        </tr>

        <tr>
          <td align="left" class="padding-3">Dichloroethanoic acid</td>

          <td align="center" class="padding-3">1.29</td>
        </tr>

        <tr>
          <td align="left" class="padding-3">Ethanoic acid</td>

          <td align="center" class="padding-3">4.756</td>
        </tr>

        <tr>
          <td align="left" class="padding-3">Methanoic acid</td>

          <td align="center" class="padding-3">3.74</td>
        </tr>

        <tr>
          <td align="left" class="padding-3">Salicylic acid</td>

          <td align="center" class="padding-3">2.75</td>
        </tr>

        <tr>
          <td align="left" class="padding-3">Ammonium hydroxide</td>

          <td align="center" class="padding-3">9.24</td>
        </tr>

        <tr>
          <td align="left" class="padding-3">Sodium hydroxide</td>

          <td align="center" class="padding-3">14.8</td>
        </tr>
      </tbody>
    </table></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id869829"></a>1.3.&nbsp;Partition coefficients
  </h3></div></div></div><p>The partition coefficients of the various forms of
  the analyte vary as a function of pH of the solution and values of the
  constant of acidity. They are expressed in the equations below by the symbol
  <mml:math overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mi>α</mml:mi>

            <mml:mn>0</mml:mn>
          </mml:msub>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math> and <mml:math overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mi>α</mml:mi>

            <mml:mn>1</mml:mn>
          </mml:msub>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math>. The coefficient <mml:math overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mi>α</mml:mi>

            <mml:mn>1</mml:mn>
          </mml:msub>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math> corresponds to the acid, that is to say the protonic form,
  while the coefficient <mml:math overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mi>α</mml:mi>

            <mml:mn>0</mml:mn>
          </mml:msub>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math> relates to the conjugate base, that is to say the anionic
  form. Considering unspecified acid HA giving the conjugate base
  A<sup>-</sup> :</p><div class="informaltable"><table border="0">
      <colgroup>
        <col />

        <col />
      </colgroup>

      <tbody>
        <tr>
          <td align="left" class="padding-r20-b10"><mml:math display="block"
              overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:msub>
                    <mml:mi>α</mml:mi>

                    <mml:mtext>1</mml:mtext>
                  </mml:msub>

                  <mml:mtext>&nbsp;&nbsp;=&nbsp;&nbsp;</mml:mtext>

                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mtext>HA</mml:mtext>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mtext>HA</mml:mtext>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>

                      <mml:mtext>&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msup>
                            <mml:mtext>A</mml:mtext>

                            <mml:mtext>-</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>

          <td align="left" class="padding-r20-b10"><mml:math display="block"
              overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:msub>
                    <mml:mi>α</mml:mi>

                    <mml:mtext>0</mml:mtext>
                  </mml:msub>

                  <mml:mtext>&nbsp;&nbsp;=&nbsp;&nbsp;</mml:mtext>

                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msup>
                            <mml:mtext>A</mml:mtext>

                            <mml:mtext>-</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mtext>HA</mml:mtext>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>

                      <mml:mtext>&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msup>
                            <mml:mtext>A</mml:mtext>

                            <mml:mtext>-</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>
        </tr>
      </tbody>
    </table></div><div class="informaltable"><table border="1">
      <colgroup>
        <col />

        <col />

        <col />
      </colgroup>

      <thead>
        <tr>
          <th align="center" class="padding-3" colspan="3">Exemples</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td align="left" class="padding-3">&nbsp;</td>

          <td align="center" class="padding-3">Hydrochloric acid (HCl)</td>

          <td align="center" class="padding-3">Sodium hydroxide (NaOH)</td>
        </tr>

        <tr>
          <td align="left" class="padding-3"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:msub>
                    <mml:mi>α</mml:mi>

                    <mml:mn>1</mml:mn>
                  </mml:msub>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>

          <td align="center" class="padding-3"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mtext>HCl</mml:mtext>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mtext>HCl</mml:mtext>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>

                      <mml:mtext>&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msup>
                            <mml:mrow>
                              <mml:mtext>Cl</mml:mtext>
                            </mml:mrow>

                            <mml:mtext>-</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>

          <td align="center" class="padding-3"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msup>
                            <mml:mrow>
                              <mml:mtext>Na</mml:mtext>
                            </mml:mrow>

                            <mml:mtext>+</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msup>
                            <mml:mrow>
                              <mml:mtext>Na</mml:mtext>
                            </mml:mrow>

                            <mml:mtext>+</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>

                      <mml:mtext>&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mtext>NaOH</mml:mtext>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>
        </tr>

        <tr>
          <td align="left" class="padding-3"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:msub>
                    <mml:mi>α</mml:mi>

                    <mml:mn>0</mml:mn>
                  </mml:msub>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>

          <td align="center" class="padding-3"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msup>
                            <mml:mrow>
                              <mml:mtext>Cl</mml:mtext>
                            </mml:mrow>

                            <mml:mtext>-</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mtext>HCl</mml:mtext>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>

                      <mml:mtext>&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msup>
                            <mml:mrow>
                              <mml:mtext>Cl</mml:mtext>
                            </mml:mrow>

                            <mml:mtext>-</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>

          <td align="center" class="padding-3"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mtext>NaOH</mml:mtext>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msup>
                            <mml:mrow>
                              <mml:mtext>Na</mml:mtext>
                            </mml:mrow>

                            <mml:mtext>+</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>

                      <mml:mtext>&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:mtext>NaOH</mml:mtext>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>
        </tr>
      </tbody>
    </table></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id870829"></a>1.4.&nbsp;Titration data</h3></div></div></div><p>In
  addition to the choice of the analyte and titrant, parameters below are to
  be fixed.</p><div class="informaltable"><table border="1">
      <colgroup>
        <col />

        <col />
      </colgroup>

      <thead>
        <tr>
          <th align="left" class="padding-3">Parameters</th>

          <th align="left" class="padding-3">Label in the XML file</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td class="padding-3">Analyte concentration</td>

          <td class="padding-3"><code class="code">c_analyte</code></td>
        </tr>

        <tr>
          <td class="padding-3">Number of intermediate values for
          calculation</td>

          <td class="padding-3"><code
          class="code">simulation_steps</code></td>
        </tr>
      </tbody>
    </table></div><p>The concentration of the titrant varies by default from 0
  to one and a half of the concentration of the analyte in order to visualize
  correctely the jump of pH at the equivalent point.</p><p> </p><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id870959"></a>1.5.&nbsp;Equations</h3></div></div></div><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="id870964"></a>1.5.1.&nbsp; Electric charge of the
  medium calculation </h4></div></div></div><table border="0"
      class="simplelist" summary="Simple list">
      <tr>
        <td><mml:math overflow="scroll"
            xmlns:mml="http://www.w3.org/1998/Math/MathML">
            <mml:semantics definitionURL="" encoding="">
              <mml:mrow>
                <mml:mtext>charge&nbsp;&nbsp;=&nbsp;&nbsp;</mml:mtext>

                <mml:mrow>
                  <mml:mo>[</mml:mo>

                  <mml:mrow>
                    <mml:msub>
                      <mml:mtext>H</mml:mtext>

                      <mml:mtext>3</mml:mtext>
                    </mml:msub>

                    <mml:msup>
                      <mml:mtext>O</mml:mtext>

                      <mml:mtext>+</mml:mtext>
                    </mml:msup>
                  </mml:mrow>

                  <mml:mo>]</mml:mo>
                </mml:mrow>

                <mml:mtext>&nbsp;-&nbsp;&nbsp;</mml:mtext>

                <mml:mfrac>
                  <mml:mrow>
                    <mml:mn>1</mml:mn>

                    <mml:msup>
                      <mml:mrow>
                        <mml:mtext>&nbsp;10</mml:mtext>
                      </mml:mrow>

                      <mml:mrow>
                        <mml:mtext>-14</mml:mtext>
                      </mml:mrow>
                    </mml:msup>
                  </mml:mrow>

                  <mml:mrow>
                    <mml:mrow>
                      <mml:mo>[</mml:mo>

                      <mml:mrow>
                        <mml:msub>
                          <mml:mtext>H</mml:mtext>

                          <mml:mtext>3</mml:mtext>
                        </mml:msub>

                        <mml:msup>
                          <mml:mtext>O</mml:mtext>

                          <mml:mtext>+</mml:mtext>
                        </mml:msup>
                      </mml:mrow>

                      <mml:mo>]</mml:mo>
                    </mml:mrow>
                  </mml:mrow>
                </mml:mfrac>

                <mml:mtext>&nbsp;-&nbsp;&nbsp;charge_analyte&nbsp;&nbsp;+&nbsp;&nbsp;charge_titrant</mml:mtext>
              </mml:mrow>

              <mml:annotation encoding="MathType-MTEF" />
            </mml:semantics>
          </mml:math></td>
      </tr>

      <tr>
        <td><mml:math overflow="scroll"
            xmlns:mml="http://www.w3.org/1998/Math/MathML">
            <mml:semantics definitionURL="" encoding="">
              <mml:mrow>
                <mml:mtext>charge_analyte&nbsp;&nbsp;=&nbsp;&nbsp;c_analyte&nbsp;*&nbsp;</mml:mtext>

                <mml:msub>
                  <mml:mi>α</mml:mi>

                  <mml:mtext>0</mml:mtext>
                </mml:msub>

                <mml:mtext>_analyte&nbsp;</mml:mtext>
              </mml:mrow>

              <mml:annotation encoding="MathType-MTEF" />
            </mml:semantics>
          </mml:math></td>
      </tr>

      <tr>
        <td><mml:math overflow="scroll"
            xmlns:mml="http://www.w3.org/1998/Math/MathML">
            <mml:semantics definitionURL="" encoding="">
              <mml:mrow>
                <mml:mtext>charge_titrant&nbsp;&nbsp;=&nbsp;&nbsp;c_titrant&nbsp;*&nbsp;</mml:mtext>

                <mml:msub>
                  <mml:mi>α</mml:mi>

                  <mml:mtext>1</mml:mtext>
                </mml:msub>

                <mml:mtext>_titrant</mml:mtext>
              </mml:mrow>

              <mml:annotation encoding="MathType-MTEF" />
            </mml:semantics>
          </mml:math></td>
      </tr>
    </table></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id871194"></a>1.5.2.&nbsp;Partition coefficients
  calculation</h4></div></div></div><div class="informaltable"><table
      border="0">
      <colgroup>
        <col align="left" />

        <col align="left" />
      </colgroup>

      <tbody>
        <tr>
          <td align="left" class="padding-r20-b10"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:msubsup>
                    <mml:mi>α</mml:mi>

                    <mml:mtext>1</mml:mtext>

                    <mml:mrow />
                  </mml:msubsup>

                  <mml:mtext>_analyte&nbsp;&nbsp;=&nbsp;&nbsp;</mml:mtext>

                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msub>
                            <mml:mtext>H</mml:mtext>

                            <mml:mtext>3</mml:mtext>
                          </mml:msub>

                          <mml:msup>
                            <mml:mtext>O</mml:mtext>

                            <mml:mtext>+</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:msub>
                        <mml:mrow>
                          <mml:mtext>&nbsp;K</mml:mtext>
                        </mml:mrow>

                        <mml:mtext>a</mml:mtext>
                      </mml:msub>

                      <mml:mo>_</mml:mo>

                      <mml:mtext>analyte&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msub>
                            <mml:mtext>H</mml:mtext>

                            <mml:mtext>3</mml:mtext>
                          </mml:msub>

                          <mml:msup>
                            <mml:mtext>O</mml:mtext>

                            <mml:mtext>+</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>

          <td align="left" class="padding-r20-b10"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:msubsup>
                    <mml:mi>α</mml:mi>

                    <mml:mtext>0</mml:mtext>

                    <mml:mrow />
                  </mml:msubsup>

                  <mml:mtext>_analyte&nbsp;&nbsp;=&nbsp;&nbsp;</mml:mtext>

                  <mml:mfrac>
                    <mml:mrow>
                      <mml:msub>
                        <mml:mtext>K</mml:mtext>

                        <mml:mtext>a</mml:mtext>
                      </mml:msub>

                      <mml:mo>_</mml:mo>

                      <mml:mtext>analyte</mml:mtext>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:msub>
                        <mml:mrow>
                          <mml:mtext>&nbsp;K</mml:mtext>
                        </mml:mrow>

                        <mml:mtext>a</mml:mtext>
                      </mml:msub>

                      <mml:mo>_</mml:mo>

                      <mml:mtext>analyte&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msub>
                            <mml:mtext>H</mml:mtext>

                            <mml:mtext>3</mml:mtext>
                          </mml:msub>

                          <mml:msup>
                            <mml:mtext>O</mml:mtext>

                            <mml:mtext>+</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>
        </tr>

        <tr>
          <td align="left" class="padding-r20-b10"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:msubsup>
                    <mml:mi>α</mml:mi>

                    <mml:mtext>1</mml:mtext>

                    <mml:mrow />
                  </mml:msubsup>

                  <mml:mtext>_titrant&nbsp;&nbsp;=&nbsp;&nbsp;</mml:mtext>

                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msub>
                            <mml:mtext>H</mml:mtext>

                            <mml:mtext>3</mml:mtext>
                          </mml:msub>

                          <mml:msup>
                            <mml:mtext>O</mml:mtext>

                            <mml:mtext>+</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:msub>
                        <mml:mrow>
                          <mml:mtext>&nbsp;K</mml:mtext>
                        </mml:mrow>

                        <mml:mtext>a</mml:mtext>
                      </mml:msub>

                      <mml:mo>_</mml:mo>

                      <mml:mtext>titrant&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msub>
                            <mml:mtext>H</mml:mtext>

                            <mml:mtext>3</mml:mtext>
                          </mml:msub>

                          <mml:msup>
                            <mml:mtext>O</mml:mtext>

                            <mml:mtext>+</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>

          <td align="left" class="padding-r20-b10"><mml:math overflow="scroll"
              xmlns:mml="http://www.w3.org/1998/Math/MathML">
              <mml:semantics definitionURL="" encoding="">
                <mml:mrow>
                  <mml:msubsup>
                    <mml:mi>α</mml:mi>

                    <mml:mtext>0</mml:mtext>

                    <mml:mrow />
                  </mml:msubsup>

                  <mml:mtext>_titrant&nbsp;&nbsp;=&nbsp;&nbsp;</mml:mtext>

                  <mml:mfrac>
                    <mml:mrow>
                      <mml:msub>
                        <mml:mtext>K</mml:mtext>

                        <mml:mtext>a</mml:mtext>
                      </mml:msub>

                      <mml:mo>_</mml:mo>

                      <mml:mtext>titrant</mml:mtext>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:msub>
                        <mml:mrow>
                          <mml:mtext>&nbsp;K</mml:mtext>
                        </mml:mrow>

                        <mml:mtext>a</mml:mtext>
                      </mml:msub>

                      <mml:mo>_</mml:mo>

                      <mml:mtext>titrant&nbsp;+&nbsp;</mml:mtext>

                      <mml:mrow>
                        <mml:mo>[</mml:mo>

                        <mml:mrow>
                          <mml:msub>
                            <mml:mtext>H</mml:mtext>

                            <mml:mtext>3</mml:mtext>
                          </mml:msub>

                          <mml:msup>
                            <mml:mtext>O</mml:mtext>

                            <mml:mtext>+</mml:mtext>
                          </mml:msup>
                        </mml:mrow>

                        <mml:mo>]</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mfrac>
                </mml:mrow>

                <mml:annotation encoding="MathType-MTEF" />
              </mml:semantics>
            </mml:math></td>
        </tr>
      </tbody>
    </table></div></div></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h2 class="title"
  style="clear: both"><a id="id871759"></a>2.&nbsp;&nbsp;Logics of the
  description in XML of the simulation </h2></div></div></div><p>We will show
  how this simulation is translated into a XML file that the <span
  class="emphasis"><em>XMLlab</em></span> tool will use to generate a
  simulation executed by <span class="emphasis"><em>Scilab</em></span>. The
  XML file will be shown in its textual form. Only elements of simulation not
  yet treated in the document Getting started<em class="citetitle">
  XMLlab</em> will be particularly detailed.</p><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="id871790"></a>2.1.&nbsp;General description
  </h3></div></div></div><p>The heading lines of the XML file always allow to
  associate to it the DTD of XMLlab, the following heading lines of simulation
  allowing to specify its title, its author, the date and the keywords related
  to it, show that the attribute of a title tag permits to internationalize
  the IHM of the simulation. It is also the case for all the tags of the
  wording intended to be displayed montrent que l'attribut <code
  class="code">lang</code> d'une balise de titre permet d'internationaliser
  l'IHM de la simulation. It is the same for all the tags including textual
  contents to be displayed.</p><pre class="programlisting">&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;!DOCTYPE simulation PUBLIC "-//UTC//DTD XMLlab V1.4//FR"
"http://xmllab.org/dtd/1.4/simulation.dtd"&gt;
&lt;simulation&gt;
  &lt;header&gt;
    &lt;title lang="french"&gt;Simulation de titrage de monoacides&lt;/title&gt;

    &lt;title lang="english"&gt;Simulation of a single acid titration&lt;/title&gt;

    &lt;author&gt;Pauss André, Guillot Ivan, Mottelet Stéphane&lt;/author&gt;

    &lt;date&gt;June 2005&lt;/date&gt;

    &lt;keywords&gt;simulation,scilab,xml&lt;/keywords&gt;
  &lt;/header&gt;
  ...</pre></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id871817"></a>2.2.&nbsp;Parameters</h3></div></div></div><p>The
  simulation parameters are grouped in several sections, each section giving
  place to a different entry of the Parameter menu of the simulation as showns
  in the following figure :</p><div class="figure"><a
  id="fig_menu_parametres"></a><p
  class="title"><b>Figure&nbsp;3.1.&nbsp;P<span class="guimenu">arameters
  entry menu </span> of a mono acid titration simulation</b></p><div
  class="screenshot"><div align="center" class="mediaobject"><img
  align="middle"
  alt="Entrées du menu Paramètres de la simulation de titrage de monoacides"
  src="images/Acid_base_titration/fen_titrage_menu_param.jpg" /></div></div></div><p>The
  choice of an entry causes then a display in the window of the corresponding
  parameters. The following lines introduce and name the parameter
  sections:</p><pre class="programlisting">  &lt;parameters&gt;
    &lt;section&gt;
      &lt;title lang="french"&gt;Choix de l'espèce à titrer&lt;/title&gt;
      &lt;title lang="english"&gt;Choice of the analyte&lt;/title&gt;
      ...
    &lt;/section&gt;
    &lt;section&gt;
      &lt;title lang="french"&gt;Choix du titrant&lt;/title&gt;
      &lt;title lang="english"&gt;Choice of the titrant&lt;/title&gt;
      ...
    &lt;/section&gt;
    &lt;section&gt;
      &lt;title lang="french"&gt;Paramètres du titrage&lt;/title&gt;
      &lt;title lang="english"&gt;Parameters of the titration&lt;/title&gt;
      ...
    &lt;/section&gt;
    &lt;section&gt;
      &lt;title lang="french"&gt;Points expérimentaux&lt;/title&gt;
      &lt;title lang="english"&gt;Experimental data&lt;/title&gt;
      ...
    &lt;/section&gt;
  &lt;/parameters&gt;</pre><p>We now will describe in detail the declaration
  of the parameters of each section, whose corresponding lines appear after
  the multilingual <code class="code">&lt;title&gt;</code> tags in
  question:</p><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a id="id871895"></a>2.2.1.
  Analyte&nbsp;Choice</h4></div></div></div><p>This choice is done in the
  window illustrated by the following figure :</p><div class="figure"><a
  id="id871915"></a><p class="title"><b>Figure&nbsp;3.2.&nbsp;Analyte
  choice</b></p><div align="center" class="mediaobject"><img align="middle"
  alt="Choix de l'espèce à titrer"
  src="images/Acid_base_titration/fen_param_espece_a_titrer.jpg" /></div></div><p>Actually,
  it consists of a database containing scalar parameters (here only one, the
  pKa) for each analyte. For each one of them, a parameter values set is
  named. For instance, the figure above presents the value set of Hydrochloric
  acid parameters<span class="guimenuitem"> </span>.</p><p>It is also possible
  to specify that all the value sets can be modified (cf. <a
  href="#balise_database" title="2.2.&nbsp;Balise database">Section&nbsp;2.2,
  «&nbsp;<code class="code">Database tag</code>&nbsp;»</a> for the details of
  the <code class="code">database tag</code>).</p><p>The following lines show
  the structure of the definition of this whole value sets :</p><pre
  class="programlisting">      &lt;database&gt;

        &lt;scalar ... label="database_tag" ...&gt;
          ... <em><span class="remark">definition of the first and sole parameter</span></em>
        &lt;/scalar&gt;

        &lt;record&gt;
          &lt;name lang="english"&gt;Hydrochloric acid&lt;/name&gt;
          ... <em><span class="remark">definition of the first value set  </span></em>
          ... <em><span class="remark">for all parameters</span></em>
        &lt;/record&gt;
        ...
        ...
        &lt;record&gt;
          &lt;name lang="english"&gt;Salicylic acid&lt;/name&gt;
          ... <em><span class="remark">definition of the last value set  </span></em>
          ... <em><span class="remark">for all parameters</span></em>
        &lt;/record&gt;

      &lt;/database&gt;</pre><p>Let us now examine this structure a little
  more in detail :</p><div class="itemizedlist"><ul type="disc">
      <li><p>Definition of all the parameters by specifying for each of them
      the <code class="code">label</code> identifying it, its name, the <span
      class="foreignphrase"><em class="foreignphrase">widget</em></span> used
      for its entry (<code class="code">entry</code> by defaut : text field),
      as well as its range of validity and its step of variation, useful for
      example if the <span class="foreignphrase"><em
      class="foreignphrase">widget</em></span> chosen is a slider (<code
      class="code">slider</code>). Here, the only parameter <code
      class="code">pKa_analyte</code> is not modifiable for a given set of
      values:</p><pre class="programlisting">        ...
        &lt;scalar increment="0.1" label="<span class="bold"><strong>pKa_analyte</strong></span>"
                max="20" min="-10" state="disabled"&gt;
          &lt;name lang="french"&gt;pKa&lt;/name&gt;
          &lt;name lang="english"&gt;pKa&lt;/name&gt;
          &lt;value&gt;4&lt;/value&gt;
        &lt;/scalar&gt;
        ...</pre></li>

      <li><p>Definition of the whole set of the values for these parameters,
      with for each one of them its multilingual name and the corresponding
      value for each defined parameter :</p><pre class="programlisting">        ...
        &lt;record&gt;
          &lt;name lang="french"&gt;Acide chlorhydrique&lt;/name&gt;
          &lt;name lang="english"&gt;Hydrochloric acid&lt;/name&gt;
          &lt;scalar-value ref="<span class="bold"><strong>pKa_analyte</strong></span>"&gt;-7&lt;/scalar-value&gt;
        &lt;/record&gt;

        &lt;record&gt;
          &lt;name lang="english"&gt;Dichloroethanoic acid&lt;/name&gt;
          ...
        &lt;/record&gt;

        &lt;record&gt;
          &lt;name lang="english"&gt;Ethanoic acid&lt;/name&gt;
          ...
        &lt;/record&gt;

        &lt;record&gt;
          &lt;name lang="english"&gt;Methanoic acid&lt;/name&gt;
          ...
        &lt;/record&gt;

        &lt;record&gt;
          &lt;name lang="english"&gt;Salicylic acid&lt;/name&gt;
          ...
        &lt;/record&gt;
        ...</pre></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id872114"></a>2.2.2.&nbsp;Titrant Choice</h4></div></div></div><p>This
  choice is done in the window illustrated by the following figure :</p><div
  class="figure"><a id="id872111"></a><p
  class="title"><b>Figure&nbsp;3.3.&nbsp;Titrant choice</b></p><div
  align="center" class="mediaobject"><img align="middle"
  alt="Choix du titrant"
  src="images/Acid_base_titration/fen_param_titrant.jpg" /></div></div><p>Once
  againt, it consists of a database containing a scalar parameter for each
  titrant.</p><p>The structure of the definition of this whole value sets is
  the same one as previously :</p><div class="itemizedlist"><ul type="disc">
      <li><p>Definition of the parameters set :</p><pre
      class="programlisting">      &lt;database&gt;

        &lt;scalar increment="0.1" label="<span class="bold"><strong>pKa_titrant</strong></span>"
                max="14" min="0" state="disabled"&gt;
          &lt;name lang="french"&gt;pKa&lt;/name&gt;
          &lt;name lang="english"&gt;pKa&lt;/name&gt;
          &lt;value&gt;14&lt;/value&gt;
        &lt;/scalar&gt;</pre></li>

      <li><p>Definition of the whole value sets for these parameters :</p><pre
      class="programlisting">        &lt;record&gt;
          &lt;name lang="french"&gt;Hydroxyde de sodium&lt;/name&gt;
          &lt;name lang="english"&gt;Sodium hydroxide&lt;/name&gt;
          &lt;scalar-value ref="<span class="bold"><strong>pKa_titrant</strong></span>"&gt;14.8&lt;/scalar-value&gt;
        &lt;/record&gt;

        &lt;record&gt;
          &lt;name lang="english"&gt;Ammonium hydroxide&lt;/name&gt;
          ...
        &lt;/record&gt;

      &lt;/database&gt;</pre></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="param_titrage"></a>2.2.3. Titration &nbsp;parameters
  </h4></div></div></div><p>Their entry is done in the window illustrated by
  the following figure :</p><div class="figure"><a
  id="fig_param_titrage"></a><p
  class="title"><b>Figure&nbsp;3.4.&nbsp;Titration parameter data
  entry</b></p><div align="center" class="mediaobject"><img align="middle"
  alt="Saisie des paramètres du titrage"
  src="images/Acid_base_titration/fen_param_titrage.jpg" /></div></div><p>It
  consists of entering the initial concentration of the analyte and the
  numbers intermediate values used for the calculation :</p><pre
  class="programlisting">      &lt;scalar increment="0.000001" label="<span
        class="bold"><strong>c_analyte</strong></span>"
              max="1" min="0.000001" unit="mol / L"&gt;
        &lt;name lang="french"&gt;Concentration de l'espèce à titrer (mol/L)&lt;/name&gt;
        &lt;name lang="english"&gt;Initial concentration of the analyte (mol/L)&lt;/name&gt;
        &lt;value&gt;0.01&lt;/value&gt;
      &lt;/scalar&gt;

      &lt;scalar increment="10" label="<span class="bold"><strong>simulation_steps</strong></span>"
              max="1000" min="10" widget="slider"&gt;
        &lt;name lang="french"&gt;Nombre de valeurs intermédiaires pour le calcul&lt;/name&gt;
        &lt;name lang="english"&gt;Number of values for the simulation&lt;/name&gt;
        &lt;value&gt;100&lt;/value&gt;
      &lt;/scalar&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="points_experimentaux"></a>2.2.4.&nbsp;Experimental
  data</h4></div></div></div><p>Their entering is done in the window
  illustrated by the following figure :</p><div class="figure"><a
  id="id872312"></a><p class="title"><b>Figure&nbsp;3.5.&nbsp;Experimental
  data entry</b></p><div align="center" class="mediaobject"><img
  align="middle" alt="Saisie des points expérimentaux"
  src="images/Acid_base_titration/fen_param_pts_experim.jpg" /></div></div><p>It
  is a matricial-type parameter, whose lines correspond to experimental data
  (64 maximum) here, and whose the two columns correspond respectively to the
  abscissa and to the ordinate. It can be saved using the icon <img
  src="images/Acid_base_titration/icone_enregistrer.jpg"></img> in a text file
  having the extension <code class="filename">.dat</code>, downloaded from the
  same file <code class="filename">.dat</code> via the icon <img
  src="images/Acid_base_titration/icone_charger.jpg"></img>, or reseted via
  the icon <img
  src="images/Acid_base_titration/icone_supprimer.jpg"></img>.</p><p>The part
  of the XML code corresponding to the definition of this matrix is the
  following one:</p><pre class="programlisting">      &lt;matrix clear="yes" cols="2" label="<span
        class="bold"><strong>user_curve_mat</strong></span>"
              load="yes" rows="64" save="yes"
              striprow="yes"&gt;
        &lt;name/&gt;
        &lt;col&gt;
          &lt;name lang="french"&gt;Abscisses&lt;/name&gt;
          &lt;name lang="english"&gt;X-axis&lt;/name&gt;
          &lt;value&gt;0&lt;/value&gt;
        &lt;/col&gt;
        &lt;col&gt;
          &lt;name lang="french"&gt;Ordonnées&lt;/name&gt;
          &lt;name lang="english"&gt;Y-axis&lt;/name&gt;
          &lt;value/&gt;
        &lt;/col&gt;
      &lt;/matrix&gt;</pre></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="id872393"></a>2.3.&nbsp;Mathematical
  models</h3></div></div></div><p>This section - that follows the tag <code
  class="code">&lt;/parameters&gt;</code> - allows to define the equations to
  be solved, the curves to calculate, as well as the fields of the values (1D
  or 2D) that certain variables should take. These different definitions are
  framed by the following tags:</p><pre class="programlisting">  &lt;compute&gt;
  ...
  &lt;/compute&gt;</pre><p>Concerning our simulation of the mono acid
  titration, the following elements are defined :</p><div class="section"
  lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="c_titrant"></a>2.3.1.&nbsp;Definition of the titrant
  concentration </h4></div></div></div><p>It is the definition of the domain
  of the discrete values taken by the variable <code
  class="code">c_titrant</code> during the titration, the number of these
  values being fixed by the variable <code
  class="code">simulation_steps</code> (cf. § <a href="#param_titrage"
  title="2.2.3.&nbsp;Paramètres du titrage">Section&nbsp;2.2.3,
  «&nbsp;Parameters of the titration&nbsp;»</a>) :</p><pre
  class="programlisting">    &lt;defdomain1d label="<span class="bold"><strong>c_titrant</strong></span>"&gt;
      &lt;name lang="french"&gt;Concentration du titrant&lt;/name&gt;
      &lt;name lang="english"&gt;Titrant concentration&lt;/name&gt;

      &lt;interval discretization="linear" steps="<span class="bold"><strong>simulation_steps</strong></span>"&gt;
        &lt;initialvalue&gt;0&lt;/initialvalue&gt;
        &lt;finalvalue&gt;1.5 * <span class="bold"><strong>c_analyte</strong></span>&lt;/finalvalue&gt;
      &lt;/interval&gt;
    &lt;/defdomain1d&gt;</pre><p>It should be precised that the variable <code
  class="code">c_titrant</code> can also be considered as a vector of all the
  values taken in its range. It can be involved in the calculations to be
  realized as a vector.</p></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="calcul_ph"></a>2.3.2.&nbsp;pH calculation using the dichotomic
  method</h4></div></div></div><p>It consists of using an implicit function
  defining an application between <code class="code">c_titrant</code> and the
  <code class="code">pH variable</code> that we try to calculate, through an
  equation of the form f(<code class="code">c_titrant</code>, <code
  class="code">pH</code>) = 0 : at each value of <code
  class="code">c_titrant</code> (cf. § <a href="#c_titrant"
  title="2.3.1.&nbsp;Définition de la concentration du titrant">Section&nbsp;2.3.1,
  «&nbsp;Definition of the titrant concentration&nbsp;»</a>), The equation
  admits a unique <code class="code">ph</code> solution.</p><p>The following
  lines represent the structure of the definition of the implicit function
  <code class="code">ph</code> that also includes :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>the definition of intermediate variables of calculation used to
      calculate the values taken by the equation,</p></li>

      <li><p>A list of output curves, whose abscissas and ordinates are for
      each one of them <code class="code">c_titrant</code> and one function of
      calculated variable, respectively.</p></li>
    </ul></div><pre class="programlisting">    &lt;implicitfunction label="<span
        class="bold"><strong>ph</strong></span>" method="dichotomic"&gt;

      <em><span class="remark">definition of the implicit function variable :</span></em>
      &lt;refdomain1d ref="<span class="bold"><strong>c_titrant</strong></span>"/&gt;

      &lt;unknowns&gt;
<em><span class="remark">        definition of the sole unknown pH, where the boundaries 
        and the initial value are precised for each solving of the equation :
</span></em>        &lt;unknown label="<span class="bold"><strong>pH</strong></span>"&gt;
          &lt;name&gt;pH&lt;/name&gt;
          &lt;guess&gt;7&lt;/guess&gt;
          &lt;lowerbound&gt;0&lt;/lowerbound&gt;
          &lt;upperbound&gt;14&lt;/upperbound&gt;
        &lt;/unknown&gt;
      &lt;/unknowns&gt;

      &lt;equations&gt;
<em><span class="remark">
        definition of our sole equation, preceeded by the definition
        of intermediary calculus variables :
</span></em>        &lt;variable label="<span class="bold"><strong>Ka_analyte</strong></span>"&gt;...&lt;/variable&gt;
        ...
        &lt;variable label="<span class="bold"><strong>titrant_load</strong></span>"&gt;...&lt;/variable&gt;
<em><span class="remark">
        definition of the equation for which the cancelation allows to calculate  
        pH for each value of c_titrant :
</span></em>        &lt;equation&gt;H - (1e-14)./H - analyte_load + titrant_load&lt;/equation&gt;

      &lt;/equations&gt;

      &lt;outputs&gt;
        ... <em><span class="remark">definition of the curves function of c_titrant</span></em>
      &lt;/outputs&gt;

    &lt;/implicitfunction&gt;</pre><p>Here is now the detail of the
  intermediate variables of calculation. It should be noted that certain
  variables are vectors (as seen for the variable <code
  class="code">c_titrant</code>), which permits to optimize the calculation of
  the curves of titration by <span
  class="emphasis"><em>Scilab</em></span>.</p><p>For this reason, certain
  particular <span class="emphasis"><em>Scilab</em></span> operator must be
  specified (<code class="code">v</code>, <code class="code">v1</code> and
  <code class="code">v2</code> are vector, <code class="code">k</code> an
  scalar) :</p><div class="itemizedlist"><ul type="disc">
      <li><p>operator <code class="code">.*</code> :</p><div
      class="itemizedlist"><ul type="circle">
          <li><p><code class="code">v1 .* v2 = </code>vector resulting from
          the products two to two of each element of <code
          class="code">v1</code> and <code class="code">v2</code>.</p></li>

          <li><p><code class="code">k .* v = v .* k = </code>vector resulting
          from the products of each element of <code class="code">v</code>
          with <code class="code">k</code>.</p></li>
        </ul></div></li>

      <li><p>operator <code class="code">./</code> :</p><div
      class="itemizedlist"><ul type="circle">
          <li><p><code class="code">v1 ./ v2 = </code>vector resulting from
          the divisions two to two of each element of <code
          class="code">v1</code> and <code class="code">v2</code>.</p></li>

          <li><p><code class="code">k ./ v = </code>vector resulting from the
          divisions of <code class="code">k</code> by each one of elements of
          <code class="code">v</code>.</p></li>

          <li><p><code class="code">v ./ k = </code>vector resulting from the
          divisions of each one of the elements of <code class="code">v</code>
          by <code class="code">k</code>.</p></li>
        </ul></div></li>

      <li><p>operator <code class="code">.^</code> : follow the same logic as
      the operator <code class="code">./</code>.</p></li>

      <li><p>operator <code class="code">+</code> and <code
      class="code">-</code> :</p><div class="itemizedlist"><ul type="circle">
          <li><p><code class="code">v + k = k + v = </code>vector resulting
          from the sum of each element of <code class="code">v</code> with
          <code class="code">k</code>.</p></li>

          <li><p><code class="code">v - k = </code>vector resulting from the
          subtractions of each element of <code class="code">v</code> with
          <code class="code">k</code>.</p></li>

          <li><p><code class="code">k - v = </code>vector resulting from the
          subtraction of <code class="code">k</code> with each one of the
          elements of <code class="code">v</code>.</p></li>
        </ul></div></li>
    </ul></div><p>These operators are used in our case, certain manipulated
  variables being vectors (calculation of the pH, the coefficients of
  partitions, analyte, titrand and media charges), whereas other variables are
  positive scalars. The table below allows to distinguish the two types of
  variables in the following code :</p><div class="informaltable"><table
      border="1">
      <colgroup>
        <col align="left" />

        <col align="left" />
      </colgroup>

      <thead>
        <tr>
          <th align="left">Scalars</th>

          <th align="left">Vectors</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td align="left"><code class="code">c_analyte</code></td>

          <td align="left"><code class="code"><code
          class="code">alpha<sub>0-1</sub>_analyte</code> et <code
          class="code">alpha<sub>0-1</sub>_titrant</code></code></td>
        </tr>

        <tr>
          <td align="left"><code class="code"><code
          class="code">Ka_analyte</code> et <code
          class="code">Ka_titrant</code></code></td>

          <td align="left"><code class="code">charge_analyte</code> et <code
          class="code">charge_titrant</code></td>
        </tr>

        <tr>
          <td align="left"><code class="code">pKa_analyte</code> et <code
          class="code">pKa_titrant</code></td>

          <td align="left">charge</td>
        </tr>

        <tr>
          <td align="left">simulation_steps</td>

          <td align="left"><code class="code">c_titrant</code></td>
        </tr>

        <tr>
          <td align="left">&nbsp;</td>

          <td align="left"><code class="code"><code class="code">H</code> :
          [H<sub>3</sub>O<sup>+</sup>]</code></td>
        </tr>

        <tr>
          <td align="left"><code class="code"></code></td>

          <td align="left">user_curve_mat</td>
        </tr>
      </tbody>
    </table></div><pre class="programlisting">        &lt;variable label="<span
        class="bold"><strong>Ka_analyte</strong></span>"&gt;10^(-pKa_analyte)&lt;/variable&gt;
        &lt;variable label="<span class="bold"><strong>Ka_titrant</strong></span>"&gt;10^(-pKa_titrant)&lt;/variable&gt;
        &lt;variable label="<span class="bold"><strong>H</strong></span>"&gt;10.^(-pH)&lt;/variable&gt;        
        &lt;variable label="<span class="bold"><strong>alpha1_analyte</strong></span>"&gt;H./(H + Ka_analyte)&lt;/variable&gt;
        &lt;variable label="<span class="bold"><strong>alpha0_analyte</strong></span>"&gt;Ka_analyte./(H + Ka_analyte)&lt;/variable&gt;
        &lt;variable label="<span class="bold"><strong>charge_analyte</strong></span>"&gt;c_analyte.*alpha0_analyte&lt;/variable&gt;
        &lt;variable label="<span class="bold"><strong>alpha1_titrant</strong></span>"&gt;H./(H + Ka_titrant)&lt;/variable&gt;
        &lt;variable label="<span class="bold"><strong>alpha0_titrant</strong></span>"&gt;Ka_titrant./(H + Ka_titrant)&lt;/variable&gt;
        &lt;variable label="<span class="bold"><strong>charge_titrant</strong></span>"&gt;c_titrant.*alpha1_titrant&lt;/variable&gt;
</pre><p>Here is now the detail of the curves function of <code
  class="code">c_titrant</code> that are defined :</p><pre
  class="programlisting">        &lt;output label="<span class="bold"><strong>alpha1</strong></span>"&gt;
          &lt;name&gt;HA&lt;/name&gt;
          &lt;value&gt;alpha1_analyte&lt;/value&gt;
        &lt;/output&gt;

        &lt;output label="<span class="bold"><strong>alpha0</strong></span>"&gt;
          &lt;name&gt;A-&lt;/name&gt;
          &lt;value&gt;alpha0_analyte&lt;/value&gt;
        &lt;/output&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="id873174"></a>2.3.3.&nbsp;Definition of the experimental data
  curve</h4></div></div></div><p>It is a pseudo parametric curve, whose
  X-coordinates and ordinates are given by the columns of the <code
  class="code">user_curve_mat</code> matrix described in § <a
  href="#points_experimentaux"
  title="2.2.4.&nbsp;Points expérimentaux">Section&nbsp;2.2.4,
  «&nbsp;Experimental data&nbsp;»</a> :</p><pre class="programlisting">    &lt;parametriccurve2d label="<span
        class="bold"><strong>user_curve</strong></span>"&gt;
      &lt;name lang="french"&gt;Points expérimentaux&lt;/name&gt;
      &lt;name lang="english"&gt;Experimental data&lt;/name&gt;
      &lt;x1&gt;
        &lt;name/&gt;
        &lt;value&gt;<span class="bold"><strong>user_curve_mat(:,1)</strong></span>&lt;/value&gt;
                 <em><span class="remark">-&gt; first column of user_curve_mat</span></em>
      &lt;/x1&gt;
      &lt;x2&gt;
        &lt;name/&gt;
        &lt;value&gt;<span class="bold"><strong>user_curve_mat(:,2)</strong></span>&lt;/value&gt;
                 <em><span class="remark">-&gt; second column of user_curve_mat</span></em>
      &lt;/x2&gt;
    &lt;/parametriccurve2d&gt;</pre></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="courbe_ph"></a>2.4.&nbsp;Results display</h3></div></div></div><p>This
  section - that follows the tag <code class="code">&lt;/compute&gt;</code> -
  allows to define the various graphic windows, a set of system of axes for
  each of them (windows can then be divided horizontally or vertically to
  contain them) as well as the curves that must be respectively displayed in
  each system of axis. These various definitions are framed by the following
  tags :</p><pre class="programlisting">  &lt;display&gt;
  ...
  &lt;/display&gt;</pre><p>In our case, only one window is vertically divided
  into two systems of cartesian axis containing the following curves :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>pH calculated and pH experimentally mesured, as a function of the
      concentration of titrant,</p></li>

      <li><p>coefficients of partition of the various protonic forms of the
      analyte, as a function of the concentration of titrant : HA and
      A<sup>-</sup>,</p></li>
    </ul></div><div class="figure"><a id="id873306"></a><p
  class="title"><b>Figure&nbsp;3.6.&nbsp;Results curves </b></p><div
  align="center" class="mediaobject"><img align="middle"
  alt="Courbes résultats"
  src="images/Acid_base_titration/fen_pH_obtenu.jpg" /></div></div><p>The
  corresponding code is as follows, logical curves previously defined
  appearing in reference in the definition of the curves to display :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>implicit function <code class="code">pH</code> and curve of the
      experimental data<code class="code"> user_curve</code>,</p></li>

      <li><p>curve of the coefficients of partition of the different protonic
      forms of the analyte : <code
      class="code">alpha<sub>0-1</sub></code>,</p></li>
    </ul></div><pre class="programlisting">  &lt;display&gt;
    &lt;window <span class="bold"><strong>splity="2"</strong></span>&gt;
      &lt;title lang="french"&gt;pH&lt;/title&gt;
      &lt;title lang="english"&gt;pH&lt;/title&gt;

      &lt;axis2d xmax="1.5*c_analyte" xmin="0" ymax="14" ymin="0"&gt;
        &lt;drawcurve2d color="blue" ref="<span class="bold"><strong>pH</strong></span>" thickness="2" /&gt;
        &lt;drawcurve2d color="red" marker="plus"
                     ref="<span class="bold"><strong>user_curve</strong></span>" thickness="1" /&gt;
      &lt;/axis2d&gt;

      &lt;axis2d xmax="1.5*c_analyte" xmin="0" ymax="1" ymin="0"&gt;
        &lt;drawcurve2d color="red" ref="<span class="bold"><strong>alpha1</strong></span>" thickness="2" /&gt;
        &lt;drawcurve2d color="green" ref="<span class="bold"><strong>alpha0</strong></span>" thickness="2" /&gt;
      &lt;/axis2d&gt;
    &lt;/window&gt;
  &lt;/display&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="id873426"></a>2.5.&nbsp;Session and results simulation saving
  </h3></div></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id873434"></a>2.5.1.&nbsp;Saving and downloading the
  session</h4></div></div></div><p>The saving session, it's available for all
  the simulation from the menu entry <span class="guimenuitem">File-&gt;Save
  the session, consists of saving the whole parameters of the simulation in a
  file, under the form of a code file <span><strong
  class="command">Tcl</strong></span> whose execution will later allow to
  restore their values, this through the entry of the menu "load a session".
  Here is an example of such a file for our simulation: </span> </p><pre
  class="programlisting">set  {$}
set pKa_analyte {-7}
set  {$}
set pKa_titrant {14.8}
set c_analyte {0.01}
set simulation_steps {100}
array set user_curve_mat {
  39,0 39 40,0 40 5,0 5 23,0 23 5,1 0.008 5,2 2.8 61,0 61 44,0 44 9,0 9 27,
  0 27 11,0 11 48,0 48 32,0 32 15,0 15 53,0 53 36,0 36 2,0 2 19,0 19 20,
  0 20 2,1 0.002 2,2 2.4 57,0 57 41,0 41 6,0 6 24,0 24 6,1 0.010 6,2 8 62,
  0 62 45,0 45 28,0 28 12,0 12 50,0 50 49,0 49 33,0 33 16,0 16 54,0 54 37,
  0 37 3,0 3 21,0 21 3,1 0.004 3,2 2.6 58,0 58 42,0 42 7,0 7 25,0 25 7,
  1 0.012 active Abscisses 7,2 11.4 63,0 63 46,0 46 29,0 29 30,0 30 13,
  0 13 51,0 51 34,0 34 17,0 17 0,1 Abscisses 0,2 Ordonnées 55,0 55 38,
  0 38 4,0 4 22,0 22 4,1 0.006 4,2 2.7 60,0 60 59,0 59 43,0 43 8,0 8 26,
  0 26 8,1 0.014 10,0 10 8,2 11.7 64,0 64 47,0 47 31,0 31 14,0 14 52,
  0 52 35,0 35 1,0 1 18,0 18 1,1 0 1,2 2.2 56,0 56
}</pre></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id873482"></a>2.5.2.&nbsp;Saving simulation
  results</h4></div></div></div><p>It is accessible from the entry menu <span
  class="guimenuitem">File-&gt;Saving simulation results as soon as it was
  defined via the </span>tag <code class="code">save</code> in the XML file of
  the simulation. The choice of the default file of saving and its format, as
  well as the list of the parameters and the results to be saved is determined
  by the following lines :</p><pre class="programlisting">  &lt;save&gt;
    &lt;file format="csv" href="essai.csv"
          labels="pKa_analyte c_analyte pKa_titrant c_titrant pH" /&gt;
  &lt;/save&gt;</pre><p>The following window allow to choose the name of the
  file which will be saved here with the format CSV :</p><div
  class="figure"><a id="id873531"></a><p
  class="title"><b>Figure&nbsp;3.7.&nbsp;Saving simulation results
  &nbsp;</b></p><div align="center" class="mediaobject"><img align="middle"
  alt="Sauvegarde des résultats de la simulation"
  src="images/Acid_base_titration/fen_sauver_resultats.jpg" /></div></div><p>Here
  is the appearance of an example of a file obtained, the tag <code
  class="code">name</code> of each parameter or result preceeding its
  value:</p><pre class="programlisting">"pKa : ",-7.000000,
"Analyte concentration (mol/L) : ",0.010000,
"pKa : ",14.800000,
"Titrant concentration : ",0.000000,0.000152,...,0.015000,
"pH : ",2.000006,2.006628,...,11.697931,</pre></div></div></div></div><div
  class="chapter" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h2
  class="title"><a id="id873582"></a>Chapter&nbsp;4.&nbsp;Finite elements:
  simulation of the Poisson's equation</h2></div></div></div><div
  class="toc"><p><b>Table of contents</b></p><dl>
      <dt><span class="section"><a href="#id873608">1. Physical description of
      the simulation</a></span></dt>

      <dt><span class="section"><a href="#id892445">2. Logics of the
      description in XML of the simulation</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id892474">2.1. General
          description</a></span></dt>

          <dt><span class="section"><a href="#id892514">2.2.
          Parameters</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id892591">2.2.1.
              Discretization parameters</a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#id892794">2.3. Mathematical
          Models</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id892819">2.3.1. Definition
              of the variable <code class="code">thetain</code> and of its
              interval of discretization [0, 2π] <code class="code"></code>
              </a></span></dt>

              <dt><span class="section"><a href="#id892870">2.3.2. Definition
              of the variable <code class="code">thetaout</code> and of its
              interval of discretization [0, 2π]</a></span></dt>

              <dt><span class="section"><a href="#id892912">2.3.3.
              &nbsp;Definition of the domaine Ω</a></span></dt>

              <dt><span class="section"><a
              href="#ex_stationary-pde_poisson">2.3.4. Definition of the
              stationary partial derivatives</a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#courbe_poisson">2.4. Results
          display</a></span></dt>
        </dl></dd>
    </dl></div><p>This exemple corresponds to the file <code
  class="filename">Physics/pde.xml</code> of the sub-directory <code
  class="filename">examples</code> of the <span
  class="emphasis"><em>XMLlab</em></span> installation directory<span
  class="emphasis"><em> .</em></span></p><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h2 class="title"
  style="clear: both"><a id="id873608"></a>1.&nbsp;Physical description of the
  simulation</h2></div></div></div><p>The purpose of the Poisson's equation is
  to simulate an electric potential. It is a particular case of the following
  Laplace equation :</p><div class="equation"><mml:math display="block"
      overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:mo>−</mml:mo>

          <mml:mi>div</mml:mi>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mi>D</mml:mi>

          <mml:mover accent="true">
            <mml:mo>∇</mml:mo>

            <mml:mo>→</mml:mo>
          </mml:mover>

          <mml:mi>u</mml:mi>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>+</mml:mo>

          <mml:mi>c</mml:mi>

          <mml:mi>u</mml:mi>

          <mml:mo>=</mml:mo>

          <mml:mi>f</mml:mi>

          <mml:mo>,</mml:mo>

          <mml:mtext> </mml:mtext>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mi>x</mml:mi>

          <mml:mo>,</mml:mo>

          <mml:mi>y</mml:mi>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>∈</mml:mo>

          <mml:mi>Ω</mml:mi>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><p>with two types of boundary conditions :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>robin : <mml:math overflow="scroll"
          xmlns:mml="http://www.w3.org/1998/Math/MathML">
          <mml:semantics definitionURL="" encoding="">
            <mml:mrow>
              <mml:mo stretchy="false">(</mml:mo>

              <mml:mi>D</mml:mi>

              <mml:mover accent="true">
                <mml:mo>∇</mml:mo>

                <mml:mo>→</mml:mo>
              </mml:mover>

              <mml:mi>u</mml:mi>

              <mml:mo stretchy="false">)</mml:mo>

              <mml:mo>.</mml:mo>

              <mml:mover accent="true">
                <mml:mi>n</mml:mi>

                <mml:mo>→</mml:mo>
              </mml:mover>

              <mml:mo>+</mml:mo>

              <mml:msub>
                <mml:mi>σ</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>

              <mml:mi>u</mml:mi>

              <mml:mo>=</mml:mo>

              <mml:msub>
                <mml:mi>ξ</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>

              <mml:mo>,</mml:mo>

              <mml:mtext> </mml:mtext>

              <mml:mo stretchy="false">(</mml:mo>

              <mml:mi>x</mml:mi>

              <mml:mo>,</mml:mo>

              <mml:mi>y</mml:mi>

              <mml:mo stretchy="false">)</mml:mo>

              <mml:mo>∈</mml:mo>

              <mml:msub>
                <mml:mi>Γ</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>
            </mml:mrow>

            <mml:annotation encoding="MathType-MTEF" />
          </mml:semantics>
        </mml:math>,</p></li>

      <li><p>dirichlet : <mml:math overflow="scroll"
          xmlns:mml="http://www.w3.org/1998/Math/MathML">
          <mml:semantics definitionURL="" encoding="">
            <mml:mrow>
              <mml:mi>u</mml:mi>

              <mml:mo>=</mml:mo>

              <mml:msub>
                <mml:mi>g</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>

              <mml:mo>,</mml:mo>

              <mml:mtext> </mml:mtext>

              <mml:mo stretchy="false">(</mml:mo>

              <mml:mi>x</mml:mi>

              <mml:mo>,</mml:mo>

              <mml:mi>y</mml:mi>

              <mml:mo stretchy="false">)</mml:mo>

              <mml:mo>∈</mml:mo>

              <mml:msub>
                <mml:mi>Γ</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>
            </mml:mrow>

            <mml:annotation encoding="MathType-MTEF" />
          </mml:semantics>
        </mml:math>.</p></li>
    </ul></div><p>knowing that the domain Ω have a boundary Γ = Γ<sub>0</sub>
  ∪ Γ<sub>1</sub> ∪ ... Γ<sub>i</sub> ∪ ... Γ<sub>n</sub>.</p><p>The example
  that we propose to treat corresponds to the following domain Ω which has as
  a boudery Γ = Γ<sub>0</sub> ∪ Γ<sub>1</sub> ∪ Γ<sub>2</sub>.</p><div
  class="figure"><a id="id891492"></a><p
  class="title"><b>Figure&nbsp;4.1.&nbsp;Domaine Ω</b></p><div
  class="screenshot"><div align="center" class="mediaobject"><img
  align="middle" alt="Domaine Ω"
  src="images/pde/omega.jpg" /></div></div></div><div
  class="equation"><mml:math display="block" overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mi>Γ</mml:mi>

            <mml:mn>0</mml:mn>
          </mml:msub>

          <mml:mo>:</mml:mo>

          <mml:mrow>
            <mml:mo>{</mml:mo>

            <mml:mtable>
              <mml:mtr>
                <mml:mtd>
                  <mml:mi>x</mml:mi>

                  <mml:mo>=</mml:mo>

                  <mml:mi>cos</mml:mi>

                  <mml:mo>⁡</mml:mo>

                  <mml:mrow>
                    <mml:mo>(</mml:mo>

                    <mml:mi>θ</mml:mi>

                    <mml:mo>)</mml:mo>
                  </mml:mrow>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:mi>y</mml:mi>

                  <mml:mo>=</mml:mo>

                  <mml:mi>sin</mml:mi>

                  <mml:mo>⁡</mml:mo>

                  <mml:mrow>
                    <mml:mo>(</mml:mo>

                    <mml:mi>θ</mml:mi>

                    <mml:mo>)</mml:mo>
                  </mml:mrow>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:mi>θ</mml:mi>

                  <mml:mo>∈</mml:mo>

                  <mml:mrow>
                    <mml:mo>[</mml:mo>

                    <mml:mrow>
                      <mml:mn>0,2</mml:mn>

                      <mml:mi>π</mml:mi>
                    </mml:mrow>

                    <mml:mo>]</mml:mo>
                  </mml:mrow>
                </mml:mtd>
              </mml:mtr>
            </mml:mtable>
          </mml:mrow>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><div class="equation"><mml:math display="block"
      overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mi>Γ</mml:mi>

            <mml:mn>1</mml:mn>
          </mml:msub>

          <mml:mo>:</mml:mo>

          <mml:mrow>
            <mml:mo>{</mml:mo>

            <mml:mtable>
              <mml:mtr>
                <mml:mtd>
                  <mml:mi>x</mml:mi>

                  <mml:mo>=</mml:mo>

                  <mml:mn>0.4</mml:mn>

                  <mml:mo>+</mml:mo>

                  <mml:mn>0.2</mml:mn>

                  <mml:mi>cos</mml:mi>

                  <mml:mo>⁡</mml:mo>

                  <mml:mrow>
                    <mml:mo>(</mml:mo>

                    <mml:mrow>
                      <mml:mo>−</mml:mo>

                      <mml:mi>θ</mml:mi>
                    </mml:mrow>

                    <mml:mo>)</mml:mo>
                  </mml:mrow>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:mi>y</mml:mi>

                  <mml:mo>=</mml:mo>

                  <mml:mn>0.2</mml:mn>

                  <mml:mi>sin</mml:mi>

                  <mml:mo>⁡</mml:mo>

                  <mml:mrow>
                    <mml:mo>(</mml:mo>

                    <mml:mrow>
                      <mml:mo>−</mml:mo>

                      <mml:mi>θ</mml:mi>
                    </mml:mrow>

                    <mml:mo>)</mml:mo>
                  </mml:mrow>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:mi>θ</mml:mi>

                  <mml:mo>∈</mml:mo>

                  <mml:mrow>
                    <mml:mo>[</mml:mo>

                    <mml:mrow>
                      <mml:mn>0,2</mml:mn>

                      <mml:mi>π</mml:mi>
                    </mml:mrow>

                    <mml:mo>]</mml:mo>
                  </mml:mrow>
                </mml:mtd>
              </mml:mtr>
            </mml:mtable>
          </mml:mrow>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><div class="equation"><mml:math display="block"
      overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mi>Γ</mml:mi>

            <mml:mn>2</mml:mn>
          </mml:msub>

          <mml:mo>:</mml:mo>

          <mml:mrow>
            <mml:mo>{</mml:mo>

            <mml:mtable>
              <mml:mtr>
                <mml:mtd>
                  <mml:mi>x</mml:mi>

                  <mml:mo>=</mml:mo>

                  <mml:mo>−</mml:mo>

                  <mml:mn>0.4</mml:mn>

                  <mml:mo>+</mml:mo>

                  <mml:mn>0.25</mml:mn>

                  <mml:mi>cos</mml:mi>

                  <mml:mo>⁡</mml:mo>

                  <mml:mrow>
                    <mml:mo>(</mml:mo>

                    <mml:mrow>
                      <mml:mo>−</mml:mo>

                      <mml:mi>θ</mml:mi>
                    </mml:mrow>

                    <mml:mo>)</mml:mo>
                  </mml:mrow>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:mi>y</mml:mi>

                  <mml:mo>=</mml:mo>

                  <mml:mn>0.25</mml:mn>

                  <mml:mi>sin</mml:mi>

                  <mml:mo>⁡</mml:mo>

                  <mml:mrow>
                    <mml:mo>(</mml:mo>

                    <mml:mrow>
                      <mml:mo>−</mml:mo>

                      <mml:mi>θ</mml:mi>
                    </mml:mrow>

                    <mml:mo>)</mml:mo>
                  </mml:mrow>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:mi>θ</mml:mi>

                  <mml:mo>∈</mml:mo>

                  <mml:mrow>
                    <mml:mo>[</mml:mo>

                    <mml:mrow>
                      <mml:mn>0,2</mml:mn>

                      <mml:mi>π</mml:mi>
                    </mml:mrow>

                    <mml:mo>]</mml:mo>
                  </mml:mrow>
                </mml:mtd>
              </mml:mtr>
            </mml:mtable>
          </mml:mrow>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><p>The convention being that the interior of the domain
  is always on the left of curve when the parameter increases (here <span
  class="emphasis"><em>θ</em></span>). There are them two holes. We will
  discretize Γ<sub>0</sub> with 2<span class="emphasis"><em>n</em></span>
  points and Γ<sub>1</sub>, Γ<sub>2</sub> with <span
  class="emphasis"><em>n</em></span> points.</p><p>The Poisson's equation
  concerning our simulation is finally as follows :</p><div
  class="equation"><mml:math display="block" overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:mo>−</mml:mo>

          <mml:mi>div</mml:mi>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mi>D</mml:mi>

          <mml:mover accent="true">
            <mml:mo>∇</mml:mo>

            <mml:mo>→</mml:mo>
          </mml:mover>

          <mml:mi>u</mml:mi>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>=</mml:mo>

          <mml:mn>0,</mml:mn>

          <mml:mtext> </mml:mtext>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mi>x</mml:mi>

          <mml:mo>,</mml:mo>

          <mml:mi>y</mml:mi>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>∈</mml:mo>

          <mml:mi>Ω</mml:mi>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><p>with <mml:math overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:mi>D</mml:mi>

          <mml:mo>=</mml:mo>

          <mml:mrow>
            <mml:mo>(</mml:mo>

            <mml:mrow>
              <mml:mtable>
                <mml:mtr>
                  <mml:mtd>
                    <mml:mrow>
                      <mml:mn>10</mml:mn>
                    </mml:mrow>
                  </mml:mtd>

                  <mml:mtd>
                    <mml:mn>0</mml:mn>
                  </mml:mtd>
                </mml:mtr>

                <mml:mtr>
                  <mml:mtd>
                    <mml:mn>0</mml:mn>
                  </mml:mtd>

                  <mml:mtd>
                    <mml:mi>d</mml:mi>
                  </mml:mtd>
                </mml:mtr>
              </mml:mtable>
            </mml:mrow>

            <mml:mo>)</mml:mo>
          </mml:mrow>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math> and, for boundary conditions :</p><div
  class="equation"><mml:math display="block" overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:mrow>
            <mml:mo>{</mml:mo>

            <mml:mtable>
              <mml:mtr>
                <mml:mtd>
                  <mml:mi>u</mml:mi>

                  <mml:mo>=</mml:mo>

                  <mml:mn>0,</mml:mn>

                  <mml:mtext> </mml:mtext>

                  <mml:mo stretchy="false">(</mml:mo>

                  <mml:mi>x</mml:mi>

                  <mml:mo>,</mml:mo>

                  <mml:mi>y</mml:mi>

                  <mml:mo stretchy="false">)</mml:mo>

                  <mml:mo>∈</mml:mo>

                  <mml:msub>
                    <mml:mi>Γ</mml:mi>

                    <mml:mn>0</mml:mn>
                  </mml:msub>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:mi>u</mml:mi>

                  <mml:mo>=</mml:mo>

                  <mml:mi>a</mml:mi>

                  <mml:mo>,</mml:mo>

                  <mml:mtext> </mml:mtext>

                  <mml:mo stretchy="false">(</mml:mo>

                  <mml:mi>x</mml:mi>

                  <mml:mo>,</mml:mo>

                  <mml:mi>y</mml:mi>

                  <mml:mo stretchy="false">)</mml:mo>

                  <mml:mo>∈</mml:mo>

                  <mml:msub>
                    <mml:mi>Γ</mml:mi>

                    <mml:mn>1</mml:mn>
                  </mml:msub>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:mi>u</mml:mi>

                  <mml:mo>=</mml:mo>

                  <mml:mi>b</mml:mi>

                  <mml:mo>,</mml:mo>

                  <mml:mtext> </mml:mtext>

                  <mml:mo stretchy="false">(</mml:mo>

                  <mml:mi>x</mml:mi>

                  <mml:mo>,</mml:mo>

                  <mml:mi>y</mml:mi>

                  <mml:mo stretchy="false">)</mml:mo>

                  <mml:mo>∈</mml:mo>

                  <mml:msub>
                    <mml:mi>Γ</mml:mi>

                    <mml:mn>2</mml:mn>
                  </mml:msub>
                </mml:mtd>
              </mml:mtr>
            </mml:mtable>
          </mml:mrow>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h2 class="title" style="clear: both"><a
  id="id892445"></a>2.&nbsp;Logics of the description in XML of the
  simulation</h2></div></div></div><p>We will show how this simulation is
  translated into an XML file that the <span
  class="emphasis"><em>XMLlab</em></span> tool will use to generate a
  simulation executed by <span class="emphasis"><em>Scilab</em></span>. The
  XML file will be shown in its textual form. Once again, only the elements of
  the simulation that have not been treated previously will be particularly
  detailed. </p><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id892474"></a>2.1.&nbsp;General description
  </h3></div></div></div><p>The heading lines of the XML file always allow to
  associate to it the DTD of XMLlab, the following heading lines of simulation
  allowing to specify its title, its author as well as the keywords related to
  it..</p><pre class="programlisting">&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;!DOCTYPE simulation PUBLIC "-//UTC//DTD XMLlab V1.4//FR" "http://xmllab.org/dtd/1.4/simulation.dtd"&gt;
&lt;simulation&gt;
  &lt;header&gt;
    &lt;title lang="french"&gt;Simulation de l'équation de Poisson&lt;/title&gt;
    &lt;title lang="english"&gt;Simulation of the Poisson equation&lt;/title&gt;

    &lt;author email="stephane.mottelet@utc.fr"&gt;Stéphane Mottelet&lt;/author&gt;
    &lt;date&gt;03/2004&lt;/date&gt;

    &lt;keywords lang="french"&gt;equation aux dérivées partielles, condensateur,
    éléments finis&lt;/keywords&gt;
    &lt;keywords lang="english"&gt;partial differential equation, condensator,
    finite elements &lt;/keywords&gt;
  &lt;/header&gt;
  ...</pre><p>Lines defining multilingual notes, are then introduced and
  displayed when selecting the entry of the menu <span
  class="guimenuitem">XMLlab-&gt;About this simulation</span> :</p><pre
  class="programlisting">  &lt;notes lang="french"&gt;
    &lt;p&gt;Cette simulation a pour but de montrer les possibilités de XMLlab en
    termes de simulation d'équations aux dérivées partielles elliptiques.&lt;/p&gt;
    &lt;p&gt;On s'intéresse ici à un exemple simple où le bord extérieur du domaine
    est mis à la masse, et où on impose deux tensions différentes sur les deux
    frontières intérieures.&lt;/p&gt;
  &lt;/notes&gt;

  &lt;notes lang="english"&gt;
    &lt;p&gt;This simulation aims to show how XMLlab is able to deal with partial
    differential equations.&lt;/p&gt;
    &lt;p&gt;Play with the sliders to change the mesh and see how the voltage on the
    inner electrodes influences the whole distribution.&lt;/p&gt;
  &lt;/notes&gt;
</pre></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id892514"></a>2.2.&nbsp;Parameters</h3></div></div></div><p> The
  parameters of this simulation contain only one section, leading to a single
  entry of the Parameter menu of the simulation as showns in the following
  figure:</p><div class="figure"><a id="id892530"></a><p
  class="title"><b>Figure&nbsp;4.2.&nbsp;Parameter menu entries<span
  class="guimenu"> of the </span>Poisson's equation simulation Results curves
  </b></p><div class="screenshot"><div align="center" class="mediaobject"><img
  align="middle"
  alt="Entrées du menu Paramètres de la simulation de l'équation de Poisson"
  src="images/pde/fen_pde_menu_param.jpg" /></div></div></div><p>The following
  lines introduce and name the single section of parameters :</p><pre
  class="programlisting">  &lt;parameters&gt;
    &lt;section&gt;
      &lt;title lang="french"&gt;Paramètres de discrétisation&lt;/title&gt;
      &lt;title lang="english"&gt;Discretization parameters&lt;/title&gt;
      ...
    &lt;/section&gt;
  &lt;/parameters&gt;</pre><p>We will now describe in detail the declaration
  of the parameters of this section, whose corresponding lines appear after
  the multilingual <code class="code">&lt;title&gt;</code> tag :</p><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="id892591"></a>2.2.1.&nbsp;Discretization
  parameters</h4></div></div></div><p>Their data entry is done in the
  previously seen window.</p><p>This section contains the following parameters
  :</p><div class="itemizedlist"><ul type="disc">
      <li><p>Number <code class="code">n</code> of points on the boundaries
      :</p><pre class="programlisting">      &lt;scalar increment="1" label="<span
            class="bold"><strong>n</strong></span>" max="25" min="10"&gt;
        &lt;name lang="french"&gt;Nombre de points sur les frontières&lt;/name&gt;
        &lt;name lang="english"&gt;Number of points on the boundary&lt;/name&gt;
        &lt;notes lang="french"&gt;
          &lt;p&gt;Ne pas dépasser n=20 si vous voulez garder&lt;/p&gt;
          &lt;p&gt;une animation fluide.&lt;/p&gt;
        &lt;/notes&gt;
        &lt;notes lang="english"&gt;
          &lt;p&gt;Don't use more than n=20 points if you&lt;/p&gt;
          &lt;p&gt;want to keep a smooth animation.&lt;/p&gt;
        &lt;/notes&gt;
        &lt;value&gt;10&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Voltage <code class="code">b</code> on the left electrode, tuned
      with a slider that can be automatically animated :</p><pre
      class="programlisting">      &lt;scalar increment="0.01" label="<span
            class="bold"><strong>b</strong></span>" max="1" min="-1" widget="animate"&gt;
        &lt;name lang="french"&gt;Tension sur l'électrode gauche&lt;/name&gt;
        &lt;name lang="english"&gt;Voltage on the left electrode&lt;/name&gt;
        &lt;value&gt;0&lt;/value&gt;
      &lt;/scalar&gt;</pre><p>The user can make the value of the parameter
      vary continuously between the defined limits and according to the
      specified incrementation step : <img
      src="images/pde/anim_tension_gauche.jpg"></img></p><p>The 4 buttons
      located beside the slider allows respectively :</p><div
      class="itemizedlist"><ul type="circle">
          <li><p>to start the animation until to the final value of the
          parameter,</p></li>

          <li><p>to start it from the initial value when the final value is
          reached,</p></li>

          <li><p>to start it in the opposite direction toward the initial
          value when the final value is reached,</p></li>

          <li><p>to put the animation in pause .</p></li>
        </ul></div></li>

      <li><p>Voltage <code class="code">a</code> on the right electrode, tuned
      with a slider :</p><pre class="programlisting">      &lt;scalar increment="0.01" label="<span
            class="bold"><strong>a</strong></span>" max="1" min="-1" widget="slider"&gt;
        &lt;name lang="french"&gt;Tension sur l'électrode droite&lt;/name&gt;
        &lt;name lang="english"&gt;Voltage on the right electrode&lt;/name&gt;
        &lt;value&gt;1&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Conductivity coefficient <code class="code">d</code> in the y
      direction, tuned with a slider :</p><pre class="programlisting">      &lt;scalar increment="10" label="<span
            class="bold"><strong>d</strong></span>" max="200" min="10" widget="slider"&gt;
        &lt;name lang="french"&gt;Coefficient de conductivité en y&lt;/name&gt;
        &lt;name lang="english"&gt;Conductivity coefficient in the y direction&lt;/name&gt;
        &lt;value&gt;10&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>
    </ul></div></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id892794"></a>2.3.&nbsp;Mathematical Models
  </h3></div></div></div><p>This section - that follows the tag <code
  class="code">&lt;/parameters&gt;</code> - allows to define the equations to
  be solved, the curves to calculate, as well as the ranges of values (1D or
  2D) that some variables must take. These various definitions are framed by
  the following tags :</p><pre class="programlisting">  &lt;compute&gt;
  ...
  &lt;/compute&gt;</pre><p>Concerning our simulation of the Poisson's
  equation, the following elements are defined :</p><div class="section"
  lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="id892819"></a>2.3.1.&nbsp;Definition of the variable
  <code class="code">thetain</code> and of its interval of discretization [0,
  2π]</h4></div></div></div><p>This variable is used to discretize
  Γ<sub>1</sub> and Γ<sub>2</sub> with n points :</p><pre
  class="programlisting">    &lt;defdomain1d label="<span class="bold"><strong>thetain</strong></span>"&gt;
      &lt;interval discretization="linear" steps="n"&gt;
        &lt;initialvalue&gt;0&lt;/initialvalue&gt;
        &lt;finalvalue&gt;2*%pi&lt;/finalvalue&gt;
      &lt;/interval&gt;
    &lt;/defdomain1d&gt;</pre><p>We also illustrates the possibility of using
  Scilab constants , here <code class="code">%pi</code>.</p></div><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="id892870"></a>2.3.2.&nbsp;Definition of the variable
  <code class="code">thetaout</code>and its interval of discretization [0,
  2π]</h4></div></div></div><p>This variable is used to discretize
  Γ<sub>0</sub> with 2n points :</p><pre class="programlisting">    &lt;defdomain1d label="<span
        class="bold"><strong>thetaout</strong></span>"&gt;
      &lt;interval discretization="linear" steps="2*n"&gt;
        &lt;initialvalue&gt;0&lt;/initialvalue&gt;
        &lt;finalvalue&gt;2*%pi&lt;/finalvalue&gt;
      &lt;/interval&gt;
    &lt;/defdomain1d&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="id892912"></a>2.3.3.&nbsp;Definition of the domaine
  Ω</h4></div></div></div><p>Its boundary is Γ = Γ<sub>0</sub> ∪ Γ<sub>1</sub>
  ∪ Γ<sub>2</sub>. Its definition (tag <code class="code">defdomain2d</code>)
  is composed of the description of its boundaries Γ<sub>0</sub>,
  Γ<sub>1</sub> and Γ<sub>2</sub>, each of them being described by a 2D
  parametric curve (tag <code class="code">parametriccurve2d</code>) depending
  on the variables <code class="code">thetain</code> and <code
  class="code">thetaout</code>, the tag <code class="code">refdomain1d</code>
  indicating the variable (<code class="code">domain1d</code>) in dependance
  :</p><pre class="programlisting">    &lt;defdomain2d dependencies="<span
        class="bold"><strong>n</strong></span>" label="<span class="bold"><strong>omega</strong></span>"&gt;
      &lt;border&gt;
        &lt;parametriccurve2d label="<span class="bold"><strong>gamma_0</strong></span>"&gt;
          &lt;refdomain1d ref="<span class="bold"><strong>thetaout</strong></span>"/&gt;
          &lt;x1&gt;
            &lt;value&gt;cos(<span class="bold"><strong>thetaout</strong></span>)&lt;/value&gt;
          &lt;/x1&gt;
          &lt;x2&gt;
            &lt;value&gt;sin(<span class="bold"><strong>thetaout</strong></span>)&lt;/value&gt;
          &lt;/x2&gt;
        &lt;/parametriccurve2d&gt;
        &lt;parametriccurve2d label="<span class="bold"><strong>gamma_1</strong></span>"&gt;
          &lt;refdomain1d ref="<span class="bold"><strong>thetain</strong></span>"/&gt;
          &lt;x1&gt;
            &lt;value&gt;0.4+0.2*cos(<span class="bold"><strong>thetain</strong></span>)&lt;/value&gt;
          &lt;/x1&gt;
          &lt;x2&gt;
            &lt;value&gt;0.2*sin(-<span class="bold"><strong>thetain</strong></span>)&lt;/value&gt;
          &lt;/x2&gt;
        &lt;/parametriccurve2d&gt;
        &lt;parametriccurve2d label="<span class="bold"><strong>gamma_2</strong></span>"&gt;
          &lt;refdomain1d ref="<span class="bold"><strong>thetain</strong></span>"/&gt;
          &lt;x1&gt;
            &lt;value&gt;-0.4+0.25*cos(<span class="bold"><strong>thetain</strong></span>)&lt;/value&gt;
          &lt;/x1&gt;
          &lt;x2&gt;
            &lt;value&gt;0.25*sin(-<span class="bold"><strong>thetain</strong></span>)&lt;/value&gt;
          &lt;/x2&gt;
        &lt;/parametriccurve2d&gt;
      &lt;/border&gt;
    &lt;/defdomain2d&gt;</pre><p>The attribute <code
  class="code">dependencies="n"</code> allows to indicate that the
  triangulation of the domain, which is an expensive operation, must only be
  done when it changes, thus when <code class="code">n</code> changes of
  value.</p></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="ex_stationary-pde_poisson"></a>2.3.4.&nbsp;Definition of the stationary
  partial derivatives </h4></div></div></div><p>It is contained in the
  following code, the correspondences being as follows :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>the matrix <span class="emphasis"><em>D</em></span> (that must be
      a constant) corresponds to the contents of the <code
      class="code">diffusion tag</code>,</p></li>

      <li><p>the function <span class="emphasis"><em>c</em></span>(<span
      class="emphasis"><em>x</em></span>, <span
      class="emphasis"><em>y</em></span>) to the <code
      class="code">proportional tag</code>,</p></li>

      <li><p><span class="emphasis"><em>f</em></span>(<span
      class="emphasis"><em>x</em></span>, <span
      class="emphasis"><em>y</em></span>) to the <code class="code">source
      tag</code>,</p></li>

      <li><p>for the boundary conditions :</p><div class="itemizedlist"><ul
          type="circle">
          <li><p><span class="emphasis"><em>σ</em></span>(<span
          class="emphasis"><em>x</em></span>, <span
          class="emphasis"><em>y</em></span>) and <span
          class="emphasis"><em>ξ</em></span>(<span
          class="emphasis"><em>x</em></span>, <span
          class="emphasis"><em>y</em></span>) corresponds to the <code
          class="code">sigma</code> and <code class="code">xi tags</code>,
          absent of this example,</p></li>

          <li><p><span class="emphasis"><em>g</em></span>(<span
          class="emphasis"><em>x</em></span>, <span
          class="emphasis"><em>y</em></span>) to the <code
          class="code">dirichlet tag</code></p></li>
        </ul></div></li>
    </ul></div><pre class="programlisting">    &lt;stationary-pde label="<span
        class="bold"><strong>pde1</strong></span>"&gt;
      &lt;refdomain2d ref="<span class="bold"><strong>omega</strong></span>"/&gt;
      &lt;pdestate label="<span class="bold"><strong>u</strong></span>"&gt;
        &lt;name lang="french"&gt;Tension&lt;/name&gt;
        &lt;name lang="english"&gt;Voltage&lt;/name&gt;
        &lt;inside dependencies="<span class="bold"><strong>n</strong></span> <span
        class="bold"><strong>d</strong></span>"&gt;
          &lt;diffusion&gt;[10 0;0 <span class="bold"><strong>d</strong></span>]&lt;/diffusion&gt;
          &lt;proportional&gt;0&lt;/proportional&gt;
          &lt;source&gt;0&lt;/source&gt;
        &lt;/inside&gt;
        &lt;boundary&gt;
          &lt;condition bdy="<span class="bold"><strong>gamma_0</strong></span>"&gt;
            &lt;dirichlet&gt;0&lt;/dirichlet&gt;
          &lt;/condition&gt;
          &lt;condition bdy="<span class="bold"><strong>gamma_1</strong></span>"&gt;
            &lt;dirichlet&gt;a&lt;/dirichlet&gt;
          &lt;/condition&gt;
          &lt;condition bdy="<span class="bold"><strong>gamma_2</strong></span>"&gt;
            &lt;dirichlet&gt;b&lt;/dirichlet&gt;
          &lt;/condition&gt;
        &lt;/boundary&gt;
      &lt;/pdestate&gt;
    &lt;/stationary-pde&gt;</pre><p>Here also, we use the attribute <code
  class="code">dependencies</code> of the <code class="code">inside tag
  </code> to calculate only what is necessary when the parameters change.
  Thus, the assembly of the problem in the domain is redone only if <code
  class="code">n</code> or <code class="code">d</code> changes, allowing to
  vary the boundary conditions without doing aganin large useless
  calculations.</p></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="courbe_poisson"></a>2.4.&nbsp;Result display
  </h3></div></div></div><p>This section - wich follows the tag <code
  class="code">&lt;/compute&gt;</code> - allows to define the various graphic
  windows, a set of systems of axes for each of them (the windows can then be
  divided horizontally or vertically to contain them) as well as the curves
  that must be respectively displayed in each system of axis. These various
  definitions are framed by the following tags :</p><pre
  class="programlisting">  &lt;display&gt;
  ...
  &lt;/display&gt;</pre><p>In our case, only one window is divided
  horizontally into two systems of axes containing different representations
  of the surface <span class="emphasis"><em>u</em></span>(<span
  class="emphasis"><em>x</em></span>,<span
  class="emphasis"><em>y</em></span>), (<span
  class="emphasis"><em>x</em></span>,<span class="emphasis"><em>y</em></span>)
  ∈ Ω : </p><div class="itemizedlist"><ul type="disc">
      <li><p>One flat representation in 2D (x,y), the variations of u being
      illustrated by color variations.</p></li>

      <li><p>One representation in isometric 3D of the surface with
      wires.</p></li>
    </ul></div><div class="figure"><a id="id893410"></a><p
  class="title"><b>Figure&nbsp;4.3.&nbsp; Results curves </b></p><div
  align="center" class="mediaobject"><img align="middle"
  alt="Courbes résultats"
  src="images/pde/fen_courbe_tension.jpg" /></div></div><p>The corresponding
  code is as follows, the previously defined logical curves appearing in
  reference in the definition of the curves to be displayed :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>One flat representation of <code class="code">u</code> in 2D :
      the attributes <code class="code">cmin</code> and <code
      class="code">cmax</code> of the <code class="code">axis2d tag</code>
      indicate the range of variation of <code class="code">u</code>,</p></li>

      <li><p>One representation in 3D of the surface : the attribute <code
      class="code">mode="wireframe"</code> indicate that a representation with
      iron wire is desired,</p></li>
    </ul></div><pre class="programlisting">  &lt;display background="blue"&gt;
    &lt;window colormap="hot" <span class="bold"><strong>splitx="2"</strong></span>&gt;
      &lt;title lang="french"&gt;Résultats&lt;/title&gt;
      &lt;title lang="english"&gt;Results&lt;/title&gt;

      &lt;axis2d cmax="1" cmin="-1" colorbar="on" iso="yes"&gt;
        &lt;drawsurface ref="<span class="bold"><strong>u</strong></span>" shading="interp"/&gt;
      &lt;/axis2d&gt;

      &lt;axis3d xmin="-1" xmax="1" ymin="-1" ymax="1" zmin="-1" zmax="1"&gt;
        &lt;drawsurface mode="wireframe" ref="<span class="bold"><strong>u</strong></span>"/&gt;
      &lt;/axis3d&gt;

    &lt;/window&gt;
  &lt;/display&gt;</pre></div></div></div><div class="chapter" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h2 class="title"><a
  id="id893525"></a>Chapter&nbsp;5.&nbsp;Simulation of Earth-Moon
  system</h2></div></div></div><div class="toc"><p><b>Table of
  contents</b></p><dl>
      <dt><span class="section"><a href="#id893553">1. Physical description of
      the simulation</a></span></dt>

      <dt><span class="section"><a href="#id894686">2. Logics of the
      simulation description in XML</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id894712">2.1. General
          description</a></span></dt>

          <dt><span class="section"><a href="#id894735">2.2.
          Parameters</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id894822">2.2.1. System
              parameters</a></span></dt>

              <dt><span class="section"><a href="#id894994">2.2.2. Solving
              parameters</a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#id895082">2.3. Mathematical
          models </a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id895111">2.3.1. Definition
              of the variable <code class="code">t</code> and of its
              discretization interval [0, <span
              class="emphasis"><em>T</em></span>]</a></span></dt>

              <dt><span class="section"><a href="#ex_ode_terre_lune">2.3.2.
              Definition of the differential equations</a></span></dt>

              <dt><span class="section"><a href="#id895444">2.3.3. Definition
              of the parametric curve giving the trajectory of the
              earth</a></span></dt>

              <dt><span class="section"><a href="#id895506">2.3.4. Definition
              of the parametric curve giving the trajectory of the
              moon</a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#courbe_terre_lune">2.4. Results
          display</a></span></dt>
        </dl></dd>
    </dl></div><p>This exemple, that will be described completely, corresponds
  to the file <code class="filename">Physics/gravitation.xml</code> of the
  sub-directory <code class="filename">examples</code> of the XMLlab
  installation directory<span class="emphasis"><em></em></span> </p><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h2
  class="title" style="clear: both"><a id="id893553"></a>1.&nbsp;Physical
  description of the simulation</h2></div></div></div><p>The purpose is to
  simulate the movement of two or several bodies subjected to their mutual
  gravitational attractions.</p><p>In the case of two bodies, the problem was
  analytically resolved, and it is well known that the trajectories obtained
  are conics having for hearth the system gravity centre composed of these two
  bodies. The <span class="emphasis"><em>problem of three bodies</em></span>
  has always escaped the mechanics, because it is not possible any more to
  find an analytical solution (for more than three bodies either, of course).
  The problems with more than two bodies were very quickly considered because
  we very fast realized that the trajectories of planets around the sun are
  not those envisaged by the simplified theory consisting in considering as
  many problems with two bodies than there are planets in orbit: the planets
  are influenced mutually, in a weak way compared to the force of gravitation
  exerted by the Sun, but sufficiently so that the long-term trajectories are
  modified.</p><p>it was thus necessary very quickly to know how to calculate
  with precision these trajectories to constitute what is called <span
  class="emphasis"><em>ephemeris</em></span>, ie real tables where we can read
  the position of various celestial bodies for future dates. The positions of
  these bodies verify differential equations, and the techniques of
  approximation are the same ones that those used for the simulation of the
  pendulum (cf. document <em class="citetitle">Getting started
  XMLlab</em>).</p><p>We quickly will describe how to implement the simulation
  of a problem at two bodies. Initially, some recalls are necessary: let us
  consider two spherical bodies of centers <span
  class="emphasis"><em>u</em></span><sup>1</sup> = (<span
  class="emphasis"><em>x</em></span><sub>1</sub>, <span
  class="emphasis"><em>y</em></span><sub>1</sub>) and <span
  class="emphasis"><em>u</em></span><sup>2</sup> = (<span
  class="emphasis"><em>x</em></span><sub>2</sub>, <span
  class="emphasis"><em>y</em></span><sub>2</sub>), and of respective masses
  <span class="emphasis"><em>m</em></span><sub>1</sub> and <span
  class="emphasis"><em>m</em></span><sub>2</sub>. The gravitational force
  exerted by body 2 on body 1 is equal to </p><div
  class="informalequation"><mml:math display="block" overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msub>
            <mml:mi>F</mml:mi>

            <mml:mrow>
              <mml:mn>21</mml:mn>
            </mml:mrow>
          </mml:msub>

          <mml:mo>=</mml:mo>

          <mml:mo>−</mml:mo>

          <mml:mi>G</mml:mi>

          <mml:mfrac>
            <mml:mrow>
              <mml:msub>
                <mml:mi>m</mml:mi>

                <mml:mn>1</mml:mn>
              </mml:msub>

              <mml:msub>
                <mml:mi>m</mml:mi>

                <mml:mn>2</mml:mn>
              </mml:msub>
            </mml:mrow>

            <mml:mrow>
              <mml:msup>
                <mml:mrow>
                  <mml:mrow>
                    <mml:mo>‖</mml:mo>

                    <mml:mrow>
                      <mml:msup>
                        <mml:mi>u</mml:mi>

                        <mml:mn>2</mml:mn>
                      </mml:msup>

                      <mml:mo>−</mml:mo>

                      <mml:msup>
                        <mml:mi>u</mml:mi>

                        <mml:mn>1</mml:mn>
                      </mml:msup>
                    </mml:mrow>

                    <mml:mo>‖</mml:mo>
                  </mml:mrow>
                </mml:mrow>

                <mml:mn>3</mml:mn>
              </mml:msup>
            </mml:mrow>
          </mml:mfrac>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:msup>
            <mml:mi>u</mml:mi>

            <mml:mn>2</mml:mn>
          </mml:msup>

          <mml:mo>−</mml:mo>

          <mml:msup>
            <mml:mi>u</mml:mi>

            <mml:mn>1</mml:mn>
          </mml:msup>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>,</mml:mo>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><p>where <span class="emphasis"><em>G</em></span> is the
  constant of universal gravitation. The gravitational force exerted by body 1
  on body 2 is equal to its opposite, that is to say</p><p><span
  class="emphasis"><em>F</em></span><sub>12</sub> = −<span
  class="emphasis"><em>F</em></span><sub>21</sub>.</p><p>If we wish to
  simulate the movement of these two bodies according to an initial position
  and speed configuration, we must write the dynamic equations, which
  gives</p><div class="informalequation"><mml:math display="block"
      overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msup>
            <mml:mover accent="true">
              <mml:mi>u</mml:mi>

              <mml:mo>˙</mml:mo>
            </mml:mover>

            <mml:mn>1</mml:mn>
          </mml:msup>

          <mml:mo>=</mml:mo>

          <mml:msup>
            <mml:mi>v</mml:mi>

            <mml:mn>1</mml:mn>
          </mml:msup>

          <mml:mo>,</mml:mo>

          <mml:mtext> </mml:mtext>

          <mml:msup>
            <mml:mover accent="true">
              <mml:mi>u</mml:mi>

              <mml:mo>˙</mml:mo>
            </mml:mover>

            <mml:mn>2</mml:mn>
          </mml:msup>

          <mml:mo>=</mml:mo>

          <mml:msup>
            <mml:mi>v</mml:mi>

            <mml:mn>2</mml:mn>
          </mml:msup>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><p>if speeds are noted, <span
  class="emphasis"><em>v</em></span><sup>1</sup>, <span
  class="emphasis"><em>v</em></span><sup>2</sup> and </p><div
  class="informalequation"><mml:math display="block" overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:mrow>
            <mml:mo>{</mml:mo>

            <mml:mtable columnalign="left">
              <mml:mtr>
                <mml:mtd>
                  <mml:msup>
                    <mml:mover accent="true">
                      <mml:mi>v</mml:mi>

                      <mml:mo>˙</mml:mo>
                    </mml:mover>

                    <mml:mn>1</mml:mn>
                  </mml:msup>

                  <mml:mo>=</mml:mo>

                  <mml:mo>−</mml:mo>

                  <mml:mi>G</mml:mi>

                  <mml:msub>
                    <mml:mi>m</mml:mi>

                    <mml:mn>2</mml:mn>
                  </mml:msub>

                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mo stretchy="false">(</mml:mo>

                      <mml:msup>
                        <mml:mi>u</mml:mi>

                        <mml:mn>2</mml:mn>
                      </mml:msup>

                      <mml:mo>−</mml:mo>

                      <mml:msup>
                        <mml:mi>u</mml:mi>

                        <mml:mn>1</mml:mn>
                      </mml:msup>

                      <mml:mo stretchy="false">)</mml:mo>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:msup>
                        <mml:mrow>
                          <mml:mrow>
                            <mml:mo>‖</mml:mo>

                            <mml:mrow>
                              <mml:msup>
                                <mml:mi>u</mml:mi>

                                <mml:mn>2</mml:mn>
                              </mml:msup>

                              <mml:mo>−</mml:mo>

                              <mml:msup>
                                <mml:mi>u</mml:mi>

                                <mml:mn>1</mml:mn>
                              </mml:msup>
                            </mml:mrow>

                            <mml:mo>‖</mml:mo>
                          </mml:mrow>
                        </mml:mrow>

                        <mml:mn>3</mml:mn>
                      </mml:msup>
                    </mml:mrow>
                  </mml:mfrac>

                  <mml:mo>,</mml:mo>
                </mml:mtd>
              </mml:mtr>

              <mml:mtr>
                <mml:mtd>
                  <mml:msup>
                    <mml:mover accent="true">
                      <mml:mi>v</mml:mi>

                      <mml:mo>˙</mml:mo>
                    </mml:mover>

                    <mml:mn>2</mml:mn>
                  </mml:msup>

                  <mml:mo>=</mml:mo>

                  <mml:mo>+</mml:mo>

                  <mml:mi>G</mml:mi>

                  <mml:msub>
                    <mml:mi>m</mml:mi>

                    <mml:mn>1</mml:mn>
                  </mml:msub>

                  <mml:mfrac>
                    <mml:mrow>
                      <mml:mo stretchy="false">(</mml:mo>

                      <mml:msup>
                        <mml:mi>u</mml:mi>

                        <mml:mn>2</mml:mn>
                      </mml:msup>

                      <mml:mo>−</mml:mo>

                      <mml:msup>
                        <mml:mi>u</mml:mi>

                        <mml:mn>1</mml:mn>
                      </mml:msup>

                      <mml:mo stretchy="false">)</mml:mo>
                    </mml:mrow>

                    <mml:mrow>
                      <mml:msup>
                        <mml:mrow>
                          <mml:mrow>
                            <mml:mo>‖</mml:mo>

                            <mml:mrow>
                              <mml:msup>
                                <mml:mi>u</mml:mi>

                                <mml:mn>2</mml:mn>
                              </mml:msup>

                              <mml:mo>−</mml:mo>

                              <mml:msup>
                                <mml:mi>u</mml:mi>

                                <mml:mn>1</mml:mn>
                              </mml:msup>
                            </mml:mrow>

                            <mml:mo>‖</mml:mo>
                          </mml:mrow>
                        </mml:mrow>

                        <mml:mn>3</mml:mn>
                      </mml:msup>
                    </mml:mrow>
                  </mml:mfrac>

                  <mml:mo>,</mml:mo>
                </mml:mtd>
              </mml:mtr>
            </mml:mtable>
          </mml:mrow>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><p> Here body 1 is the Earth and body 2 the
  Moon.</p><p><span class="emphasis"><em>m</em></span><sub>1</sub> = 5,975e24
  ; <span class="emphasis"><em>m</em></span><sub>2</sub> = 7,35e22 ; <span
  class="emphasis"><em>G</em></span> = 6,67e-11 ; The average distance
  Earth-Moon is <span class="emphasis"><em>d</em></span><sub>TL</sub> = 3,
  84402e8 m and the rotation period is about <span
  class="emphasis"><em>T</em></span> = 27,55 days. We thus choose as initial
  positions</p><div class="informalequation"><mml:math display="block"
      overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msup>
            <mml:mi>u</mml:mi>

            <mml:mn>1</mml:mn>
          </mml:msup>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mn>0</mml:mn>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>=</mml:mo>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mn>0,</mml:mn>

          <mml:mtext> </mml:mtext>

          <mml:mn>0</mml:mn>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>,</mml:mo>

          <mml:mtext> </mml:mtext>

          <mml:msup>
            <mml:mi>u</mml:mi>

            <mml:mn>2</mml:mn>
          </mml:msup>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mn>0</mml:mn>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>=</mml:mo>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:msub>
            <mml:mi>d</mml:mi>

            <mml:mrow>
              <mml:mi>T</mml:mi>

              <mml:mi>L</mml:mi>
            </mml:mrow>
          </mml:msub>

          <mml:mo>,</mml:mo>

          <mml:mtext> </mml:mtext>

          <mml:mn>0</mml:mn>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>,</mml:mo>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><p>and as initial speeds </p><div
  class="informalequation"><mml:math display="block" overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:msup>
            <mml:mi>v</mml:mi>

            <mml:mn>1</mml:mn>
          </mml:msup>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mn>0</mml:mn>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>=</mml:mo>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mn>0,</mml:mn>

          <mml:mtext> </mml:mtext>

          <mml:mn>0</mml:mn>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>,</mml:mo>

          <mml:mtext> </mml:mtext>

          <mml:msup>
            <mml:mi>v</mml:mi>

            <mml:mn>2</mml:mn>
          </mml:msup>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mn>0</mml:mn>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>=</mml:mo>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mn>0,</mml:mn>

          <mml:mtext> </mml:mtext>

          <mml:mfrac>
            <mml:mrow>
              <mml:mn>2</mml:mn>

              <mml:mi>π</mml:mi>
            </mml:mrow>

            <mml:mi>T</mml:mi>
          </mml:mfrac>

          <mml:msub>
            <mml:mi>d</mml:mi>

            <mml:mrow>
              <mml:mi>T</mml:mi>

              <mml:mi>L</mml:mi>
            </mml:mrow>
          </mml:msub>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>.</mml:mo>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><div class="figure"><a
  id="trajectoires_terre_lune"></a><p class="title"><b>Figure&nbsp;5.1.&nbsp;
  Earth-Moon system trajectories</b></p><div align="center"
  class="mediaobject"><img align="middle"
  alt="Trajectoires du système Terre-Lune"
  src="images/gravitation/terreLune.jpg" /></div></div><div class="figure"><a
  id="trajectoires_terre_lune_CG"></a><p
  class="title"><b>Figure&nbsp;5.2.&nbsp;Trajectories of Earth-Moon system in
  the reference mark related to the centre of gravity </b></p><div
  align="center" class="mediaobject"><img align="middle"
  alt="Trajectoires du système Terre-Lune dans le repère lié au centre de gravité"
  src="images/gravitation/terreLuneCG.jpg" /></div></div><p>The <a
  href="#trajectoires_terre_lune"
  title="Figure&nbsp;5.1.&nbsp;Trajectoires du système Terre-Lune">Figure&nbsp;5.1,
  «&nbsp;Earth-Moon system trajectories»</a> shows the two trajectories
  obtained (the trajectory of the Earth will be easily recognized), that can
  seem odd but it should not be forgotten that it is necessary to be reduced
  to the centre of gravity to see there more clearly. It only takes to
  calculate the position of the centre of gravity at every moment and to
  withdraw its coordinates from those of the Moon and the Earth. This gives <a
  href="#trajectoires_terre_lune_CG"
  title="Figure&nbsp;5.2.&nbsp;Trajectoires du système Terre-Lune dans le repère lié au centre         de gravité">Figure&nbsp;5.2,
  «&nbsp;Trajectories of Earth-Moon system in the reference mark retated to
  the center of gravity&nbsp;»</a>, which is more familiar. It will be noted
  that Earth undergoes in an obvious way the influence of the
  Moon.</p></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h2 class="title" style="clear: both"><a
  id="id894686"></a>2.&nbsp;Logics of the simulation description in XML
  </h2></div></div></div><p>We will show how this simulation is translated
  into an XML file that the <span class="emphasis"><em>XMLlab</em></span> tool
  will use to generate a simulation executed by <span
  class="emphasis"><em>Scilab</em></span>. The XML file will be shown in its
  textual form. This example will be treated in a similar way than the
  preceding example.</p><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id894712"></a>2.1.&nbsp;General description
  </h3></div></div></div><p>The heading lines of the XML file always allow to
  associate to it the DTD of XMLlab, the heading lines of simulation which
  follow allowing to specify its title, its author, the keywords related to
  it.</p><pre class="programlisting">&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;!DOCTYPE simulation PUBLIC "-//UTC//DTD XMLlab V1.4//FR" "http://xmllab.org/dtd/1.4/simulation.dtd"&gt;
&lt;simulation&gt;
  &lt;header&gt;
    &lt;title&gt;Système Terre-Lune&lt;/title&gt;
    &lt;author&gt;Please set author's name&lt;/author&gt;
    &lt;keywords&gt;simulation,scilab,xml&lt;/keywords&gt;
  &lt;/header&gt;
  ...</pre></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id894735"></a>2.2.&nbsp;Parameters</h3></div></div></div><p>The
  simulation parameters are grouped in several sections, each section giving
  place to a different entry of the Parameter menu of the simulation as showns
  in the following figure:</p><div class="figure"><a id="id894754"></a><p
  class="title"><b>Figure&nbsp;5.3.&nbsp;Parameters menu entries of the
  Earth-Moon system simulation System parameters data entry Solving parameters
  data entry Earth and moon trajectories</b></p><div class="screenshot"><div
  align="center" class="mediaobject"><img align="middle"
  alt="Entrées du menu Paramètres de la simulation du système Terre-Lune"
  src="images/gravitation/fen_gravitation_menu_param.jpg" /></div></div></div><p>The
  choice of an entry then causes the display in the window of the
  corresponding parameters. The following lines introduce and name the
  sections of parameters :</p><pre class="programlisting">  &lt;parameters&gt;
    &lt;section&gt;
      &lt;title&gt;System parameters&lt;/title&gt;
      ...
    &lt;/section&gt;
    &lt;section&gt;
      &lt;title&gt;Solving parameters&lt;/title&gt;
      ...
    &lt;/section&gt;
  &lt;/parameters&gt;</pre><p>We now will describe in detail the declaration
  of the parameters of each section, whose corresponding lines appear after
  the multilingual <code class="code">&lt;title&gt;</code> tag in question
  :</p><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id894822"></a>2.2.1.&nbsp;System parameters
  </h4></div></div></div><p>Their data entry is done in the window illustrated
  by the following figure :</p><div class="figure"><a id="id894836"></a><p
  class="title"><b>Figure&nbsp;5.4.&nbsp;System parameters data entry
  </b></p><div align="center" class="mediaobject"><img align="middle"
  alt="Saisie des paramètres du système"
  src="images/gravitation/fen_param_systeme.jpg" /></div></div><p>This section
  contains the following parameters:</p><div class="itemizedlist"><ul
      type="disc">
      <li><p>Initial moon speed <code class="code">vL0</code> :</p><pre
      class="programlisting">      &lt;scalar label="<span class="bold"><strong>vL0</strong></span>" unit="ms^-1"&gt;
        &lt;name&gt;Initial moon speed&lt;/name&gt;
        &lt;value&gt;2*%pi/(27.55*24*3600)*3.84402e8&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Earth mass <code class="code">mT</code> / 1e24 :</p><pre
      class="programlisting">      &lt;scalar label="<span class="bold"><strong>mT</strong></span>" unit="m" widget="slider"
              min="4" max="5.975" increment="0.01"&gt;
        &lt;name&gt;Earth mass (1e24)&lt;/name&gt;
        &lt;value&gt;5.975&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Moon mass <code class="code">mL</code> / 1e24 :</p><pre
      class="programlisting">      &lt;scalar label="<span class="bold"><strong>mL</strong></span>" unit="m" widget="slider"
              min="0.0735" max="5.975" increment="0.01"&gt;
        &lt;name&gt;Moon mass (1e24)&lt;/name&gt;
        &lt;value&gt;0.0735&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>

      <li><p>Attack angle <code class="code">theta</code> between the
      moon-earth vector and the moon initial speed vector (<code
      class="code">theta</code> determines the direction of <span
      class="emphasis"><em>v</em></span><sup>2</sup>(0)) : </p><pre
      class="programlisting">      &lt;scalar label="<span class="bold"><strong>theta</strong></span>" unit="deg" widget="slider"
              min="1" max="179" increment="1"&gt;
        &lt;name&gt;Attack angle&lt;/name&gt;
        &lt;value&gt;90&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id894994"></a>2.2.2.&nbsp;Solving parameters
  </h4></div></div></div><p>Their data entry is done in the window illustrated
  by the following figure :</p><div class="figure"><a id="id895005"></a><p
  class="title"><b>Figure&nbsp;5.5.&nbsp;Solving parameters data entry
  </b></p><div align="center" class="mediaobject"><img align="middle"
  alt="Saisie des paramètres de résolution"
  src="images/gravitation/fen_param_resolution.jpg" /></div></div><p>This
  section contains the following parameters :</p><div class="itemizedlist"><ul
      type="disc">
      <li><p>Final <code class="code">jf</code> time (days) : it is the
      duration of simulation, the value suggested being the moon period of
      rotation <span class="emphasis"><em>T</em></span> around the earth.
      <code class="code">jf</code> is used to calculate the upper limit of the
      discretization interval involved in the resolution of the differential
      equation giving the moon and earth moves :</p><pre
      class="programlisting">      &lt;scalar label="<span class="bold"><strong>jf</strong></span>" unit="d"&gt;
        &lt;name&gt;Final time (jours)&lt;/name&gt;
        &lt;value&gt;27.55&lt;/value&gt;
      &lt;/scalar&gt;</pre></li>
    </ul></div></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id895082"></a>2.3.&nbsp;Mathematical
  models</h3></div></div></div><p>This section - that follows the tag <code
  class="code">&lt;/parameters&gt;</code> - allows to define the equations to
  be solved, the curves to calculate, as well as the range of values (1D or
  2D) that some variables must take. These various definitions are framed by
  the following tags :</p><pre class="programlisting">  &lt;compute&gt;
  ...
  &lt;/compute&gt;</pre><p>Concerning our simulation of celestial mechanics,
  the following elements are defined:</p><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="id895111"></a>2.3.1.&nbsp;Definition of the variable <code
  class="code">t</code> and of its discretization interval [0, <span
  class="emphasis"><em>T</em></span>]</h4></div></div></div><p>It is the
  integration variable used for the solution of our differential equation, the
  discretization interval being cut out in 1000 steps :</p><pre
  class="programlisting">    &lt;defdomain1d label="<span class="bold"><strong>t</strong></span>" unit="s"&gt;
      &lt;name&gt;Time&lt;/name&gt;
      &lt;discretization interval="linear" steps="1000"&gt;
        &lt;initialvalue&gt;0&lt;/initialvalue&gt;
        &lt;finalvalue&gt;<span class="bold"><strong>jf</strong></span>*24*3600&lt;/finalvalue&gt;
      &lt;/interval&gt;
    &lt;/defdomain1d&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="ex_ode_terre_lune"></a>2.3.2.&nbsp;Definition of the differential
  equations</h4></div></div></div><p>Definition of the <code class="code">ode
  element</code> (ordinary differential equation) grouping together :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>the reference to the integration variable <code
      class="code">t</code> and to its domain of variation,</p></li>

      <li><p>the definition of the states <code class="code">xT</code> and
      <code class="code">vT</code> (earth position and speed) on the one hand,
      <code class="code">xL</code> and <code class="code">vL</code> (moon
      position and speed) on the other hand, with for each one of them its
      derivative and its initial value; it should be noted that each one of
      these states is a vector having two components <span
      class="emphasis"><em>x</em></span> and <span
      class="emphasis"><em>y</em></span> (<code
      class="code">size="2"</code>),</p></li>

      <li><p>the exit <code class="code">xG</code> giving the position of the
      gravity centre of the Earth-Moon system.</p></li>
    </ul></div><pre class="programlisting">    &lt;ode label="<span
        class="bold"><strong>terre_lune</strong></span>"&gt;
      &lt;refdomain1d ref="<span class="bold"><strong>t</strong></span>"/&gt;

      &lt;states&gt;
        &lt;variable label="<span class="bold"><strong>r3</strong></span>"&gt;norm(<span
        class="bold"><strong>xT</strong></span>-<span class="bold"><strong>xL</strong></span>)^3&lt;/variable&gt;

        &lt;state label="<span class="bold"><strong>xT</strong></span>" size="2"&gt;
          &lt;name&gt;Earth position&lt;/name&gt;
          &lt;derivative&gt;<span class="bold"><strong>vT</strong></span>&lt;/derivative&gt;
          &lt;initialcondition&gt;[0;0]&lt;/initialcondition&gt;
        &lt;/state&gt;

        &lt;state label="<span class="bold"><strong>vT</strong></span>" size="2"&gt;
          &lt;name&gt;Earth speed&lt;/name&gt;
          &lt;derivative&gt;6.67e-11*<span class="bold"><strong>mL</strong></span>*1e24*(<span
        class="bold"><strong>xL</strong></span>-<span class="bold"><strong>xT</strong></span>)/<span
        class="bold"><strong>r3</strong></span>&lt;/derivative&gt;
          &lt;initialcondition&gt;[0;0]&lt;/initialcondition&gt;
        &lt;/state&gt;

        &lt;state label="<span class="bold"><strong>xL</strong></span>" size="2"&gt;
          &lt;name&gt;Moon position&lt;/name&gt;
          &lt;derivative&gt;<span class="bold"><strong>vL</strong></span>&lt;/derivative&gt;
          &lt;initialcondition&gt;[3.84402e8;0]&lt;/initialcondition&gt;
        &lt;/state&gt;

        &lt;state label="<span class="bold"><strong>vL</strong></span>" size="2"&gt;
          &lt;name&gt;Moon speed&lt;/name&gt;
          &lt;derivative&gt;6.67e-11*<span class="bold"><strong>mT</strong></span>*1e24*(<span
        class="bold"><strong>xT</strong></span>-<span class="bold"><strong>xL</strong></span>)/<span
        class="bold"><strong>r3</strong></span>&lt;/derivative&gt;
          &lt;initialcondition&gt;<span class="bold"><strong>
            vL0</strong></span>*[cos(%pi*<span class="bold"><strong>theta</strong></span>/180);sin(%pi*<span
        class="bold"><strong>theta</strong></span>/180)]
          &lt;/initialcondition&gt;
        &lt;/state&gt;
      &lt;/states&gt;

      &lt;outputs&gt;
        &lt;output label="<span class="bold"><strong>xG</strong></span>"&gt;
          &lt;name&gt;Gravity centre&lt;/name&gt;
          &lt;value&gt;(<span class="bold"><strong>xL</strong></span>*<span
        class="bold"><strong>mL</strong></span>+<span class="bold"><strong>xT</strong></span>*<span
        class="bold"><strong>mT</strong></span>)/(<span class="bold"><strong>mL</strong></span>+<span
        class="bold"><strong>mT</strong></span>)&lt;/value&gt;
        &lt;/output&gt;
      &lt;/outputs&gt;
    &lt;/ode&gt;</pre></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id895444"></a>2.3.3.&nbsp;Definition of the parametric curve giving the
  trajectory of the earth</h4></div></div></div><p>It consists in the earth
  position relative to the centre of gravity of the Earth-Moon system
  :</p><pre class="programlisting">    &lt;parametriccurve2d label="<span
        class="bold"><strong>traj_terre</strong></span>"&gt;
      &lt;name&gt;Earth&lt;/name&gt;
      &lt;refdomain1d ref="<span class="bold"><strong>t</strong></span>"/&gt;
      &lt;x1&gt;
        &lt;value&gt;<span class="bold"><strong>xT</strong></span>(:,1)-<span
        class="bold"><strong>xG</strong></span>(:,1)&lt;/value&gt;
      &lt;/x1&gt;
      &lt;x2&gt;
        &lt;value&gt;<span class="bold"><strong>xT</strong></span>(:,2)-<span
        class="bold"><strong>xG</strong></span>(:,2)&lt;/value&gt;
      &lt;/x2&gt;
    &lt;/parametriccurve2d&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="id895506"></a>2.3.4.Definition of the parametric curve giving the
  trajectory of the moon</h4></div></div></div><p>It consists in the moon
  position relative to the centre of gravity of the Earth-Moon system
  :</p><pre class="programlisting">    &lt;parametriccurve2d label="<span
        class="bold"><strong>traj_lune</strong></span>"&gt;
      &lt;name&gt;Moon&lt;/name&gt;
      &lt;refdomain1d ref="<span class="bold"><strong>t</strong></span>"/&gt;
      &lt;x1&gt;
        &lt;value&gt;<span class="bold"><strong>xL</strong></span>(:,1)-<span
        class="bold"><strong>xG</strong></span>(:,1)&lt;/value&gt;
      &lt;/x1&gt;
      &lt;x2&gt;
        &lt;value&gt;<span class="bold"><strong>xL</strong></span>(:,2)-<span
        class="bold"><strong>xG</strong></span>(:,2)&lt;/value&gt;
      &lt;/x2&gt;
    &lt;/parametriccurve2d&gt;</pre></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="courbe_terre_lune"></a>2.4.&nbsp;Results
  display</h3></div></div></div><p>This section - that follows the tag <code
  class="code">&lt;/compute&gt;</code> - allows to define the different
  graphic windows, a set of system of axes for each one of it (windows can
  then be divided horizontally or vertically to contain them) as well as the
  curves that must be respectively displayed in each system of axis. These
  different definitions are framed by the following tags :</p><pre
  class="programlisting">  &lt;display&gt;
  ...
  &lt;/display&gt;</pre><p>In our case, only one window contains a system of
  cartesian axis containing the curves of the earth and the moon
  trajectories:</p><div class="figure"><a id="id895602"></a><p
  class="title"><b>Figure&nbsp;5.6.&nbsp;Earth and moon
  trajectories</b></p><div align="center" class="mediaobject"><img
  align="middle" alt="Trajectoires de la terre et de la lune"
  src="images/gravitation/fen_trajectoires.jpg" /></div></div><p>The
  corresponding code is as follows, the logical curves previously definited
  appearing in reference in the definition of the curves to display :</p><pre
  class="programlisting">  &lt;display&gt;
    &lt;window&gt;
      &lt;title&gt;System orbits&lt;/title&gt;
      &lt;axis2d position="initial" iso="yes"
              xmin="-5e8" ymin="-5e8" xmax="5e8" ymax="5e8"&gt;
        &lt;drawcurve2d ref="<span class="bold"><strong>moon_traj</strong></span>"/&gt;
        &lt;drawcurve2d ref="<span class="bold"><strong>earth_traj</strong></span>" color="green"/&gt;
      &lt;/axis2d&gt;
    &lt;/window&gt;
  &lt;/display&gt;</pre></div></div></div><div class="chapter" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h2 class="title"><a
  id="id895662"></a>Chapter&nbsp;6.&nbsp;Reference of the elements
  participating in the description of a simulation</h2></div></div></div><div
  class="toc"><p><b>Table of contents</b></p><dl>
      <dt><span class="section"><a href="#id895904">1. General
      description</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id895916">File and simulation
          headings</a></span></dt>

          <dt><span class="section"><a href="#balise_notes">1.2. Notes about
          the simulation</a></span></dt>
        </dl></dd>

      <dt><span class="section"><a href="#balise_parameters">2.
      Parameters</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#balise_subsection">2.1. <code
          class="code">Subsection Tag</code></a></span></dt>

          <dt><span class="section"><a href="#balise_database">2.2. <code
          class="code">Database Tag</code></a></span></dt>

          <dt><span class="section"><a href="#id896698">2.3. <code
          class="code">Group Tag</code></a></span></dt>

          <dt><span class="section"><a href="#id896782">2.4. <code
          class="code">Scalar Tag</code></a></span></dt>

          <dt><span class="section"><a href="#balise_matrix">2.5. <code
          class="code">Matrix Tag</code></a></span></dt>

          <dt><span class="section"><a href="#balise_point">2.6. <code
          class="code">Point Tag</code></a></span></dt>

          <dt><span class="section"><a href="#balise_record">2.7. <code
          class="code">Record Tag</code></a></span></dt>
        </dl></dd>

      <dt><span class="section"><a href="#balise_actions">3.
      Actions</a></span></dt>

      <dt><span class="section"><a href="#id898070">4. Script or mathematical
      models</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id898099">4.1.
          Script</a></span></dt>

          <dt><span class="section"><a href="#modeles_mathematiques">4.2.
          Mathematical models</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#def_ref_domain1d">4.2.1.
              <code class="code">Defdomain1d</code> and <code
              class="code">refdomain1d Tags</code></a></span></dt>

              <dt><span class="section"><a href="#def_ref_domain2d">4.2.2.
              <code class="code">Defdomain2d</code> and <code
              class="code">refdomain2d Tags</code></a></span></dt>

              <dt><span class="section"><a href="#id898514">4.2.3. <code
              class="code">Ode Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id898825">4.2.4. <code
              class="code">Implicitfunction Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id899263">4.2.5. <code
              class="code">Stationary-pde Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id900089">4.2.6. <code
              class="code">Nonparametriccurve2d Tag</code></a></span></dt>

              <dt><span class="section"><a href="#parametriccurve2d">4.2.7.
              <code class="code">Parametriccurve2d Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id900479">4.2.8. <code
              class="code">Parametriccurve3d Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id900727">4.2.9. <code
              class="code">Nonparametricsurface Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id900888">4.2.10. <code
              class="code">Parametricsurface Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id901154">4.2.11. <code
              class="code">Polyline Tag</code></a></span></dt>
            </dl></dd>
        </dl></dd>

      <dt><span class="section"><a href="#id901273">5. Results
      display</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id901375">5.1. &nbsp;Systems of
          axes</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#id901381">5.1.1. <code
              class="code">Axis2d Tag</code></a></span></dt>

              <dt><span class="section"><a href="#id901646">5.1.2. A<code
              class="code">xis3d Tag</code></a></span></dt>
            </dl></dd>

          <dt><span class="section"><a href="#courbes_et_surfaces">5.2. Curves
          and surfaces</a></span></dt>

          <dd><dl>
              <dt><span class="section"><a href="#balise_drawcurve2d">5.2.1.
              D<code class="code">rawcurve2d Tag</code></a></span></dt>

              <dt><span class="section"><a href="#balise_drawcurve3d">5.2.2.
              D<code class="code">rawcurve3d Tag</code></a></span></dt>

              <dt><span class="section"><a href="#drawsurface">5.2.3. D<code
              class="code">rawsurface Tag</code></a></span></dt>

              <dt><span class="section"><a href="#balise_drawpoints">5.2.4.
              D<code class="code">rawpoints Tag</code></a></span></dt>
            </dl></dd>
        </dl></dd>

      <dt><span class="section"><a href="#balise_save">6. Saving simulation
      results </a></span></dt>
    </dl></div><p>We are going to detail exhaustively all the XML tags that
  can participate to the description of a simulation. They can be classified
  into four main categories:</p><div class="itemizedlist"><ul type="disc">
      <li><p>heading, titles and multilingual notes , image (displaying for
      example the equations governing the simulation),</p></li>

      <li><p>parameters: scalars, matrices, points 2D-3D (possibly
      constrained), definition of sets of values of experimentation for a
      group of scalar or matric parameters, regroupings of parameters in
      sections,</p></li>

      <li><p>calculation elements: domain 1D-2D, different curves and surfaces
      2D-3D (parametric or not), differential equations defined by a list of
      states and exits, implicit systems of functions, equations with
      stationary partial derivatives, inclusion of Scilab
      mini-scripts,</p></li>

      <li><p>display elements of the simulation results : windows, curves
      "continues" 2D cartesian or polar", curves 2D of points, 2D-3D surfaces
      and 3D curves.</p></li>
    </ul></div><p>The following conventions are used in the description of XML
  tags :</p><div class="itemizedlist"><ul type="disc">
      <li><p>Attributes in <span class="bold"><strong>bold</strong></span> are
      obligatorily present, the values in <span class="bold"><strong><span
      class="bold"><strong>bold</strong></span></strong></span> cannot be
      modified,</p></li>

      <li><p>Texts in <em><span class="remark">italic bordeaux</span></em>
      specify the use of the tags</p></li>

      <li><p>Opening tags are preceded if necessary by an indication in
      <em><span class="remark">italic bordeaux</span></em> on their possible
      number of occurences</p></li>

      <li><p>Concerning the values of attributes or of body of tag :</p><div
      class="itemizedlist"><ul type="circle">
          <li><p>A free value is represented by a text in<em
          class="replaceable"><code> italic</code></em> describing this
          value,</p></li>

          <li><p>A value forced in a set of possible values is represented as
          follows.</p><pre class="programlisting">"<span class="bold"><strong>default_value</strong></span>|value_2|...|value_<em
                class="replaceable"><code>n</code></em>"</pre></li>
        </ul></div></li>

      <li><pre class="programlisting">&lt;tag_1|tag_2|...|tag_<em
            class="replaceable"><code>n</code></em>&gt;</pre><p>indicates an
      alternative between several possible tags at this place,</p></li>

      <li><pre class="programlisting">&lt;tag_1&gt;<em><span class="remark">...</span></em>
  <em><span class="remark">OR</span></em>
&lt;tag_2&gt;<em><span class="remark">...</span></em></pre><p>also indicates
      an alternative, here between two tags,</p></li>

      <li><p>the values of the attributes <code class="code">label</code> must
      obligatorily be correct <span class="emphasis"><em>Scilab</em></span>
      variable identifiers: start with an alphabetical character (not
      accentuated) or with '<code class="code">_</code>', and be followed by
      alphanumeric characters or with '<code class="code">_</code>'. It is to
      note that most of the softwares allowing to edit an XML file do this
      check.</p></li>
    </ul></div><p>For an introduction to the XML tag language, the following
  site can be consulted : <code
  class="uri">http://www.infomaniak.ch/support/details_categorie.php?iCodeCategorie=7</code></p><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h2
  class="title" style="clear: both"><a id="id895904"></a>1.&nbsp;General
  description </h2></div></div></div><p>It includes a heading of the
  simulation and the possible associated notes.</p><div class="section"
  lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h3
  class="title"><a id="id895916"></a>1.1.&nbsp;File and simulation
  headings</h3></div></div></div><p>The heading lines of the XML file allows
  to associate it to the DTD of XMLlab:</p><pre class="programlisting">&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;!DOCTYPE simulation PUBLIC "-//UTC//DTD XMLlab V1.4//FR"
"http://xmllab.org/dtd/1.4/simulation.dtd"&gt;</pre><p>The following
  heading lines of the simulation that allows to specify the title, the
  author, the version, the date, the keywords that are related to it, as well
  as an image (for example equations governing the simulation) displayed
  permanently at the bottom of the parameters tuning window..</p><pre
  class="programlisting">&lt;simulation version="<span class="bold"><strong>1.4</strong></span>" label="<em
        class="replaceable"><code>id_simulation</code></em>"&gt;
<em><span class="remark">  -&gt; id_simulation will allow in the futur to identify the simulation to dialogue with others Tk applications, but not currently used
</span></em>
<em><span class="remark">  once and only once :
</span></em>  &lt;header&gt;

<em><span class="remark">    one or several times :
</span></em>    &lt;title lang="french|english|german|spanish"&gt;
      S<em class="replaceable"><code>imulation title in a given language </code></em>
    &lt;/title&gt;

<em><span class="remark">    maximum once:
</span></em>    &lt;author email="<em class="replaceable"><code>author email</code></em>"&gt;
      S<em class="replaceable"><code>imulation authors</code></em>
    &lt;/author&gt;

<em><span class="remark">    maximum once :
</span></em>    &lt;version&gt;<em class="replaceable"><code>Simulation version</code></em>&lt;/version&gt;

<em><span class="remark">    maximum once:
</span></em>    &lt;date&gt;<em class="replaceable"><code>Simulation date</code></em>&lt;/date&gt;

<em><span class="remark">    none or several times :
</span></em>    &lt;keywords lang="french|english|german|spanish"&gt;
      <em class="replaceable"><code>Simulation keywords</code></em>
    &lt;/keywords&gt;

<em><span class="remark">    maximum once :
</span></em>    &lt;image <span class="bold"><strong>href</strong></span>="I<em
        class="replaceable"><code>mage file </code></em>path" /&gt;

  &lt;/header&gt;
  ...</pre></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="balise_notes"></a>1.2.&nbsp;Notes about the
  simulation</h3></div></div></div><p>Lines defining multilingual notes can
  eventually be added, which are displayed during the selection of the menu
  entry <span class="guimenuitem">XMLlab-&gt;About this simulation</span>
  :</p><pre class="programlisting"><em><span class="remark">  none or several times :
</span></em>  &lt;notes lang="french|english|german|spanish"&gt;
none or several times<em><span class="remark"> :
</span></em>    &lt;p&gt;<em class="replaceable"><code>Simulation notes</code></em>&lt;/p&gt;
  &lt;/notes&gt;</pre></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h2 class="title"
  style="clear: both"><a
  id="balise_parameters"></a>2.&nbsp;Parameters</h2></div></div></div><p>The
  simulation parameters, if it has some, are defined within a single tag <code
  class="code">&lt;parameters&gt;...&lt;/parameters&gt;</code>, this one being
  divided into several sections, each of them allowing to group logically a
  set of parameters, and giving place to a different entry of <span
  class="guimenu">the menu Parameters of the</span> simulation. One section at
  least must be defined</p><p>The choice of an entry causes then the display
  of the corresponding parameters. Here is the structure of the definition of
  the parameters:</p><pre class="programlisting"><em><span class="remark">  maximum once :
</span></em>  &lt;parameters widget="<span class="bold"><strong>plain</strong></span>|notebook"&gt;

<em><span class="remark">    one or several times :
</span></em>    &lt;section hidden="<span class="bold"><strong>no</strong></span>" label="<em
        class="replaceable"><code>id_section</code></em>"&gt;
                           <em><span class="remark">-&gt; id_section is reserved for a futur use </span></em>

<em><span class="remark">      none or several times :
</span></em>      &lt;title lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code>section title (and of the submenu or corresponding tabs)</code></em>
        <em><span class="remark">cf. attribute widget explanation of parameters tag follows</span></em> 
      &lt;/title&gt;

<em><span class="remark">      none or several times :
</span></em>      &lt;notes lang="french|english|german|spanish"&gt;
<em><span class="remark">        one or several times :
</span></em>        &lt;p&gt;<em class="replaceable"><code>section note</code></em>&lt;/p&gt;
      &lt;/notes&gt;

<em><span class="remark">      one or several times :
</span></em>      &lt;scalar|matrix|point|group&gt;<em><span class="remark">... tags to be detailed further  </span></em>
    <em><span class="remark">    OR</span></em>
<em><span class="remark">      one or several times :
</span></em>      &lt;subsection|database&gt;<em><span class="remark">... tags to be detailed further</span></em>

    &lt;/section&gt;

  &lt;/parameters&gt;</pre><p>The use of the form<code class="code">
  &lt;parameters widget="notebook"&gt;</code> leads to a presentation of the
  IHM of the window based on tabs (only the menu File remains) rather than
  based on menus and submenus to reach the different sections of parameters,
  to the saving) of the simulation results, as well as the notes concerning
  XMLlab and the ones concerning the simulation. This is illustrated by the
  following figure: </p><div class="figure"><a id="id896236"></a><p
  class="title"><b>Figure&nbsp;6.1.&nbsp;IHM presentation based on tags
  &nbsp;</b></p><div align="center" class="mediaobject"><img align="middle"
  alt="Présentation de l'IHM à base d'onglets"
  src="images/reference/fen_widget_notebook.jpg" /></div></div><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h3
  class="title"><a id="balise_subsection"></a>2.1. <code
  class="code">Subsection Tag</code></h3></div></div></div><p>It allows,
  inside a section, to group logically a set of parameters, the parameters of
  each subsection being then gathered visually in the data entry window. The
  structure of this tag is as follows:</p><pre class="programlisting">      &lt;subsection hidden="<span
        class="bold"><strong>no</strong></span>" label="<em
        class="replaceable"><code>id_sous-section</code></em>"
                  tearoff="yes|<span class="bold"><strong>no</strong></span>" <em><span
          class="remark">explanation of this attribute follows</span></em>
      &gt;

<em><span class="remark">        none or several times :
</span></em>        &lt;title lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>subsection title (and the framework surrounding its parameters)</code></em>
          <em><span class="remark">cf. exemple below</span></em>
        &lt;/title&gt;

<em><span class="remark">        none or several times :
</span></em>        &lt;notes lang="french|english|german|spanish"&gt;
<em><span class="remark">          one or several times :
</span></em>          &lt;p&gt;<em class="replaceable"><code>section note</code></em>&lt;/p&gt;
        &lt;/notes&gt;

<em><span class="remark">        one or several times :
</span></em>        &lt;scalar|matrix|point|group&gt;<em><span class="remark">... tags to be detailed further</span></em>

    &lt;/subsection&gt;</pre><p>Here is an example of a IHM corresponding to a
  section separated into two subsections. Coefficients of the right and Data
  of the user whose attribute <code class="code">tearoff</code> was located at
  <code class="code">yes</code> : one click on the icon <img
  src="images/reference/icone_tearoff.jpg"></img> involve then the display of
  the corresponding subsection in a separate window.</p><div class="figure"><a
  id="id896381"></a><p class="title"><b>Figure&nbsp;6.2.&nbsp;Subsection
  utilization exemple </b></p><div align="center" class="mediaobject"><img
  align="middle" alt="Exemple d'utilisation de sous-sections"
  src="images/reference/fen_ex_sous_section.jpg" /></div></div><div
  class="figure"><a id="id896403"></a><p
  class="title"><b>Figure&nbsp;6.3.&nbsp;Exemple of a subsection displayed in
  a separate window </b></p><div align="center" class="mediaobject"><img
  align="middle"
  alt="Exemple d'une sous-section affichée dans une fenêtre séparée"
  src="images/reference/fen_sous_section_separee.jpg" /></div></div></div><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h3
  class="title"><a id="balise_database"></a>2.2.&nbsp;<code
  class="code">Database Tag</code></h3></div></div></div><p>It allows to
  define a set of experimentation values for a set of scalar or matric
  parameters, each value sets being named. The file <code
  class="filename">Acid-equilibria/Acid_base_titration.xml</code> provided in
  the subdirectory <code class="filename">examples</code> of the <span
  class="emphasis"><em>XMLlab</em></span> installation repertory illustrates
  its use: it consists of a simulation of titration in aqueous media and the
  figure below shows the set of parameters values for citric Acid among a
  group of sets of values whose choice is carried out via a scrolling list.
  </p><div class="figure"><a id="id896469"></a><p
  class="title"><b>Figure&nbsp;6.4. Parameters data entry for the species to
  be titrated </b></p><div align="center" class="mediaobject"><img
  align="middle" alt="Saisie des paramètres de l'espèce à titrer"
  src="images/Acid_base_titration/fen_param_espece_a_titrer.jpg" /></div></div><p>It
  is also possible to specify that the group of the sets of values is
  modifiable (via the attribute <code class="code">editable</code> of the
  <code class="code">database tag</code>), the possible modifications being
  then the following ones (simulation is started again after each
  modification) :</p><div class="itemizedlist"><ul type="disc">
      <li><p>Addition of a set of values: select the entry Defined by the
      user: rename it with the name of this new set, fill the values of the
      corresponding parameters, and click on the icon <img
      src="images/Acid_base_titration/icone_enregistrer.jpg"></img> to save
      the change in the XML file.</p></li>

      <li><p>Removal of a set of values: select the entry to be removed, and
      click on the icon to save the deletion in the <img
      src="images/Acid_base_titration/icone_supprimer.jpg"></img> XML
      file.</p></li>

      <li><p>Modification of the entry selected initially : select it, and
      click on the icon <img
      src="images/Acid_base_titration/icone_par_defaut.jpg"></img> to save the
      modification in the XML file.</p></li>
    </ul></div><p>Here is the structure of the definition of a group of sets
  of values :</p><pre class="programlisting">      &lt;database editable="yes|<span
        class="bold"><strong>no</strong></span>"
                tearoff="yes|<span class="bold"><strong>no</strong></span>" <em><span
          class="remark">cf. <a href="#balise_subsection"
            title="2.1.&nbsp;Balise subsection">Section&nbsp;2.1, «&nbsp;<code
              class="code">Subsection</code>&nbsp;tag»</a></span></em>
                label="<em class="replaceable"><code>id_database</code></em>" <em><span
          class="remark">-&gt; reserved for a futur use</span></em>
      &gt;

<em><span class="remark">        none or several times :
</span></em>        &lt;title lang="french|english|german|spanish"&gt;
          title of the all set values <em class="replaceable"><code>
         (and the framework surrounding its parameters)</code></em>
        &lt;/title&gt;

<em><span class="remark">Definition of all parameters of each values set :
</span></em><em><span class="remark">        one or several times :
</span></em>        &lt;scalar|matrix|group&gt;<em><span class="remark">... tags to be detailed further</span></em>

<em><span class="remark"><em><span class="remark">Definition of all values set with for each one of them the corresponding parameter value  :
</span></em>        none or several times :
</span></em>        &lt;record&gt;
          <em><span class="remark">... cf. <a href="#balise_record"
            title="2.7.&nbsp;Balise record">Section&nbsp;2.7, «&nbsp;<code
              class="code">Record tag</code>&nbsp;»</a></span></em>
        &lt;/record&gt;

      &lt;/database&gt;</pre><p>Concerning the <code class="code">group</code>
  sub-tag of the <code class="code">database tag</code>, it is necessary to
  specify that it cannot, in this case, contain a <code class="code">point
  tag</code>.</p></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id896698"></a>2.3.&nbsp;<code class="code">Group
  Tag</code></h3></div></div></div><p>It allows to logically group a set of
  parameters inside a section or a sub-section, the parameters in question
  appearing on the same line. The following figure presents an example
  concerning the same section of parameters illustrated by <a
  href="#fig_param_titrage"
  title="Figure&nbsp;3.4.&nbsp;Saisie des paramètres du titrage">Figure&nbsp;3.4,
  «&nbsp;Data entry of the titration parameter&nbsp;»</a>, and for which
  subsections were replaced by groups:</p><div class="figure"><a
  id="id896720"></a><p class="title"><b>Figure&nbsp;6.5.&nbsp;<code
  class="code">Group Tag example </code></b></p><div align="center"
  class="mediaobject"><img align="middle"
  alt="Exemple d'utilisation de la balise group"
  src="images/reference/fen_ex_groupe.jpg" /></div></div><p>Here is the
  structure of the definition of a parameters group :</p><pre
  class="programlisting">      &lt;group&gt;

<em><span class="remark">        none or several times :
</span></em>        &lt;title lang="french|english|german|spanish"&gt;
          Title of parameters group<em class="replaceable"><code>
</code></em>        &lt;/title&gt;

<em><span class="remark">Definition of all paramameters group :
</span></em><em><span class="remark">        one or several times :
</span></em>        &lt;scalar|matrix|point&gt;<em><span class="remark">... tags to be detailed further</span></em>

      &lt;/group&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="id896782"></a>2.4.&nbsp;<code class="code">Scalar
  Tag</code></h3></div></div></div><p>It consist of the definition of a scalar
  parameter, whose value is possibly forced by boundaries, as well as the
  <span class="foreignphrase"><em class="foreignphrase">widget</em></span>
  used for its data entry :</p><pre class="programlisting">      &lt;scalar <span
        class="bold"><strong>label</strong></span>="<em class="replaceable"><code>id_scalaire</code></em>" unit="<em
        class="replaceable"><code>scalar unit</code></em>"
              widget="<span class="bold"><strong>entry</strong></span>|slider|hidden|animate"
              state="disabled|<span class="bold"><strong>normal</strong></span>"
<em><span class="remark">                -&gt; disabled makes insensible the widget,
                   preventing the parameter data entry 
</span></em>
<em><span class="remark">              The two following attributes are at present useful only if widget="slider|animate", but they will be useful in a futur use
              in a widget entry to do a verification in the data entry.
</span></em>              min="scalar <em class="replaceable"><code>minimun</code></em>" max="<em
        class="replaceable"><code>scalar maximum</code></em>"
<em><span class="remark">                -&gt; define the potential boundaries 
                   the scalar minimun and maximun 

</span></em>              increment="scalar increment step<em
        class="replaceable"><code> </code></em>"
<em><span class="remark">                -&gt; used when the scalar increases or decreases of one step :
                   - widget="animate" : during the animation
                   - widget="slider"  : during a slider left or right click
</span></em>              period="scalar period<em class="replaceable"><code> </code></em>(default value 10)"
<em><span class="remark">                -&gt; Number of milliseconds between each parameter value variation during an animation
</span></em>
              scale="s<em class="replaceable"><code>calar scale</code></em> (default value 1)"
<em><span class="remark">                -&gt; It is the factor between the data entry value and 
                   the scalar value attributed
</span></em>      &gt;
<em><span class="remark">
        one or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>parameter name as displayed in the data entry zone </code></em>
        &lt;/name&gt;

<em><span class="remark">Notes for the sole purpose of comments on the scalar parameter:</span></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;notes lang="french|english|german|spanish"&gt;
<em><span class="remark">          one or several times :
</span></em>          &lt;p&gt;scalar parameter notes&lt;/p&gt;
        &lt;/notes&gt;

<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>parameter initial value</code></em>
        &lt;/value&gt;

      &lt;/scalar&gt;</pre><p>Here are examples of representations for the
  different possible values of the attribute <code class="code">widget</code>
  :</p><div class="itemizedlist"><ul type="disc">
      <li><p><code class="code">entry</code> : <img
      src="images/reference/ex_widget_entry.jpg"></img></p></li>

      <li><p><code class="code">slider</code> : <img
      src="images/reference/ex_widget_slider.jpg"></img></p></li>

      <li><p><code class="code">hidden</code> : this attribute indicates that
      there is no representation associated with this parameter. It is a
      parameter for an internal use of the simulation, such as for example a
      physical or a chemical constant.</p></li>

      <li><p><code class="code">animate</code> : it allows the user to make
      the parameter value vary continuously between its defined boundaries,
      and according to the specified incrementation step. Thus, the
      representation below results from the following code : <img
      src="images/reference/ex_widget_animate.jpg"></img></p><pre
      class="programlisting">      &lt;scalar label="iv" widget="animate"
              min="0" max="500" increment="1" period="40"&gt;
        &lt;name&gt;Instant of visualization&lt;/name&gt;
        &lt;value&gt;1&lt;/value&gt;
      &lt;/scalar&gt;</pre><p>The 4 buttons located beside the slider allows
      respectively :</p><div class="itemizedlist"><ul type="circle">
          <li><p>to start the animation up to the end value of the
          parameter,</p></li>

          <li><p>to start it by restarting from the initial value when the
          final value is reached,</p></li>

          <li><p>to start it by restarting in opposite direction toward the
          initial value when the final value is reached,</p></li>

          <li><p>to put the animation in pause.</p></li>
        </ul></div></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a id="balise_matrix"></a>2.5.
  M<code class="code">atrix Tag</code></h3></div></div></div><p>It consists of
  the definition of a matrix parameter, whose value can eventually be saved or
  loaded from a file, and whose either the line titles, or the columns titles
  are defined :</p><pre class="programlisting">      &lt;matrix <span
        class="bold"><strong>label</strong></span>="<em class="replaceable"><code>id_matrice</code></em>"
              rows="<em class="replaceable"><code>number of line</code></em>s" cols="<em
        class="replaceable"><code>number of columns</code></em>"

<em><span class="remark">              The two next attributes respectively indicates that the
              empty or null lines and/or columns located at the matrix ends
              must be deleted.
</span></em>              striprow="yes|<span class="bold"><strong>no</strong></span>"
              stripcol="yes|<span class="bold"><strong>no</strong></span>"

<em><span class="remark">              The three next attributes indicates if the download icon, save icon and clear icon,
              must be respectively displayed (cf. example bellow).
</span></em>              load="yes|<span class="bold"><strong>no</strong></span>"
              save="yes|<span class="bold"><strong>no</strong></span>"
              clear="yes|<span class="bold"><strong>no</strong></span>"

              widget="hidden|<span class="bold"><strong>normal</strong></span>"
                <em><span class="remark">-&gt; indicate if the data entry acquisition widget is visible or not</span></em>
      &gt;
<em><span class="remark">
        one or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>Parameter name as displayed above of the data entry matrix </code></em>
        &lt;/name&gt;

<em><span class="remark">Notes for the sole purpose of comments on the matrix parameter :</span></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;notes lang="french|english|german|spanish"&gt;
<em><span class="remark">          one or several times :
</span></em>          &lt;p&gt;<em class="replaceable"><code>scalar parameter note</code></em>&lt;/p&gt;
        &lt;/notes&gt;

<em><span class="remark">Definition of the columns or the lines titles and defaut values :
        none or several times :
</span></em>        &lt;col&gt;
<em><span class="remark">          none or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            <em class="replaceable"><code>title of this column</code></em>
          &lt;/name&gt;
<em><span class="remark">          once and only once :
</span></em>          &lt;value&gt;
            <em class="replaceable"><code>initial value of this column elements</code></em>
          &lt;/value&gt;
        &lt;/col&gt;
    <em><span class="remark">      OR</span></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;row&gt;
<em><span class="remark">          none or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            <em class="replaceable"><code>title of this line</code></em>
          &lt;/name&gt;
<em><span class="remark">          once and only once :
</span></em>          &lt;value&gt;
            <em class="replaceable"><code>initial value of this line elements</code></em>
          &lt;/value&gt;
        &lt;/row&gt;

      &lt;/matrix&gt;</pre><p>Here is an example of data entry window of a
  64x2 matrix parameter, the lines corresponding to experimental data, and
  both columns corresponding respectively to their abscissa and to their
  ordinate :</p><div class="figure"><a id="id897280"></a><p
  class="title"><b>Figure&nbsp;6.6.&nbsp;Data entry of experimental data
  &nbsp;</b></p><div align="center" class="mediaobject"><img align="middle"
  alt="Saisie des points expérimentaux"
  src="images/Acid_base_titration/fen_param_pts_experim.jpg" /></div></div><p>It
  can be saved using the icon <img
  src="images/Acid_base_titration/icone_enregistrer.jpg"></img> (<code
  class="code">save="yes"</code>) in a text file having the extension <code
  class="filename">.dat</code>, downloaded from the same file <code
  class="filename">.dat</code> via the icon <img
  src="images/Acid_base_titration/icone_charger.jpg"></img> (<code
  class="code">load="yes"</code>), or reseted via the icon <img
  src="images/Acid_base_titration/icone_supprimer.jpg"></img> (<code
  class="code">clear="yes"</code>).</p><p>The part of the XML code
  corresponding to the definition of this matrix is the following :</p><pre
  class="programlisting">      &lt;matrix clear="yes" cols="2" label="user_curve_mat"
              load="yes" rows="64" save="yes"
              stripcol="no" striprow="yes" widget="normal"&gt;
        &lt;name/&gt;
        &lt;col&gt;
          &lt;name lang="french"&gt;Abscisses (volumes de titrant)&lt;/name&gt;
          &lt;name lang="english"&gt;X data (titrant volumes)&lt;/name&gt;
          &lt;value&gt;0&lt;/value&gt;
        &lt;/col&gt;
        &lt;col&gt;
          &lt;name lang="french"&gt;Ordonnées (pH)&lt;/name&gt;
          &lt;name lang="english"&gt;Y data (pH values)&lt;/name&gt;
          &lt;value/&gt;
        &lt;/col&gt;
      &lt;/matrix&gt;</pre><p>It can be besides made reference to a matrix
  elements (let us suppose <code class="code">label="mat"</code>) in the other
  parts of the simulation XML code in several manners (it is about the <span
  class="emphasis"><em>Scilab syntax</em></span>) :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p><code class="code">mat(<em
      class="replaceable"><code>i</code></em>,<em
      class="replaceable"><code>j</code></em>)</code> : row <em
      class="replaceable"><code>i</code></em> and column <em
      class="replaceable"><code>j</code></em> element,</p></li>

      <li><p><code class="code">mat(<em
      class="replaceable"><code>i</code></em>,:)</code> : <em
      class="replaceable"><code>i</code></em><sup>th</sup> row matrix (last
      row if <code class="code"><em
      class="replaceable"><code>i</code></em></code> = <code
      class="code">$</code>),</p></li>

      <li><p><code class="code">mat(:,<em
      class="replaceable"><code>j</code></em>)</code> : <em
      class="replaceable"><code>j</code></em><sup>th</sup> column matrix (last
      column if <code class="code"><em
      class="replaceable"><code>j</code></em></code> = <code
      class="code">$</code>),</p></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="balise_point"></a>2.6.&nbsp;P<code class="code">oint
  Tag</code></h3></div></div></div><p>It allows to define a 2D or 3D point
  respecting eventually possibly constraints, each one being expressed by the
  reference to a curve to which it is constraint to belong and/or a set of
  inequalities that its coordinates must respect. It can comprise any explicit
  interface data entry, because its graphic representation can also be
  manipulable, providing that it is included in a system of axis via the <code
  class="code">drawpoints</code> tag (cf. § <a href="#balise_drawpoints"
  title="5.2.4.&nbsp;Balise drawpoints">Section&nbsp;5.2.4, «&nbsp;<code
  class="code">Drawpoints Tag</code>&nbsp;»</a>) :</p><pre
  class="programlisting">      &lt;point <span class="bold"><strong>label</strong></span>="<em
        class="replaceable"><code>id_point</code></em>"
             widget="<span class="bold"><strong>entry</strong></span>|hidden"
<em><span class="remark">               -&gt; Indicate if coordinates input fields must be present in the zone of the parameters data entry
</span></em>             state="disabled|<span class="bold"><strong>normal</strong></span>"
<em><span class="remark">               -&gt; disabled makes the input data zone disabled
</span></em>      &gt;

<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>parameter name as displayed in the coordinates data entry zone  nom du paramètre tel qu'affiché en regard
          des champs de saisie</code></em> des coordonnées
        &lt;/name&gt;

<em><span class="remark">        once and only once :
</span></em>        &lt;x1 label="<em class="replaceable"><code>id_X_data_unit</code></em>" unit="<em
        class="replaceable"><code>X data unit"&gt;</code></em>
<em><span class="remark">          none or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            <em class="replaceable"><code>X data name</code></em><em><span
          class="remark"><em class="replaceable"><code> (not used at present)</code></em></span></em>
          &lt;/name&gt;
<em><span class="remark">          once and only once :
</span></em>          &lt;value&gt;
            X<i> data initial value</i> 
          &lt;/value&gt;
        &lt;/x1&gt;

<em><span class="remark">        once and only once :
</span></em>        &lt;x2 label="<em class="replaceable"><code>id_X_data_unit</code></em>" unit="Y data unit<em
        class="replaceable"><code>"&gt;</code></em>
<em><span class="remark">          none or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            Y data name<em class="replaceable"><code> <em><span class="remark">(not used at present)</span></em></code></em>
          &lt;/name&gt;
<em><span class="remark">          once and only once :
</span></em>          &lt;value&gt;
            Y data initial value<em class="replaceable"><code> </code></em>
          &lt;/value&gt;
        &lt;/x2&gt;

<em><span class="remark">       <em><span class="remark"> maximum once :
</span></em></span></em>        &lt;x3 label="<em class="replaceable"><code>id_</code></em>Z" unit="<em
        class="replaceable"><code>Z data unit"&gt;</code></em>
<em><span class="remark">          none or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            Z<em class="replaceable"><code> data name<em><span class="remark"> (not used at present)</span></em></code></em>
          &lt;/name&gt;
<em><span class="remark">          once and only once :
</span></em>          &lt;value&gt;
            <em class="replaceable"><code>Z data initial value</code></em>
          &lt;/value&gt;
        &lt;/x3&gt;

<em><span class="remark">The constraints are used only to validate the point movements by the user, 
but not when a parameter on which they depend is modified :
</span></em>       <em><span class="remark"> maximum once :
</span></em>        &lt;constraints label="<em class="replaceable"><code>id_contraints</code></em>"&gt;
          <em><span class="remark">none or several times :</span></em>
          &lt;inequality&gt;
            <em class="replaceable"><code>inequality related to x1 and/or x2 and/or x3
            (These being identified by their label),
            as well as on potentially all the parameters of the simulation, </code></em>
            <em class="replaceable"><code>it is an expression which must be</code></em><em><span
          class="remark"> &lt;= 0</span></em>
          &lt;/inequality&gt;
         <em><span class="remark"> maximum once :
</span></em>          &lt;curve <span class="bold"><strong>ref</strong></span>="<em
        class="replaceable"><code>curve reference label</code></em>" /&gt;
                   <em><span class="remark">-&gt; (cf. <a
            href="#modeles_mathematiques"
            title="4.2.&nbsp;Modèles mathématiques">Section&nbsp;4.2, «&nbsp;Mathematical Models&nbsp;»</a>)</span></em>
        &lt;/constraints&gt;

       <em><span class="remark"> maximum once :
</span></em>        &lt;refconstraints <span class="bold"><strong>ref</strong></span>="<em
        class="replaceable"><code>another constraint reference label</code></em>" /&gt;
                          <em><span class="remark">-&gt; that the point must respect</span></em>

      &lt;/point&gt;</pre><p>Paragraph § 3 of the document <em
  class="citetitle">Getting started XMLlab</em> includes an example of the
  <code class="code">point tag</code> use.</p></div><div class="section"
  lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h3
  class="title"><a id="balise_record"></a>2.7.&nbsp;<code class="code">Record
  Tag</code></h3></div></div></div><p>It consists of defining a set of
  experimentation values for a set of scalar or matrix parameters defined by a
  parent tag <code class="code">database</code> (cf. <a
  href="#balise_database" title="2.2.&nbsp;Balise database">Section&nbsp;2.2,
  «<code class="code">Database Tag</code>&nbsp;»</a>). A values set is named
  and refers to each one of these parameters by its <code
  class="code">label</code> to assign it a value :</p><pre
  class="programlisting">        &lt;record&gt;

<em><span class="remark">          one or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            value set name as displayed in the value sets scrolling list <em
        class="replaceable"><code> </code></em>
          &lt;/name&gt;

<em><span class="remark">        one or several times :
        {
</span></em>          &lt;scalar-value <span class="bold"><strong>ref</strong></span>="<em
        class="replaceable"><code>label of one of the parameters</code></em>"&gt;
            <em class="replaceable"><code>value of this parameter for this value set</code></em>
          &lt;/scalar-value&gt;
        <em><span class="remark">    OR</span></em>
          &lt;matrix-value <span class="bold"><strong>ref</strong></span>="label of one of the parameters<em
        class="replaceable"><code> </code></em>"&gt;
<em><span class="remark">Values definition, columns, lines :
            none or several times :
</span></em>            &lt;col&gt;
<em><span class="remark">              once and only once :
</span></em>              &lt;value&gt;
                <em class="replaceable"><code>element values of this column</code></em>
                separated by spaces or commas
              &lt;/value&gt;
            &lt;/col&gt;
    <em><span class="remark">          OUR</span></em>
<em><span class="remark">            none or several times :
</span></em>            &lt;row&gt;
<em><span class="remark">              once and only once :
</span></em>              &lt;value&gt;
                <em class="replaceable"><code>element values of this line</code></em>
                <em><span class="remark">separated by spaces or commas</span></em>
              &lt;/value&gt;
            &lt;/row&gt;
          &lt;/matrix-value&gt;
        <em><span class="remark">}</span></em>

        &lt;/record&gt;
</pre></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h2 class="title" style="clear: both"><a
  id="balise_actions"></a>3.&nbsp;Actions</h2></div></div></div><p>They allows
  to define a set of <span class="emphasis"><em>Scilab</em></span>
  mini-scripts (one per action) executable via a menu entry, the purpose of
  each script being to update some parameters of the simulation. They allow to
  perform some calculations that cannot be described and supported by the
  mathematical models of XMLlab (cf. <a href="#modeles_mathematiques"
  title="4.2.&nbsp;Modèles mathématiques">Section&nbsp;4.2,
  «&nbsp;Mathematical Models »</a>).</p><p>The following figure illustrates
  this mechanism: a set of actions named <span
  class="guimenu">Identification</span> was defined, which comprises the
  single action Linear <span class="guimenuitem">Régression </span>, whose
  purpose is to calculate the least squares line corresponding to the points
  entered by the user:</p><div class="figure"><a id="id897950"></a><p
  class="title"><b>Figure&nbsp;6.7.&nbsp;Actions menu example </b></p><div
  align="center" class="mediaobject"><img align="middle"
  alt="Exemple de menu Actions"
  src="images/reference/ex_actions.jpg" /></div></div><p>Here is the structure
  of the <code class="code">actions tag</code> that, if it is present, must
  appear immediately after the definition of the simulation parameters (<code
  class="code">parameters tag</code>) :</p><pre class="programlisting"><em><span
          class="remark">  maximum once :
</span></em>  &lt;actions&gt;

    <em><span class="remark">one or several times :</span></em>
    &lt;title lang="french|english|german|spanish"&gt;
      <em class="replaceable"><code>title of the actions set
        <em><span class="remark">-&gt; corresponds to the menu title added</span></em></code></em>
    &lt;/title&gt;

    <em><span class="remark">one or several times :</span></em>
    &lt;action update="<em class="replaceable"><code>parameter list labels</code></em>"&gt;
<em><span class="remark">              -&gt; It is a parameter which the value is update by the action;
                 the list separator is the space
</span></em>
      <em><span class="remark">one or several times :</span></em>
      &lt;title lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code>action title
          <em><span class="remark">-&gt; corresponds to the sub-menu title added</span></em></code></em>
      &lt;/title&gt;

<em><span class="remark">      once and only once :
</span></em>      &lt;script href="script file path to be executed<em
        class="replaceable"><code> </code></em>"&gt;
        <em class="replaceable"><code>Scilab code to be executed</code></em>
          <em><span class="remark">-&gt; being able to make involved any simulation parameter ;
             ignore if href attribut is present</span></em>
      &lt;/script&gt;

    &lt;/action&gt;

  &lt;/actions&gt;</pre></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h2 class="title"
  style="clear: both"><a id="id898070"></a>4.&nbsp;Script or mathematical
  models</h2></div></div></div><p>The next part in the simulation XML file is
  composed whether of a <span class="emphasis"><em>Scilab</em></span> script
  (<code class="code">script tag</code>), or whether of a definition of the
  mathematical models governing the simulation, this last case being the one
  that sticks best on the XMLlab philosophy.</p><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="id898099"></a>4.1.&nbsp;Script</h3></div></div></div><p>It consists of a
  <span class="emphasis"><em>Scilab </em></span>script , that handles the
  simulation execution, the defined parameters being accessible as <span
  class="emphasis"><em>Scilab</em></span> matrix variables (1x1 for scalars)
  :</p><pre class="programlisting"><em><span class="remark">  once and only once :
</span></em>  &lt;script href="<em class="replaceable"><code>script file path to be executed</code></em>"&gt;
    <em class="replaceable"><code>cScilab code to be executed</code></em>
      <em><span class="remark">-&gt; being able to make involved any simulation parameter ;
         ignore if href attribut is present</span></em>
  &lt;/script&gt;</pre></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="modeles_mathematiques"></a>4.2.&nbsp;Mathematical
  models</h3></div></div></div><p>This section - that follows the tag <code
  class="code">&lt;/parameters&gt;</code> - allows to define the equations to
  be solved, the curves to calculate, as well as the range of values (1D or
  2D) that certain variables must take. Here is the structure of the parameter
  definition:</p><pre class="programlisting"><em><span class="remark">  once and only once :
</span></em>  &lt;compute&gt;

<em><span class="remark">    none or several times :
</span></em>    &lt;defdomain1d | 
     defdomain2d | 
     ode | 
     implicitfunction |
     stationary-pde |
     nonparametriccurve2d | 
     parametriccurve2d | 
     parametriccurve3d | 
     nonparametricsurface |
     parametricsurface |
     polyline&gt;<em><span class="remark">... tag detailed in the following</span></em> paragraphs 

  &lt;/compute&gt;</pre><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="def_ref_domain1d"></a>4.2.1.&nbsp;<code class="code">Defdomain1d</code>
  and <code class="code">refdomain1d Tags</code></h4></div></div></div><div
  class="itemizedlist"><ul type="disc">
      <li><p> <code class="code">Defdomain1d</code> : it is the definition of
      a domain of values in one dimension, therefore an interval, that
      indicates the set of the discrete values taken by a variable (for
      example a integration variable). The interval is cut out linearly or
      logarithmically in a given number of steps:</p><pre
      class="programlisting">    &lt;defdomain1d <span class="bold"><strong>label</strong></span>="<em
            class="replaceable"><code>id_domaine1d</code></em>" unit="<em
            class="replaceable"><code>unité de la variable</code></em>"&gt;
<em><span class="remark">
      none or several times :
</span></em>      &lt;name lang="french|english|german|spanish"&gt;
        variable name as displayed in the simulation save file 
      &lt;/name&gt;

<em><span class="remark">      once and only once :
</span></em>      &lt;interval discretization="<span class="bold"><strong>linear</strong></span>|log"
                steps="<em class="replaceable"><code>number of steps</code></em><em
            class="replaceable"><code> </code></em>(default number 100)"&gt;

        &lt;initialvalue&gt;
          initial value<em class="replaceable"><code> </code></em>
        &lt;/initialvalue&gt;

        &lt;finalvalue&gt;
          <em class="replaceable"><code>final valeu</code></em>
        &lt;/finalvalue&gt;

      &lt;/interval&gt;

    &lt;/defdomain1d&gt;</pre></li>

      <li><p> <code class="code">Refdomain1d</code> Tag : It is the reference
      to a domain of values in one dimension defined by a <code
      class="code">defdomain1d tag</code>, that allows for example, in the
      definition of a integration calculation, to define the values taken by
      the integration variable :</p><pre class="programlisting">      &lt;refdomain1d <span
            class="bold"><strong>ref</strong></span>="<em class="replaceable"><code>ref_id_domaine1d</code></em>"&gt;
      &lt;/refdomain1d&gt;</pre></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="def_ref_domain2d"></a>4.2.2.&nbsp;<code class="code">Defdomain2d</code>
  and <code class="code">refdomain2d Tags</code></h4></div></div></div><div
  class="itemizedlist"><ul type="disc">
      <li><p> <code class="code">Defdomain2d</code> : it is the definition of
      a domain of values in two dimensions that indicates all the discreet
      values taken by a variable 2D. It can freely be defined by two different
      manners :</p><div class="itemizedlist"><ul type="circle">
          <li><p>by a <code class="code">rectangle tag</code> including two
          intervals, each of them being defined on the spot or by
          reference,</p></li>

          <li><p>by a <code class="code">border</code> tag, including the
          definition of one or several parametric 2D curves specifying the 2D
          domain boundary.</p></li>
        </ul></div><pre class="programlisting">    &lt;defdomain2d <span
            class="bold"><strong>label</strong></span>="<em
            class="replaceable"><code>id_domaine2d</code></em>"
                 dependencies="<em class="replaceable"><code>param_list_label</code></em>"&gt;
<em><span class="remark"><em><span class="remark">                   -&gt; the list separator is the space ;
                      that indicate that this calculation element depends  
                      only on the listed parameters, that avoid useless recalculations,
                      namely the triangulation of the domain if this one 
                      is defined via a &lt;border&gt; tag
</span></em>
      none or several times :
</span></em>      &lt;name lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code>2D domain name as displayed in the simulation save file</code></em>
      &lt;/name&gt;

<em><span class="remark">      once and only once :
</span></em>      &lt;rectangle&gt;
<em><span class="remark">        First values interval definition (<em><span
                  class="remark">cf. § <a href="#def_ref_domain1d"
                    title="4.2.1.&nbsp;Balises defdomain1d et           refdomain1d">Section&nbsp;4.2.1, «&nbsp;<code
                      class="code">Defdomain1d</code> and
          <code class="code">refdomain1d</code>&nbsp;Tags»</a></span></em>) :</span></em>
        &lt;defdomain1d&gt;...
          <em><span class="remark">OR</span></em>
        &lt;refdomain1d&gt;...
<em><span class="remark">        Second values interval definition :</span></em>
        &lt;defdomain1d&gt;...
          <em><span class="remark">OR</span></em>
        &lt;refdomain1d&gt;...     
      &lt;/rectangle&gt;
        <em><span class="remark">OR</span></em>
      &lt;border&gt;
        <em><span class="remark">one or several times :</span></em>
        &lt;parametriccurve2d&gt;... <em><span class="remark">cf <a
                href="#parametriccurve2d"
                title="4.2.7.&nbsp;Balise parametriccurve2d">Section&nbsp;4.2.7, «&nbsp;<code
                  class="code">Parametriccurve2d</code>&nbsp;Tag »</a></span></em>
      &lt;/border&gt;

    &lt;/defdomain2d&gt;</pre></li>

      <li><p><code class="code">Refdomain2d Tag</code> : It is the reference
      to a values domain in two dimensions defined by a<code
      class="code">defdomain2d</code> tag : </p><pre class="programlisting">      &lt;refdomain2d <span
            class="bold"><strong>ref</strong></span>="<em class="replaceable"><code>ref_id_domaine2d</code></em>"&gt;
      &lt;/refdomain2d&gt;</pre></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id898514"></a>4.2.3.&nbsp;<code class="code">Ode
  Tag</code></h4></div></div></div><p>It allows to define a system of
  differential equations (<span class="foreignphrase"><em
  class="foreignphrase">ordinary differential equation</em></span>) :</p><pre
  class="programlisting">    &lt;ode <span class="bold"><strong>label</strong></span>="<em
        class="replaceable"><code>id_ode</code></em>"
         dependencies="param_<em class="replaceable"><code>list_label</code></em>"&gt;
<em><span class="remark">           -&gt; the list separator is the space ;
              that indicate that this calculation element depends  
              only on the listed parameters, that avoid useless recalculations
</span></em>      ...
    &lt;/ode&gt;</pre><p>It gathers the following elements :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>the domain of variation of the integration variable:</p><pre
      class="programlisting"><em><span class="remark">      once and only once :</span></em>
      <em><span class="remark">(cf. § <a href="#def_ref_domain1d"
                title="4.2.1.&nbsp;Balises defdomain1d et           refdomain1d">Section&nbsp;4.2.1, «&nbsp;<code
                  class="code">Defdomain1d</code> and
          <code class="code">refdomain1d</code> Tag&nbsp;»</a>)</span></em>
      &lt;defdomain1d&gt;...
        <em><span class="remark">OR</span></em>
      &lt;refdomain1d&gt;...</pre></li>

      <li><p>the definition of the states, that are the functions involved in
      the different equations, with for each one of them, its derivative and
      its value at the initial time; intermediate variables of calculation can
      be defined to simplify the states formulas writing:</p><pre
      class="programlisting"><em><span class="remark">      once and only once :</span></em>
      &lt;states&gt;
<em><span class="remark">
        none or several times :
</span></em>        &lt;variable <span class="bold"><strong>label</strong></span>="<em
            class="replaceable"><code>stat_variable_id</code></em>"&gt;
          Intermediate variable calculation formula <em class="replaceable"><code> </code></em>
        &lt;/variable&gt;

        <em><span class="remark">one or several times :</span></em>
        &lt;state <span class="bold"><strong>label</strong></span>="<em
            class="replaceable"><code>stat_id</code></em>"
               size="<span class="bold"><strong>1</strong></span>|2"
                 <em><span class="remark">-&gt; 1 : scalar, 2 : 2 components vector </span></em>
               unit="<em class="replaceable"><code>stat_unit</code></em>"&gt;

<em><span class="remark">          one or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            <em class="replaceable"><code>state name as displayed in the simulation save file</code></em>
          &lt;/name&gt;

<em><span class="remark">          once and only once :</span></em>
          &lt;derivative&gt;
            <em class="replaceable"><code>state derivative </code></em>
          &lt;/derivative&gt;

<em><span class="remark">          once and only once :</span></em>
          &lt;initialcondition&gt;
            <em class="replaceable"><code>state value at initial condition</code></em>
          &lt;/initialcondition&gt;

        &lt;/state&gt;

      &lt;/states&gt;</pre></li>

      <li><p>eventually a list of outputs depending potentially on the states,
      intermediate variables of calculation that can there too be defined to
      simplify the outputs formulas writing :</p><pre class="programlisting"><em><span
              class="remark">      maximum once :
</span></em>      &lt;outputs&gt;

        <em><span class="remark">one or several times :</span></em>
        &lt;output <span class="bold"><strong>label</strong></span>="<em
            class="replaceable"><code>output_id</code></em>"
                unit="<em class="replaceable"><code>output_unit</code></em>"&gt;
<em><span class="remark">
          one or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            <em class="replaceable"><code>output name as displayed in the simulation save file</code></em>
          &lt;/name&gt;

<em><span class="remark">          none or several times :
</span></em>          &lt;variable <span class="bold"><strong>label</strong></span>="i<em
            class="replaceable"><code>nter_variable_id</code></em>"&gt;
            <em class="replaceable"><code>intermediate variable calculation formula</code></em>
          &lt;/variable&gt;

<em><span class="remark">          once and only once :</span></em>
          &lt;value&gt;
            <em class="replaceable"><code>output calculation formula</code></em>
          &lt;/value&gt;

        &lt;/output&gt;

      &lt;/outputs&gt;</pre></li>
    </ul></div><p>For examples of the <code class="code">ode tag</code>, use
  refer to the following simulations:</p><div class="itemizedlist"><ul
      type="disc">
      <li><p>Simulation of the pendulum in the document <em
      class="citetitle">Getting started XMLlab</em>,</p></li>

      <li><p>Simulation of the Kinetics of prey predation by predators, § <a
      href="#ex_ode_predation"
      title="2.3.2.&nbsp;Définition des équations différentielles">Section&nbsp;2.3.2,
      «&nbsp;Definition of the differential equations»</a>,</p></li>

      <li><p>Simulation of the Earth-Moon system, § <a
      href="#ex_ode_terre_lune"
      title="2.3.2.&nbsp;Définition des équations différentielles">Section&nbsp;2.3.2,
      «&nbsp;Definition of the differential equations&nbsp;»</a>.</p></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id898825"></a>4.2.4.&nbsp;<code class="code">Implicitfunction
  Tag</code></h4></div></div></div><p>It is supposed that we have an equation
  <span class="emphasis">
      <em>f(</em>
    </span><span class="emphasis">
      <em>x</em>
    </span>, <span class="emphasis">
      <em>y</em>
    </span>) = 0. If for each value of <span class="emphasis">
      <em>x</em>
    </span>, this equation admits a single solution in <span class="emphasis">
      <em>y</em>
    </span>, the application that associates <span class="emphasis">
      <em>x</em>
    </span> to <span class="emphasis">
      <em>y</em>
    </span> is called implicit function (<span class="emphasis">
      <em>of y</em>
    </span> as a function of <span class="emphasis">
      <em>x</em>
    </span>). Exemple : whether the equation <span class="emphasis">
      <em>f(</em>
    </span><span class="emphasis">
      <em>x</em>
    </span>, <span class="emphasis">
      <em>y</em>
    </span>) = <span class="emphasis">
      <em>x</em>
    </span><sup>2</sup> + <span class="emphasis">
      <em>y</em>
    </span><sup>2</sup> - 1 = 0. For each value of <span class="emphasis">
      <em>x</em>
    </span> of the interval [0,1], the equation admits a unique solution
  <mml:math overflow="scroll" xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:mi>y</mml:mi>

          <mml:mo>=</mml:mo>

          <mml:msqrt>
            <mml:mrow>
              <mml:mn>1</mml:mn>

              <mml:mo>−</mml:mo>

              <mml:msup>
                <mml:mi>x</mml:mi>

                <mml:mn>2</mml:mn>
              </mml:msup>
            </mml:mrow>
          </mml:msqrt>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math>. However, it is not possible in general to express <span
      class="emphasis">
      <em>y</em>
    </span> as a function of <span class="emphasis">
      <em>x</em>
    </span>. </p><p>The role of the <code class="code">implicit function tag
  </code>is actually to define a system of implicit functions :</p><pre
  class="programlisting">    &lt;implicitfunction <span class="bold"><strong>label</strong></span>="<em
        class="replaceable"><code>implicit_function_id</code></em>"
                      method="<span class="bold"><strong>newton</strong></span>|dichotomic"
<em><span class="remark">                        -&gt; method used for the equation resolutions in each value of the variable in dependence
                           méthode utilisée pour la résolution des équations  en chaque valeur de la variable en dépendance
</span></em>    &gt;
      ...
    &lt;/implicitfunction&gt;</pre><p>It gathers the following
  elements:</p><div class="itemizedlist"><ul type="disc">
      <li><p>the domain of variation of the variable on which depends the
      implicit function :</p><pre class="programlisting"><em><span
              class="remark">      once and only once :</span></em>
      <em><span class="remark">(cf. § <a href="#def_ref_domain1d"
                title="4.2.1.&nbsp;Balises defdomain1d et           refdomain1d">Section&nbsp;4.2.1, «&nbsp;<code
                  class="code">Defdomain1d</code> and
          <code class="code">refdomain1d</code>&nbsp;Tag»</a>)</span></em>
      &lt;defdomain1d&gt;...
        <em><span class="remark">OR</span></em>
      &lt;refdomain1d&gt;...     </pre></li>

      <li><p>la définition des variables dont on recherche les valeurs pour
      chaque valeur de la variable précédente, en précisant pour chacune
      d'elle une valeur de départ pour sa recherche et éventuellement une
      borne inférieure et/ou une borne inférieure qu'elle doit respecter
      :</p><pre class="programlisting"><em><span class="remark">      once and only once :</span></em>
      &lt;unknowns&gt;
        <em><span class="remark">one or several times :</span></em>
        &lt;unknown <span class="bold"><strong>label</strong></span>="<em
            class="replaceable"><code>unknown_id</code></em>"&gt;
<em><span class="remark">
          one or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            <em class="replaceable"><code>unknown <em class="replaceable"><code>name as displayed in the simulation save file</code></em></code></em>
          &lt;/name&gt;

<em><span class="remark">          once and only once :</span></em>
          &lt;guess&gt;
            search <em class="replaceable"><code>start value </code></em>
          &lt;/guess&gt;

<em><span class="remark">          maximum once :
</span></em>          &lt;lowerbound&gt;
            <em class="replaceable"><code>possible lower boundary to be respected </code></em>
          &lt;/lowerbound&gt;

<em><span class="remark">          maximum once :
</span></em>          &lt;upperbound&gt;
            <em class="replaceable"><code>possible upper boundary to be respected</code></em>
          &lt;/upperbound&gt;

        &lt;/unknown&gt;
      &lt;/unknowns&gt;</pre></li>

      <li><p>The equations defining the system of implicit functions, as well
      as eventually intermediate variables facilitating their writing
      :</p><pre class="programlisting"><em><span class="remark">      once and only once :</span></em>
      &lt;equations&gt;

<em><span class="remark">        none or several times :
</span></em>        &lt;variable <span class="bold"><strong>label</strong></span>="<em
            class="replaceable"><code>intermediate_variable_id</code></em>"&gt;
          <em class="replaceable"><code>intermediate variable calculation formula</code></em>
        &lt;/variable&gt;

<em><span class="remark">        one or several times :
</span></em>        &lt;equation&gt;
          <i>formula that must be worth</i> <em class="replaceable"><code>0</code></em>
        &lt;/equation&gt;

      &lt;/equations&gt;</pre></li>

      <li><p>Eventually a list of ouputs variablesdepending potentially on
      intermediate variables and on the variable on which implicit functions
      depend:</p><pre class="programlisting"><em><span class="remark">      maximum once :
</span></em>      &lt;outputs&gt;

        <em><span class="remark">one or several times :</span></em>
        &lt;output <span class="bold"><strong>label</strong></span>="<em
            class="replaceable"><code>output_id</code></em>"
                unit="<em class="replaceable"><code>output_unit</code></em>"&gt;
<em><span class="remark">
          one or several times :
</span></em>          &lt;name lang="french|english|german|spanish"&gt;
            o<em class="replaceable"><code>utputs <em class="replaceable"><code><em
                    class="replaceable"><code>name as displayed in the simulation save file</code></em></code></em></code></em>
          &lt;/name&gt;

<em><span class="remark">          none or several times :
</span></em>          &lt;variable <span class="bold"><strong>label</strong></span>="<em
            class="replaceable"><code>intermediate_variable_id</code></em>"&gt;
            <em class="replaceable"><code>intermediate variable calculation formula</code></em>
          &lt;/variable&gt;

<em><span class="remark">          once and only once :</span></em>
          &lt;value&gt;
            output calculation <em class="replaceable"><code>formula</code></em>
          &lt;/value&gt;

        &lt;/output&gt;

      &lt;/outputs&gt;</pre></li>
    </ul></div><p>For an example of <code class="code">implicit function
  tag</code> use, refer to the acido-basic simulation of titration in aqueous
  medium, § <a href="#calcul_ph"
  title="2.3.2.&nbsp;Calcul du pH par dichotomie">Section&nbsp;2.3.2,
  «&nbsp;&nbsp;pH calculation using the dichotomic method »</a>.</p></div><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="id899263"></a>4.2.5.&nbsp;<code
  class="code">Stationary-pde Tag</code></h4></div></div></div><p>It aims at
  describing the following Laplace equation:</p><div
  class="equation"><mml:math display="block" overflow="scroll"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
      <mml:semantics definitionURL="" encoding="">
        <mml:mrow>
          <mml:mo>−</mml:mo>

          <mml:mi>div</mml:mi>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mi>D</mml:mi>

          <mml:mover accent="true">
            <mml:mo>∇</mml:mo>

            <mml:mo>→</mml:mo>
          </mml:mover>

          <mml:mi>u</mml:mi>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>+</mml:mo>

          <mml:mi>c</mml:mi>

          <mml:mi>u</mml:mi>

          <mml:mo>=</mml:mo>

          <mml:mi>f</mml:mi>

          <mml:mo>,</mml:mo>

          <mml:mtext> </mml:mtext>

          <mml:mo stretchy="false">(</mml:mo>

          <mml:mi>x</mml:mi>

          <mml:mo>,</mml:mo>

          <mml:mi>y</mml:mi>

          <mml:mo stretchy="false">)</mml:mo>

          <mml:mo>∈</mml:mo>

          <mml:mi>Ω</mml:mi>
        </mml:mrow>

        <mml:annotation encoding="MathType-MTEF" />
      </mml:semantics>
    </mml:math></div><p>with two types of boundary conditions :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>robin : <mml:math overflow="scroll"
          xmlns:mml="http://www.w3.org/1998/Math/MathML">
          <mml:semantics definitionURL="" encoding="">
            <mml:mrow>
              <mml:mo stretchy="false">(</mml:mo>

              <mml:mi>D</mml:mi>

              <mml:mover accent="true">
                <mml:mo>∇</mml:mo>

                <mml:mo>→</mml:mo>
              </mml:mover>

              <mml:mi>u</mml:mi>

              <mml:mo stretchy="false">)</mml:mo>

              <mml:mo>.</mml:mo>

              <mml:mover accent="true">
                <mml:mi>n</mml:mi>

                <mml:mo>→</mml:mo>
              </mml:mover>

              <mml:mo>+</mml:mo>

              <mml:msub>
                <mml:mi>σ</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>

              <mml:mi>u</mml:mi>

              <mml:mo>=</mml:mo>

              <mml:msub>
                <mml:mi>ξ</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>

              <mml:mo>,</mml:mo>

              <mml:mtext> </mml:mtext>

              <mml:mo stretchy="false">(</mml:mo>

              <mml:mi>x</mml:mi>

              <mml:mo>,</mml:mo>

              <mml:mi>y</mml:mi>

              <mml:mo stretchy="false">)</mml:mo>

              <mml:mo>∈</mml:mo>

              <mml:msub>
                <mml:mi>Γ</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>
            </mml:mrow>

            <mml:annotation encoding="MathType-MTEF" />
          </mml:semantics>
        </mml:math>,</p></li>

      <li><p>dirichlet : <mml:math overflow="scroll"
          xmlns:mml="http://www.w3.org/1998/Math/MathML">
          <mml:semantics definitionURL="" encoding="">
            <mml:mrow>
              <mml:mi>u</mml:mi>

              <mml:mo>=</mml:mo>

              <mml:msub>
                <mml:mi>g</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>

              <mml:mo>,</mml:mo>

              <mml:mtext> </mml:mtext>

              <mml:mo stretchy="false">(</mml:mo>

              <mml:mi>x</mml:mi>

              <mml:mo>,</mml:mo>

              <mml:mi>y</mml:mi>

              <mml:mo stretchy="false">)</mml:mo>

              <mml:mo>∈</mml:mo>

              <mml:msub>
                <mml:mi>Γ</mml:mi>

                <mml:mi>i</mml:mi>
              </mml:msub>
            </mml:mrow>

            <mml:annotation encoding="MathType-MTEF" />
          </mml:semantics>
        </mml:math>.</p></li>
    </ul></div><p>knowing that the domain Ω have as boundary Γ = Γ<sub>0</sub>
  ∪ Γ<sub>1</sub> ∪ ... Γ<sub><span class="emphasis"><em>i</em></span></sub> ∪
  ... Γ<sub><span class="emphasis"><em>n</em></span></sub>.</p><p>This tag has
  the following aspect, knowing that the definition of the 2d domain
  corresponding to Ω to which it refers, must include the definitions of
  Γ<sub>0</sub>, Γ<sub>1</sub>, ... Γ<sub><span
  class="emphasis"><em>i</em></span></sub>, ... Γ<sub><span
  class="emphasis"><em>n</em></span></sub> via a <code class="code">border
  tag</code> containing a <code class="code">parametriccurve2d</code> tag for
  each Γ<sub><span class="emphasis"><em>i</em></span></sub>. The convention
  being that the interior of the domain is always on the left curve when its
  parameter increases, which allows to build domains containing holes
  :</p><pre class="programlisting">    &lt;stationary-pde <span class="bold"><strong>label</strong></span>="<em
        class="replaceable"><code>stationary_pde_id</code></em>"&gt;
<em><span class="remark">
      once and only once :</span></em>
      &lt;refdomain2d <span class="bold"><strong>ref</strong></span>="<em
        class="replaceable"><code>domaine2d_ref_id</code></em>"&gt;...<em><span
          class="remark">(cf. § <a href="#def_ref_domain2d"
            title="4.2.2.&nbsp;Balises defdomain2d et           refdomain2d">Section&nbsp;4.2.2, «&nbsp;<code
              class="code">Defdomain2d</code> and
          <code class="code">refdomain2d</code>&nbsp;Tag»</a>)</span></em>

<em><span class="remark">      once and only once :</span></em>
      &lt;pdestate <span class="bold"><strong>label</strong></span>="<em
        class="replaceable"><code>variable_u_id</code></em>"&gt;

<em><span class="remark">        one or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>variable name as displayed in the simulation save file</code></em>
        &lt;/name&gt;

        &lt;inside&gt;...<em><span class="remark">equation definition</span></em>

        &lt;boundary&gt;...<em><span class="remark">boundary conditions definition </span></em>

      &lt;/pdestate&gt;

    &lt;/stationary-pde&gt;</pre><p>Here is the detail of the elements
  concerning the equation and the boundary conditions :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>Definition of the stationary partial derivatives in <span
      class="emphasis"><em>u</em></span>, with the following correspondences
      :</p><div class="itemizedlist"><ul type="circle">
          <li><p>the matrix <span class="emphasis"><em>D</em></span> (that
          must be a constant) corresponds to the content of the <code
          class="code">diffusion tag</code>,</p></li>

          <li><p>the function <span class="emphasis"><em>c</em></span>(<span
          class="emphasis"><em>x</em></span>, <span
          class="emphasis"><em>y</em></span>) to the <code
          class="code">proportional tag</code>,</p></li>

          <li><p><span class="emphasis"><em>f</em></span>(<span
          class="emphasis"><em>x</em></span>, <span
          class="emphasis"><em>y</em></span>) to the <code class="code">source
          tag</code>.</p></li>
        </ul></div><pre class="programlisting"><em><span class="remark">        once and only once :</span></em>
        &lt;inside dependencies="<em class="replaceable"><code>param_list_label</code></em>"&gt;
<em><span class="remark">                  -&gt; the list separator is the space ;
                     that indicate that this calculation element depends  
                     only on the listed parameters, that avoid useless recalculations,
                     here the assembly problem in the domain
</span></em>
          &lt;diffusion&gt;
            <em class="replaceable"><code>matrix D</code></em>  <em><span
              class="remark">-&gt; must be a constant</span></em>
          &lt;/diffusion&gt;

          &lt;proportional&gt;
            <em class="replaceable"><code>function c(x,y)</code></em>
          &lt;/proportional&gt;

          &lt;source&gt;
            <em class="replaceable"><code>function f(x,y)</code></em>
          &lt;/source&gt;

        &lt;/inside&gt;</pre></li>

      <li><p>the definition of the boundary conditions with the following
      correspondences, given that it is possible that there are fewer definite
      conditions than of Γ<sub><span class="emphasis"><em>i</em></span></sub>
      : an absence of condition on a piece of the edge of Ω corresponds to a
      homogeneous Neuman condition (the normal derivative of the state is
      equal to zero):</p><div class="itemizedlist"><ul type="circle">
          <li><p><span class="emphasis"><em>σ</em></span><sub><span
          class="emphasis"><em>i</em></span></sub>(<span
          class="emphasis"><em>x</em></span>, <span
          class="emphasis"><em>y</em></span>) et <span
          class="emphasis"><em>ξ</em></span><sub><span
          class="emphasis"><em>i</em></span></sub>(<span
          class="emphasis"><em>x</em></span>, <span
          class="emphasis"><em>y</em></span>) corresponds to <code
          class="code">sigma</code> and <code class="code">xi
          tags</code>,</p></li>

          <li><p><span class="emphasis"><em>g</em></span><sub><span
          class="emphasis"><em>i</em></span></sub>(<span
          class="emphasis"><em>x</em></span>, <span
          class="emphasis"><em>y</em></span>) to the <code
          class="code">dirichlet tag</code>.</p></li>
        </ul></div><pre class="programlisting"><em><span class="remark">        maximum once :
</span></em>        &lt;boundary dependencies="<em class="replaceable"><code>param</code></em>_list_label"&gt;
<em><span class="remark">                    -&gt; the list separator is the space ;
                       that indicate that this calculation element depends  
                       only on the listed parameters, that avoid useless recalculations,
                       here the boundary condition assembly
</span></em>
<em><span class="remark">          one or several times :
</span></em>          &lt;condition <span class="bold"><strong>bdy</strong></span>="2D_domain_element_label"&gt;
<em><span class="remark">                       -&gt; it is one of the labels identifying one  
                          parametric curves defined in 
                          defdomain2d tag referred by 2ddomain_ref_id ;
                          it is indicated thus on which boundary 
                          element &lt;i&gt; concerns the condition
</span></em>
<em><span class="remark">            once and only once :</span></em>
            &lt;robin&gt;
              &lt;xi&gt;
                <em class="replaceable"><code>function ξ(x,y)</code></em>
              &lt;/xi&gt;
              &lt;sigma&gt;
                <em class="replaceable"><code>function σ(x,y)</code></em>
              &lt;/sigma&gt;
            &lt;/robin&gt;
              <em><span class="remark">OR</span></em>
            &lt;dirichlet&gt;
              <em class="replaceable"><code>function g(x,y)</code></em>
            &lt;/dirichlet&gt;

          &lt;/condition&gt;

        &lt;/boundary&gt;</pre></li>
    </ul></div><p class="remark"><i><span class="remark">Caution: when the
  coefficients are functions, one must absolutely use <code
  class="code">x</code> and <code class="code">y</code> to handle the
  X-coordinate and the ordinate (whatever the labels used in the <code
  class="code">parametriccurve2d</code> in the <code
  class="code">border</code>).</span></i></p><p>For an example of <code
  class="code">stationary-pde tag use</code>, refers to simulation via finite
  elements of the Poisson's equation, § <a href="#ex_stationary-pde_poisson"
  title="2.3.4.&nbsp;Définition de l'équation aux dérivées partielles           stationnaire">Section&nbsp;2.3.4,
  «&nbsp;Definition of the stationary partial
  derivatives&nbsp;»</a>.</p></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="id900089"></a>4.2.6.&nbsp;<code class="code">Nonparametriccurve2d
  Tag</code></h4></div></div></div><p>It deals with a curve defined by a
  function <span class="emphasis"><em>y</em></span> = <span
  class="emphasis"><em>f</em></span>(<span
  class="emphasis"><em>x</em></span>). It contains the domain of variation of
  <span class="emphasis"><em>x</em></span> and the definition of <span
  class="emphasis"><em>f</em></span> :</p><pre class="programlisting">    &lt;nonparametriccurve2d <span
        class="bold"><strong>label</strong></span>="<em class="replaceable"><code>curve_id</code></em>"&gt;

<em><span class="remark">      none or several times :
</span></em>      &lt;name lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code>possible curve name as displayed in its plot (cf. § </code></em><a
        href="#balise_drawcurve2d" title="5.2.1.&nbsp;Balise drawcurve2d">Section&nbsp;5.2.1, «&nbsp;<code
          class="code">Drawcurve2d</code>&nbsp;Tag»</a>)
      &lt;/name&gt;

<em><span class="remark">X definition :
      once and only once :</span></em>
      <em><span class="remark">(cf. § <a href="#def_ref_domain1d"
            title="4.2.1.&nbsp;Balises defdomain1d et           refdomain1d">Section&nbsp;4.2.1, «&nbsp;<code
              class="code">Defdomain1d</code> and
          <code class="code">refdomain1d</code>&nbsp;Tag»</a>)</span></em>
      &lt;defdomain1d&gt;...
        <em><span class="remark">OR</span></em>
      &lt;refdomain1d&gt;...

<em><span class="remark">Y definition y = f(x) :
      once and only once :
</span></em>      &lt;x2 label="<em class="replaceable"><code>Y_data_id</code></em>" unit="Y data <em
        class="replaceable"><code>unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>Y data name<em><span class="remark"> (not used at present)</span></em></code></em>
        &lt;/name&gt;
<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>f(x)</code></em>
        &lt;/value&gt;
      &lt;/x2&gt;

    &lt;/nonparametriccurve2d&gt;</pre><p>For an example of <code
  class="code">nonparametriccurve2d</code> Tag use, refer to the file <code
  class="filename">Math/tangente.xml</code> in the subdirectory <code
  class="filename">examples</code> of the XMLlab installation directory<span
  class="emphasis"><em> </em></span>.</p></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="parametriccurve2d"></a>4.2.7.&nbsp;<code class="code">Parametriccurve2d
  Tag</code></h4></div></div></div><p>It consists of a parametric curve <span
  class="emphasis"><em>x</em></span> = <span
  class="emphasis"><em>f</em></span>(<span
  class="emphasis"><em>t</em></span>), <span
  class="emphasis"><em>y</em></span> = <span
  class="emphasis"><em>g</em></span>(<span
  class="emphasis"><em>t</em></span>). It contains the domain of variation of
  <span class="emphasis"><em>t</em></span> and the definitions of <span
  class="emphasis"><em>f</em></span> and <span
  class="emphasis"><em>g</em></span> :</p><pre class="programlisting">    &lt;parametriccurve2d <span
        class="bold"><strong>label</strong></span>="<em class="replaceable"><code>curve_id</code></em>"&gt;

<em><span class="remark">      none or several times :
</span></em>      &lt;name lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code><em class="replaceable"><code>possible curve name as displayed in its plot</code></em> (cf. </code></em><em
        class="replaceable"><code>§ </code></em><a href="#balise_drawcurve2d"
        title="5.2.1.&nbsp;Balise drawcurve2d">Section&nbsp;5.2.1, «&nbsp;<code
          class="code">Drawcurve2d</code>&nbsp;Tag»</a>)
      &lt;/name&gt;

<em><span class="remark">T definition :
      once and only once :</span></em>
      <em><span class="remark">(cf. § <a href="#def_ref_domain1d"
            title="4.2.1.&nbsp;Balises defdomain1d et           refdomain1d">Section&nbsp;4.2.1, «&nbsp;<code
              class="code">Defdomain1d</code> and
          <code class="code">refdomain1d</code>&nbsp;Tag»</a>)</span></em>
      &lt;defdomain1d&gt;...
        <em><span class="remark">OR</span></em>
      &lt;refdomain1d&gt;...

<em><span class="remark">X definition x = f(t) :
      once and only once :
</span></em>      &lt;x1 label="<em class="replaceable"><code>X_data_id</code></em>" unit="<em
        class="replaceable"><code>X data unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>X data name</code></em><em><span
          class="remark"><em class="replaceable"><code> (not used at present)</code></em></span></em>
        &lt;/name&gt;
<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>f(t)</code></em>
        &lt;/value&gt;
      &lt;/x1&gt;

Y<em><span class="remark"> definition  y = g(t) :
      once and only once :
</span></em>      &lt;x2 label="<em class="replaceable"><code>Y_data_id</code></em>" unit="<em
        class="replaceable"><code>Y data unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>Y data name<em><span class="remark"> (not used at present)</span></em></code></em>
        &lt;/name&gt;
<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>g(t)</code></em>
        &lt;/value&gt;
      &lt;/x2&gt;

    &lt;/parametriccurve2d&gt;</pre><p>For example of <code
  class="code">parametriccurve2d tag</code> use, refers to the following
  simulations :</p><div class="itemizedlist"><ul type="disc">
      <li><p>Acido-basic simulation of titration in aqueous medium, § <a
      href="#calcul_ph"
      title="2.3.2.&nbsp;Calcul du pH par dichotomie">Section&nbsp;2.3.2,
      «&nbsp;pH calculation using the dichotomic method&nbsp;»</a>.</p></li>

      <li><p>Simulation via finite elements of the Poisson's equation, § <a
      href="#ex_stationary-pde_poisson"
      title="2.3.4.&nbsp;Définition de l'équation aux dérivées partielles           stationnaire">Section&nbsp;2.3.4,
      «Definition of the stationary partial derivatives&nbsp;»</a>.</p></li>

      <li><p>Simulation of the Earth-Moon system, § <a
      href="#ex_ode_terre_lune"
      title="2.3.2.&nbsp;Définition des équations différentielles">Section&nbsp;2.3.2,
      «&nbsp;Definition of the differential equations&nbsp;»</a>.</p></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id900479"></a>4.2.8.&nbsp;<code class="code">Parametriccurve3d
  Tag</code></h4></div></div></div><p>It consists of a parametric curve <span
  class="emphasis"><em>x</em></span> = <span
  class="emphasis"><em>f</em></span>(<span
  class="emphasis"><em>t</em></span>), <span
  class="emphasis"><em>y</em></span> = <span
  class="emphasis"><em>g</em></span>(<span
  class="emphasis"><em>t</em></span>), <span
  class="emphasis"><em>z</em></span> = <span
  class="emphasis"><em>h</em></span>(<span
  class="emphasis"><em>t</em></span>). It contains the domain of variation of
  <span class="emphasis"><em>t</em></span> and the definitions of <span
  class="emphasis"><em>f</em></span>, <span class="emphasis"><em>g</em></span>
  and <span class="emphasis"><em>h</em></span> :</p><pre
  class="programlisting">    &lt;parametriccurve3d <span class="bold"><strong>label</strong></span>="curve_<em
        class="replaceable"><code>id</code></em>"&gt;

<em><span class="remark">      none or several times :
</span></em>      &lt;name lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code>possible curve name as displayed in its plot</code></em><em
        class="replaceable"><code> (cf. </code></em>§ <a href="#drawsurface"
        title="5.2.3.&nbsp;Balise drawsurface">Section&nbsp;5.2.3, «&nbsp;<code
          class="code">Drawsurface Tag</code>&nbsp;»</a>)
      &lt;/name&gt;

<em><span class="remark">      none or several times :</span></em>
      <em><span class="remark">(cf. § <a href="#def_ref_domain1d"
            title="4.2.1.&nbsp;Balises defdomain1d et           refdomain1d">Section&nbsp;4.2.1, «&nbsp;<code
              class="code">Defdomain1d</code> and
          <code class="code">refdomain1d Tag</code>&nbsp;»</a>)</span></em>
      &lt;defdomain1d&gt;...
        <em><span class="remark">OR</span></em>
      &lt;refdomain1d&gt;...

<em><span class="remark">      once and only once :
</span></em>      &lt;x1 label="X_data_<em class="replaceable"><code>id</code></em>" unit="X<em
        class="replaceable"><code> data unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          X data name<em class="replaceable"><code> </code></em><em><span
          class="remark"><em class="replaceable"><code> (not used at present)</code></em></span></em>
        &lt;/name&gt;
<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>f(t)</code></em>
        &lt;/value&gt;
      &lt;/x1&gt;

<em><span class="remark">      once and only once :
</span></em>      &lt;x2 label="Y_data_<em class="replaceable"><code>id</code></em>" unit="Y data <em
        class="replaceable"><code>unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>Y data name<em><span class="remark"> (not used at present)</span></em></code></em>
        &lt;/name&gt;
 <em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>g(t)</code></em>
        &lt;/value&gt;
      &lt;/x2&gt;

<em><span class="remark">      once and only once :
</span></em>      &lt;x3 label="<em class="replaceable"><code> </code></em>z_id" unit="z <em
        class="replaceable"><code>unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>z name<em><span class="remark"> (not used at present)</span></em></code></em>
        &lt;/name&gt;
<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>h(t)</code></em>
        &lt;/value&gt;
      &lt;/x3&gt;

    &lt;/parametriccurve3d&gt;</pre><p>For an exemple of <code
  class="code">parametriccurve3d</code> tag use , refers to the file <code
  class="filename">Math/helice.xml</code> in the subdirectory <code
  class="filename">examples</code> of the XMLlab installation directory<span
  class="emphasis"><em> </em></span>.</p></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="id900727"></a>4.2.9.&nbsp;<code class="code">Nonparametricsurface
  Tag</code></h4></div></div></div><p>It deals with a non parametric surface
  <span class="emphasis"><em>z</em></span> = <span
  class="emphasis"><em>h</em></span>(<span class="emphasis"><em>x</em></span>,
  <span class="emphasis"><em>y</em></span>). Its contains the 2D domain of the
  variation of (<span class="emphasis"><em>x</em></span>, <span
  class="emphasis"><em>y</em></span>) and the definition of <span
  class="emphasis"><em>h</em></span> :</p><pre class="programlisting">    &lt;nonparametricsurface <span
        class="bold"><strong>label</strong></span>="<em class="replaceable"><code>surface_id</code></em>"&gt;

<em><span class="remark">      none or several times :
</span></em>      &lt;name lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code>possible curve name as displayed in its plot</code></em><em><span
          class="remark"> (cf. § <a href="#drawsurface"
            title="5.2.3.&nbsp;Balise drawsurface">Section&nbsp;5.2.3, «&nbsp;Balise <code
              class="code">drawsurface</code>&nbsp;»</a>)</span></em>
      &lt;/name&gt;

<em><span class="remark">      once and only once :</span></em>
      <em><span class="remark">(cf. § <a href="#def_ref_domain2d"
            title="4.2.2.&nbsp;Balises defdomain2d et           refdomain2d">Section&nbsp;4.2.2, «&nbsp;<code
              class="code">Defdomain2d</code> and
          <code class="code">refdomain2d</code>&nbsp;Tag»</a>)</span></em>
      &lt;defdomain2d&gt;...
        <em><span class="remark">OR</span></em>
      &lt;refdomain2d&gt;...

<em><span class="remark">      once and only once :
</span></em>      &lt;x3 label="<em class="replaceable"><code> </code></em>z_id" unit="<em
        class="replaceable"><code>z unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>z name<em><span class="remark"> (not used at present)</span></em></code></em>
        &lt;/name&gt;
<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>h(x,y)</code></em>
<em><span class="remark">            -&gt; X and y being labels identifying the x and y coordinates 
               of 2D domaine points, namely as this one contains one :
               - &lt;rectangle&gt; : x and y are the 2 domains 1D labels
                               defined or in reference,
               - &lt;border&gt;    : x and y are the &lt;x1&gt; and &lt;x2&gt; tags labels of
                               &lt;parametriccurve2d&gt; defining the 2D domain.
</span></em>        &lt;/value&gt;
      &lt;/x3&gt;

    &lt;/nonparametricsurface&gt;</pre><p>For an exemple of <code
  class="code">nonparametricsurface</code> tag use, refers to the <code
  class="filename">Math/gauss.xml</code> file in the subdirectory <code
  class="filename">examples</code> of the XMLlab installation directory<span
  class="emphasis"><em> </em></span>.</p></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="id900888"></a>4.2.10.&nbsp;<code class="code">Parametricsurface
  Tag</code></h4></div></div></div><p>It deals wtih a parametric surface <span
  class="emphasis"><em>x</em></span> = <span
  class="emphasis"><em>f</em></span>(<span class="emphasis"><em>θ</em></span>,
  <span class="emphasis"><em>φ</em></span>), <span
  class="emphasis"><em>y</em></span> = <span
  class="emphasis"><em>g</em></span>(<span class="emphasis"><em>θ</em></span>,
  <span class="emphasis"><em>φ</em></span>), <span
  class="emphasis"><em>z</em></span> = <span
  class="emphasis"><em>h</em></span>(<span class="emphasis"><em>θ</em></span>,
  <span class="emphasis"><em>φ</em></span>). Its contains the 2D domain of
  variation of (<span class="emphasis"><em>θ</em></span>, <span
  class="emphasis"><em>φ</em></span>) and the definition of <span
  class="emphasis"><em>f</em></span>, <span class="emphasis"><em>g</em></span>
  and <span class="emphasis"><em>h</em></span> :</p><pre
  class="programlisting">    &lt;nonparametricsurface <span class="bold"><strong>label</strong></span>="<em
        class="replaceable"><code>id_surface</code></em>"&gt;

<em><span class="remark">      none or several times :
</span></em>      &lt;name lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code><em class="replaceable"><code>possible curve name as displayed in its plot</code></em></code></em><em><span
          class="remark"> (cf. § <a href="#drawsurface"
            title="5.2.3.&nbsp;Balise drawsurface">Section&nbsp;5.2.3, «&nbsp;Balise <code
              class="code">drawsurface</code>&nbsp;»</a>)</span></em>
      &lt;/name&gt;

<em><span class="remark">      once and only once :</span></em>
      <em><span class="remark">(cf. § <a href="#def_ref_domain2d"
            title="4.2.2.&nbsp;Balises defdomain2d et           refdomain2d">Section&nbsp;4.2.2, «&nbsp;<code
              class="code">Defdomain2d</code> and
          <code class="code">refdomain2d</code>&nbsp;Tag»</a>)</span></em>
      &lt;defdomain2d&gt;...
        <em><span class="remark">OR</span></em>
      &lt;refdomain2d&gt;...

<em><span class="remark">      once and only once :
</span></em>      &lt;x1 label="X_data_<em class="replaceable"><code>id</code></em>" unit="X data <em
        class="replaceable"><code>unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          X data name<em class="replaceable"><code> </code></em><em><span
          class="remark"><em class="replaceable"><code>(not used at present)</code></em></span></em>
        &lt;/name&gt;
<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>f(θ,φ)</code></em>
        &lt;/value&gt;
      &lt;/x1&gt;

<em><span class="remark">      once and only once :
</span></em>      &lt;x2 label="<em class="replaceable"><code>Y_data_id</code></em>" unit="<em
        class="replaceable"><code>Y data unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          Y data name<em class="replaceable"><code> <em><i> (not used at present)</i></em></code></em>
        &lt;/name&gt;
<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>g(θ,φ)</code></em>
        &lt;/value&gt;
      &lt;/x2&gt;

<em><span class="remark">      once and only once :
</span></em>      &lt;x3 label="<em class="replaceable"><code>z_id</code></em>" unit="<em
        class="replaceable"><code>z unit"&gt;</code></em>
<em><span class="remark">        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          z name<em class="replaceable"><code> <em><span class="remark"> (not used at present)</span></em></code></em>
        &lt;/name&gt;
<em><span class="remark">        once and only once :
</span></em>        &lt;value&gt;
          <em class="replaceable"><code>h(θ,φ)</code></em>
        &lt;/value&gt;
      &lt;/x3&gt;

    &lt;/nonparametricsurface&gt;</pre><p>For an exemple of the <code
  class="code">parametricsurface tag</code> use, refers to the file <code
  class="filename">Math/sphere.xml</code> in the subdirectory <code
  class="filename">examples</code> of the XMLlab installation
  directory.</p></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id901154"></a>4.2.11.&nbsp;<code class="code">Polyline
  Tag</code></h4></div></div></div><p>It deals with a 2D or 3D multiline curve
  defined by a set of points (<code class="code">vertex tag</code>) of
  segments composing it :</p><pre class="programlisting">    &lt;polyline <span
        class="bold"><strong>label</strong></span>="id_courbe"&gt;

<em><span class="remark">      none or several times :
</span></em>      &lt;name lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code><em class="replaceable"><code>possible curve name as displayed in its plot</code></em> </code></em><em><span
          class="remark">(cf. § <a href="#balise_drawcurve2d"
            title="5.2.1.&nbsp;Balise drawcurve2d">Section&nbsp;5.2.1, «<code
              class="code">Drawcurve2d</code>&nbsp;Tag»</a>)</span></em>
      &lt;/name&gt;

<em><span class="remark">      one or several times :
</span></em>      &lt;vertex <span class="bold"><strong>x1</strong></span>="<em
        class="replaceable"><code>x</code></em>" <span class="bold"><strong>x2</strong></span>="<em
        class="replaceable"><code>y</code></em>" x3="<em class="replaceable"><code>z</code></em>"&gt;
<em><span class="remark">
        none or several times :
</span></em>        &lt;name lang="french|english|german|spanish"&gt;
          <em class="replaceable"><code>possible curve name as displayed in its plot</code></em>
        &lt;/name&gt;

      &lt;/vertex&gt;

    &lt;/polyline&gt;</pre><p>For an exemple of the<code class="code">
  polyline tag use</code>, refers tothe file <code
  class="filename">Math/gauss.xml</code> provided in the subdirectory <code
  class="filename">examples</code> of the XMLlab installation
  directory.</p></div></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h2 class="title"
  style="clear: both"><a id="id901273"></a>5.&nbsp;Results display
  </h2></div></div></div><p>This section - that follows the <code
  class="code">&lt;/compute&gt; Tag</code> - is optional and allows to define
  the different graphic windows, a set of system of axes for each one of them
  (windows can then be divided horizontally or vertically to contain them) as
  well as the curves that must be respectively displayed in each system of
  axis. Here is the structure of the graphic windows definition : </p><pre
  class="programlisting"><em><span class="remark">  maximum once :
</span></em>  &lt;display background="white|black|blue"&gt;
<em><span class="remark">             -&gt; name of the background color curves displayed in all windows, 
                a grey frame surrounding curves
</span></em>
<em><span class="remark">    one or several times :
</span></em>    &lt;window dependencies="<em class="replaceable"><code>param</code></em>_label_list"
<em><span class="remark">              -&gt; The list separator is the space ;
                 that indicate that this window contents depends  
                 only on the listed parameters, that avoid useless recalculations
</span></em>            splitx="<span class="bold"><strong>1</strong></span>|2|3"
<em><span class="remark">              -&gt; indicate that the window is horizontally divided  
                 into as many axis systems
</span></em>            splity="<span class="bold"><strong>1</strong></span>|2|3"
<em><span class="remark">              -&gt; indicate that the window is vertically divided
                 into as many axis systems
</span></em>            colormap="gray|hot|copper|cool|bone|jet|red|green|blue"
<em><span class="remark">              -&gt; color pallet to use for the window
</span></em>    &gt;

      <em><span class="remark">none or several times :</span></em>
      &lt;title lang="french|english|german|spanish"&gt;
        <em class="replaceable"><code>possible window title
</code></em>      &lt;/title&gt;

<em><span class="remark">      one or several times :
</span></em>      &lt;axis2d |
       axis3d&gt;<em><span class="remark">... detailed tag in the following paragraphs </span></em>

    &lt;/window&gt;

  &lt;/display&gt;</pre><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id901375"></a>5.1.&nbsp;Systems of axes</h3></div></div></div><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="id901381"></a>5.1.1.&nbsp;<code class="code">Axis2d
  Tag</code></h4></div></div></div><p>It consists of a 2D axes system
  contained in a window or a part of a window, and for which we
  define:</p><div class="itemizedlist"><ul type="disc">
      <li><p>its type: Cartesian or polar,</p></li>

      <li><p>the positioning of the axes,</p></li>

      <li><p>eventually the extrema of abscissas and ordinates that are
      otherwise calculated automatically,</p></li>

      <li><p>if a surface (via a <code class="code">drawsurface tag</code>) is
      included in the 2D axes system, the variations of <span
      class="emphasis"><em>z</em></span> are illustrated by variations of
      colors (the attributes <code class="code">cmin</code> and <code
      class="code">cmax</code> indicating then the range of variation of <span
      class="emphasis"><em>z</em></span>) and a corresponding legend can be
      associated,</p></li>

      <li><p>the identity or not of the scales of abscissas and
      ordinates,</p></li>

      <li><p>the curves to be displayed.</p></li>
    </ul></div><pre class="programlisting">      &lt;axis2d type="<span
        class="bold"><strong>cartesian</strong></span>|polar"
              position="<span class="bold"><strong>left</strong></span>|right|center|origin"
<em><span class="remark">                -&gt; - "left" or "right" : puts the y axis at left or at right
                   - "center" : always puts the axes crossing in the center of the graphic window 
                   - "origin" : puts the axis crossing if possible at (0,0)
</span></em>              xmin="<em class="replaceable"><code>x_min</code></em>" xmax="<em
        class="replaceable"><code>x_max</code></em>"
              ymin="<em class="replaceable"><code>y_min</code></em>" ymax="<em
        class="replaceable"><code>y_max</code></em>"
              iso="yes|<span class="bold"><strong>no</strong></span>"
<em><span class="remark">                -&gt; indicate if, whatever is the system of axis size  
                   (via the recutting of the window which contains it),
                   the scales of X, and Y are identical
</span></em>              cmin="<em class="replaceable"><code>z_min</code></em>" cmax="<em
        class="replaceable"><code>z_max</code></em>"
              colorbar="on|<span class="bold"><strong>off</strong></span>|top|left|right|bot"
                <em><span class="remark">-&gt; position of the possible legend "color(z)"  
                   ("on" is equivalent to "left")</span></em>
      &gt;

<em><span class="remark">        one or several times :
</span></em>        &lt;drawcurve2d |
         drawsurface |
         drawpoints&gt;<em><span class="remark">... cf. § <a
            href="#courbes_et_surfaces" title="5.2.&nbsp;Courbes et surfaces">Section&nbsp;5.2, «&nbsp;Curves and surfaces&nbsp;»</a></span></em>

      &lt;/axis2d&gt;</pre><p>For examples of the <code class="code">axis2d
  tag use</code>, refers to the following simulations :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>Simulation of the pendulum in the document <em
      class="citetitle">Getting started XMLlab</em>,</p></li>

      <li><p>Acido-basic simulation of titration in aqueous medium, § <a
      href="#courbe_ph"
      title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4,
      «&nbsp;Results display&nbsp;»</a>.</p></li>

      <li><p>Simulation via finite elements of the Poisson's equation, § <a
      href="#courbe_poisson"
      title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4,
      «&nbsp;Results displays&nbsp;»</a>.</p></li>

      <li><p>Simulation of kinetics of prey predation by predators, § <a
      href="#courbe_predation"
      title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4,
      «&nbsp;Results display&nbsp;»</a>,</p></li>

      <li><p>Simulation of the Earth-Moon system, § <a
      href="#courbe_terre_lune"
      title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4,
      «&nbsp;Results display&nbsp;»</a>.</p></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="id901646"></a>5.1.2.&nbsp;<code class="code">Axis3d
  Tag</code></h4></div></div></div><p>It deals whith a 3D system of axes
  contained in a window or a part of window, and for which we define :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>eventually the extrema of abscissas, ordinates and the <span
      class="emphasis"><em>z</em></span> taht are otherwise calculated
      automatically,</p></li>

      <li><p>the values of the elevation and the azimuth that indicate the
      point of view of the observer of the 3D axes system,</p></li>

      <li><p>the identity or not of the scales of abscissas, ordinates and of
      the <span class="emphasis"><em>z</em></span>,</p></li>

      <li><p>the variations of <span class="emphasis"><em>z</em></span> or of
      the illumination (if <code class="code">mode="light"</code> in a <code
      class="code">drawsurface</code> tag included) are illustrated by colors
      variations (the attributes <code class="code">cmin</code> and <code
      class="code">cmax</code> then indicating the variation range of <span
      class="emphasis"><em>z</em></span> - the minimum and the maximum of
      <span class="emphasis"><em>z</em></span> being used in their absence -
      or of the illumination) and a corresponding legend can be
      associated,</p></li>

      <li><p>the surfaces to be displayed.</p></li>
    </ul></div><pre class="programlisting">      &lt;axis3d xmin="<em
        class="replaceable"><code>x_min</code></em>" xmax="<em
        class="replaceable"><code>x_max</code></em>"
              ymin="<em class="replaceable"><code>y_min</code></em>" ymax="<em
        class="replaceable"><code>y_max</code></em>"
              zmin="<em class="replaceable"><code>z_min</code></em>" zmax="<em
        class="replaceable"><code>z_max</code></em>"
              elevation="<em class="replaceable"><code>3D</code></em> view elevation (default number 45)" <em><span
          class="remark">-&gt; in degree</span></em>
              azimuth="<em class="replaceable"><code>3D</code></em> view azimuth (default number -45)" <em><span
          class="remark">   -&gt; in degree</span></em>
              iso="yes|<span class="bold"><strong>no</strong></span>"
<em><span class="remark">                -&gt; indicate if, whatever is the system of axis size  
                   (via the recutting of the window which contains it),
                   the scales of X, Y and Z are identical 
</span></em>              cmin="<em class="replaceable"><code>min_z_or_illumination</code></em>" cmax="<em
        class="replaceable"><code>max</code></em><em class="replaceable"><code>_z_or_illumination</code></em>"
              colorbar="<span class="bold"><strong>off</strong></span>|top|left|right|bot"
                <em><span class="remark">-&gt; position of the possible legend 
                   "color (Z or illumination)"</span></em>   
      &gt;

<em><span class="remark">        one or several times :
</span></em>        &lt;drawsurface |
         drawcurve3d&gt;<em><span class="remark">... cf. § <a
            href="#courbes_et_surfaces" title="5.2.&nbsp;Courbes et surfaces">Section&nbsp;5.2, «&nbsp;Curves and surfaces&nbsp;»</a></span></em>

      &lt;/axis3d&gt;</pre><p>For examples of <code class="code">axis3d tag
  use</code>, refers to the simulation via finite elements of the Poisson's
  equation, § <a href="#courbe_poisson"
  title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4, «&nbsp;Results
  display&nbsp;»</a>.</p></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="courbes_et_surfaces"></a>5.2.&nbsp;Curves and
  surfaces</h3></div></div></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="balise_drawcurve2d"></a>5.2.1.&nbsp;<code class="code">Drawcurve2d
  Tag</code></h4></div></div></div><p>It consists of a 2D curve displayed in a
  2D system of axes, and for which we defines :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p>the reference to the <code class="code">label</code> of the curve
      to be drawn,</p></li>

      <li><p>graphic properties of the layout: color, type and line thickness,
      possible marker of the curve points.</p></li>
    </ul></div><pre class="programlisting">        &lt;drawcurve2d <span
        class="bold"><strong>ref</strong></span>="<em class="replaceable"><code>curve label to draw</code></em>"
<em><span class="remark">                       -&gt; could be the label of one of the following tags :
                          - &lt;state&gt; of one &lt;ode&gt;
                          - &lt;unknown&gt; of one &lt;implicitfunction&gt;
                          - &lt;nonparametriccurve2d&gt;
                          - &lt;parametriccurve2d&gt;
                          - &lt;polyline&gt;
</span></em>                     color="<span class="bold"><strong>auto</strong></span>|blue|green|red|cyan|magenta|black|yellow"
<em><span class="remark">                       -&gt; "auto" : colors follow a cycle from a curve 
                          to the other one among the curves of the same &lt;axis2d&gt;
                          (there are two possible cycles as the  
                           &lt;window&gt; background is rather "clear" or "dark")
</span></em>                     linetype="<span class="bold"><strong>solid</strong></span>|dashed|dashdot|none"
<em><span class="remark">                       -&gt; - "solid" : continuous line
                          - "dashed" : dashed line
                          - "dashdot" : alternation of points and lines
                          - "none" : has sense only if marker is defined:
                                     there is even in that case a line
                                     which connects points, except if linetype="none"
</span></em>                     thickness="<span class="bold"><strong>1</strong></span>|2|3|4|5"  <em><span
          class="remark">-&gt; </span></em><em><span class="remark">line thickness</span></em>
                     marker="point|circle|trefoil|plus|star|diamond|
                             filled-diamond|triangle-up|triangle-down"
<em><span class="remark">                       -&gt; point, circle, trefoil, plus sign, star, 
                          diamond, filled diamond, triangle point in top, 
                          triangle points in bottom</span></em><em><span
          class="remark">
</span></em>        /&gt;</pre><p>For examples of the <code
  class="code">drawcurve2d tag</code> use , refers to the following
  simulations:</p><div class="itemizedlist"><ul type="disc">
      <li><p>Simulation of the pendulum in the document <em
      class="citetitle">Getting started XMLlab</em>,</p></li>

      <li><p>Acido-basic simulation of titration in aqueous medium, § <a
      href="#courbe_ph"
      title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4,
      «&nbsp;Results display&nbsp;»</a>.</p></li>

      <li><p>Simulation of kinetics of prey predation by predators, § <a
      href="#courbe_predation"
      title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4,
      «&nbsp;Results display&nbsp;»</a>,</p></li>

      <li><p>Simulation of the Earth-Moon system, § <a
      href="#courbe_terre_lune"
      title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4,
      «&nbsp;Results display&nbsp;»</a>.</p></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h4 class="title"><a
  id="balise_drawcurve3d"></a>5.2.2.&nbsp;<code class="code">Drawcurve3d
  Tag</code></h4></div></div></div><p>It deals with 3D curves displayed in a
  3D system of axes, and for which we define:</p><div class="itemizedlist"><ul
      type="disc">
      <li><p>the reference to <code class="code">the label</code> of the curve
      to be drawn,</p></li>

      <li><p>graphic properties of the layout: color, type and line thickness,
      possible marker of the curve points.</p></li>
    </ul></div><pre class="programlisting">        &lt;drawcurve3d <span
        class="bold"><strong>ref</strong></span>="<em class="replaceable"><code>curve label to draw</code></em>"
<em><span class="remark">                       -&gt; could be the label of one of the following tags :
                          - &lt;state&gt; of one &lt;ode&gt;o
                          - &lt;pdestate&gt; of one &lt;stationary-pde&gt;
                          - &lt;parametriccurve3d&gt;
                          - &lt;polyline&gt;
</span></em>                     color="<span class="bold"><strong>auto</strong></span>|blue|green|red|cyan|magenta|black|yellow"
<em><span class="remark">                       -&gt; "auto" : colors follow a cycle from a curve 
                          to the other one among the curves of the same &lt;axis2d&gt;
                          (there are two possible cycles as the  
                           &lt;window&gt; background is rather "clear" or "dark")
</span></em>                     linetype="<span class="bold"><strong>solid</strong></span>|dashed|dashdot|none"
<em><span class="remark">                       -&gt; - "solid" : continuous line
                          - "dashed" : dashed line
                          - "dashdot" : alternation of points and lines
                          - "none" : has sense only if marker is defined:
                                     there is even in that case a line
                                     which connects points, except if linetype="none"
 
</span></em>                     thickness="<span class="bold"><strong>1</strong></span>|2|3|4|5"  <em><span
          class="remark">-&gt; line thickness</span></em>
                     marker="point|circle|trefoil|plus|star|diamond|
                             filled-diamond|triangle-up|triangle-down"
<em><span class="remark">                       -&gt; point, circle, trefoil, plus sign, star, 
                          diamond, filled diamond, triangle point in top, 
                          triangle points in bottom
</span></em>        /&gt;</pre><p>For examples of the <code
  class="code">drawcurve3d</code> tag use, refers to the file <code
  class="filename">Math/helice.xml</code> located in the subdirectory <code
  class="filename">examples</code> of the installation directory of <span
  class="emphasis"><em>XMLlab</em></span>.</p></div><div class="section"
  lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h4
  class="title"><a id="drawsurface"></a>5.2.3.&nbsp;<code
  class="code">Drawsurface Tag</code></h4></div></div></div><p>It consists a
  displayed surface in a 2D or 3D axes system, and for which we defines
  :</p><div class="itemizedlist"><ul type="disc">
      <li><p>the reference to <code class="code">thelabel</code> of the curve
      to be drawn,</p></li>

      <li><p>graphic properties of the layout: mode of representation of
      surface and the type of shade obtained.</p></li>
    </ul></div><pre class="programlisting">        &lt;drawsurface <span
        class="bold"><strong>ref</strong></span>="<em class="replaceable"><code>surface label to draw</code></em>"
<em><span class="remark">                       -&gt; could be the label of one of the following tags :
                          - &lt;pdestate&gt; of one &lt;stationary-pde&gt;
                          - &lt;parametriccurve3d&gt;
                          - &lt;nonparametricsurface&gt;
                          - &lt;parametricsurface&gt;
                          - &lt;polyline&gt;
</span></em>                     mode="<span class="bold"><strong>level</strong></span>|light|wireframe"
<em><span class="remark">                       -&gt; - level : surface filled, color aiming 
                                    towards the black when Z decreases,
                          - light : surface filled, shade calculated 
                                    in function to a source of light,
                          - wireframe : wire representation.
</span></em>                     shading="<span class="bold"><strong>flat</strong></span>|interp|faceted"
<em><span class="remark">                       -&gt; shadow depiction, only taken into account 
                          if mode &lt;&gt; "wireframe" :
                          - flat : plain on each facet,
                          - interp : continue, by interpolation on each facet,
                          - faceted : flat + white wire around each facet in superpositionf
</span></em>                     hidden="<span class="bold"><strong>off</strong></span>"  <em><span
          class="remark">-&gt; not used at present</span></em>
        /&gt;</pre><p>For examples of the <code class="code">drawsurface tag
  use</code>, refers to the simulation via finite elements of the Poisson's
  equation, § <a href="#courbe_poisson"
  title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4, «&nbsp;Results
  display&nbsp;»</a>.</p></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h4 class="title"><a
  id="balise_drawpoints"></a>5.2.4. <code class="code">Drawpoints
  Tag</code></h4></div></div></div><p>It deals with a list of 2D or 3D points
  displayed in a 2D or 3D system of axes, each point being illustrated by a
  cross accompanied by its co-ordinates :</p><pre class="programlisting">        &lt;drawpoints <span
        class="bold"><strong>ref</strong></span>="<em class="replaceable"><code>points_labels_list</code></em>"
<em><span class="remark">                      -&gt; list, separated by spaces,
                         &lt;point&gt; labels to draw
</span></em>        /&gt;</pre><p>Moreover, the position of each 2D point
  listed is manipulable from the constraints defined on it remain respected :
  click on the cross, the coordinates of the point is displayed then in a
  different color. Move then the cursor to modify its position. All the
  calculations resulting from the modification of this parameter are then
  realized in real time and curves in dependence are displayed again. Once
  obtained the wished value, click again the cross to fix its
  position.</p><p>For examples of the <code class="code">drawpoints tag
  use</code>, refers to the simulation of the pendulum in the document <em
  class="citetitle">Getting started XMLlab</em>.</p></div></div></div><div
  class="section" lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h2
  class="title" style="clear: both"><a id="balise_save"></a>6.&nbsp;Save the
  simulation results</h2></div></div></div><p>This section - which follows the
  <code class="code">&lt;/display&gt; tag</code> - is optional. It allows to
  define a set of parameters and of simulation results which can be saved via
  the entry of menu <span class="guimenuitem">File-&gt;Save the simulation
  results </span> :</p><pre class="programlisting">  &lt;save&gt;

<em><span class="remark">    one or several times :
</span></em>    &lt;file href="<em class="replaceable"><code>save file</code></em>"
            <em><span class="remark">-&gt; name initially proposed during the saving demand</span></em>
          format="<span class="bold"><strong>csv</strong></span>|scilab"
<em><span class="remark">            -&gt; file format : CSV or Scilab
</span></em>          <span class="bold"><strong>labels</strong></span>="<em
        class="replaceable"><code>labels_list</code></em>"
<em><span class="remark">            -&gt; list, separated by spaces, parameters labels and results to save
</span></em>    /&gt;

  &lt;/save&gt;</pre><p>For examples of CSV file obtained, refers to the
  simulation of kinetics of prey predation by predators, § <a
  href="#courbe_predation"
  title="2.4.&nbsp;Affichage des résultats">Section&nbsp;2.4, «&nbsp;Results
  display&nbsp;»</a>.</p></div></div><div class="chapter" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h2 class="title"><a
  id="id902466"></a>Chapter&nbsp;7.&nbsp;XMLlab command and menu lines
  </h2></div></div></div><div class="toc"><p><b>Table of contents</b></p><dl>
      <dt><span class="section"><a href="#id902472">1. Command
      line</a></span></dt>

      <dt><span class="section"><a href="#id902512">2. XMLlab simulation
      menu</a></span></dt>

      <dd><dl>
          <dt><span class="section"><a href="#id902518">2.1. File Menu<span
          class="guimenu"> </span></a></span></dt>

          <dt><span class="section"><a href="#id902635">2.2. <span
          class="guimenuitem"><em class="replaceable"><i>Actions
          Menu</i></em></span></a></span></dt>

          <dt><span class="section"><a href="#id902675">2.3.<span
          class="guimenu"> Parameters Menu</span></a></span></dt>

          <dt><span class="section"><a href="#id902700">2.4. <span
          class="guimenu">XMLlab Menu</span></a></span></dt>
        </dl></dd>

      <dt><span class="section"><a href="#id902754">3. Scilab XMLlab
      Menu</a></span></dt>
    </dl></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h2 class="title" style="clear: both"><a
  id="id902472"></a>1.&nbsp;Command line</h2></div></div></div><p>Since the
  line of command Unix or <span class="emphasis"><em>Scilab</em></span>, take
  place in the directory containing the XML file and tape the following
  command:</p><table border="0" class="simplelist" summary="Simple list">
      <tr>
        <td><span><strong class="command">xmllab -run </strong></span><span
        class="emphasis"><em><span><strong
        class="command">nom_simulation</strong></span></em></span><span><strong
        class="command">.xml</strong></span></td>
      </tr>
    </table></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h2 class="title" style="clear: both"><a
  id="id902512"></a>2.&nbsp; XMLlab simulation menu
  </h2></div></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id902518"></a>2.1.&nbsp;<span class="guimenu">File
  Menu</span></h3></div></div></div><p>It contains the following entries
  :</p><div class="itemizedlist"><ul type="disc">
      <li><p><span class="guimenuitem">Execute</span> : Today, the
      modification of a simulation parameter automatically lead to the
      recalculation of the mathematical models and the displayed curves. It
      will nevertheless be possible in a near future to make this
      recalculation manual for some parameters; in the case where the time
      necessary to do it would be too important. This menu entry will allow to
      start this recalculation manually.</p></li>

      <li><p><span class="guimenuitem">Save the session</span> : saves in a
      file all the simulation parameters of the simulation, under a code
      <span><strong class="command">Tcl </strong></span> file type.</p></li>

      <li><p><span class="guimenuitem">Load a session</span> : restores the
      values of all the parameters, via the execution of a <span><strong
      class="command">Tcl</strong></span> code file previously saved.</p></li>

      <li><p><span class="guimenuitem">Save the simulation results</span>:
      this entry, that is present only if the simulation contains a section
      <code class="code">&lt;save&gt;...&lt;/save&gt;</code> (cf. § <a
      href="#balise_save"
      title="6.&nbsp;Sauvegarde des résultats de la simulation">Section&nbsp;6,
      «&nbsp;Save the results of the simulation&nbsp;»</a>), saves all the
      parameters and the simulation results that are specified.</p></li>

      <li><p><span class="guimenuitem">Quit</span> : quits the
      simulation.</p></li>
    </ul></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h3 class="title"><a
  id="id902635"></a>2.2.&nbsp;<span class="guimenuitem"><em
  class="replaceable"><code>Actions
  Menu</code></em></span></h3></div></div></div><p>This menu is present only
  if the simulation contains a section <code
  class="code">&lt;actions&gt;...&lt;/actions&gt;</code> (cf. § <a
  href="#balise_actions" title="3.&nbsp;Actions">Section&nbsp;3,
  «&nbsp;Actions&nbsp;»</a>) that defines then a set of <span
  class="emphasis"><em>Scilab</em></span> mini-scripts (one per action)
  executable via an entry of this menu, the purpose of every script being to
  update certain parameters of the simulation.</p></div><div class="section"
  lang="fr" xml:lang="fr"><div class="titlepage"><div><div><h3
  class="title"><a id="id902675"></a>2.3. <span class="guimenu">Parameters
  Menu </span></h3></div></div></div><p>It contains one entry per sections of
  simulation parameters defined (cf. § <a href="#balise_parameters"
  title="2.&nbsp;Paramètres">Section&nbsp;2,
  «&nbsp;Parameters&nbsp;»</a>).</p></div><div class="section" lang="fr"
  xml:lang="fr"><div class="titlepage"><div><div><h3 class="title"><a
  id="id902700"></a>2.4.&nbsp;<span class="guimenu">XMLlab Menu
  </span></h3></div></div></div><p>It contains the following entries :</p><div
  class="itemizedlist"><ul type="disc">
      <li><p><span class="guimenuitem">About XMLlab</span> : indicates the
      precise version of the XMLlab software and the addresses of their
      authors.</p></li>

      <li><p><span class="guimenuitem">About this simulation</span> : displays
      notes relating to the simulation (cf. § <a href="#balise_notes"
      title="1.2.&nbsp;Notes sur la simulation">Section&nbsp;1.2,
      «&nbsp;Simulation notes&nbsp;»</a>).</p></li>
    </ul></div></div></div><div class="section" lang="fr" xml:lang="fr"><div
  class="titlepage"><div><div><h2 class="title" style="clear: both"><a
  id="id902754"></a>3.&nbsp;Scilab XMLlab menu</h2></div></div></div><p>It
  contains the following entries :</p><div class="itemizedlist"><ul
      type="disc">
      <li><p><span class="guimenuitem">Execute a simulation</span> : proposes
      to select a simulation in the file tree structure (by positioning
      initially in the <code class="filename">examples</code> sub-directory of
      the <span class="emphasis"><em>XMLlab installation directory)
      </em></span>and executes it. </p></li>

      <li><p><span class="guimenuitem">Edit a simulation</span> :propose to
      select a simulation in the file tree structure and runs its edition in
      the <span class="emphasis"><em>SciPad</em></span> of <span
      class="emphasis"><em>Scilab</em></span> editor. This one is extended by
      XMLlab and contains the supplementary <span
      class="guimenu">XMLlab</span> menu allowing to validate (entry of menu
      <span class="guimenuitem">Validate</span>) and to execute (entry of menu
      <span class="guimenuitem">Run</span>) the edited simulation.</p></li>

      <li><p><span class="guimenuitem">Demos XMLlab</span> : displays a list
      of simulation categories, the choice of a list causing the display of
      the list of the corresponding simulations, the choice of a simulation
      causing its execution.</p></li>

      <li><p><span class="guimenuitem">Help</span> : displays the <span
      class="foreignphrase"><em class="foreignphrase">manpage</em></span> of
      XMLlab.</p></li>

      <li><p><span class="guimenuitem">About XMLlab</span> : indicates the
      precise version of the XMLlab software, the addresses of their authors,
      and its licence type.</p></li>

      <li><p><span class="guimenuitem">Uninstalling XMLlab</span> : uninstalls
      XMLlab.</p></li>
    </ul></div></div></div></div></body>
</html>