I am running simulations on chemical reaction systems. Usually for these I have some input signal and I want to investigate what happens to the system when suddenly an input is turned on. Typically I might have a variable (X), representing something which is produced under certain input (i). Typically I could model this as:
dX/dt = i - d*X
(Then X goes on to activate some system.)
using parameters I would express this as:
dX/dt = p - p*X
Now my input is a step, so up and until some timepoint (t0) i (that is p) would be small, i_inactive. But at time t0 the input becomes i_active which is some large number. How would I do to create a callback which changes the parameter value of p to a new value? I think I know how to use the
affect! function to change the integrator to change the actual value of X, but how do I change the parameter values (the integrator seems to have no field for the parameter).
At worst I could make i a second variable, which have di/dt = 0, and then change it via the integrator. But this do not feel like the natural solution to the problem?