<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2" level="2" version="1">

  <!-- This is an example SBML file for MesoRD.  The different parts
       of this file is described in more detail in the MesoRD
       Documentation at http://mesord.sourceforge.net/
       
       - Try running it with spatial discretization 0.5 um and 8
         molecules shown per subvolume.
       
       - Color the molecules as you like.

       - Turn off grid in the viesualizer using "g", use "Ctrl+
         mouse-left" to zoom and use mouse to rotate
  -->
  
  <model name="MesoRD Tutorial System">

    <listOfUnitDefinitions>
      
      <unitDefinition id="um">
	<listOfUnits>
	  <unit kind="metre" scale="-6"/>
	</listOfUnits>
      </unitDefinition>
      
      <unitDefinition id="pMps">
	<listOfUnits>
	  <unit kind="mole" exponent="-1"/>
	  <unit kind="litre" exponent="+1"/>
	  <unit kind="second" exponent="-1"/>
	</listOfUnits>
      </unitDefinition>
      
      <unitDefinition id="cm2ps">
	<listOfUnits >
	  <unit kind="metre" exponent="2" scale="-4"/>
	  <unit kind="second" exponent="-1"/>
	</listOfUnits>
      </unitDefinition>
      
      <unitDefinition id="ps">
	<listOfUnits>
	  <unit kind="second" exponent="-1"/>
	</listOfUnits>
      </unitDefinition>

    </listOfUnitDefinitions>


    <listOfCompartments>

      <compartment id="CompartmentTwo">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <!--MesoRD:units is defined for forward compatibility with
	       later releases of MesoRD. In releses <= 0.2.1 degrees
	       are assumed-->
	  <MesoRD:rotation MesoRD:x="0"
			   MesoRD:y="0"
			   MesoRD:z="1"
			   MesoRD:angle="20"
			   MesoRD:units="foo">
	    <MesoRD:scale MesoRD:x="1" 
			  MesoRD:y="2" 
			  MesoRD:z="1"
			  MesoRD:units="um">
	      <MesoRD:sphere MesoRD:radius="2"
			     MesoRD:units="um"/>
	    </MesoRD:scale>
	  </MesoRD:rotation >
	</annotation>
      </compartment>

      <compartment id="CompartmentOne">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:difference>
	    <MesoRD:union>
	      <MesoRD:cylinder MesoRD:radius="4.5" 
			       MesoRD:height="8"
			       MesoRD:units="um"/>
	      <MesoRD:translation MesoRD:x="0.00" 
				  MesoRD:y="-4" 
				  MesoRD:z="0"
				  MesoRD:units="um">
		<MesoRD:sphere MesoRD:radius="4.5"
			       MesoRD:units="um"/>
	      </MesoRD:translation>
	      <MesoRD:translation MesoRD:x="0.00" 
				  MesoRD:y="4" 
				  MesoRD:z="0"
				  MesoRD:units="um">
		<MesoRD:sphere MesoRD:radius="4.5"
			       MesoRD:units="um"/>
	      </MesoRD:translation>
	      <MesoRD:translation MesoRD:x="0" 
				  MesoRD:y="7" 
				  MesoRD:z="3.5"
				  MesoRD:units="um">
		<MesoRD:sphere MesoRD:radius="4.5"
			       MesoRD:units="um"/>
	      </MesoRD:translation>
	    </MesoRD:union>
	    <MesoRD:compartment MesoRD:id="CompartmentTwo" /> 
	  </MesoRD:difference>
	</annotation>
      </compartment>

      <compartment id="CompartmentThree">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:difference>
	    <MesoRD:union>
	      <MesoRD:translation MesoRD:x="-0.00" 
				  MesoRD:y="-0.00" 
				  MesoRD:z="0"
				  MesoRD:units="um">
		<MesoRD:cylinder MesoRD:radius="5.0" 
				 MesoRD:height="8.0"
				 MesoRD:units="um"/>
	      </MesoRD:translation>
	      <MesoRD:translation MesoRD:x="0.0" 
				  MesoRD:y="-4" 
				  MesoRD:z="0"
				  MesoRD:units="um">
		<MesoRD:sphere MesoRD:radius="5"
			       MesoRD:units="um"/>
	      </MesoRD:translation>
	      <MesoRD:translation MesoRD:x="0.0" 
				  MesoRD:y="4" 
				  MesoRD:z="0.0"
				  MesoRD:units="um">
		<MesoRD:sphere MesoRD:radius="5"
			       MesoRD:units="um"/>
	      </MesoRD:translation>
	      <MesoRD:translation MesoRD:x="0" 
				  MesoRD:y="7" 
				  MesoRD:z="3.5"
				  MesoRD:units="um">
		<MesoRD:sphere MesoRD:radius="5"
			       MesoRD:units="um"/>
	      </MesoRD:translation>
	    </MesoRD:union>
	    <MesoRD:union>
	      <MesoRD:compartment MesoRD:id="CompartmentOne" /> 
	      <MesoRD:compartment MesoRD:id="CompartmentTwo" /> 
	    </MesoRD:union>
	  </MesoRD:difference>
	</annotation>
      </compartment>
  
    </listOfCompartments>


    <listOfSpecies>

      <species id="A1"
	       name="A"
	       boundaryCondition="false"
	       compartment="CompartmentOne"
	       hasOnlySubstanceUnits="true"
	       initialAmount="0"
	       substanceUnits="item">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>
      
      <species id="A2"
	       name="A"
	       boundaryCondition="false"
	       compartment="CompartmentTwo"
	       hasOnlySubstanceUnits="true"
	       initialAmount="0"
	       substanceUnits="item">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>      
      
      <species id="A3"
	       name="A"
	       boundaryCondition="false"
	       compartment="CompartmentThree"
	       hasOnlySubstanceUnits="true"
	       initialAmount="1"
	       substanceUnits="item">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="0.01e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>

      <species id="B1"
	       name="B"
	       boundaryCondition="false"
	       compartment="CompartmentOne"
	       hasOnlySubstanceUnits="true"
	       initialAmount="0"
	       substanceUnits="item">
	<!-- The B molecules diffuses with the same rate in and 
	     between all compartments -->
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne"
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>

      <species id="B2"
	       name="B"
	       boundaryCondition="false"
	       compartment="CompartmentTwo"
	       hasOnlySubstanceUnits="true"
	       initialAmount="0"
	       substanceUnits="item">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>

      
      
      <species id="B3"
	       name="B"
	       boundaryCondition="false"
	       compartment="CompartmentThree"
	       hasOnlySubstanceUnits="true"
	       initialAmount="0"
	       substanceUnits="item">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>




      <species id="C1"
	       name="C"
	       boundaryCondition="false"
	       compartment="CompartmentOne"
	       hasOnlySubstanceUnits="false"
	       initialConcentration="0"
	       substanceUnits="mole"
	       spatialSizeUnits="litre">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>

            
      <species id="C2"
	       name="C"
	       boundaryCondition="false"
	       compartment="CompartmentTwo"
	       hasOnlySubstanceUnits="false"
	       initialConcentration="0"
	       substanceUnits="mole"
	       spatialSizeUnits="litre">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>



      <species id="C3"
	       name="C"
	       boundaryCondition="false"
	       compartment="CompartmentThree"
	       hasOnlySubstanceUnits="false"
	       initialConcentration="1e-9"
	       substanceUnits="mole"
	       spatialSizeUnits="litre">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>

      
      <species id="D1"
	       name="D"
	       boundaryCondition="false"
	       compartment="CompartmentOne"
	       hasOnlySubstanceUnits="true"
	       initialAmount="0"
	       substanceUnits="item">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>


      <species id="D2"
	       name="D"
	       boundaryCondition="false"
	       compartment="CompartmentTwo"
	       hasOnlySubstanceUnits="true"
	       initialAmount="0"
	       substanceUnits="item">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>
      
      
      <species id="D3"
	       name="D"
	       boundaryCondition="false"
	       compartment="CompartmentThree"
	       hasOnlySubstanceUnits="true"
	       initialAmount="0"
	       substanceUnits="item">
	<annotation xmlns:MesoRD="http://www.icm.uu.se">
	  <MesoRD:diffusion MesoRD:compartment="CompartmentThree" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentTwo" 
			    MesoRD:rate="2.0e-8" 
			    MesoRD:units="cm2ps"/>
	  <MesoRD:diffusion MesoRD:compartment="CompartmentOne" 
			    MesoRD:rate="0" 
			    MesoRD:units="cm2ps"/>
	</annotation>
      </species>


    </listOfSpecies>


    <listOfParameters>

      <parameter id="k" units="ps" value="100.0"/>
      <parameter id="ka" units="pMps" value="1e8"/>
      <parameter id="kd" units="ps" value="0.01"/>
      <parameter id="mu" units="ps" value="0.5"/>
      <parameter id="mu2" units="ps" value="0.005"/>

    </listOfParameters>


    <listOfReactions>

      <reaction id="Reaction1" reversible="false">
	<listOfReactants>
	  <speciesReference species="A3"/>
	</listOfReactants>
	<listOfProducts>
	  <speciesReference species="A3"/>
	  <speciesReference species="B3"/>
	</listOfProducts>
	<kineticLaw>
	  <math xmlns="http://www.w3.org/1998/Math/MathML">
	    <apply>
	      <times/>
	      <ci>k</ci>
	      <ci>A3</ci>
	    </apply>
	  </math>
	</kineticLaw>
      </reaction>

      <reaction id="Reaction2" reversible="false">
	<listOfReactants>
	  <speciesReference species="D2"/>
	</listOfReactants>		
	<kineticLaw>
	  <math xmlns="http://www.w3.org/1998/Math/MathML">
	    <apply>
	      <times/>
	      <ci>mu2</ci>
	      <ci>D2</ci>
	    </apply>
	  </math>
	</kineticLaw>
      </reaction>

      <reaction id="Reaction3" reversible="false">
	<listOfReactants>
	  <speciesReference species="B1"/>
	</listOfReactants>		
	<kineticLaw>
	  <math xmlns="http://www.w3.org/1998/Math/MathML">
	    <apply>
	      <times/>
	      <ci>mu</ci>
	      <ci>B1</ci>
	    </apply>
	  </math>
	</kineticLaw>
      </reaction>

      <reaction id="Reaction4" reversible="false">
	<listOfReactants>
	  <speciesReference species="B2" stoichiometry="2" />
	</listOfReactants>
	<listOfProducts>
	  <speciesReference species="D2"/>
	</listOfProducts>
	<kineticLaw>
	  <math xmlns="http://www.w3.org/1998/Math/MathML">
	    <apply>
	      <times/>
	      <ci>ka</ci>
	      <ci>B2</ci>
	      <apply>
		<minus/>
		<ci>B2</ci>
		<ci>one_molecule_molar_spc</ci>	            
	      </apply>
	    </apply>
	  </math>
	</kineticLaw>
      </reaction>

      <reaction id="Reaction5" reversible="false">
	<listOfReactants>
	  <speciesReference species="D2"/>
	</listOfReactants>
	<listOfProducts>
	  <speciesReference species="B2" stoichiometry="2" />
	</listOfProducts>
	<kineticLaw>
	  <math xmlns="http://www.w3.org/1998/Math/MathML">
	    <apply>
	      <times/>
	      <ci>kd</ci>
	      <ci>D2</ci>
	    </apply>
	  </math>
	</kineticLaw>
      </reaction>
    </listOfReactions>


  </model>
</sbml>
