How does the nature of forest fire vary as you lower the incidence of lightning strikes?
Note
you're encouraged to play with all the parameters (
r
,
f
,
and
L
) but the codex has a runtime limit of
1
0
s
,
so keep that in mind as you explore the forest.
import random
import numpy as np
import matplotlib.pyplot as plt
def print_lattice(my_lattice):
for row in my_lattice:
print(row)
print("----")
moves = [[1,0], [0,1], [-1,0], [0,-1]]
moves = [np.array(move) for move in moves]
def simulate(r, f, L):
tree_numbers = np.array([])
trees = 0
lattice = np.array([["Empty" for i in range(L)] for j in range(L)], dtype=object)
for moment in range(500):
# Hold the previous state of the lattice
temp_lattice = np.copy(lattice)
for i in range(L):
for j in range(L):
# Current state of all neighboring points
neighbor_list = [[i + move[0], j + move[1]] for move in moves]
neighbor_list = [[_[0], _[1]] for _ in neighbor_list if (-1 not in _) & (L not in _)]
neighbor_states = [temp_lattice[neighbor[0]][neighbor[1]] for neighbor in neighbor_list]
# The current state of the lattice point under consideration
current_state = temp_lattice[i][j]
if (current_state == "Empty") and (random.random() < r):
lattice[i][j] = "Tree"
trees += 1
elif (current_state == "Tree") and ("Burning" in neighbor_states):
lattice[i][j] = "Burning"
trees -= 1
elif (current_state == "Tree") and (random.random() < f):
lattice[i][j] = "Burning"
trees -= 1
elif current_state == "Burning":
lattice[i][j] = "Empty"
tree_numbers = np.append(tree_numbers, [trees])
return(tree_numbers)
L = 25
(r, f) = (0.02, 0.01)
burn_record = simulate(r, f, L)
plt.plot(burn_record)
plt.ylim([0, L**2])
plt.xlabel("Time", fontsize=15)
plt.ylabel("Trees", fontsize=15)
plt.savefig('tree_over_time.png', dpi=100)
Python 3
As
f
shrinks, the forest is more dense on average, but fires are more devastating
As
f
shrinks, the forest is less dense on average, and fires are more manageable
As
f
rises, the forest is less dense on average, and fires are more devastating
As
f
rises, the forest is denser on average, but fires are more devastating
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Plot: Time series of the number of trees vs time as
f
varies from
2
1
r
to
2
0
0
0
1
r
.
r
is held constant at
0
.
0
2
throughout.
For the default parameters of the system, we observe the time series shown in the top row of the figure to the right.
The number of trees hovers around
⟨
s
⟩
=
2
0
0
so that
ρ
^
tree
≈
s
/
L
2
=
2
0
0
/
6
2
5
=
0
.
3
2
.
We can see that from moment to moment, the number of trees fluctuates, but the fluctuations are small relative to the mean number of trees.
This implies that the number of trees that burn down per unit time is small relative to the number of trees.
In other words, although there are many fires they are each relatively inconsequential and short lived.
As we lower
f
we notice several things.
The average number of trees in the forest increases, rising up to nearly
⟨
s
⟩
≈
4
0
0
when
f
=
0
.
0
0
0
0
1
.
The fluctuations in the number of trees increases tremendously.
When
f
=
0
.
0
1
,
the fires are not big enough to meaningfully affect the state of the forest, as we noted above.
As
f
drops, the number of fires is reduced, but the swing in tree count explodes.
This suggests that the severity of forest fires is increasing.
By the time
f
=
0
.
0
0
0
1
,
the flucutations are almost equal to the size of the system
⟨
T
2
⟩
−
⟨
T
⟩
2
≈
L
2
.
At this point the fires are so severe that the typical fire can essentially burn down the entire forest!
Note
that the drops in these plots slightly
underestimate
the severity of fire, as new trees can start to grow in the fire's wake even as it continues to burn across the system.
For the default parameters of the system, we observe the time series shown in the top row of the figure to the right.
The number of trees hovers around ⟨ s ⟩ = 2 0 0 so that ρ ^ tree ≈ s / L 2 = 2 0 0 / 6 2 5 = 0 . 3 2 .
We can see that from moment to moment, the number of trees fluctuates, but the fluctuations are small relative to the mean number of trees. This implies that the number of trees that burn down per unit time is small relative to the number of trees. In other words, although there are many fires they are each relatively inconsequential and short lived.
As we lower f we notice several things.
By the time f = 0 . 0 0 0 1 , the flucutations are almost equal to the size of the system ⟨ T 2 ⟩ − ⟨ T ⟩ 2 ≈ L 2 . At this point the fires are so severe that the typical fire can essentially burn down the entire forest!
Note that the drops in these plots slightly underestimate the severity of fire, as new trees can start to grow in the fire's wake even as it continues to burn across the system.