Uses the L-J potential (Lenord Jonnes potential), the columb potential, a good derivative approximation, velocity verlet integration, and pen to make a molecular dynamics (MD) simulation in scratch! (use https://turbowarp.org/867149511/fullscreen?hqpen&fps=250 for better graphics). And it’s actually realistic. Well, at least for noble gasses. And NaCl. It calculates each interaction between atoms, no matter what, and thus can get a little slow with more atoms. You can also modify the atomic radius, potential depth, and even the potential equation, all easily. Please keep dt low (dt <= 50). Click to place an atom. Up to double the speed of every atom, down to half the speed of every atom, left to make your atoms negitive, right to make your atoms positive, drag an atom to drag it based on how Interactive Molecular Dynamics (IMD) does it (almost), /+drag to delete an atom, .+drag to fix an atom, and space to make everything absolute zero. Note the L-J+Columb potential is used IRL: https://en.wikipedia.org/wiki/Interatomic_potential. This can simulate: Helium atoms NaCl’s square lattice The states of matter (all 5, including crit point and triple point) Lattices with n charges, in general This can’t simulate: Low-temperature systems (accurately at least, also maybe these are helium 3 atoms?) Covalent bonds (since when did helium not have a full valence shell though?) Fusion (you’d get a NaN/Infinity) Fission (but these are most likely helium 3 atoms) Atoms with different sizes (should still be possible) Atoms with different potential depths (same as above) Heavy noble gasses (HEY, EINSTEIN) How to simulate: Actual helium: Depth = 0.00094 Size = 0.264 Mass = 4 Scale = 50 (because it’s inaccurate otherwise) Versions V1.0: Release. V1.1: Charged atoms! V1.2: Really bad drag (delete) V1.3: Working drag, far away atoms deleted V1.4: Velocity verlet algorithm (kinda) from IMD’s source code. V1.4.1: Velocity verlet integration working, and it wasn’t because I needed to set the acceleration to 0. V1.4.2: You can internally choose weather to use Euler’s method or the verlet method. V1.4.3: Columb potential corrected from Q1Q2/r^2 to Q1Q2/r. V1.5: Atom fixing (inspired by IMD). V1.6: Energy display. V1.6.1: Time speed display, based on units stuff. V1.7: Actual velocity verlet, using wikipedia’s code. V1.7.1: Everything in one sprite, so you can use this for whatever. V1.7.2: Everything in one script, except stuff in the background. V1.7.3: Moved functions, fixed dragging, and added comments V1.7.4: Added “place atom” function, inspired by . V1.7.5: Colorblind friendly! Now, each atom gets a label, so it’s ok if you’re colorblind or for whatever reason your green subpixels in your screen are broken. I did this because of . Also I made the charge controls less confusing. V1.7.6: Instead of using trig, I’m just multiplying a normalized vector which should be faster.
https://scratch.mit.edu/projects/869504153/ shows how to make stuff like this. I don’t think there’s any molecular dynamics simulation online that simulates, atoms, ions, and is this customizable (execpt this). The closest I’ve gotten are java applets, but java is *kinda* depracetated for the web. There’s the online IMD which has presets and is faster, but no charges, https://sciencedemos.org.uk/ions.php where there’s charge, but no L-J, for some reason, and https://andeplane.github.io/atomify/, which uses LAMPPS but doesn’t have a drag feature (it’s 3d). And it’s hard to customize them because you have to open the console and know JS, but scratch is much simpler. You can just see inside and modify the potential. You can also have more than 2 charges at a time! By default, you can place +, 0, and - charges. I decided to call this ChargedMD for obvious reasons. Please give credit if you use this in your own projects (unless it’s only gravity, in that case, use something other than this), as this it is probably a first. This is my first simulation using verlet integration. #MD #games (or at least, could be in #games ) #verlet #ODEsolver #Atoms #Ions #First #FirstMD #Accurate #trending? #popular? #ChargedMD (maybe I’ll make a series of things with this engine? probably not, except maybe incorporating it into @SpaceBoyBLM’s space engine, once the actual space engine is done) #MolecularDynamics #Physics #First guys md in the context doesn’t stand for the following: Material Design Murder Drones MD-80 airplane MD-83 airplane super mario bubble bobble MD Mc Donalds Maximized Dynasty or anything other than molecular dynamics (see https://scratch.mit.edu/search/projects?q=md )