Question: please use python In this question we will develop a model for a bushfire. Let's approach this problem by considering a 2 D grid with

please use python
In this question we will develop a model for a bushfire. Let's approach this problem by considering a 2D grid with side length nsize. Each cell on the grid can be in one of three states: empty (value 0), bush (value 1) or burning (value 10). We will then use two rules to simulate the system:
1.A cell with a burning neighbour will become a burning cell with probability b.
2.A burning cell becomes an empty cell on the next time step.
(a) Provide the Python code which sets up a grid of 1010 cells (i.e.n size =10) composed of bush, except for one cell randomly chosen in the grid (equal probability of choosing any cell), which is set to be burning.
(b) We can use the function scipy.signal.correlate 2d() to check if any neighbours are burning. Set up a grid of 1010 cells (i.e. nsize =10) and as an initial condition start with all cells bush, except for one randomly chosen cell set to be burning. Calculate the correlation array between your grid and the kernel: kernel =
[11111001111]. Make sure your correlation array has the same size as your original grid, wrap the boundaries, and write out the Python code below that performs the correlation step.
Hint: To wrap the boundaries you can use the option boundary = 'wrap' in the
correlate 2d() function.
(c) Inspection of the correlation array shows that values that are greater than or equal to 1000 correspond to a burning cell, while values that are less than 1000 but greater than or equal to 110 correspond to a cell with bush and one or more burning neigh bours. Using this information provide the Python code which performs one time step of the bushfire, implementing the two rules presented in the introduction, with b=0.5, and using the scipy.signal.correlate 2d() function. Hint: This can be achieved without setting up a look-up table.
(d) Using nsize =100 and b=0.5, and all cells initially bush except for one randomly chosen cell, which is set to be burning, step forward 50 time steps and display the output. Sketch the main features of the output and interpret the output. Does the model appear to be a reasonable description of a bushfire?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!