Errors on Different Time Scales

LTE, GTE
Long-term

Kinetic energy: 1/2ms ||Vs||^2
Potential enery: -G mems/||Xs||

def total_enery():
	num_steps = 20000
	x = numpy.zeros([num_steps + 1, 2])
	v = numpy.zeros([num_steps + 1, 2])
	enery = numpy.zeros(num_steps + 1)

	x[0, 0] = 15e6
	x[0, 1] = 1e6
	v[0, 0] = 2e3
	v[0, 1] = 4e3

	for step in range(num_steps):
		x[step + 1] = x[step] + h * v[step]
		v[step + 1] = v[step] + h * acceleration(x[step])

	return x, energy