class ASTroCAT extends DiverseEcosystem { // the ASTroCAT ecosystem model itself. // // imposed N supply, spectrum of P, spectrum of Z, and that's it. No light dependence. Statevar Ptot, Ztot, N; Statevar[] P, Z; Flux[][] FgrazP; // one for each P-Z pair Flux[] Fegest; // summed over Z for each P Flux[] Fexcret; // summed over P for each Z Flux[] Fuptake, Fpmort, Fzmort; Flux Fsupply; FreeParam epsilon, fegest, supply; // system params FreeParam mu0, m, I0, zeta; // rate params FreeParam ks, K0; // shape params FreeParam xpreyopt, dxprey; // grazing pref params float[][] phiP; // grazing preferences P -> Z boolean doAnnualCycle = false; int NP, NZ; // system definition ---------------------- ASTroCAT() {construct(10);} ASTroCAT(int NP) {construct(NP);} void construct(int NP) { this.NP = NP; this.NZ = NP; float PMinEsd = 1; // size ranges in microns float PMaxEsd = 20; // state variables N = addVar("nutrients","N","µM"); P = addDiverseVarSet("phytoplankton","P","µM",NP,PMinEsd, PMaxEsd); Ptot = addGhostVar("total P","Ptot","µM"); Z = addDiverseVarSet("zooplankton","Z","µM",NZ,1,2); for (int i=0; i 400) { arrows[0].draw(); // draw the supply arrow only if there's a lot of arrows } else { for (int i=0; i