from __future__ import division
T=35 #Temperature of the skin in celsius
T1=T+273 #Temperature in kelvin
#From Wien's displacement law
Lambda_max=(0.2898*10**-2)/T1
print "Wavelength at which radiation emitted from the skin reaches its peak = %0.2e meters"%Lambda_max
from math import sqrt, pi
m=2 # mass of the object in Kg
k=25 #force constant of spring in N/m
A=0.4 #Amplitude of Simple harmonic oscillation by spring in meters
h=6.63*10**-34#js
#a) Total energy and frequency of SHO calculation
E=(1/2)*k*A**2
f=(1/(2*pi))*sqrt(k/m)
print "a) Total energy of Simple harmonic oscillator with given amplitude = %0.2f Joules"%E
print " Frequency of oscillation = %0.2f Hertz"%f
#b) Calculation of quantum number for the system
n=E/(h*f)
print "b) Quantum number for the given macroscopic system : %0.2e"%n
#c) Calculation of energy carried away in a quantum charge
delta_E=h*f
print "c) Energy carried away by a one-quantum charge = %0.2e joules"%delta_E
f=6*10**14 #frequency of yellow light in hertz
h=6.63*10**-34 #plancks constant J.s
E=h*f
print "Energy carried by a photon with the given frequency = %0.2e Joules"%E
l=0.3*10**-6 #wavelength of light in meters
W=2.46 #work function for sodium in ev
c=3*10**8 #velocity of light in m/s
h=6.63*10**-34#js
#a) Maximum KE of the ejected photoelectrons
E=(h*c/l)/(1.6*10**-19) #energy of each photon of th eilluminating light beam in ev
KE_max=E-W
print "a) Maximum Kinetic energy of th eejected photoelectrons = %0.2f ev is"%KE_max
#b) Cut off wavelength for sodium
W1=W*1.6*10**-19
lc=h*c/W1
print "b) Cut off wavelength for sodium = %0.2e meters"%lc
V=10**5 #potential difference in Volts
h=6.63*10**-34 # plancks constant in J.s
c=3*10**8# velocity of light in m/s
e=1.6*10**-19# elelctronic charge in coulombs
L_min=(h*c)/(e*V)
print "Minimum wavelength produced = %0.2e meters"%L_min
from math import asin, degrees
d=0.314 #spacing between certain planes in a crystal of calcite in nm
l=0.070 #wavelength of X-rays in nm
m=1# first order of interference
theta1=degrees(asin((m*l)/(2*d)))
print "Grazing angle at first order of interference = %0.2f degree"%theta1
m=3 #third order of interference
theta2=degrees(asin((m*l)/(2*d)))
print "Grazing angle at third order of interference = %0.2f degree"%theta2
from math import pi, cos
Lo=0.200000 #wavelength of X-rays in nm
h=6.63*10**-34 #in J.s
m_e=9.11*10**-31 # in Kg
c=3*10**8 #in m/s
theta=45 #in degrees
#wavelength is represented by d
delta_L=(h/(m_e*c))*(1-cos(pi/180*theta))
L=delta_L+Lo
print "Wavelength of the scattered X-rays at the given angle in %.2f nm"%L
#Answer given in textbook is wrong
h=6.63*10**-34 #in J.s
m_e=9.11*10**-31 # in Kg
v=1*10**7 #in m/s
lamda=h/(m_e*v)
print "de Broglie wavelength for an electron = %0.2e meters"%lamda
h=6.63*10**-34 #in J.s
m=0.145 # in Kg
v=40 #in m/s
lamda=h/(m*v)
print "de Broglie wavelength of the ball = %0.2e meters"%lamda
from math import pi
h=6.63*10**-34#js
v=5*10**3 #speed of the electron in m/s
m_e=9.11*10**-31 # mass of electron in Kg
p=m_e*v
delta_p=0.00300*p
#Uncertainity principle states delta_x*delta_p >=h/(4*pi)
delta_x=h/(4*pi*delta_p)
print "Uncertainity in position of electron = %0.2e Meters"%delta_x
from math import pi
h=6.63*10**-34 # plancks constant in J.s
delta_t=1.00*10**-8 # Average time that an ellectron exists in the excited states in sec
delta_E=h/(4*pi*delta_t)
print " Minimum uncertainity in energy of the excited states = %0.2e Joules"%delta_E