model = """
# Generated by PySCeS 0.7.2 (2010-08-10 13:12)
 
# Keywords
Description: Dimerisation model (003), variant 03
Modelname: Dimerisation03
Output_In_Conc: True
Species_In_Conc: False
 
# GlobalUnitDefinitions
UnitVolume: litre, 1.0, 0, 1
UnitLength: metre, 1.0, 0, 1
UnitSubstance: item, 1.0, 0, 1
UnitArea: metre, 1.0, 0, 2
UnitTime: second, 1.0, 0, 1
 
# Compartments
Compartment: Cell, 1.0, 3 
 
# Reactions
Dimerisation@Cell:
    {2.0}P > P2
    k1*P*(P-1)/2

Disassociation@Cell:
    P2 > {2.0}P
    k2*P2
 
# Event definitions
Event: reset, operator.ge(_TIME_,25), 0.0 
{
P2 = 0
P = 100
}
 
# Fixed species
 
# Variable species
P2@Cell = 0.0
P@Cell = 100.0
 
# Parameters
k1 = 0.001
k2 = 0.01
"""

xml_model="""<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
  <model id="Dimerisation03" name="Dimerisation model (003), variant 03">
    <listOfUnitDefinitions>
      <unitDefinition id="substance">
        <listOfUnits>
          <unit kind="item"/>
        </listOfUnits>
      </unitDefinition>
    </listOfUnitDefinitions>
    <listOfCompartments>
      <compartment id="Cell"/>
    </listOfCompartments>
    <listOfSpecies>
      <species id="P" compartment="Cell" initialAmount="100" hasOnlySubstanceUnits="true"/>
      <species id="P2" compartment="Cell" initialAmount="0" hasOnlySubstanceUnits="true"/>
    </listOfSpecies>
    <listOfParameters>
      <parameter id="k1" value="0.001"/>
      <parameter id="k2" value="0.01"/>
    </listOfParameters>
    <listOfReactions>
      <reaction id="Dimerisation" reversible="false">
        <listOfReactants>
          <speciesReference species="P" stoichiometry="2"/>
        </listOfReactants>
        <listOfProducts>
          <speciesReference species="P2"/>
        </listOfProducts>
        <kineticLaw>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <divide/>
              <apply>
                <times/>
                <ci> k1 </ci>
                <ci> P </ci>
                <apply>
                  <minus/>
                  <ci> P </ci>
                  <cn type="integer"> 1 </cn>
                </apply>
              </apply>
              <cn type="integer"> 2 </cn>
            </apply>
          </math>
        </kineticLaw>
      </reaction>
      <reaction id="Disassociation" reversible="false">
        <listOfReactants>
          <speciesReference species="P2"/>
        </listOfReactants>
        <listOfProducts>
          <speciesReference species="P" stoichiometry="2"/>
        </listOfProducts>
        <kineticLaw>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <times/>
              <ci> k2 </ci>
              <ci> P2 </ci>
            </apply>
          </math>
        </kineticLaw>
      </reaction>
    </listOfReactions>
    <listOfEvents>
      <event id="reset">
        <trigger>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <geq/>
              <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/time"> t </csymbol>
              <cn type="integer"> 25 </cn>
            </apply>
          </math>
        </trigger>
        <listOfEventAssignments>
          <eventAssignment variable="P">
            <math xmlns="http://www.w3.org/1998/Math/MathML">
              <cn type="integer"> 100 </cn>
            </math>
          </eventAssignment>
          <eventAssignment variable="P2">
            <math xmlns="http://www.w3.org/1998/Math/MathML">
              <cn type="integer"> 0 </cn>
            </math>
          </eventAssignment>
        </listOfEventAssignments>
      </event>
    </listOfEvents>
  </model>
</sbml>
"""

