-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhydrogen.py
30 lines (25 loc) · 901 Bytes
/
hydrogen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 21 11:36:48 2013
@author: joseph
"""
from classicalChargedParticles import *
proton = ChargedParticle(charge = 1, mass = 1836,
initialPosition = (0.0,0.0),
initialMomentum = (0.0, 0.0),
stationary = True)
electron1 = ChargedParticle(charge = -1, mass = 1,
initialPosition = (1.0, 0.0),
initialMomentum = (0.0, 1.0),
radiates = True)
hydrogen = chargedParticleUniverse([proton, electron1], timeStep = .05)
hydrogen.evolveNTimeSteps(4000)
hydrogen.plotHistory()
#hydrogen.animateHistory(3000, "hydrogen.mp4")
#plt.figure()
#plt.plot(hydrogen.totalEnergyHistory)
#plt.title("Energy")
#
#plt.figure()
#plt.plot(hydrogen.totalAngularMomentumHistory)
#plt.title("Angular Momentum")