Numerical Simulation of the Model Equations
2.7 Adaptive Time Stepping
derivatives using five point stencils will generally have higher orders of accuracy. Given these, it seems clear how we should proceed.
The difficulty that remains is in connecting these two linear pieces. We first tried to use a polynomial to do this, ensuring that function, first and second derivative values were continuous. This leads to a quintic polynomial, which surprisingly, does not connect them in a truly monotonic way. By this we mean that we observe a change in curvature over its domain. Although there is no reason why this is unacceptable, it appears that this is unnecessary if all we require is a smooth connection between the two linear pieces.
If we no longer require continuity in the second derivative of h, then a cubic polynomial can be used. This too, however, has a change in its curvature and we again discard it as a possibility.
Our next attempt was to use a circular arc to connect the linear ends. This again would not give a continuous second derivative for h, but it was hoped that the discon- tinuous jumps would be small. This would be the case if the arc had a large radius.
Although we were not able to arbitrarily specify this radius, in practice it will be large if the connection occurs over a reasonably large region. For this we reason, we basically divided the range of r (which is just the radius of our disk) into thirds. The circular arc would then cover the region over this middle third, with linear pieces over the first and last thirds. We would generally choose the slope of the "outer" linear piece to be one, and the "inner" slope to be a fraction 11k, where k = 2,3, .... This corresponds to the inner third of the radial mesh having k-times the resolution of the outer third.
Our solutions on meshes generated from this approach have been found to be more than satisfactory.
implemented. This involved computing the solution at some time t, using a step of size L::.t and the solution at the same time using two steps of size L::.t/2. If a local measure of error between these two solutions was below a specified tolerance (usually 1 % of the two-norm of the solution), then the time step was doubled to 2L::.t and the same accuracy test performed. Since the dynamics of the pattern formation tends to decrease as time increases or if E is reduced, this test is performed to determine an appropriate time step size, comparable to the dynamics in the solution.
The simple adaptive time stepping procedure was implemented in two ways. The first was to simply conduct the test after a specified number of time steps. In general we found that, after the initial transients in the dynamics had dissipated, it was likely that the time step could be doubled as often as required, and there seems to be little sign of an upper bound on the time step. This provides some justification that the scheme achieves almost unconditional stability. In practice, we would not allow for too large a time step since the method is only second order accurate in time, and the simple accuracy test we perform clearly only checks the accuracy locally in time. In Fig. (2.3) we show a plot of the time step trace on logarithmic scales in a typical run.
The persistent dynamics expected in these systems is another reason that simply checking the accuracy at specific times in the evolution may not be a particularly good method of choosing an appropriate time step. The possibility of local changes in the patterns happening on time scales that are less than the current time step would lead to inaccurate solutions that the simple test above would be unable to detect. Therefore, as an alternative or additional criterion for determining when the accuracy test is performed, we compute a measure of the rate of change of the solution after each time step. This simply involves obtaining a local measure of 8'lj; / 8t by evaluating the right-hand side of Eq. (2.1) after each time step. Any large deviations in this value indicates the possibility of rapid changes in the solution, and therefore the need to check the accuracy at the current time step.
In Fig. (2.4) we show a time step trace for a typical run using this particular scheme.
The two spikes seen at t ~ 1200 and t ~ 1800 clearly shows the capability of this scheme to detect rapid changes in the solution and change (in this case halve) the time step accordingly. We see that the time step is quickly doubled again and shows that the
Time
Figure 2.3: Example of the simple adaptive time stepping procedure shown on logarith- mic scales. The time step is doubled or halved according to whether the solutions at !:l.t and 2!:l.t or !:l.t and !:l.t/2, respectively, differ by less than 1%. In this case, the accuracy test is performed every 50 time steps. For this particular run, f
=
0.01.16 14 12
<i
10Co CI)
-
U) CI) 8j::
E
6 4
V
2
00 1000 2000 3000 4000
Time
Figure 2.4: Example of adaptive time stepping procedure based on checking the rate of change in the solution. At each time step, 8?j; / 8t is computed and monitored for large changes (relative to 11?j;112). If a significant change is detected, the accuracy test is used to determine if the time step is doubled, halved or left unchanged. The two spikes seen indicates that the scheme always tries to use the largest time step size compatible with the dynamics. For this particular run, E = 0.05.
scheme is successful at choosing the largest step compatible with the dynamics in the system. In general, we did not find many such large changes in the long time evolutions and the usual accuracy check after a specified number of time steps was usually sufficient for providing the appropriate time step size.