Mathematical and Physical Journal
for High Schools
Issued by the MATFUND Foundation
Already signed up?
New to KöMaL?

Problem I. 187. (May 2008)

I. 187. Snowflakes agglomerate into larger heaps. Occasionally a slide occurs and an avalanche is formed. You should study this phenomenon - also typical for solid granular materials - by creating a simulation.

Let us consider a plane grid consisting of N×M cells (3\leN,M\le100). A single snowflake is put randomly onto a cell in each simulation step. (Of course, in reality much more snowflakes fall at the same time, but this will be compensated by the large number of simulation steps.)

The thickness of the growing snow layer is computed for each cell. Nothing happens until a critical thickness HM (4\leHM\le12) is reached. If the thickness exceeds this value, the height of the snow in that cell decreases by 4: these 4 snowflakes roll over to each of the 4 neighbours of the cell, respectively. This increases the thickness of snow in the neighbouring cells as well, and if the critical level is reached there, the process continues in their neighbours and so on. (If the critical level is not reached, no further movement will occur and it is not necessary to examine further neighbours.) Snow falling through the border of the grid disappears. A slide occurs when snowflakes move through several cells, and if this region is large, an avalanche occurs.

Your graphical simulation should be updated after the fall of each snowflake. For visibility reasons, each cell is represented as a 3×3 or 5×5 block of pixels. Background colour should be used if there is no change in a cell, otherwise a different colour is used.

The left example illustrates a situation with 1 snowflake, and there is a slide in the right example.

It should be possible to run the simulation in a step-by-step mode (by pressing L or l) or in a continuous mode (F or f). The simulation should end if V or v is pressed.

The source code of your program (i187.pas, i187.cpp, ...) together with a short documentation (i187.txt, i187.pdf, ...) should be submitted, also containing a brief description of your solution and the name of the developer environment to use.

(10 pont)

Deadline expired on June 16, 2008.


Sorry, the solution is available only in Hungarian. Google translation

Megoldás

Havazáskor a hópihék talajra érkezésének helye és ideje véletlenszerűnek tekinthető. A természeti jelenség párhuzamos jellegét nagyszámú elemi lépés (egy hópihe leesése) gyors, egymás utáni végrehajtásával szimulálhatjuk. Modellünkben a talajt egy N×M-es mátrix reprezentálja. A mátrix elemeiben számláljuk az adott pontba érkezett hópelyheket, azaz a hó magasságot ábrázoljuk.

Szimulációs lépés

Vizsgáljunk meg egy elemi lépést! Egy hópehely leesését a mátrix egy véletlenszerű elemének eggyel növelése jelenti. Ha az így kialakuló hó magassága nem éri el a kritikus magasságot, akkor a szimulációs lépés be is fejeződött. Ellenkező esetben az omlás, a megcsúszás jelenségét kell meghatároznunk.

Omlás

Ha a cellában a hópihék száma eléri a kritikus értéket, akkor 4 szomszédjának átad egy-egy hópihét. (A cella értéke 4-gyel csökken és a négy oldalszomszédjáé 1-1-gyel nő.) Ennek hatására a szomszéd cellákban is megnő a hóréteg magassága és a kritikus magasság felett, az előbbiekhez hasonlóan azok is továbbadják a négy szomszédjuknak a hópihéket. A hatás terjedését rekurzív vizsgálattal, illetve mátrixelem érték változtatással tudjuk szimulálni.

Megjelenítés A jelenség tanulmányozásához egy-egy szimulációs lépés után az előző állapothoz képesti változásokat jelenítjük meg. A hópihe becsapódását és az esetleges omlást figyeljük meg. Tanulmányozhatjuk, hogy sok szimulációs lépésen keresztül különösebb változást nem tapasztalunk, a hóréteg vastagsága növekszik. Később 1-1 becsapódás óriási változást, átrendeződést eredményez. Szimulációnk tárgya a káosz-jelenségek közé tartozik. A megcsúszás nagy területre terjedhet ki.

Üzemmódok

A szimuláció végrehajtása közben lépésenkénti és folyamatos üzemmódok választunk a jelenség megfelelő nyomon követéséhez. A lépésenkénti üzemmód azt jelenti, hogy valamely billentyű leütése szükséges egy új hópehely leeséséhez. Így a kiváltott hatás jól megfigyelhető.

Siegler Gábor

Mintamegoldás

LAVINA.PAS


Statistics:

6 students sent a solution.
10 points:Véges Márton.
9 points:Póta Kristóf.
8 points:1 student.
6 points:1 student.
5 points:2 students.

Problems in Information Technology of KöMaL, May 2008