/usr/share/doc/xmds/examples/duffing.xmds is in xmds 1.6.6-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | <?xml version="1.0"?>
<simulation>
<!-- $Id: duffing.xmds 1526 2007-08-21 17:30:14Z paultcochrane $ -->
<!-- Copyright (C) 2000-2007 -->
<!-- -->
<!-- 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., 51 Franklin St, Fifth Floor, Boston, -->
<!-- MA 02110-1301, USA. -->
<name> duffing </name> <!-- the name of the simulation -->
<author> Paul Cochrane </author> <!-- the author of the simulation -->
<description>
<!-- a description of what the simulation is supposed to do -->
Example simulation of Duffing's equation which describes the
motion of a mechanical system in a twin-well potential.
</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 -->
<use_prefs> yes </use_prefs> <!-- defaults to yes -->
<!-- Global variables for the simulation -->
<globals>
<![CDATA[
const double xo = 1; // initial x
const double yo = 2; // initial y
const double k = 0.01; // damping coefficient
]]>
</globals>
<!-- Field to be integrated over -->
<field>
<name> main </name>
<samples> 1 </samples> <!-- sample 1st point of dim? -->
<vector>
<name> main </name>
<type> double </type> <!-- data type of vector -->
<components> x y </components> <!-- names of components -->
<![CDATA[
x = xo;
y = yo;
]]>
</vector>
</field>
<!-- The sequence of integrations to perform -->
<sequence>
<integrate>
<algorithm> RK4EX </algorithm> <!-- RK4EX, RK4IP, SIEX, SIIP -->
<interval> 1000 </interval>
<lattice> 100000 </lattice> <!-- no. points in main dim -->
<samples> 10000 </samples> <!-- no. pts in output moment group -->
<vectors> main </vectors>
<![CDATA[
dx_dt = y;
dy_dt = -k*y + x*(1-x*x);
]]>
</integrate>
</sequence>
<!-- The output to generate -->
<output format="ascii">
<group>
<sampling>
<moments> yOut xOut </moments> <!-- names of moments -->
<![CDATA[
xOut = x;
yOut = y;
]]>
</sampling>
</group>
</output>
</simulation>
|