Developing simple chemical physics simulations that run in the browser
I’ve been experimenting with using Scala.js to create educational simulations and would like to share the results and what I’ve learned.
- Random Walk in a Periodic Box
- Simulation of Soft Spheres in a Periodic Box
- Simulation of Polymer Chains
All the initial rough code is available at github.com/matthagy/chem_prog_exp. I apologize for the current lack of documentation.
Overall, I’m excited about how easy it has been to develop these simple, rough proof-of-concept simulations. I’m looking forward to developing more interactive and sophisticated simulations in the future as a hobby project. I’m also starting to brush up on my chemical physics knowledge so that I can make these into better educational resources.
I’m even starting to think about how some of these resources could be useful to practitioners; i.e., academic and industrial researchers and engineers. To that end, we’ll need the code to run outside of the browser and I think that should be straightforward if everything is in Scala since Scala primarily runs on the JVM. It might be cool to provide a simple, browser-based interface into simulations that run in the cloud. If I do this, it would be within a non-profit organization since I don’t think there’s much potential for profit margins.
Let me know what you think about this preliminary work and any ideas you have for how this work could evolve. I’m also certainly open to collaboration. You can reach me at email@example.com.