Skip to content

Instantly share code, notes, and snippets.

View andersx's full-sized avatar

Anders Steen Christensen andersx

View GitHub Profile
@andersx
andersx / Emin.py
Last active December 20, 2015 03:09 — forked from jhjensen2/Emin.py
# A simple energy minimization program that uses steepest descent
# and a force field to minimize the energy of water in internal coordinates.
# Written by Jan H. Jensen, 2013
def Eandg(rOH,thetaHOH):
""""
Arguments: (internal coordinates of the water molecule)
#include <sys/time.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
static unsigned int g_seed;
inline int fastrand() {
g_seed = (214013*g_seed+2531011);
return (g_seed>>16)&0x7FFF;