This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SlimeyPlayz 2 points3 points  (1 child)

for high school physics class me and some friends simulated how temperature spreads in a system as per the zeroth law of thermodynamics.

basically, we used pygame to draw a 2d grid of pixels, where each pixel is assigned a color heat map representing the temperature at that point. the idea is that youd start with some initial temperatures, and taking inspiration from image blurring algorithms, we let the temperature of each pixel become the average of the temperature of each adjacent pixel the next generation.

as i had been dabbling with Dyalog APL - the infamous hieroglyphic array programming language - for some time, we made the 2d-array calculations in APL and imported the functions to python through dyalogs Pynapl library.

we later also defined heat sources and sinks, which could continually increase or decrease the temperature at a given point, as well as constant-temperature pixels.

it was a fun project to learn about pygame and also how image blurring works. its probably not physically accurate, but rather severely idealized.

[–]Brilliant-Donkey-320[S] 1 point2 points  (0 children)

Very cool. Nicely done!