Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Guide to Mathematical Modelling.pdf
Скачиваний:
224
Добавлен:
08.05.2015
Размер:
3.56 Mб
Скачать

gave the following results:

For this run, all passenger journeys were set to one stop only.

With the interval changed to 60 s for the buses and the mean time between passenger arrivals reduced to 10 s, bunching and overtaking of buses can be seen, as follows.

In a fully stochastic version of the model, we would of course collect statistical summaries of the results of several runs.

9.10 Further battles

We have frequently mentioned the fact that many different models can be devised for the same physical situation. We now return to a topic previously

considered in chapter 6 where we used a differential equation model to predict the outcome of a battle between two armies. To be more precise, this was a continuous deterministic model. No randomness was involved and each army was represented as a continuous function of time. In the model the progress of the battle was represented by the graph shown again here in Figure 9.20.

Time is of course a truly continuous variable but the numbers of troops still fighting on both sides at time t are really integers. We now wish to study this problem using two other models, both of which are discrete, the first being deterministic and the second stochastic.

Discrete deterministic model

For this we represent our two armies by integer variables x and y and also let time progress in a series of discrete jumps. We recall that in section 6.5 we made the following explicit assumptions. In 1 h, each surviving X soldier kills 0.1 Y soldiers; in 1 h, each surviving Y soldier kills 0.15 X soldiers. We started with x = 5000 and y = 10 000 and we found that the battle ended with x = 7906 and y = 0 after about 5.8 h. Let us choose 0.1 h as a time step and use x n and y n to denote the number of X and Y troops still alive after n time steps (where n is necessarily a positive integer). We shall take the above assumptions to be equivalent to the following. In one time step, each X soldier kills 0.01 Y soldiers; in one time step, each Y soldier kills 0.015 X soldiers. The model can now be written as

Figure 9.20

i.e.

and

Note that, by using the INT function, we are making x i and y i into integer variables. We could have left x i and y i as discrete but real variables and ignored the decimal parts in our final evaluation. This

leads to similar but slightly different results owing to the accumulated rounding errors. (Try it!)

Starting with x = 10 000 and y = 5000, we can now very easily generate x 1 , y 1 ; x 2 , y 2 ; …, from our two equations to give Table 9.17.

Discrete stochastic model

The fact that there are more troops on one side or that they are more effective fighters makes it more likely that the next single casualty in a battle will be from the other side. We can put together a model which allows chance to enter while at the same time taking account of this bias in the following way. If at any stage in the battle, there are x and y troops surviving and fighting, then the probability that the next death is that of an X soldier can be represented by

and of a Y soldier

Note that the two probabilities add up to 1 (the next death must be on one side or the other) and are in the correct ratio bx : ay.

Table 9.17

Our stochastic model is therefore quite simple. We start with the values x = 10000 and y = 5000 and substitute in the above expressions to calculate the probabilities:

Taking a uniform [0,1] random variable RND from a random-number generator, we let x become x − 1 if RND < 0.429; otherwise y becomes y − 1. We then recalculate the probabilities and take another random number, and so on. The graph describing the progress of the battle can be represented as in Figure 9.21.

We start from the point x = 10 000, y = 5000, and move in regular horizontal or vertical jumps along the grid until we finally reach one of the axes and one army or the other has been reduced to zero. Three particular runs from the same initial conditions gave the following results: y = 0 when x = 7958; y = 0 when x = 7961; y = 0 when x = 7895. By carrying out several runs, we can estimate the spread of likely results under identical conditions. Note that it is possible for army Y to win (but very unlikely).

Figure 9.21

Comparing the models

Why do the figures obtained from the deterministic discrete model not quite agree with those given by the continuous model? Note that in the discrete model the x and y values remain constant for 0.1 h at a time. The ‘kill rates’ of 0.015 and 0.01 per time unit which we have used are not precisely equivalent to the instantaneous rates 0.15 and 0.1 in the continuous model.

With the discrete stochastic model, different runs will of course produce different results but, if we take the mean of a large number of runs, then we would expect to reach very similar conclusions about the eventual outcome of the battle, as in the other two models. Note that one deficiency of the discrete stochastic model is that time does not explicitly appear, so that we have no way of estimating the duration of the battle. This could be done, however, by extending the model to make the deaths events in a ‘pooled Poisson process’. At any stage in the battle the time between deaths is then a negative exponentially distributed random variable with mean 1/( bx + ay ); so we can simulate it by taking

Note that at the beginning of the battle, when x and y are large, T is likely to be smaller, while towards the end of the battle we get longer time intervals between deaths, as we would expect.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]