Hi, I'll try and explain my problem as simple as possible. I have written a module to perform a generalised operation (as shown below).
from math import sqrt
from math import pow
from math import log10
from Numeric import *
import numpy as np
def Entropy(parameters, temperature):
t=float(temperature/1000.0)
return (("%0.7f" %(float(A*log(t) + B*t + C*((pow(t,2.))/2.) + D*((pow(t,3.))/3.) - (E/(2.*(pow(t,2.)))) + G)/1000)))
The operation require values and I have put these into a dictionary in the running script (This is shown as well).
import thermodynamics
oxygen={'A':31.32234, 'B':-20.23531, 'C':57.86644, 'D':-36.50624, 'E':-0.007374, 'F':-8.903471, 'G':246.7945, 'H':0.000000,'EnthalpyTempZero':8.68, 'frequency':1580.19, 'EDFT':-4.9316435}
Oshomate= oxygen['A'], oxygen['B'], oxygen['C'],oxygen['D'], oxygen['E'],oxygen['F'],oxygen['G'],oxygen['H']
print EntropyO
EnthalpyEntropyO = thermodynamics.EnthalpyEntropy(EnthalpyO,oxygen['EnthalpyTempZero'], EntropyO, temperature)
When I run the scripts, it gives an error message "NameError: global name 'A' is not defined". How can I get the module to access the dictionary values in the running script?