Iceberger Remixed and Improved – Iceberg Simulator

Posted In: Fun | Water

The code has been updated to allow for multiple chunks of icebergs now, which can occur via melting if you draw an iceberg a certain way.

Draw (or choose) an iceberg and visualize how it will float and melt

I was so impressed with the interactive Iceberger tool that Josh Tauberer (@JoshData) made that I had to modify it and add some additional features. Click here to see the original. My additions allow you to conjure up pre-made “icebergs” to see how they float and also allow some interaction. Try “poking” the icebergs you make.

Josh and I were both inspired by a tweet by Megan Thompson-Munson (@GlacialMeg).

Instructions
You can choose between 3 different iceberg creation options:

  • Draw Iceberg – the original Iceberger option. Choose this option and draw any shape you want and see how it floats.
  • Select State – Choose this option and select from one of the states of the United States to see how it will float.
  • Select Shape = Choose this option and select from one of the premade shapes to see how it will float.

Once the iceberg has been created, you can also affect it in a couple of different ways:

  • Click on the Iceberg – This lets you push on the left side of the iceberg to induce some rotation and see if there are multiple stable orientations. Click it several times in a row if you want to flip the iceberg over. If you push on the right size it will rotate the iceberg clockwise and if you push on the left size, it will rotate counter clockwise. if you push in the middle third of the iceberg, it will push it straight down.
  • Melting – You can select between different options – No melting, slow medium and fast. This took awhile to code correctly. Previously, I’d just scale parts of the iceberg but this new code actually takes material away from the surface of the iceberg in a uniform way. It works more like you would expect melting ice to behave.
  • Changing the Sky – You can change the colors of the sky between sunrise, midday and sunset colors.
  • Showing forces – You can toggle whether to show the center of buoyancy (B) and center of gravity (B) of the iceberg.

Some Physics – no equations
The force of gravity (G) affects the entire body regardless of where it is or how it is oriented. If you show the forces, the red dot labeled G shows where the center of mass of the iceberg is. The blue dot labeled B shows where the center of buoyancy is. This is the center of mass of the part of the iceberg that is submerged. The force acting on the submerged part is equal to the volume of water displaced. If the center of buoyancy is below the center of gravity, then the forces will be equal and object will be in stable equilibrium. If the center of buoyancy is somewhere other than under the center of gravity, then the buoyant force will be pushing up on a different place than the gravity force and this will induce a rotation until they are directly over one another.

The code has been updated so that multiple icebergs are now allowed. Melting can separate a single piece of iceberg into multiple pieces, just as in real life. The melting process was a bit difficult to program because of the complexity of shapes that could be produced.

If you have additional suggestions for shapes or countries to add to the list or other improvements to make, let me know in the comments. Also if you are using this as a teaching tool, I’d love to hear how you are incorporating it into your curriculum.

Sources and Tools:
This visualization uses HTML/CSS/Javascript code from the Iceberger app to simulate the buoyancy of icebergs. Melting was accomplished with the help of code from the turf.js, polygon-offset and simplify.js javascript libraries. Additional elements of the UI and other features are also made using HTML, CSS and javascript.

Iceberger simulation




22 Comments »


22 Responses to Iceberger Remixed and Improved – Iceberg Simulator

  1. Suzanne Hubbard says:

    The iceberg Titanic stayed afloat better than the ship Titanic.

  2. Tharin Blumenschein says:

    Can you add Brazil to the list?

  3. Master says:

    Chido

  4. Akari2436 says:

    We should add the central asia countries! (Kazakhstan, Uzbekistan, Tajikistan, Kyrgyzstan and Turkmenistan)

  5. FoundonReddit says:

    Why no Pakistan in the country drop down list?

  6. Susanne says:

    Nice! Have you considered accounting for the submerged ice melting faster than the ice that is above water? That would be really cool and allow icebergs to roll over spontanously

    • chris says:

      It used to do that before I changed the melting algorithm. I’m not sure how I would do that with my new algorithm but I’ll think about it.

  7. Michalis says:

    Greece, with all its islands, is gonna be fun to see melt!

  8. Matt says:

    No cats?

  9. Abbas says:

    Beware! Europe part of Turkey which consist of Istanbul doesnt included in Turkey map!

  10. David Finch says:

    That’s specifically why I was making a dumbbell-shaped object…

  11. george says:

    I’m not gonna say that I drew things that I drew in my friend’s notebooks in middle school, but I definitely drew what I drew in my friend’s notebooks in middle school. And I ran a fun little “experiment” about the buoyancy of different sizes and shapes. Thank you for helping me brighten my day a bit 🙂

  12. Cody says:

    The witch pre-made must be made of wood, not ice.

  13. Emir Fassad says:

    The sim doesn’t do well with dumbbell-shaped objects when calculating melting.

    • chris says:

      yes, I’ve tried several different ways to simulate melting, but none work well, partly because I don’t want the object to break into multiple pieces which a dumbbell would.

    • chris says:

      The newer version of this simulation now handles dumbbell objects better as they can melt and separate at thinner parts into multiple chunks.

Leave a Reply

Your email address will not be published. Required fields are marked *