summaryrefslogtreecommitdiff
path: root/2411/CH3/EX3.d.309/Ex3d_9.sce
diff options
context:
space:
mode:
Diffstat (limited to '2411/CH3/EX3.d.309/Ex3d_9.sce')
-rwxr-xr-x2411/CH3/EX3.d.309/Ex3d_9.sce13
1 files changed, 13 insertions, 0 deletions
diff --git a/2411/CH3/EX3.d.309/Ex3d_9.sce b/2411/CH3/EX3.d.309/Ex3d_9.sce
new file mode 100755
index 000000000..30b31c202
--- /dev/null
+++ b/2411/CH3/EX3.d.309/Ex3d_9.sce
@@ -0,0 +1,13 @@
+// Scilab Code Ex3d.9: Page-208 (2008)
+clc; clear;
+theta = 30; // Maximum angle of diffraction, degree
+lambda1 = 5400e-010; // Wavelength of light giving certain diffraction order, m
+lambda2 = 4050e-010; // Wavelength of light giving higher diffraction order, m
+n = poly(0, 'n');
+n = roots(lambda1*n-(n+1)*lambda2); // Order of diffraction for first wavelength
+a_plus_b = n*lambda1/sind(theta); // Grating element, m
+N = 1/a_plus_b; // Number of lines per cm ruled on grating, lines/cm
+printf("\nThe number of lines per cm on the diffraction grating = %d lines per cm", N/100);
+
+// Result
+// The number of lines per cm on the diffraction grating = 3086 lines per cm \ No newline at end of file