Sunday, July 12, 2015

Coding the Rainfall


Written by Jonathan Paul (III MCA)

Its amazing to watch how one can find so much to learn from the nature around us. Inspired by nature is this piece of challenge in which we had to simulate a situation where in rain water would be trapped in trenches and pits.
 
    It always seems to be a daunting task when we face a new challenge, but we have to understand that every problem has a solution. It’s only the time that we need to worry about, nothing else.
    So it began; I loaded a matrix with 1 representing water, 2 representing air and 3 representing land. The challenge I faced was in realising that gravity starts from the surface (a hint :P). Also, we should ensure that molecules behave naturally, fall drop by drop, and last but not the least, we should ensure that we do not add or remove molecules by faulty logic.
    The other constraints were that water molecules need to settle down and ensure they are in a stable equilibrium state. Only a layer of water molecules could settle on the surface of land. Water would flow down slopes and would accumulate in crevices.
    The fun part was added by Prof. Jibrael Jos, when he asked us to drain the water through a hole in the surface. My joy knew no bounds when I saw the water flowing out literally “naturally”.
                                    

 

No comments:

Post a Comment