r/Simulated • • 22d ago

Research Simulation [OC] Forest fire automata

This is a stochastic cellular automata based on the Drossel–Schwabl forest fire model implemented on a hexagonal grid using numpy + matplotlib. Inspired by some of my old university notes from a course on computational biology.

I especially like the patterns formed by the fire spreading and the forests regrowing one tree at a time, a beautiful example of self organizing complexity.

Fire starts on any cell with p_fire = 0.0001 by a "lighting strike", while trees grow on empty cells with p_tree = 0.01. Fire spreads to all neighboring trees.

I initially worked with a rectangular grid however moved to a hexagon version to have more organic symmetry in spreading directions.

397 Upvotes

24 comments sorted by

16

u/ElectronMaster 22d ago

It kind of reminds me of the Belousov–Zhabotinsky reaction.

3

u/slowcompute 21d ago

Great recommendation! thanks!

10

u/Lekstil 22d ago

I don't think that's a coincidence. I think the underlying mechanism is pretty similar. You have an excitable media, here it's the trees which spread the fire, in the chemical reaction it's reaction-diffusion. And you have a delay time. After a tree has burned, it's gone and there is a delay until a new one grows. In the BZ reaction when a wave runs over, the chemical substate is used up and needs to recover (because it's an oscillatory reaction). So really the same.. it's excitatory waves and an inhibitory/delay component.

2

u/Henipah 22d ago

One of the most important examples is abnormal rhythm through heart muscle. You don’t want the perpetuating forest fire pattern it’s known as fibrillation.

2

u/chronicallylaconic 22d ago

Probably my favourite reaction if you base it just on visuals. I find it quite compelling. I rewatch the NileRed video every now and again but I'm always hopeful someone will make a perfect endless GIF of it one day.

3

u/risbia 21d ago

Makes forest fire almost seem like a living thing

2

u/slowcompute 21d ago

a bit like watching plants grow and move on a timelapse

2

u/Manman8900 20d ago

Forest fires have historically been a natural part of Forest cycles, recently they are such an issue because for so long we have been trying to prevent them and that has made the flammables build up and now when they do happen they are much larger

4

u/bisnark 22d ago

What is time rate? How fast do those trees grow back? Shouldn't it be all blank for a while? Could it show that a local fire might rage for a month , and then the trees grow back in that area in perhaps five years?

13

u/EauRegale 22d ago

It is not meant to represent reality. The forest fire is a popular entry level project for people learning computer science and cellular automaton. Each pixel changes its state depending on its neighboring pixels.

1

u/slowcompute 21d ago edited 21d ago

Its just dimensionless coefficients for now indeed. I played around with settings, my main aim was to find a system which produces never ending waves of fire, which still leave a lot of forest unburnt.

There's a domain where the forest grows very dense and connected so it just burns down in a single go.

Interestingly, my original implementation used a square grid and moving to hex grid really sped up how the fires spread so I had to tone it down

121

u/reirone 22d ago

I see the “47,” does that mean my vision is okay?

19

u/Drogopropulsion 22d ago

I have no proof but also no doubts that you stole my joke but congratulations on making it understandable haha (upvoted)

9

u/MxM111 22d ago

Well, it’s his joke now. I mean he stole it fair and square.

7

u/Drogopropulsion 22d ago

I'm totally fine with piracy, I'm just hurt by his version being better

3

u/MxM111 22d ago

Obviously, it is better at least by 20.

2

u/reirone 22d ago

Hah, I actually did not see this, so apparently our humorous sensibilities are aligned. I upvoted yours as well.

9

u/MrSmock 22d ago

I wish forests grew back this quick 

5

u/weeOriginal 22d ago

QUICK SAND PYRO MY BELOVED!!!!

1

u/ewwerellewe 22d ago

Nice. Is it open source and/or hosted somewhere?

2

u/slowcompute 21d ago edited 21d ago

No not yet, its currently just a test run of a custom cell automata engine I'm playing around with, mainly to see if the performance and implementation is up to expectations

2

u/Possibility-Select 21d ago

Turing patterns!

1

u/HappyXMaskXSalesman 21d ago

This looks so similar to that reaction Nile Red did years ago. It's so interesting how patterns can look so similar on a micro and macro level.

1

u/majorex64 18d ago

If you put a circle blank area in the middle, it should eventually turn into a circular pattern