Input := Clear[p, t];
Input :=
V = 1000000;
eqn = p'[t] == 6000 - 5000/V p[t];
ic = p[0] == 0;
ans = Flatten[DSolve[{eqn, ic}, p[t], t]];
Input := sol = p[t] /. ans;
Input :=
psol = Plot[sol, {t, 0, 100}]

Output = -Graphics-
Input :=
V = 1000000;
e1 = p1'[t] == 6000 - 5000/(V/2) p1[t] - d12/(V/2) p1[t] +
d21/(V/2) p2[t];
e2 = p2'[t] == d12/(V/2) p1[t] - d21/(V/2) p2[t];
Input :=
eq1 = 6000 - 5000/(V/2) p1[t] - d12/(V/2) p1[t] +
d21/(V/2) p2[t]==0;
eq2 = d12/(V/2) p1[t] - d21/(V/2) p2[t]==0;
Flatten[Solve[{eq1, eq2}, {p1[t], p2[t]}]]
Output =
600000 d12
{p2[t] -> ----------, p1[t] -> 600000}
d21
Input :=
jac = {{- 5000/(V/2) - d12/(V/2), d21/(V/2)},
{d12/(V/2), -d21/(V/2)}}
Output =
1 d12 d21 d12 -d21
{{-(---) - ------, ------}, {------, ------}}
100 500000 500000 500000 500000
Input := Simplify[Eigenvalues[jac]]
Output =
{(-500000 - 100 d12 - 100 d21 -
2
Sqrt[-200000000 d21 + 10000 (5000 + d12 + d21) ]) / 100000000,
(-500000 - 100 d12 - 100 d21 +
2
Sqrt[-200000000 d21 + 10000 (5000 + d12 + d21) ]) / 100000000}
If we assume that the lake is initially clean, we have the following initial conditions:
Input := ic1 = p1[0] == 0; ic2 = p2[0] == 0;
Here's the general solutions:
sol1 and sol2 (in terms of the unspecified parameters d12, d21, and V.)
Input :=
ans = Flatten[DSolve[{e1, e2, ic1, ic2}, {p1[t], p2[t]}, t]];
Input := sol1 = p1[t] /. ans[[1]]; sol2 = p2[t] /. ans[[2]];
Here we show that when d12 = d21 is small, p1(t) and p2(t) are quite different and p1(t) > p2(t) (which makes sense since most particulate matter remains near the surface where it came into the lake water), while as d12 = d21 -> infinity, mixing becomes instantaneous throughout the lake and p1(t) and p2(t) coalesce. The animation further demonstrates that p2(t) increases from nearly zero (the initial weight of pollutants) as the diffusivity increases, while p1(t) decreases with increasing diffusivity since more of the pollutants are able to cross to the other layer.
(In the animation, the parameter d12 = d21 increases exponentially. The thicker curve is p1(t).)
Input :=
Do[Plot[{sol1 /. {d12 -> N[Exp[i]], d21 -> N[Exp[i]]},
sol2 /. {d12 -> N[Exp[i]], d21 -> N[Exp[i]]}},
{t, 0, 100},
PlotStyle -> {AbsoluteThickness[2],
AbsoluteThickness[1]},
AxesLabel -> {"minutes", "pollutant weight"},
PlotRange -> {{0, 100}, {0, 350000}}],
{i, 5, 13}]









Input :=
Do[Plot[{sol1 /. {d21 -> 1., d12 -> N[Exp[alpha]]},
sol2 /. {d21 -> 1., d12 -> N[Exp[alpha]]}},
{t, 0, 100},
PlotStyle -> {AbsoluteThickness[2],
AbsoluteThickness[1]},
AxesLabel -> {"minutes", "pollutant weight"},
PlotRange -> {{0, 100}, {0, 350000}}],
{alpha, 6, 12, 0.5}]













Input :=
Do[Plot[{sol1+sol2 /. {d21 -> N[Exp[i]], d12 -> N[Exp[i]]},
sol},
{t, 0, 100},
PlotStyle -> {AbsoluteThickness[1],
AbsoluteThickness[2]},
AxesLabel -> {"minutes", "pollutant weight"},
PlotRange -> {{0, 100}, {0, 500000}}],
{i, 5, 12, 0.5}]















Input :=
Show[Graphics[{Line[{{0, 0}, {4, 0}}],
Line[{{0, 0}, {0, 4}}],
Line[{{0, 4}, {4, 4}}],
Line[{{4, 4}, {4, 0}}],
Line[{{1, 0}, {1, 4}}],
Line[{{2, 0}, {2, 4}}],
Line[{{3, 0}, {3, 4}}],
Line[{{0, 1}, {4, 1}}],
Line[{{0, 2}, {4, 2}}],
Line[{{0, 3}, {4, 3}}],
Text["Diffusion This Way", {1.3, 1.4}],
Line[{{1.8, 1.5}, {2.2, 1.5}}],
Line[{{2.1, 1.4}, {2.2, 1.5}}],
Line[{{2.1, 1.6}, {2.2, 1.5}}],
Text["But Not This Way", {2.3, 2.4}],
Line[{{2.2, 2.2}, {1.8, 1.8}}],
Line[{{1.8, 1.8}, {1.85, 1.9}}],
Line[{{1.8, 1.8}, {1.9, 1.85}}]},
AspectRatio -> Automatic]]
