I have a PDE system, whose functions are $a=a(t, x, y)$, $b=b(t,x,y)$, and $c=c(t,x,y)$,
with Dirichlet null boundary conditions and initial conditions in the form of circle.
The respective code is,
L = 5;(*length of square*)
pts = 150;
T = 250;(*Time integration*)
Df = 1;
σ = 0.6;
µ = 0.3;
(*system of nonlinear PDE*)
pde = {D[a[t, x, y], t] ==
Df (D[a[t, x, y], x, x] + D[a[t, x, y], y, y]) + µ (1 -
a[t, x, y] - b[t, x, y] - c[t, x, y]) a[t, x, y] - σ c[
t, x, y] a[t, x, y],
D[b[t, x, y], t] ==
Df (D[b[t, x, y], x, x] + D[b[t, x, y], y, y]) + µ (1 -
a[t, x, y] - b[t, x, y] - c[t, x, y]) b[t, x, y] - σ a[
t, x, y] b[t, x, y],
D[c[t, x, y], t] ==
Df (D[c[t, x, y], x, x] + D[c[t, x, y], y, y]) + µ (1 -
a[t, x, y] - b[t, x, y] - c[t, x, y]) c[t, x, y] - σ c[
t, x, y] b[t, x, y]};
(*Dirichlet boundary condition*)
bc = {a[t, -L, y] == 0, a[t, L, y] == 0, a[t, x, -L] == 0,
a[t, x, L] == 0, b[t, -L, y] == 0, b[t, L, y] == 0,
b[t, x, -L] == 0, b[t, x, L] == 0, c[t, -L, y] == 0,
c[t, L, y] == 0, c[t, x, -L] == 0, c[t, x, L] == 0};
(*initial condition*)
ic = {a[0, x, y] == If[(x)^2 + (y - 2.5)^2 <= (L/4)^2, 1, 0],
b[0, x, y] == If[(x + 2.5)^2 + (y + 2.5)^2 <= (L/4)^2, 1, 0],
c[0, x, y] == If[(x - 2.5)^2 + (y + 2.5)^2 <= (L/4)^2, 1, 0]};
eqns = Flatten@{pde, bc, ic};
sol = NDSolve[eqns, {a, b, c}, {t, 0, T}, {x, -L, L}, {y, -L, L},
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MinPoints" -> pts, "MaxPoints" -> pts}}];
I would like to plot $6$ frames ($y \times x$) using DensityPlot (or ListDensityPlot) for the times $t=0$, $t=50$, $t=100$, $t=150$, $t=200$, $t=250$. I would like also to represent $a(t, x, y)$ $\rightarrow $ red color, $b(t, x, y)$ $\rightarrow $ blue, and $c(t, x, y)$ $\rightarrow $ green.
At each point $(x, y)$, if $a(t, x, y)$ has the highest value in relation to $b(t, x, y)$ and/or $c(t, x, y)$ to color the respective point with red color. If at some point $(x, y)$, $b(t, x, y)$ has the largest value in relation to $a(t, x, y)$ and $c(t, x, y)$ to color that point with blue. If at any point $(x, y)$, $c(t, x, y)$ has a value greater than $a(t, x, y)$ and/or $b(t, x, y)$, then to color the respective point with green.The figure below shows the expected scheme
can anybody help me?
sol
does not appear to give those results. Nevertheless I think you should be able to apply the methods I show in my answer; please try them and report. $\endgroup$