Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Eq = x'[t] + (x[t] - λ) == 0;
- WhenEvent[x'[t] == 0, λ -> x[t]].
- λ = 1;
- Eq = x'[t] + (x[t] - λ) == 0;
- sol = NDSolve[{Eq, x[0] == 0,
- WhenEvent[x'[t] == 0., λ -> x[t]]
- }, x, {t, 0, 5}][[1]]
- equation = x'[t] + (x[t] - λ[t]) == 0;
- sol = NDSolveValue[{equation, x[0] == 0, λ[0] == 1,
- WhenEvent[x'[t] == 0.25, λ[t] -> x[t]]}, x, {t, 0, 5},
- DiscreteVariables -> {λ}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement