# Variables
c_cu = 2.*10**13; #concentration of copper in /m**3
c_al = 4.*10**6; #concn of copper on other side of Al in /m**3
# Calculations
t = 3.*10**-3; #thickness in m
z = (c_cu-c_al)/t; #z = dm/dx,concentration graient
jx = 10.**21; #outward flux of copperv atoms in /sq m/sec
d = -jx/z; #diffusivity in sq m/sec
# Results
print "Diffusivity (in sq m/sec) = %.2e m**2/s"%d
import math
c_n = 12.; #nitrogen concentration in kg/m**3
t = 6.*10**-3; #thickness in m
# Calculations
z = (c_n-0)/t; #concentration gradient in kg/m**4
d0 = 5.*10**-7; #in sqm/sec
q = 75.*10**3; #in j/mol
r = 8.314; #in J/mol/K
t = 400.; #in K
dx = d0*math.exp(-q/(r*t)); #diffusivity in sqm/sec
jx = dx * 2*10**-3; #rate of flow of nitrogen in kg/sqm/sec
# Results
print "concentration gradient (in kg/m4) = %.0e"%z
print "Diffusivity (in sqm/sec) = %.3e m**2/s"%dx
print "Rate at which nitrogen escapes (in kg/sqm/sec) = %.3e kg/m**2/s"%jx
import math
# variables
z = 8.; #ratio of diffusion in silicon at 1350 C and 1100 C
x = math.log(z);
# calculations
q = x/(1.35*10**-5); #activation energy for silver diffusion in J/mol
q1 = q/1000.; #in kJ/mol
# results
print "Activation Energy in Silver diffusion (in kJ/mol) = %d kJ/mol"%q1