from __future__ import division
#given
#length of glass rod and steel rod is equal at 273 K and differ by 1.2 mm at 373 K
T1=273 #K
T2=373 #K
#coefficients of linear expansion af glass and steel are
alphaG=8*10**-6 #per degree C
alphaS=12*10**-6 #per degrees C
#we know that
#lT2=lT1*(1+alpha(T2-T1))
#so for glass rod
#l100G=l0*(1+(alpha1)*(T2-T1))
#similarly for steel rod
#l100G=1.0008*l0 ----(1)
#l100S=lo*(1+(alpha2)*(T2-T1))
#l100S=1.0012*l0 ----------(2)
#we have given that
#l100S-l100G=1.2 mm ---(3)
#from 1 and 2 put in 3, we get
#1.0012*l0-1.0008*l0=1.2
#so
l0=1.2*10**-3/(0.0012-.0008) #m
print " the length of rod at 0 degrees celcius is %.f m"%(l0)
#given
#coefficient of linear expansion of Cu and steel are
alphaCu=18*10**-6 #cm/cm/degree C
alphaSteel=14*10**-6 #cm/cm/degree C
#young's modulus of elasticity
ECu=106*10**9 #Pa
ESteel=200*10**9 #Pa
#part(a)
#since alphaCu>alphaSteel
#so steel will contract less.
print " Hence strip will bend in the direction of copper"
#part(b)
#annealing temp
T2=530 #degrees celcius
#room temp
T1=30 #degrees celcius
#difference in temp
T=T2-T1 #degrees celcius
#differnce in values of coefficient of linear expansion
alpha=alphaCu-alphaSteel #cm/cm/degrees celcius
#differential contraction
contraction=T*alpha #cm/cm
#since the two metals in the strip have equal dimension
#sigmaCu=sigmaSteel=sigma
#strain in copper
#eCu=sigma/Ecu -----(1)
#strain in steel
#eSteel=sigma/ESteel ---(2)
#sum of strains given by equation 1 and 2
sigma=contraction*ESteel*ECu/(ESteel+ECu)*10**-6 # MPa
print " the stresses in each metal is %0.3f MPa"%(sigma)