I have a bunch of linked PDEs that I want to solve numerically with Mathematica (11.3 or 12.0).

The problem is that I have to solve in a large area to make sure there are no edge effects.

Mathematica seems to have problems with such calculations (probably due to my RAM only). Therefore, I decided to split the problem into small time intervals and export only parts of the solution and start with the last solution as a new initial condition.

Now Mathematica crashes in this calculation, z. After 30 passes of the loop. Why so? Is there a way to avoid that?

Here is the code:

```
$HistoryLength = 0; (* save *)
(*PDEs*)
pde11 :=
D(pp(t, x), t) ==
1.*Laplacian(pp(t, x), {x}) +
pp(t, x)*(1 - c11*pp(t, x) - z(t, x)/(1 + pp(t, x)^2));
pde21 := D(z(t, x), t) ==
1.*Laplacian(z(t, x), {x}) +
z(t, x)*(eps*pp(t, x)/(1 + pp(t, x)^2) - m);
(*Initial conditions*)
lo = 7498;
hi = 7502;
domlen = 15000;
ic11(x_) := Which(x > lo && x < hi, 6, True, 0);
ic21(x_) := Which(x < hi && x > lo, 0.5, True, 1/c11);
eps = 1.4434; m = 0.3; c11 = 0.1732;
tfin = 30;
For(i = 0, i <= IntegerPart(6000/30), i++,
Print(i);
sol1d = NDSolve({pde11, pde21, z(0, x) == ic11(x),
pp(0, x) == ic21(x)}, {pp, z}, {t, 0, tfin}, {x, 0, domlen},
MaxStepSize -> 0.1);
resultsForExport = {};
For(j = 0, j < tfin, j = j + 0.1,
resultsForExport =
Append(resultsForExport, Evaluate(z(j, 7500)) /. sol1d);
);
resultsForExport = Flatten(resultsForExport);
Export("largedomain" <> ToString(i) <> ".dat", resultsForExport);
ic11(x_) := sol1d((1, 2, 2))(tfin, x);
ic21(x_) := sol1d((1, 1, 2))(tfin, x);
)
```

I suspect my expedition is not too elegant – I'm sorry.

I have done this several times now (takes a long time) and it keeps crashing $ i = 20 $ and $ i = 30 $,

All thoughts / help / workarounds / comments are appreciated.