I am trying to add a time dependent fraction to a parameter in NDSolve
,
i.e. when 10 < t< 20
, add s
to k1
...
Manipulate[ sol = NDSolve[{A'[t] == k1*A[t], A[0] == 10,
WhenEvent[ 10 < t < 20, k1 -> (k1 + s)]},
A, {t, 0, 100}],
{k1, 0.0, 1.0}, {s, 0.0, 1.0}]
But I cannot get the code to work, and get the following error message. Does anyone have any suggestions, or can find the error in the code?
NDSolve::wenset: Warning: the rule FE`k1$$16->FE`k1$$16+FE`s$$16 will not directly set the state because the left-hand side is not a list of state variables. >>