summaryrefslogtreecommitdiff
path: root/1172/CH3/EX3.22/Example3_22.sce
blob: e9c7d0f744f88c661ebc4d7a6982190108472cee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
clc
//Given that
h = 6.6e-34 // plank's constant
m_e = 9.1e-31 // mass of electron in kg
L = 1e-10 // length of box of particle in m
//Sample Problem 22 page No. 146
printf("\n # Problem 22 # \n")
printf("\n Standard formula Used \n E= h^2 * (n_x^2+n_y^2+n_z^2) / (8*m*L^2)")
sum = 0 
n_y = 1
    for n_x = 1:3
        
            for n_z = 1:2
                sum = n_x+n_y+n_z
                if sum<6 then
                     E = h^2 * (n_x^2+n_y^2+n_z^2)/ (1.6e-19*8*m_e*L^2) // calculation of energy
                printf("\n \n E%d%d%d is  %f eV. ",n_x,n_y,n_z,E)
                end
               
                
            
        end
    end