# Variables
T = 25.+273 #K
F = 23060.
# Calculations
H = -68317.
G = -56690.
Er = -G/(2*F)
eta = G/H
W = -G
Q = H-G
# Results
print "Voltage output of the cell = %.3f volts"%(Er)
print " Efficiency = %d percent"%(eta*100 +1)
print " Electrical Work output = %d cal/mol H2"%(W)
print " Heat transfer to the surroundings = %d cal/mol H2"%(Q)
# Variables
import math
x1 = 0.75
x2 = 0.25
an = -190*10**-6 #volt/C
rn = 1.45*10**-3 #ohm cm
zn = 2*10**-3 #K**-1
ap = 190*10**-6 #volt/C
rp = 1.8*10**-3 #ohm cm
zp = 1.7*10**-3 #K**-1
T = 200.+273 #K
Tc = 373. #K
Th = 573. #K
# Calculations
Ktn = an**2/(rn*zn)
Ktp = ap**2/(rp*zp)
Z = (an-ap)**2 /(math.sqrt(rn*Ktn) + math.sqrt(rp*Ktp))**2
Ap = math.sqrt(Ktn*rp/Ktp/rn)
An = 1
K = Ktn*An+ Ktp*Ap
R = rn/An + rp/Ap
mopt = math.sqrt(1+ Z*T)
RL = mopt*R
nopt = (T-273)*(mopt-1)/(Th*(mopt+ Tc/Th))
nmax = T/(Th*(1+1- T/Th/2 + 4/Th/Z))
nmax = 0.0624
dT = T-273
Popt = (an-ap)**2 *dT**2 /((1+mopt)**2 *RL)
Pmax = (an-ap)**2 *dT**2 /((1+1)**2 *R)
# Results
print "Optimum efficiency = %.2f percent"%(nopt*100)
print " Max. efficiency = %.2f percent"%(nmax*100)
print " Optimum power = %.3f Watt"%(Popt)
print " Maximum power = %.3f Watt"%(Pmax)
# Variables
import math
phic = 2.5 #V
phia = 2. #V
phip = 0.1 #V
Th = 2000. #K
Tc = 1000. #K
eff = 0.2
k = 1.38*10**-23
e = 1.6*10**-19
sigma = 5.67*10**-12
# Calculations
V = phic-phia-phip
Jc = 1.2*10**6 *Th**2 *math.exp(-e*phic/(k*Th))
Ja = 1.2*10**6 *Tc**2 *math.exp(-e*phia/(k*Tc))
J = Jc
Qc1 = J*(phic + 2*k*Th/e) + eff*sigma*10**4 *(Th**4 - Tc**4)
eta1 = J*0.4/Qc1
eta2 = (Th-Tc)/Th
# Results
print "Efficiency of the device = %.1f percent"%(eta1*100)
print " Carnot efficiency = %d percent"%(eta2*100)