summaryrefslogtreecommitdiff
path: root/1271/CH2/EX2.39/example2_39.sce
blob: b12fe647b8f371bbf5af0ca8762eb238d4078b4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
clc 
// Given that
n = 3 // no. of order
theta = %pi / 6 // view angle of third order in radian
lambda1 = 5.89e-7 // min. wavelength of light in meter
lambda2 = 5.896e-7 // max.wavelength of light in meter
// Sample Problem 39 on page no. 2.53
printf("\n # PROBLEM 39 # \n")
mean_lambda = (lambda1 + lambda2) / 2 // calculation for mean wavelength
s = (n * mean_lambda) / sin(theta) // calculation for grating space b+d
N = lambda1 / (n * (lambda2 - lambda1)) // calculation for minimum no. of lines in grating
printf("\n Standard formula used \n mean_lambda = (lambda1 + lambda2) / 2. \n s = (n * mean_lambda) / sin(theta). \n N = lambda1 / (n * (lambda2 - lambda1)). \n")
printf("\n Grating space = %e meter. \n Total width of ruled surface = %e meter. ",s,s * N)