Can WhenEvent
be used to reset the conditions on a PDE at a given time? How would the syntax of that be?
This is the code I`m using
r = 2;
d2 = 1;
l = 5;
sol = NDSolve[{Derivative[0, 1][n][x, t] ==
d2 Derivative[2, 0][n][x, t] + r*n[x, t]*(1 - n[x, t]),
n[x, 0] == 0.1*x*(1 - x/l), n[0, t] == 0, n[l, t] == 0,
WhenEvent[t == 50, n[x, t] -> 0]}, {n}, {x, 0, l}, {t, 0, tmax}]
Comments
Post a Comment