from math import log,exp
# Initialisation of Variables
r1=0.111;#Rate of copper in min^-1 at 135 degree celsius
r2=0.004;#Rate of copper in min^-1 at 88 degree celsius
T1=408.;#Temperature in K
T2=361.;#Temperature in K
R=1.987;#Gas constant
Q=20693.;#Change in Rates
slope=(log(r1)-log(r2))/((1/T1)-(1/T2));#Slope of the straight line ploted ln(Growth rate) as a function of 1=T,
A=r1/(exp(-Q/(R*T1)));#Constant
print "Constant 10**10 A=",A/10**10
print "Slpoe of the straight line -Q/R",round(2*slope)
#diffrence in asnwer is due to round off error
# Initialisation of Variables
Fe=6.67;#Carbon percentage in Cementite
G=0.77;#Carbon percentage in peralite in composition
A=0.0218;#Carbon percentage in Ferrite
#CALCULATIONS
ferrite=((Fe-G)/(Fe-A))*100#Amount of ferrite present in peralite
C=((G-A)/(Fe-A))*100;#Amount of Cementite present in peralite
print "Amount of ferrite present in peralite:",round(ferrite,1)
print "Amount of Cementite present in peralite:",round(C,1)
# Initialisation of Variables
A=0.0218;#Carbon percentage in primary alpha in percent
Fe=6.67;#Carbon percentage in Cementite in percent
G=0.77;#Carbon percentage in eutectoid composition at 727 degree celsius
C=0.60;#Carbon percentage in Pearlite in percent
#CALCULATIONS
alpha=((Fe-C)/(Fe-A))*100;# Composition of Phase Ferrite in alloy
Ce=((C-A)/(Fe-A))*100;#Composition of Cementite in percent in alloy
PF=((G-C)/(G-A))*100;#Percentage of microconstituents Primary Ferrite in alloy
P=((C-A)/(G-A))*100;#Percentage of microconstituents Pearlite in alloy
print "Composition of Phase Ferrite in alloy :",round(alpha,1)
print "Composition of Cementite in percent in alloy:",round(Ce,1)
print "Percentage of microconstituents Primary Ferrite in alloy:",round(PF,1)
print "Percentage of microconstituents Pearlite in alloy:", round(P,1)
# Initialisation of Variables
d=0.001;#Actual distence between one alpha plate to next alpha plate
S=14;#Spacings between between one alpha plate to next alpha plate
#CALCULATIONS
lamida=d/S;#The interlamellar spacing between one alpha plate to next alpha plate in Pearlite Microstructure
print "The interlamellar spacing between one alpha plate to next alpha plate in Pearlite Microstructure:",lamida
# Initialisation of Variables
M=0.60;#Percentage of Carbon in Martensite at 750 degree celsius
a=50.;#Percentage of Carbon in Austenite at 750 degree celsius
c=0.02;#Percentage of Carbon atoms in Steel
X=(a/100)*(M-c)+c;#The carbon content of Steel in percentage
print "The carbon content of hypoeutectoid Steel in percentage:",X