#Calculate the potential of the cell
#Initialization of variables
import math
Gr=-math.pow(10,5) #kJ/mol
v=1
F=9.6485*10000. #C/mol
#calculations
E=-Gr/(v*F)
#results
print '%s %d %s' %("potential of the cell =",E,"V")
#calculate the equilibrium constant of the reaction
#Initialization of variables
import math
V=1.1 #V
F=9.6485*10000. #C/mol
R=8.314 #J/K mol
T=298.15 #K
#calculations
lnK=2*F*V/(R*T)
k=math.pow(math.e,(lnK))
#results
print '%s %.1e' %("Equilibrium constant =",k)
#Calculate the acidity constant of the acid
#Initialization of variables
import math
lw=34.96 #mS m^2 /mol
la=4.09 #mS m^2 /mol
C=0.010 #M
K=1.65 #mS m^2 /mol
#calculations
lmd=lw+la
alpha=K/lmd
Ka=C*alpha*alpha
pKa=-math.log10(Ka)
#results
print '%s %.2f' %("Acidity constant of the acid = ",pKa)
#Calculate if the reaction is favoring the products or not. Also calculate the E value
#Initialization of variables
ER=1.23 #V
EL=-0.44 #V
#calculations
E=ER-EL
#results
if(E>0):
print '%s %.2f %s' %("The reaction is favouring products and E is",E,"V")
else:
print '%s %.2f %s' %("The reaction is not favouring products and E is",E," V")
#calculate the equilibrium constant
#Initialization of variables
import math
ER=0.52 #V
EL=0.15 #V
#calculations
E=ER-EL
lnK=E*1000./(25.69)
K=math.exp(lnK)
#results
print '%s %.1e' %("Equilbrum constant K= ",K)
#calculate the biological standard potential
#Initialization of variables
import math
E0=-0.11 #V
H=math.pow(10,-7)
#calculations
pH=-math.log10(H)
E=E0-29.59*pH*math.pow(10,-3)
#results
print '%s %.2f %s' %("Biological standard potential =",E,"V")
#calculate the equilibrium constant for the reaction
#Initialization of variables
import math
ER=-0.21 #V
EL=-0.6 #V
#calculations
E=ER-EL
lnK=2*E*1000./(25.69)
K=math.exp(lnK)
#results
print '%s %.1e' %("Equilibrium constant for the reaction = ",K)
#calculate the electric potential
#Initialization of variables
E1=2*(-0.340)
E2=-0.522
#calculations
FE=-E1+E2
#results
print '%s %.3f %s' %("Electric potential =",FE,"V")
#calculate the Gibbs enthalpy, Standard entropy and enthalpy of the process
#Initialization of variables
import math
v=2
F=9.6485*10000. #C/mol
E=0.2684 #V
V1=0.2699 #V
V2=0.2669 #V
T1=293. #K
T=298. #K
T2=303. #K
#calculations
Gr= -v*F*E/1000.
Sr=v*F*(V2-V1)/(T2-T1)
Hr=Gr+T*Sr/1000.
#results
print '%s %.2f %s' %("Gibbs enthalpy =",Gr,"kJ/mol")
print '%s %.1f %s' %("\n Standard Entropy =",Sr,"J /K mol")
print '%s %.1f %s' %("\n Enthalpy =",Hr,"kJ/mol")