<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1">
    <model id="example" substanceUnits="mole" volumeUnits="litre" 
           timeUnits="second" extentUnits="mole">
        <listOfUnitDefinitions>
            <unitDefinition id="conc">
                <listOfUnits>
                    <unit kind="mole"  multiplier="1" scale="0" exponent="1"/>
                    <unit kind="litre" multiplier="1" scale="0" exponent="-1"/>             
                </listOfUnits>
            </unitDefinition>
            <unitDefinition id="per_second">
                <listOfUnits>
                    <unit kind="second" exponent="-1" scale="0" multiplier="1"/>
                </listOfUnits>
            </unitDefinition>
        </listOfUnitDefinitions>
        <listOfCompartments>
            <compartment id="C" size="1" spatialDimensions="3" constant="true"/>
        </listOfCompartments>
        <listOfSpecies>
            <species id="S1" compartment="C" initialConcentration="1" constant="false"
                             boundaryCondition="false" hasOnlySubstanceUnits="false"/>
            <species id="S2" compartment="C" initialConcentration="0" constant="false"
                             boundaryCondition="false" hasOnlySubstanceUnits="false"/>
            <species id="S3" compartment="C" initialConcentration="0" constant="false"
                             boundaryCondition="false" hasOnlySubstanceUnits="false"/>
        </listOfSpecies>
        <listOfParameters>
            <parameter id="p1" value="1"   constant="true" units="conc"/>
            <parameter id="p2" value="1.5" constant="true" units="conc"/>
        </listOfParameters>
        <listOfRules>
            <algebraicRule>
                <math xmlns="http://www.w3.org/1998/Math/MathML">
                    <apply> <minus/> <ci> S1 </ci> <ci> S3 </ci> </apply>
                </math>
            </algebraicRule>
        </listOfRules>
        <listOfReactions>
            <reaction id="R" reversible="true" fast="false">
                <listOfReactants>
                    <speciesReference species="S1" stoichiometry="1" constant="true"/>
                </listOfReactants>
                <listOfProducts>
                    <speciesReference species="S2" stoichiometry="1" constant="true"/>
                </listOfProducts>
                <kineticLaw>
                    <math xmlns="http://www.w3.org/1998/Math/MathML">
                        <apply> <times/> <ci> C </ci> <ci> k1 </ci> <ci> S1 </ci> 
                        </apply>
                    </math>
                    <listOfLocalParameters>
                        <localParameter id="k1" value="0.1" units="per_second"/>
                    </listOfLocalParameters>
                </kineticLaw>
            </reaction>
        </listOfReactions>
        <listOfEvents>
            <event useValuesFromTriggerTime="true">
                <trigger persistent="false" initialValue="true">
                    <math xmlns="http://www.w3.org/1998/Math/MathML">
                        <apply> <gt/> <ci> S2 </ci> <ci> p1 </ci> </apply>
                    </math>              
                </trigger>
                <listOfEventAssignments>
                  <eventAssignment variable="S1">
                    <math xmlns="http://www.w3.org/1998/Math/MathML">
                        <ci> p1 </ci>
                    </math>                  
                  </eventAssignment>
                  <eventAssignment variable="S2">
                    <math xmlns="http://www.w3.org/1998/Math/MathML">
                        <ci> p2 </ci>
                    </math>                  
                  </eventAssignment>
                </listOfEventAssignments>
            </event>
        </listOfEvents>
    </model>
</sbml>
