Chapter 1: Thermal Radiation and Planck's Postulate

Example 1.1, Page 6

In [1]:
#Variable declaration
#For sun
sigma=5.67*10**-8#w/m^2-k^4
T=5700#in K

#Calculations&Results
ST_sun=sigma*T**4
print " Surface temperature of sun is %.2e W/m^2."%ST_sun
#For north star
T=8300#in K
ST_Northstar=sigma*T**4
print " Surface temperature of sun is %.2e W/m^2."%ST_Northstar
 Surface temperature of sun is 5.99e+07 W/m^2.
 Surface temperature of sun is 2.69e+08 W/m^2.

Example 1.6, Page 21

In [2]:
import math

#Variable declaration
g=9.8#in m/s^2, constant
l=.1#in m
m=0.01#in kg
h=6.63*10**-34#Joule-sec
theta=0.1#in radians

#Calculations&Results
v=(1/(2*math.pi)*math.sqrt(g/l))
print "Oscillation frequency of pendulum %.1f per sec."%v
E=m*g*l*(1-math.cos(theta))
print "Energy of pendulum at its maximum potential %.e Joule."%E
Delta_e=h*v
print "Delta E %.1e Joule"%Delta_e
Oscillation frequency of pendulum 1.6 per sec.
Energy of pendulum at its maximum potential 5e-05 Joule.
Delta E 1.0e-33 Joule