You are browsing as a guest. Sign up (or log in) to start making projects!

Atom Simulator VSEPR

  • 2 Devlogs
  • 8 Total hours

Read this first WAIT 10-20 SECONDS BECAUSE IT TAKES TIME TO COMPUTE ALL THE POSITIONS. Since small structures were already there, what about structures with 22 atoms, not real, but what if we had an infinitely large amount of energy to make that happen? It basically builds structures of compounds according to VSEPR by taking in the number of peripheral atoms, and 7-8 other fine tuned variables. Number of atoms for web based demo is set to 70 for interesting purposes ALTHOUGH, for the python file ive set it to 10000, the result of which you can see in the banner, 20 minutes of time just to load this beast for a single frame, not even a simulation. Adjust the number for however much particles you like, and maybe decrease the force or increase normalisation force if you do it.

Open comments for this post

1h 29m 22s logged

Added a smart cylinder calculation

This is a 10000 particle beast which took 20 minutes to compute one final frame after settling.

Added numpy because calculations are reduced from hours to minutes

0
0
6
Ship #1

What did you make?

An Atom Simulator that visualises VSEPR theory — a chemistry concept I was studying
in 11th grade that explains how atoms arrange themselves when forming compounds.
I gave each particle a repulsive force and used some physics where atoms naturally settle into the same structures VSEPR predicts.

What was challenging?

Two things:
1. The radial force, getting particles to stay on the sphere surface without snapping or drifting took a lot of tuning (damping constants, partial normalisation, force scaling)

2.Dynamic bond drawing, since particles move every frame, the cylinders connecting them have to be recalculated each frame, including figuring out which particles are close enough to be "bonded" and hiding the rest

What are you proud of?

I started by manually hard-coding forces between every pair of atoms, then refactored
everything into loops and 2D lists, cutting the code down massively. I also pre-compute all the frames before the animation starts, so playback is smooth with
no lag.

To test it

Use the GlowScript web version, it works in any browser instantly.
If you run it locally, note that it freezes for ~30 seconds while pre-computing
frames before the animation starts. That's normal, not a crash.

  • 1 devlog
  • 6h
  • 11.34x multiplier
  • 73 Stardust
Try project → See source code →
Open comments for this post

6h 24m 3s logged

*Built an Atom Simulator

I’m in 11th so I had the topic of VSEPR in my curriculum, So I built a program that simulates these structures by giving repulsion energies to these atoms. Then after using VPython, vectors, partial normalisation, 2D Lists and stuff I made it a bit not so boring.
The structure automatically takes place when they go into lowest energy state. The positions are all first calculated and then the animation begins where you can see them going into lowest energy states.

The maximum limit is said to be 12, but you could try with any number of particles you want, seeing how the structure would look like if it were real

0
0
5

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…