summaryrefslogtreecommitdiff
path: root/3014/CH2/EX2.28/Ex2_28.sce
blob: bb8cb9c91f138f6788b98aed84486dd89f7dc6b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
clc 
 
//given that
l = 1 // width of potential well in angstrom
h = 6.63e-34 // Plank constant
m = 9.1e-31 // mass of electron in Kg
printf("Example 2.28")
for n = 1:3
    lambda = 2*l/n // Calculation of wavelength
    E = n^2*h^2/(8*m*(l*1e-10)^2) // Calculation of energy in Joule
E_eV = E/1.6e-19 // Calculation of energy in eV
printf("\n For state:%d  Energy is %f eV & wavelength is %f angstrom ",n,E_eV,lambda);
end