BYOM function simplefun.m (the model as explicit equations)

Syntax: Xout = simplefun(t,X0,par,c)

This function calculates the output of the model system. It is linked to the script files byom_doseresp.m and byom_doseresp_surv.m. Therefore, t is used for concentrations and c for time! As input, it gets:

Variable t is handed over as a vector, and scenario name c as single number, by call_deri.m (you do not have to use them in this function). Output Xout (as matrix) provides the output for each state at each t.



function Xout = simplefun(t,X0,par,c)
global glo   % allow for global parameters in structure glo (handy for switches)

Unpack parameters

The parameters enter this function in the structure par. The names in the structure are the same as those defined in the byom script file. The 1 between parentheses is needed as each parameter has 5 associated values.

ECx  = par.ECx(1);  % concentration for x% effect (x in glo.x_EC)
Y0   = par.Y0(1);   % response in control
beta = par.beta(1); % slope factor of the dose response

Calculate the model output

This is the actual model, specified as explicit function(s):

x = glo.x_EC;
y = Y0 ./ (1+(x/(100-x))*(t/ECx).^beta);

Xout = [y]; % combine them into a matrix