BYOM function simplefun.m (the model as explicit equations)
Syntax: Xout = simplefun(t,X0,par,c,glo)
This function calculates the output of the model system. It is linked to the script files named byom_doseresp_*.m. Therefore, t is used for concentrations and c for time! (Note: BYOM normally works with 'time' on the x-axis). As input, it gets:
- t is the vector with exposure concentrations
- X0 is a vector with the initial values for states (not used)
- par is the parameter structure
- c is the exposure time at which the dose-response is made
- glo is the structure with information (normally global)
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.
- Author: Tjalling Jager
- Date: November 2021
- Web support: http://www.debtox.info/byom.html
- Back to index walkthrough_doseresp.html
Copyright (c) 2012-2021, Tjalling Jager, all rights reserved. This source code is licensed under the MIT-style license found in the LICENSE.txt file in the root directory of BYOM.
Contents
Start
function Xout = simplefun(t,X0,par,c,glo)
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, the log-logistic dose-response curve, specified as explicit function.
x = glo.x_EC; % the effect level (as percentage) y = Y0 ./ (1+(x/(100-x))*(t/ECx).^beta); % log-logistic dose-response function Xout = [y]; % combine all outputs into a matrix