\begin{verbatim} # Change N where N is the desired number of runs BEGIN { N=99; # how many times do we step through the model TIMESTEPS=20; # how fine should the numeric appr be UNITSTEP=200; SMALL=.000001; } m4_include(includes/base_awk.m4) # Model: # dx/dt = a1*x * ((k1-x - alpha*y)/k1) # dy/dt = a2*y * ((k2-y - beta*x)/k2) # model parameters Choice(a1SpyVal,=,n){ return linear(a1SpyVal_min,a1SpyVal_max,n); } Choice(k1SpyVal,=,n) { return linear(k1SpyVal_min, k1SpyVal_max,n); } Choice(k2SpyVal,=,n) { return linear(k2SpyVal_min, k2SpyVal_max,n); } Choice(alphaSpyVal,=,n){ return linear(alphaSpyVal_min,alphaSpyVal_max,n); } Choice(betaSpyVal,=,n) { return linear(betaSpyVal_min,betaSpyVal_max,n); } function rho( tmp) { tmp = a1SpyVal(); #split 0-1 in half and then rescale if(tmp>.5) return (tmp+.5)*10; else return tmp*2; } function a12( tmp){ tmp = alphaSpyVal(); #split 0-1 in half and then rescale to 0-1 and 1-15 if(tmp>.5) return (tmp+.5)*10; else return tmp*2; } function a21( tmp) { tmp = betaSpyVal(); #split 0-1 in half and then rescale to 0-1 and 1-15 if(tmp>.5) return (tmp+.5)*10; else return tmp*2; } function X0() { return (k1SpyVal()+.02)*2; } function Y0() { return (k2SpyVal()+.02)*2; } function dx(x,y, tmp) { tmp = x*(1-x-a12()*y); return tmp; } function dy(x,y, tmp) { tmp = rho()*y*(1-y-a21()*x); return tmp; } # do time stepping in main function function main(warmup, n,delx,dely,xt,yt) { a1SpyVal(n); k1SpyVal(n);k2SpyVal(n); alphaSpyVal(n);betaSpyVal(n); xt=X0();yt=Y0(); sumworth=0.0; REDO=0 if (!warmup) {print "# new experiment" >> "points.dat"; print count++ " " a12() " " a21() >> "parameters.dat";} do { REDO++; if (!warmup) {print xt " " yt " " sumworth >> "points.dat"; } delx = dx(xt,yt)/UNITSTEP; dely = dy(xt,yt)/UNITSTEP; xt += delx;xt=(xt.01?1:0)+(yt>.01?1:0));#sumworth; } function abs(x){ return (x<0?-x:x);} \end{verbatim}