EBT
escalator boxcar train: runs Andre de Roos' C-code using a generalized reactor
Contents
Syntax
txL23W = EBT (species, tT, tJX, x_0, V_X, h, t_max, numPar)
Description
Escalator Boxcar Train: Plots population trajectories in a generalised reactor for a selected species of cohorts that reproduce continuously. Opens 2 html-pages in system browser to report species traits and EBT parameter settings, and plots 4 figures. The parameters of species are obtained either from allStat.mat, or from a cell-string {par, metaPar, metaData}. The 3 cells are obtained by loading a copy of results_my_pet.mat. Structure metaData is required to get species-name, T_typical and ecoCode, metaPar to get model. If dioecy applies, the sex-ratio is assumed to be 1:1 and fertilisation is assumed to be sure. The present implementation ignores males. The initial population is a single fertilized (female) egg. Starvation parameters are added to parameter structure, if not present. Like all parameters, default settings can be changed by changing structure par in cell-string input. If specified background hazards in 6th input are too high, the population goes extinct.
Input:
- species: character-string with name of entry or cell-string with structures: {metaData, metaPar, par}
- tT: optional (nT,2)-array with time and temperature in Kelvin (default: T_typical); time between 0 (= start) and t_max If scalar, the temperature is assumed to be constant
- tJX: optional (nX,2)-array with time and food supply; time scaled between 0 (= start) and t_max If scalar, the food supply is assumed to be constant (default 100 times max ingestion rate)
- h: optional vector with dilution and background hazards for each stage (depending on the model) and boolean for thinning Default value for the std model: [h_X, h_B0b, h_Bbp, h_Bpi, thin] = [0 0 0 0 0]
- V_X: optional scalar with reactor volume (default 1000*V_m, where V_m is max struct volume)
- x_0: optional scalar with initial scaled food density as fraction of half saturation constant (default: 0)
- t_max: optional scalar with simulation time (d, default 250*365).
- numPar: optional structure with numerical parameter settings. Possible fields:
TIME_METHOD,integr_accuracy,cycle_interval,tol_zero,time_interval_out,state_out_interval,min_cohort_nr, ... relTol_a,relTol_q,relTol_h_a,relTol_L,relTol_E,relTol_E_R,relTol_E_H,relTol_W, ... absTol_a,absTol_q,absTol_h_a,absTol_L,absTol_E,absTol_E_R,absTol_E_H,absTol_W
Possible values for TIME_METHOD: - rk2: the 2nd order Runge-Kutta integration method with fixed step size, - rk4: the 4th order Runge-Kutta integration method with fixed step size, - rkf45: the Runge-Kutta-Fehlberg 4/5th order integration method with an adaptive step size, - rkck: the Cash-Karp Runga-Kutta integration method with adaptive step size, - DOPRI5: an explicit Runge-Kutta method of order (4)5 due to Dormand & Prince with step size control and dense output. - DOPRI8: an explicit Runge-Kutta method of order 8(5,3) due to Dormand & Prince with step size control and dense output. - RADAU5: an implicit Runge-Kutta method of order 5 with step size control and dense output.
The DOPRI5, DOPRI8 and RADAU5 methods can detect and locate discontinuities or events. These events are signalled by the routine EventLocation() in the program definition file. Integration will be carried out exactly up to the moment that the event takes place and will be restarted subsequently. Default: DOPRI5
Output:
- txNL23W: (n,7)-array with times and densities of scaled food, total number, length, squared length, cubed length, weight
- info: boolean with failure (0) of success (1)
Remarks
The function assumes that a C-compiler with name gcc.exe has been installed and a path to it specified. This C-code was written by Andre de Roos. This Matlab function only uses the computational core of EBTtool, which required tiny modifications; the required modified files have been copied into DEBtool_M/EBTtool
If species is specified by string (rather than by data), its parameters are obtained from allStat.mat. The starvation parameters can only be set different from the default values by first input in the form of data and adding them to the par-structure. Empty inputs are allowed, default values are then used. The (first) html-page has traits at inidvidual level using the possibly modified parameter values. This function EBT only controls input/output; computations are done in EBTtool of Andre de Roos via get_EBT. Temperature changes during embryo-period are ignored; age at birth uses T(0); All embryo's start with f=1. Background hazards do not depend on temperature, ageing hazards do. For modification of EBTtool, see manual
Example of use
- If results_My_Pet.mat exists in current directory (where "My_Pet" is replaced by the name of some species, but don't replace "my_pet"): load('results_My_Pet.mat'); prt_my_pet_pop({metaData, metaPar, par}, [], T, f, destinationFolder)
- EBT('Torpedo_marmorata');
- EBT('Torpedo_marmorata', C2K(18));