pwAddConstraint
m = pwAddConstraint(m, lhs, operator, rhs, reactants, parameters, lambda)
Adds constraints concerning system trajectory or parameter values
to the model, which will penalize the optimization function
if not fullfilled.
Argument Type Description
---------------------------------------------------------------------------------
lhs string Mathematical expression using placeholders ri, ki.
operator string '==', '<', '>'
rhs string Mathematical expression using placeholders ri, ki.
reactants ID Array Used variables.
parameters ID array Used parameters.
lambda float Weighing factor.
---------------------------------------------------------------------------------
Description
During optimization, all free parameters are calibrated to decrease
the distance between model trajectory and experimental
data. Lower and upper limits for the fitted parameter values can
be specified. However, sometimes more qualitative or
soft constraints exist, e.g. the maximum of player A should
not exceed 30% of the maximum of player B. These constraints
can be specified within the model definition file:
m = pwAddConstraint(m,'max(r1)', '<', '0.3 * max(r2)', {'A','B'}, {}, 100);
The weighing factor lambda determines how important the
constraint is compared to the residuals between data and model. If lambda
is small, the constraint may be violated in order to allow a better
fit of the data.
The chi-square value is increased by d^2, where d = constraint * lambda.
In the above example, the absolute values of max(A) and
max(B) influence the probability, that the constraint is fulfilled or
not. In order to avoid this, it is more suitable to specify it as follows:
pwAddConstraint(m, lhs, operator, rhs, reactants, parameters, lambda);
m = pwAddConstraint(m,'max(r1)/max(r2)', '<', '0.3', {'A','B'}, {}, 100);
Example
m = pwAddConstraint(m, 'k1', '==', 'r1(t==0)', {'A'}, {'A_0'}, 100);
This forces A to go through A_0 at t==0.