是否可以使用ODE求解器(例如ode45),並仍然能夠在被調用函數內「更改」參數值? 例如,如果我是使用下面的功能: function y = thisode(t, Ic)
% example derivative function
% parameters
a = .05;
b = .005;
c = .0005;
d = .00005;
% state variables
我已經包含了一些賦有以下功能: myfunction <- function(t, state, parameters) {
with(as.list(c(state, parameters)),{
if (X>20) { # this is an internal threshold!
Y <- 35000
dY <- 0
}el