|
lotka_volterra.xmds
Script source: lotka_volterra.xmds.gz
<?xml version="1.0"?>
<!-- Lotka-Volterra system simulation -->
<!-- $Id: lotka_volterra_body.part 999 2004-08-03 05:42:47Z cochrane $ -->
<!-- Copyright (C) 2000-2004 -->
<!-- -->
<!-- Code contributed by Greg Collecutt, Joseph Hope and Paul Cochrane -->
<!-- -->
<!-- This file is part of xmds. -->
<!-- -->
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License -->
<!-- as published by the Free Software Foundation; either version 2 -->
<!-- of the License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the Free Software -->
<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
<!-- MA 02111-1307, USA. -->
<simulation>
<name> lotka_volterra </name> <!-- the name of the simulation -->
<author> Paul Cochrane </author> <!-- the author of the simulation -->
<description>
Example simulation: The Lotka-Volterra system, used to model
undamped oscillations in autocatalytic chemical reactions.
Adapted from the journal article: "A new transformation for the
Lotka-Volterra problem", C.M. Evans and G.L. Findley, J. Math. Chem.
<b>25</b>, 1, Jan (1999)
</description>
<!-- Global system parameters and functionality -->
<prop_dim> t </prop_dim> <!-- name of main propagation dim -->
<error_check> yes </error_check> <!-- defaults to yes -->
<use_wisdom> yes </use_wisdom> <!-- defaults to no -->
<benchmark> yes </benchmark> <!-- defaults to no -->
<!-- Global variables for the simulation -->
<globals>
<![CDATA[
double const a = 0.50;
double const b = 1.30;
double const c = 0.67;
// these variables are the transformation variables in the paper,
// we don't do this here, however we use their initial values
// (it makes converting the paper to xmds easier)
double const wo = 2.0;
double const wo_dot = 0.5;
]]>
</globals>
<!-- Field to be integrated over -->
<field>
<samples> 1 </samples> <!-- sample 1st point of dim? -->
<vector>
<name> main </name>
<type> double </type> <!-- data type of vector -->
<components> x1 x2 </components> <!-- names of components -->
<![CDATA[
x1 = (c*wo + wo_dot)/b;
x2 = (a*wo - wo_dot)/b;
]]>
</vector>
</field>
<!-- The sequence of integrations to perform -->
<sequence>
<integrate>
<algorithm> RK4EX </algorithm> <!-- RK4EX, RK4IP, SIEX, SIIP -->
<interval> 30.0 </interval> <!-- how far in main dim? -->
<lattice> 3000 </lattice> <!-- no. points in main dim -->
<samples> 100 </samples> <!-- no. pts in output moment group -->
<vectors> </vectors> <!-- vector names -->
<![CDATA[
dx1_dt = a*x1 - b*x1*x2;
dx2_dt = -c*x2 + b*x1*x2;
]]>
</integrate>
</sequence>
<!-- The output to generate -->
<output format="ascii">
<group>
<sampling>
<moments> x1Out x2Out </moments> <!-- names of moments -->
<![CDATA[
x1Out = x1;
x2Out = x2;
]]>
</sampling>
</group>
</output>
</simulation>
Generated by GNU enscript 1.6.3.
|