def main(): # tests print "" a = neutron(neutron_mass_u, neutron_eC_charge) b = proton(proton_mass_u, proton_eC_charge) print a print b print "" print str(a.charge) print str(b.charge) get_info_test = get_info(40.5,15.0) density_count = density(get_info_test.mass, get_info_test.Volume) print density_count Ag_relative_mass = relative_atomic_mass(Ag.atomic_mass, Ag.stable_with) print str(km.val) + "km = " + str(km_to_m) + "m" nucleus_a = Nucleus(Ag.protons_num,Ag.neutrons_num[0]) print str(nucleus_a.nucleon_protons) + " " + str(nucleus_a.nucleon_neutrons) atom_a = atom([nucleus_a.nucleon_protons, nucleus_a.nucleon_neutrons], nucleus_a.nucleon_protons) print str(atom_a.electrons) + " " + str(atom_a.nucleus[1]) print ""
def main(): # tests if args.chtest == True: print "" a = neutron(neutron_mass_u, neutron_eC_charge) b = proton(proton_mass_u, proton_eC_charge) print a print b print "" print str(a.charge) print str(b.charge) get_info_test = get_info(40.5,15.0) density_count = density(get_info_test.mass, get_info_test.Volume) print density_count Ag_relative_mass = relative_atomic_mass(Ag.atomic_mass, Ag.stable_with) print str(km.val) + "km = " + str(km_to_m) + "m" nucleus_a = Nucleus(Ag.protons_num,Ag.neutrons_num[0]) print str(nucleus_a.nucleon_protons) + " " + str(nucleus_a.nucleon_neutrons) atom_a = atom([nucleus_a.nucleon_protons, nucleus_a.nucleon_neutrons], nucleus_a.nucleon_protons) print str(atom_a.electrons) + " " + str(atom_a.nucleus[1]) print "" else print "Enter `help`"
from atom import * atom_list = {} class Molecule: def __init__(self, chem_el_xx, full_molecule = ""): self.chem_el_xx = chem_el_xx #chem_el_xx = local; #damn; kinda wierd way to do it chem_el_xx == chem_el_x self.full_molecule = full_molecule atom_list[chem_el_xx.name] = chem_el_xx.num_of_atoms full_molecule == str(chem_el_xx.name) + str(chem_el_xx.num_of_atoms) H_molecule = atom([1,0],1) H_molecule.chem_el_x(H,2) H_molecule_out = Molecule(H,"")
from atom import * atom_list = {} class Molecule: def __init__(self, chem_el_xx, full_molecule=""): self.chem_el_xx = chem_el_xx #chem_el_xx = local; #damn; kinda wierd way to do it chem_el_xx == chem_el_x self.full_molecule = full_molecule atom_list[chem_el_xx.name] = chem_el_xx.num_of_atoms full_molecule == str(chem_el_xx.name) + str(chem_el_xx.num_of_atoms) H_molecule = atom([1, 0], 1) H_molecule.chem_el_x(H, 2) H_molecule_out = Molecule(H, "")
import numpy as np with open("./practice_1/cartesian.gjf", "r") as f: lines = f.readlines() print lines ''' read atom number. set a Dist, in which every element represent a ... ''' atomNumber = int(lines[0]) Dict = {} ''' complete atoms import. ''' for i in range(atomNumber): Dict[(i)] = atom() Dict[(i)].readCoordinate(lines[i + 2].strip()) print Dict[(i)].Atom, Dict[(i)].getCoordinate() ''' complete vectors and import. ''' for i in range(atomNumber): for j in range(i + 1, atomNumber): Dict[(j, i)] = vector() Dict[(j, i)].readCoordinateForSecondAtom(lines[j + 2].strip()) Dict[(j, i)].readCoordinate(lines[i + 2].strip()) # print "vector of ", Dict[(j,i)].Atom, "->", Dict[(j,i)].secondAtom, "is", \ # Dict[(j,i)].calculateVector() # print "distance between", Dict[(j,i)].Atom, "and", Dict[(j,i)].secondAtom, "is", \ # Dict[(j,i)].calculateVectorLength() for k in range(j + 1, atomNumber):