Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 D grid with side length nsize. Each cell on the grid can be in one of three states: empty value bush value or burning value We will then use two rules to simulate the system:
A cell with a burning neighbour will become a burning cell with probability b
A burning cell becomes an empty cell on the next time step.
a Provide the Python code which sets up a grid of cells ie size 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 to check if any neighbours are burning. Set up a grid of cells ie nsize 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
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 function.
c Inspection of the correlation array shows that values that are greater than or equal to correspond to a burning cell, while values that are less than but greater than or equal to 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 and using the scipy.signal.correlate function. Hint: This can be achieved without setting up a lookup table.
d Using nsize and and all cells initially bush except for one randomly chosen cell, which is set to be burning, step forward 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started