// simple, 1-box NPZ and NPZD models, no light dependence, no sinking, no physics. // included as examples with ASTroCAT. class SimpleNPZ extends Ecosystem { Statevar N,P,Z,totalN; Flux Fuptake, Fingest, Fpmort, Fzmort, Fexcret; FreeParam mu0, I0, ks, Ks, m, mz, epsilon; // system definition ---------------------- SimpleNPZ() { N = addVar("nutrients","N","µM"); P = addVar("phytoplankton","P","µM"); P.sinks = true; Z = addVar("zooplankton","Z","µM"); totalN = addGhostVar("total nitrogen","T","µM"); Fuptake = addFlux("uptake","uptake", N, P); Fingest = addFlux("ingestion","ingest", P, Z); Fpmort = addFlux("P mortality","Pmort", P, N); Fzmort = addFlux("Z mortality","Zmort", Z, N); Fexcret = addFlux("excretion","excret", Z, N); mu0 = addParam("P max growth","mu0","1/d",2,0,2); ks = addParam("nutrient half-saturation","ks","µM",1, 0.1, 5); m = addParam("P mortality","m","1/d",0.1, 0, 0.4); I0 = addParam("Z max growth","I0","1/d", 3, 0, 5); Ks = addParam("grazing half-saturation","Ks","µM",3, 0, 4); epsilon = addParam("Z growth efficiency","epsilon","",0.3, 0, 1); mz = addParam("Z mortality","mz","1/d",0.4, 0, 1.0); } // grazing and mortality are linear: simple, prone to oscillations void calcFluxes() { for (int i=0; i