I have trouble finding a numerical solution to the partial differential equation below.
It seems to be a singularity in the solution somewhere, so I searched online and found that it is suggested to use Method -> {"StiffnessSwitching"}. But that didn't work very well.
I have no idea how to handle singularity in the numerical solving of PDE. Any comment is very welcome.
This is my code.
ClearAll["Global`*"]
a = 1;
b = 5;
diff = (a*y[x, t] + b*(1 - y[x, t]))*(1 - y[x, t] (1 - y[x, t])) // Simplify
time = 2000;
length = 1000;
amp = 100;
sol = NDSolve[{D[y[x, t], t] ==
D[(a*y[x, t] + b*(1 - y[x, t]))*(1 - y[x, t] (1 - y[x, t]))*
D[y[x, t], x], x], y[0, t] == amp, y[x, 0] == amp*UnitStep[-x],
y[length, t] == 0}, y, {x, 0, length}, {t, 0, time},
Method -> {"StiffnessSwitching"}]
alpha = y[x, t] /. sol;
beta1 = D[alpha, t];
beta2 = D[(a*alpha + b*(1 - alpha))*(1 - alpha (1 - alpha))*
D[alpha, x], x];
Plot3D[beta1 - beta2, {x, 0, length}, {t, 0, time}]
ContourPlot[alpha, {x, 0, length}, {t, 0, time},
AxesLabel -> {"length", "time", "value"}]
Plot3D[alpha, {x, 0, length}, {t, 0, time}]
Plot3D[beta1, {x, 0, length}, {t, 0, time}]