1. ## Water molecule simulation

I wrote this program as a visual aid for my engineering chemistry professor.

It is 3 water molecules which bonds to a central +3 aluminum. I implemented it by integrating the force and torque from the coloumb forces of Hydrogen and Oxygen. It is 'correct,' except that I modified the variables such that the reaction would not happen instantaneously.

The molecule that emerges is similar to the real thing, e.g. a central aluminum with 3 water molecules evenly spaced around it (equal angles). I didn't specifically tell it to do this, it emerges from the physics. This model limits it to a single plane.

I plan on implementing more complex molecules/compounds.

2. Cool stuff. How are you doing it? Are you solving directly for the minimum points in the potential function? Or are you doing some kind of annealing technique to search for the lowest energy? Or are you letting the molecule oscillate under the influence of a frictional force?

3. I've taken all of the information I could find about a water molecule, e.g. the bond length bond angle, etc and made sure that these quantities remained proportional. I loop through each molecule and solve for their new positions and orientations based on the coloumbic forces.

I add very slight dampening factors to their positions and orientations.

4. Originally Posted by BobMcGee123
I've taken all of the information I could find about a water molecule, e.g. the bond length bond angle, etc and made sure that these quantities remained proportional. I loop through each molecule and solve for their new positions and orientations based on the coloumbic forces.

I add very slight dampening factors to their positions and orientations.
So it sounds like the third option I mentioned. If I'm not mistaken, you are integrating the coulomb force through some finite difference method? And then applying friction so that instead of oscillating around the stable state forever it slowly settles into it.

How do you deal with false minima? Are there any other stable configurations of this complex which have a higher energy than the one you found?

Very cool.

5. That's really cool

*Goes back to simulating orbiting shiny spheres*

I have a long ways to go.

6. Originally Posted by indigo0086
That's really cool

*Goes back to simulating orbiting shiny spheres*
If you can simulate gravity, you can simulate the coulomb force They are both inverse square laws. Simulating magnetism is quite a bit harder.

7. orbiting sans gravity, more simple rotation.

8. Those are pretty comments, Bob

9. If you can simulate gravity, you can simulate the coulomb force They are both inverse square laws. Simulating magnetism is quite a bit harder.
Yeah, the basics aren't too hard, although integrating it numerically isn't particularly easy. I've got an RK4 solver doing the work on this one, which isn't best suited for this particular application, but it works with no catastropic anomalies.

10. Wow, this is actually what I'm doing right now. I'm writing molecular dynamics and I am trying to use adaptive numerical methods, which isn't trivial. The difference between simulating gravity and simulating molecular dynamics is surprisingly small.

Perhaps I'll post more here later.

11. I hate chemistry, but this still looks pretty cool (even though I really don't know what it is exactly ).

12. Originally Posted by Sang-drax
Wow, this is actually what I'm doing right now. I'm writing molecular dynamics and I am trying to use adaptive numerical methods, which isn't trivial. The difference between simulating gravity and simulating molecular dynamics is surprisingly small.

Perhaps I'll post more here later.
The equations for forces and gravitational/electric fields are identical in form.

What type of adaptive numerical solver are you using? Nothing about mine is 'adaptive,' e.g. I use the same timestep throughout.

I hate chemistry too, for some reason it just doesn't make sense to me. But this little project is going to boost my grade, so I'm all set.

13. We're trying to implement the adaptive step size controller described in this paper: http://www.maths.lth.se/na/staff/gustaf/revstep2.pdf. The author has implemented the method for planetary orbits, but the equations are very similar. We have had some success and it turns out that the adaptive method pays off if there is much happening, i.e. before the system has reached an equilibrium configuration.

14. I don't understand chemistry to hate it

Nice inverted colours though *cough*, how the hell do you work with a windows coloured (or not-coloured ) like that.

15. Originally Posted by Sang-drax
broke my brain.