{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 3: Vibration Waves and Light" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_02: Frequency_of_particle_executing_SHM.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.a.2: Page-132 (2008)\n", "clc; clear;\n", "m = 10; // Mass of the particle, g\n", "x = poly(0, 'x');\n", "V = 50*x^2 + 100; // Potential field surrounding the particle, erg/g\n", "U = m*V; // Potential energy of the particle field system, erg\n", "F = -derivat(U); // Force acting on the particle, dyne\n", "// As F = -m*a = -m*omega^2*x = -m*(2%pi*f)^2*x, solving for f\n", "f = sqrt(eval(pol2str(-pdiv(F,x)/m)))/(2*%pi); // Frequency of oscillations of the particle executing SHM, Hz\n", "printf('\nThe frequency of oscillations of the particle executing SHM = %4.2f Hz', f);\n", "\n", "// Result\n", "// The frequency of oscillations of the particle executing SHM = 1.59 Hz " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_03: A_body_executing_SHM.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.a.3:Page-133 (2008)\n", "clc; clear;\n", "v1 = 80; // Velocity of the body at 3 cm displacement, cm/s\n", "v2 = 60; // Velocity of the body at 4 cm displacement, cm/s\n", "x1 = 3; // Displacement of the body at velocity of 80 cm/s\n", "x2 = 4; // Displacement of the body at velocity of 60 cm/s\n", "// As v = omega*sqrt(a^2 - x^2), solving for a\n", "a = poly(0, 'a');\n", "a = roots(v1^2*(a^2-16) - v2^2*(a^2 - 9));\n", "omega = v1/sqrt(a(1)^2 - x1^2); // Angular ferquency of the oscillations, rad/s\n", "x = a(1); // Maximum displacement, cm\n", "// As x = a*sin(omega*t), solving for t\n", "t_ex = asin(x/a(1))/omega; // Time taken to reach the +ve extremity, s\n", "d = a(1) - 2.5; // Distance of the point from the mean position, cm\n", "t = asin(d/a(1))/omega; // Time taken to travel from mean position to positive extremity, s\n", "printf('\nThe time taken to travel from 2.5 cm from +ve extremity = %5.3f s', t_ex - t); \n", "\n", "// Result\n", "// The time taken to travel from 2.5 cm from +ve extremity = 0.052 s " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_04: Time_period_of_a_body_oscillating_in_the_tunnel_across_the_earth.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.a.4: Page-134 (2008)\n", "clc; clear;\n", "R = 6.4e+006; // Radius of the earth, m\n", "g = 10; // Acceleration due to gravity, m/sec-square\n", "T = 2*%pi*sqrt(R/g); // Time period of oscillations of the body, s\n", "printf('\nThe time period of oscillations of the body = %4.1f min', T/60);\n", "\n", "// Result\n", "// The time period of oscillations of the body = 83.8 min " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_05: Resultant_amplitude_and_phase_angle_relative_to_the_first_SHM.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.a.5: Page-135 (2008)\n", "clc; clear;\n", "phi1 = 0; // Phase of the first SHM, degree\n", "phi2 = 60; // Phase of the second SHM, degree\n", "phi3 = 90; // Phase of the third SHM, degree\n", "a1 = 1.0; // Amplitude of the first SHM, cm\n", "a2 = 1.5; // Amplitude of the second SHM, cm\n", "a3 = 2.0; // Amplitude of the third SHM, cm\n", "A = sqrt((a1 + a2*cosd(phi2)+a3*cosd(phi3))^2 + (a2*sind(phi2)+a3*sind(phi3))^2); // Resultant amplitude relative to the first SHM, cm\n", "phi = atand((a2*sind(phi2)+a3*sind(phi3))/(a1 + a2*cosd(phi2)+a3*cosd(phi3))); // Resultant phase angle relative to the first SHM, degree\n", "printf('\nThe resultant amplitude and phase angle relative to the first SHM = %4.2f cm and %2d degrees respectively', A, phi);\n", "\n", "// Result\n", "// The resultant amplitude and phase angle relative to the first SHM are 3.73 cm and 62 degrees respectively" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_07: Two_SHMs_acting_in_the_same_direction.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.a.7:Page-136 (2008)\n", "clc; clear;\n", "phi1 = 0; // Phase of the first SHM, degree\n", "phi2 = 45; // Phase of the second SHM, degree\n", "a1 = 0.005; // Amplitude of the first SHM, m\n", "a2 = 0.002; // Amplitude of the second SHM, m\n", "A = sqrt((a1 + a2*cosd(phi2))^2 + (a2*sind(phi2))^2); // Resultant amplitude relative to the first SHM, m\n", "phi = atand(a2*sind(phi2)/(a1 + a2*cosd(phi2))); // Resultant phase angle relative to the first SHM, degree\n", "printf('\nThe amplitude of the resultant displacement and phase angle relative to the first SHM are %7.5f m and %5.2f degrees respectively', A, phi);\n", "\n", "// Result\n", "// The amplitude of the resultant displacement and phase angle relative to the first SHM are 0.00657 m and 12.43 degrees respectively " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_11: A_spring_disc_system_undergoing_damped_oscillation.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.b.1: Page-138 (2008)\n", "clc; clear;\n", "m = 100; // Mass of the horizontal disc, g\n", "t = 60; // Time during which the amplitude reduces to half of its undamped value, s\n", "f = 10; // Frequency of oscillations of the system, Hz\n", "omega_prime = 2*%pi*f; // Angular frequency of the oscillations, rad/s\n", "A0 = 1; // Assume the amplitude of undamped oscillations to be unity, cm\n", "// As A = A0*exp(-k*t), solving for k\n", "A = A0/2; // Amplitude of damped oscillations after 1 min, cm\n", "k = log(A0/A)/t; // Resisting force per unit mass per unit velocity, nepers/sec\n", "r = 2*k*m; // Resistive force constant, sec/cm\n", "tau = 1/k; // Relaxation time, sec\n", "Q = m*omega_prime/r; // Quality factor\n", "s = m*(omega_prime^2 + k^2); // Force constant of the spring, dynes/Sq.cm\n", "printf('\nThe resistive force constant = %4.2f dyne-sec/cm', r);\n", "printf('\nThe relaxation time of the system = %4.2f sec', tau);\n", "printf('\nThe quality factor, Q = %4.2f', Q);\n", "printf('\nThe force constant of the spring = %4.2e dyne/Sq.cm', s);\n", "\n", "// Result\n", "// The resistive force constant = 2.31 dyne-sec/cm\n", "// The relaxation time of the system = 86.56 sec\n", "// The quality factor, Q = 2719.42\n", "// The force constant of the spring = 3.95e+005 dyne/Sq.cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_12: A_mass_executing_damped_oscillations_in_one_dimension.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.b.2: Page-139 (2008)\n", "clc; clear;\n", "function m = check_motion_type(k, omega0)\n", " if k > omega0 then\n", " m = 'aperiodic';\n", " else if k == omega0 then\n", " m = 'criticallydamped';\n", " else if k < omega0 then\n", " m = 'oscillatory';\n", " end\n", " end\n", " end\n", "endfunction\n", "m = 10; // Mass of the body, g\n", "s = 10; // Restoring force, dyne/cm\n", "r = 2; // Resistive force constant, dyne.sec/cm\n", "k = r/(2*m); // Resisting force, nepers/sec\n", "// As omega0^2 = s/m, solving for omega0\n", "omega0 = sqrt(s/m); // Angular frequency, rad/s\n", "motion = check_motion_type(k, omega0); // Check for the type of motion\n", "r_new = 2*sqrt(m*s); // Resistive force constant, dyne-sec/cm\n", "m = r^2/(4*s); // Mass for which the given forces makes the motion critically damped, g\n", "printf('\nThe motion is %s in nature', motion);\n", "printf('\nThe resistive force constant = %d dyne-sec/cm', r_new);\n", "printf('\nThe mass for which the given forces makes the motion critically damped = %3.1f g', m);\n", "\n", "// Result\n", "// The motion is oscillatory in nature\n", "// The resistive force constant = 20 dyne-sec/cm\n", "// The mass for which the given forces makes the motion critically damped = 0.1 g " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_14: A_mass_executing_damped_oscillations_in_one_dimension.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.b.4: Page-140 (2008)\n", "clc; clear;\n", "m = 1; // Mass of the suspended body, kg\n", "s = 25; // Stifness constant of the spring, N/m\n", "r = poly(0, 'r');\n", "// As f0/f_prime = 2/sqrt(3), solving for r\n", "r = roots(4*(s/m-r^2/(4*m^2))-3*s/m); // Damping factor, kg/sec\n", "printf('\nThe damping factor of damped oscillations = %d kg/sec', r(1));\n", "\n", "// Result\n", "// The damping factor of damped oscillations = 5 kg/sec " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_15: Resisting_force_for_critically_damped_motion.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "// Scilab Code Ex3a.b.5: Page-141 (2008)\n", "clc; clear;\n", "function m = check_motion_type(k, omega0)\n", " if k > omega0 then\n", " m = 'aperiodic';\n", " else if k == omega0 then\n", " m = 'criticallydamped';\n", " else if k < omega0 then\n", " m = 'oscillatory';\n", " end\n", " end\n", " end\n", "endfunction\n", "m = 10; // Mass of the oscillating body, g\n", "r = 2; // Resisting force, dyne-sec/cm\n", "s = 5; // Restoring force, dyne/cm\n", "k = r/(2*m); // Resisting force, nepers/sec\n", "// As omega0^2 = s/m, solving for omega0\n", "omega0 = sqrt(s/m); // Angular frequency, rad/s\n", "motion = check_motion_type(k, omega0); // Check for the type of motion\n", "r = 2*sqrt(m*s); // Resistive force constant for critical damping, dyne-sec/cm\n", "printf('\nThe motion is %s in nature', motion);\n", "printf('\nThe resistive force constant for critical damping = %4.1f dyne-sec/cm', r);\n", "\n", "// Result\n", "// The motion is oscillatory in nature\n", "// The resistive force constant for critical damping = 14.1 dyne-sec/cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_16: Damped_oscillatory_motio.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.b.6: Page-141 (2008)\n", "clc; clear;\n", "m = 0.1; // Mass of the oscillating body, kg\n", "t = 50; // Time during which the energy of system decays to 1/e of its undamped value, s\n", "s = 10; // Spring constant, N/m\n", "E0 = 1; // Assume the energy of undamped oscillations to be unity, erg\n", "// As E = E0*exp(-k*t) and E/E0 = 1/e, solving for k\n", "E = E0/%e; // Energy of damped oscillations after 50 sec, erg\n", "k = log(E0/E)/t; // Resisting force per unit mass per unit velocity, nepers/sec\n", "p = m*k; // A resistive force constant, N-s/m\n", "omega0 = sqrt(s/m); // Angular frequency in the absence of damping, rad/sec\n", "omega_prime = sqrt(omega0^2 - k^2/4); // Angular frequency when damping takes place, rad/sec\n", "Q = omega_prime/k; // Quality factor\n", "printf('\nThe resistive force constant, p = %1.0e N-s/m', p);\n", "printf('\nThe quality factor, Q = %d', ceil(Q));\n", "\n", "// Result\n", "// The resistive force constant, p = 2e-003 N-s/m\n", "// The quality factor, Q = 500 " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_17: Damped_simple_harmonic_motion.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.b.7: Page-142 (2008)\n", "clc; clear;\n", "t = 10; // Time during which the amplitude reduces to 1/10th of its undamped value, s\n", "f = 200; // Frequency of oscillations of the system, Hz\n", "omega0 = 2*%pi*f; // Angular frequency of the oscillations, rad/s\n", "A0 = 1; // Assume the amplitude of undamped oscillations to be unity, cm\n", "// As A = A0*exp(-k*t), solving for k\n", "A = A0/10; // Amplitude of damped oscillations after 10 sec, cm\n", "k = log(A0/A)/t; // Resisting force per unit mass per unit velocity, nepers/sec\n", "tau = 1/(2*k); // Relaxation time, sec\n", "Q = omega0*tau; // Quality factor\n", "E0 = 1; // Assume energy of undamped oscillations to be unity, erg\n", "E = E0/10; // Energy of damped oscillations after t sec, erg\n", "// As E = E0*exp(-2*k*t), solving for t\n", "t = 1/(2*k)*log(E0/E); // Time during which the energy falls to 1/10 of its initial value, sec\n", "printf('\nThe relaxation time = %4.2f sec', tau);\n", "printf('\nThe quality factor, Q = %d', Q);\n", "printf('\nThe time during which the energy falls to 1/10 of its initial value = %d sec', t);\n", "printf('\nThe damping constant, k = %4.2f', k);\n", "\n", "// Result\n", "// The relaxation time = 2.17 sec\n", "// The quality factor, Q = 2728\n", "// The time during which the energy falls to 1/10 of its initial value = 5 sec\n", "// The damping constant, k = 0.23 \n", "// The answer for Q is given wrongly in the textbook" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_21: Characteristics_of_progressive_waves.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.c.1: Page-143 (2008)\n", "clc; clear;\n", "// Comparing with the standard progressive wave equation, we have\n", "a = 0.5; // Amplitude of the wave, m\n", "lambda = 2*%pi/12.56; // Wavelength of the wave, m\n", "v = 314/12.56; // Wave velocity, m/s\n", "nu = v/lambda; // Frequency of the wave, Hz\n", "printf('\nThe amplitude of the wave = %3.1f m', a);\n", "printf('\nThe wavelength of the wave = %3.1f m', lambda);\n", "printf('\nThe velocity of the wave = %d m/s', v);\n", "printf('\nThe frequency of the wave = %d Hz', ceil(nu));\n", "\n", "// Result\n", "// The amplitude of the wave = 0.5 m\n", "// The wavelength of the wave = 0.5 m\n", "// The velocity of the wave = 25 m/s\n", "// The frequency of the wave = 50 Hz " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_22: A_simple_harmonic_wave_travelling_along_X_axis.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.c.2: Page-144 (2008)\n", "clc; clear;\n", "// Comparing with the standard progressive wave equation, we have\n", "a = 5; // Amplitude of the wave, m\n", "nu = 0.2; // Frequency of the wave, Hz\n", "lambda = 1/0.5; // Wavelength of the wave, m\n", "v = nu*lambda; // Wave velocity, m/s\n", "printf('\nThe amplitude of the wave = %3.1f m', a);\n", "printf('\nThe wavelength of the wave = %3.1f m', lambda);\n", "printf('\nThe velocity of the wave = %3.1f m/s', v);\n", "printf('\nThe frequency of the wave = %3.1f Hz', nu);\n", "\n", "// Result\n", "// The amplitude of the wave = 5.0 m\n", "// The wavelength of the wave = 2.0 m\n", "// The velocity of the wave = 0.4 m/s\n", "// The frequency of the wave = 0.2 Hz " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.a_23: Travelling_wave_characteristics_and_phase_difference.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3a.c.3: Page-144 (2008)\n", "clc; clear;\n", "// Comparing with the standard progressive wave equation, we have\n", "a = 8; // Amplitude of the wave, cm\n", "nu = 4/2; // Frequency of the wave, Hz\n", "lambda = 2/0.02; // Wavelength of the wave, cm\n", "v = nu*lambda; // Wave velocity, cm/s\n", "delta_x = 20; // Path difference between two particles, cm\n", "delta_phi = delta_x*2*%pi/lambda*180/%pi; // Phase difference between two particles, degree\n", "printf('\nThe amplitude of the wave = %3.1f cm', a);\n", "printf('\nThe wavelength of the wave = %3.1f cm', lambda);\n", "printf('\nThe velocity of the wave = %3.1f cm/s', v);\n", "printf('\nThe frequency of the wave = %d Hz', nu);\n", "printf('\nThe phase difference between two particles = %d degree', delta_phi);\n", "\n", "// Result\n", "// The amplitude of the wave = 8.0 cm\n", "// The wavelength of the wave = 100.0 cm\n", "// The velocity of the wave = 200.0 cm/s\n", "// The frequency of the wave = 2 Hz\n", "// The phase difference between two particles = 72 degree " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.b_101: Brewster_angle_and_angle_of_refraction_for_glass.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3b.1: Page-163 (2008)\n", "clc; clear;\n", "mu = 1.5; // Refractive indexof glass\n", "i_p = atand(mu); // Angle of polarization from Brewster's law, degree\n", "r = 90 - i_p; // Angale of refraction, degree\n", "printf('\nThe Brewster angle for glass = %4.1f degree', i_p);\n", "printf('\nThe angle of refraction for glass = %4.1f degree', r);\n", "\n", "// Result\n", "// The Brewster angle for glass = 56.3 degree\n", "// The angle of refraction for glass = 33.7 degree " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.b_102: Polarizing_angles_for_various_pair_of_media.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3b.2: Page-163 (2008)\n", "clc; clear;\n", "// Function to convert degree to degree-minute\n", "function [d,m]= deg2deg_min(deg)\n", " d = int(deg);\n", " m = (deg - d)*60;\n", "endfunction\n", "mu_air = 1; // Refractive index fo air\n", "mu_glass = 1.54; // Refractive index of glass\n", "mu_water = 1.33; // Refractive index of water\n", "// Air to glass incidence\n", "i_p = atand(mu_glass/mu_air); // Angle of polarization for air to glass incidence, degree\n", "printf('\nFor air to glass, i_p = %d degree', i_p);\n", "// glass to air incidence\n", "i_p = atand(mu_air/mu_glass); // Angle of polarization for glass to air incidence, degree\n", "printf('\nFor glass to air, i_p = %d degree', ceil(i_p));\n", "// Water to glass incidence\n", "i_p = atand(mu_glass/mu_water); // Angle of polarization for water to glass incidence, degree\n", "[d,m] = deg2deg_min(i_p); // Call function to convert to deg-min\n", "printf('\nFor water to glass, i_p = %d degree %d min', d, m);\n", "// Glass to water incidence\n", "i_p = atand(mu_water/mu_glass); // Angle of polarization for glass to water incidence, degree\n", "[d,m] = deg2deg_min(i_p); // Call function to convert to deg-min\n", "printf('\nFor glass to water, i_p = %d degree %d min', d, m);\n", "// Air to water incidence\n", "i_p = atand(mu_water/mu_air); // Angle of polarization for air to water incidence, degree\n", "[d,m] = deg2deg_min(i_p); // Call function to convert to deg-min\n", "printf('\nFor air to water, i_p = %d degree %d min', d, m);\n", "// Water to air incidence\n", "i_p = atand(mu_air/mu_water); // Angle of polarization for water to airincidence, degree\n", "[d,m] = deg2deg_min(i_p); // Call function to convert to deg-min\n", "printf('\nFor water to air, i_p = %d degree %d min', d, m);\n", "\n", "// Result\n", "// For air to glass, i_p = 57 degree\n", "// For glass to air, i_p = 33 degree\n", "// For water to glass, i_p = 49 degree 11 min\n", "// For glass to water, i_p = 40 degree 48 min\n", "// For air to water, i_p = 53 degree 3 min\n", "// For water to air, i_p = 36 degree 56 min " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.b_103: Polarizing_angle_for_glass.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3b.3: Page-163 (2008)\n", "clc; clear;\n", "C = 40; // Critical angle for glass to air\n", "mu = 1/sind(C); // Refractive index of glass w.r.t. air\n", "i_p = atand(mu); // Polarizing angle for glass, degree\n", "printf('\nThe polarizing angle for glass = %4.1f degree', i_p);\n", "\n", "// Result\n", "// The polarizing angle for glass = 57.3 degree " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.b_104: Polarization_by_reflection.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3b.4: Page-164 (2008)\n", "clc; clear;\n", "i = 60; // Angle of incidence, degree\n", "i_p = i; // Angle of polarization, degree\n", "mu = tand(i_p); // Refractive index of the medium\n", "r = 90 - i; // Angle of refraction, degree\n", "printf('\nThe refractive index of transparent medium = %5.3f', mu);\n", "printf('\nThe angle of refraction, r = %d degree', r);\n", "printf('\nThe reflected and transmitted components are at right angles to each other.');\n", "\n", "// Result\n", "// The refractive index of transparent medium = 1.732\n", "// The angle of refraction, r = 30 degree\n", "// The reflected and transmitted components are at right angles to each other." ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.b_105: Intensity_ratio_of_two_beams_through_analyser.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3b.5: Page-164 (2008)\n", "clc; clear;\n", "theta_A = 30; // Angle between principal sections of polariser and analyser for beam A, degree\n", "theta_B = 60; // Angle between principal sections of polariser and analyser for beam B, degree\n", "// As I_A*cosd(theta_A)^2 = I_B*cosd(theta_B)^2, solving for I ratio\n", "I_ratio = cosd(theta_B)^2/cosd(theta_A)^2; // The intensity ratio of the two beams\n", "printf('\nThe intensity ratio of the two beams = %4.2f', I_ratio);\n", "\n", "// Result\n", "// The intensity ratio of the two beams = 0.33" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.b_106: Percentage_reduction_in_the_intensity_of_the_inident_light.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3b.6: Page-165 (2008)\n", "clc; clear;\n", "theta = [30 45 60 90]; // Angles between principal sections of polariser and analyser, degree\n", "for i = 1:1:4\n", " P_red = (1-cosd(theta(i))^2)*100; // Percentage reduction in intensity of incident light\n", " printf('\nFor theta = %d degree, percentage reduction = %1.0f percent', theta(i), P_red);\n", "end\n", "\n", "// Result\n", "// For theta = 30 degree, percentage reduction = 25 percent\n", "// For theta = 45 degree, percentage reduction = 50 percent\n", "// For theta = 60 degree, percentage reduction = 75 percent\n", "// For theta = 90 degree, percentage reduction = 100 percent " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.b_107: Angle_of_rotation_of_polaroid_to_reduce_the_intensity.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3b.7: Page-165 (2008)\n", "clc; clear;\n", "// For half reduction in intensity\n", "I_ratio = 1/2; // Intensity ratio\n", "theta = acosd(sqrt(I_ratio)); // Angle of rotation of polaroid, degree\n", "printf('\nFor half reduction in intensity, the angle of rotation = %d degree', theta);\n", "// For one-fourth reduction in intensity\n", "I_ratio = 1/4; // Intensity ratio\n", "theta = acosd(sqrt(I_ratio)); // Angle of rotation of polaroid, degree\n", "printf('\nFor one-fourth reduction in intensity, the angle of rotation = %d degree', theta);\n", "\n", "// Result\n", "// For half reduction in intensity, the angle of rotation = 45 degree\n", "// For one-fourth reduction in intensity, the angle of rotation = 60 degree " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_202: Ratio_of_maximum_to_minimum_intensity_in_the_interference_fringe_system.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.2: Page-184 (2008)\n", "clc; clear;\n", "I2 = 1; // Assume intensity of light beam from the second source to be unity\n", "I1 = 81*I2; // Intensity of light beam from the first source\n", "a = sqrt(I1); // Width of the first slit, mm\n", "b = sqrt(I2); // Width of the second slit, mm\n", "I_max = (1+a/b)^2; // Maximum intensity in the fringe pattern\n", "I_min = (1-a/b)^2; // Minimum intensity in the fringe pattern\n", "fact = gcd([I_max,I_min]); // Find l.c.m. of I_max and I_min\n", "printf('\nThe ratio of maximum to minimum intensity in the fringe system, I_max:I_min = %d:%d', I_max/4, I_min/4);\n", "\n", "// Result\n", "// The ratio of maximum to minimum intensity in the fringe system, I_max:I_min = 25:16 " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_203: Wavelength_of_light_from_interference_of_fringes.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.3: Page-184 (2008)\n", "clc; clear;\n", "d = 0.1; // Separation between the two slits, cm\n", "D = 100; // Distance between the source and the slit, cm\n", "bita = 0.05; // Fringe width, cm\n", "lambda = bita*d/D; // Wavelength of light, cm\n", "printf('\nThe wavelength of light used = %4d angstrom', lambda/1e-008);\n", "\n", "// Result\n", "// The wavelength of light used = 5000 angstrom " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_204: Fringe_width_from_interference_pattern.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.4: Page-184 (2008)\n", "clc; clear;\n", "d = 0.3; // Separation between the two slits, cm\n", "D = 60; // Distance between the source and the slit, cm\n", "lambda = 59e-006; // Wavelength of light, cm\n", "bita = lambda*D/d; // Fringe width, cm\n", "printf('\nThe fringe width = %4.2e cm', bita);\n", "\n", "// Result\n", "// The fringe width = 1.18e-002 cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_205: Distance_between_the_two_coherent_sources.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.5: Page-185 (2008)\n", "clc; clear;\n", "D = 80; // Distance between the source and the slit, cm\n", "lambda = 5890e-008; // Wavelength of light, cm\n", "bita = 9.424e-002; // Fringe width, cm\n", "d = lambda*D/bita; // Separation between the two slits, cm\n", "printf('\nThe distance between the two coherent sources = %4.2f cm', d);\n", "\n", "// Result\n", "// The distance between the two coherent sources = 0.05 cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_206: Distance_between_consecutive_interference_bands.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.6: Page-185 (2008)\n", "clc; clear;\n", "D = 100; // Distance between the source and the slit, cm\n", "lambda = 5893e-008; // Wavelength of light, cm\n", "d1 = 4.05e-001; // Distance between the images of the two slits in one position, cm\n", "d2 = 2.90e-001; // Distance between the images of the two slits in second position, cm\n", "d = sqrt(d1*d2); // Separation between the two slits, cm\n", "bita = lambda*D/d; // Fringe width, cm\n", "printf('\nThe distance between consecutive interference bands = %6.4f cm', bita);\n", "\n", "// Result\n", "// The distance between consecutive interference bands = 0.0172 cm" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_207: Wavelength_of_the_light_used_in_biprism_experiment.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.7: Page-185 (2008)\n", "clc; clear;\n", "D = 1.2; // Distance between the source and the slit, m\n", "d = 7.5e-004; // Separation between the two slits, cm\n", "n = 20; // Number of fringes crossed in the field of view\n", "bita = 1.888e-002/n; // Fringe width, cm\n", "lambda = bita*d/D; // Wavelength of light, cm\n", "printf('\nThe wavelength of the light used in biprism experiment = %4d angstrom', lambda/1e-010);\n", "\n", "// Result\n", "// The wavelength of the light used in biprism experiment = 5900 angstrom " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_208: Number_of_fringes_obtained_with_the_given_wavelength.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.8: Page-186 (2008)\n", "clc; clear;\n", "lambda1 = 5893; // First wavelength of light, angstrom\n", "lambda2 = 4358; // Second wavelength of light, angstrom\n", "n = 40; // Number of fringes obtained with first wavelength\n", "// As bita1/bita2 = lambda1/lambda2, so\n", "x = n*lambda1/lambda2; // Number of fringes obtained with the seocond wavelength\n", "printf('\nThe number of fringes obtained with the given wavelength = %d', x);\n", "\n", "// Result\n", "// The number of fringes obtained with the given wavelength = 54 " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_209: Wavelength_of_light_from_biprism_interference_pattern.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.9: Page-186 (2008)\n", "clc; clear;\n", "D = 100; // Distance between the source and the slit, cm\n", "bita = 0.0135; // Fringe width, cm\n", "alpha = %pi/360; // Angle of refracting face with the base of biprism, radian\n", "mu = 1.5; // Refractive index of the material of biprism\n", "x = 50; // Distance between slit and the biprism, cm\n", "d = 2*(mu-1)*x*alpha; // Separation between the two virtual slits, cm\n", "lambda = bita*d/D; // Wavelength of light, cm\n", "printf('\nThe wavelength of light from biprism interference pattern = %4d angstrom', lambda/1e-008);\n", "\n", "// Result\n", "// The wavelength of light from biprism interference pattern = 5890 angstrom " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_210: Fringe_width_observed_at_one_metre_distance_from_biprism.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.10: Page-187 (2008)\n", "clc; clear;\n", "mu = 1.5; // Refractive index of the material of biprism\n", "alpha = %pi/180; // Base angle of biprism, radian\n", "D = 110; // Distance between the source and the slit, cm\n", "x = 10; // Distance between slit and the biprism, cm\n", "d = 2*(mu-1)*x*alpha; // Separation between the two virtual slits, cm\n", "lambda = 5900e-008; // Wavelength of light, cm\n", "bita = lambda*D/d; // Fringe width, cm\n", "printf('\nThe fringe width observed at one metre distance from biprism = %6.4f cm', bita);\n", "\n", "// Result\n", "// The fringe width observed at one metre distance from biprism = 0.0372 cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_211: Wavelength_of_light_in_Newton_ring_experiment.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.11: Page-187 (2008)\n", "clc; clear;\n", "D_n = 0.42; // Diameter of nth ring, cm\n", "D_mplusn = 0.7; // Diameter of (m+n)th ring, cm\n", "m = 14; // Difference between (m+n)th and nth rings\n", "R = 100; // Radius of curvature of the plano-convex lens, m\n", "lambda = (D_mplusn^2 - D_n^2)/(4*m*R); // Wavelength of the light, cm\n", "printf('\nThe wavelength of the light used = %4d angstrom', lambda/1e-008);\n", "\n", "// Result\n", "// The wavelength of the light used = 5600 angstrom " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_212: Radius_of_plano_convex_lens.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.12: Page-187 (2008)\n", "clc; clear;\n", "D5 = 0.336; // Diameter of 5th ring, cm\n", "D10plus5 = 0.590; // Diameter of (10+5)th ring, cm\n", "m = 10; // Difference between (10+5)th and 5th rings\n", "lambda = 5890e-008; // Wavelength of the light, cm\n", "R = (D10plus5^2 - D5^2)/(4*m*lambda); // Radius of curvature of the plano-convex lens, m\n", "printf('\nThe radius of plano convex lens = %5.2f cm', R);\n", "\n", "// Result\n", "// The radius of plano convex lens = 99.83 cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_213: Wavelenght_of_light_used_in_obtaining_Newton_rings.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.13: Page-187 (2008)\n", "clc; clear;\n", "D3 = 0.181; // Diameter of 3rd ring, cm\n", "D23 = 0.501; // Diameter of 23rd ring, cm\n", "m = 23-3; // Difference between (m+n)th and nth rings\n", "R = 50; // Radius of curvature of the plano-convex lens, m\n", "lambda = (D23^2 - D3^2)/(4*m*R); // Wavelength of the light, cm\n", "printf('\nThe wavelength of the light used = %4d angstrom', lambda/1e-008);\n", "\n", "// Result\n", "// The wavelength of the light used = 5456 angstrom" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_214: Diameter_of_the_20th_dark_ring.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.14: Page-188 (2008)\n", "clc; clear;\n", "D4 = 0.4; // Diameter of 4th ring, cm\n", "D12 = 0.7; // Diameter of 12th ring, cm\n", "m = 12-4; // Difference between (m+n)th and nth rings\n", "lambda_R = (D12^2 - D4^2)/(4*m); // Wavelength-Radius product, Sq.cm\n", "D20 = sqrt(80*lambda_R); // Diameter of the 20th dark ring, cm\n", "printf('\nThe diameter of the 20th dark ring = %5.3f cm', D20);\n", "\n", "// Result\n", "// The diameter of the 20th dark ring = 0.908 cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_215: Radius_of_curvature_of_the_lens_and_the_thickness_of_the_air_film.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.15: Page-188 (2008)\n", "clc; clear;\n", "D10 = 0.50; // Diameter of 10th ring, cm\n", "n = 10; // Number of dark fringe\n", "lambda = 6250e-008; // Wavelength of light used, cm\n", "R = D10^2/(4*n*lambda); // Radius of curvature of the lens, cm\n", "t = D10^2/(8*R); // Thickness of the air film, cm\n", "printf('\nThe radius of curvature of the lens = %3d cm', R);\n", "printf('\nThe thickness of the air film = %9.7f cm', t);\n", "\n", "// Result\n", "// The radius of curvature of the lens = 100 cm\n", "// The thickness of the air film = 0.0003125 cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_216: Newton_rings_observed_in_reflected_light.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.16: Page-188 (2008)\n", "clc; clear;\n", "D10 = 5e-003; // Diameter of 10th ring, cm\n", "n = 10; // Number of dark fringe\n", "lambda = 5.9e-007; // Wavelength of reflected light, m\n", "R = D10^2/(4*n*lambda); // Radius of curvature of the lens, cm\n", "t = D10^2/(8*R); // Thickness of the air film, cm\n", "printf('\nThe radius of curvature of the lens = %5.3f m', R);\n", "printf('\nThe thickness of the air film = %4.2e m', t);\n", "\n", "// Result\n", "// The radius of curvature of the lens = 1.059 m\n", "// The thickness of the air film = 2.95e-006 m " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.c_217: Smallest_thickness_of_the_glass_film_in_which_it_appears_dark.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3c.17: Page-189 (2008)\n", "clc; clear;\n", "lambda = 5893e-010; // Wavelength of light used, m\n", "mu = 1.5; // Refractive index of glass film\n", "r = 60; // Angle of reflection in the film, degree\n", "t = lambda/(2*mu*cosd(r)); // Smallest thickness of the \n", "printf('\nThe smallest thickness of the glass film when it appears dark = %6.1f angstrom', t/1e-010);\n", "\n", "// Result\n", "// The smallest thickness of the glass film when it appears dark = 3928.7 angstrom " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_301: Wavelength_of_light_used_in_diffraction_due_to_narrow_slit.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.1: Page-205 (2008)\n", "clc; clear;\n", "D = 200; // Distance between the source and the slit, cm\n", "a = 0.02; // Slit width, cm\n", "x = 0.5; // Position of first minimum, cm\n", "n = 1; // Order of diffraction\n", "lambda = a*x/(D*n); // Wavelength of light used, cm\n", "printf('\nThe wavelength of light used = %4d angstrom', lambda/1e-008);\n", "\n", "// Result\n", "// The wavelength of light used = 5000 angstrom " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_302: Separation_between_the_second_minima_on_either_side_of_the_central_maximum.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.2: Page-205 (2008)\n", "clc; clear;\n", "f = 20; // Focal length of the lens, cm\n", "a = 0.06; // Slit width, cm\n", "n = 2; // Order of diffraction\n", "lambda = 6e-005; // Wavelength of light used, cm\n", "x = 2*lambda*f/a; // Separation between the second minima on either side of the central maximum, cm\n", "printf('\nThe separation between the second minimum an central maximum = %4.2f cm', x);\n", "\n", "// Result\n", "// The separation between the second minimum an central maximum = 0.04 cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_303: Distance_of_the_first_dark_band_from_the_axis.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.3: Page-206 (2008)\n", "clc; clear;\n", "n = 1; // Order of diffraction\n", "f = 40; // Focal length of the lens, cm\n", "a = 0.03; // Slit width, cm\n", "lambda = 5890e-008; // Wavelength of the light used, cm\n", "// As a*sind(theta) = n*lambda, solving for theta\n", "theta = asin(n*lambda/a); // The angle of diffraction corresponding to the first minimum, radian\n", "x = f*theta; // The distance of the first dark band from the axis, cm \n", "printf('\nThe distance of the first dark band from the axis = %6.4f cm', x);\n", "\n", "// Result\n", "// The distance of the first dark band from the axis = 0.0785 cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_304: Angle_of_diffraction_for_the_principal_maxima.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.4: Page-206 (2008)\n", "clc; clear;\n", "lambda1 = 5890e-008; // Wavelength of D1 line of sodium lamp, cm\n", "lambda2 = 5896e-008; // Wavelength of D2 line of sodium lamp, cm\n", "d_lambda = lambda2 - lambda1; // Wavelength difference, cm\n", "w = 0.5; // Width of the grating, cm\n", "N = 2500; // Total number of grating lines\n", "N_prime = N/w; // Number of lines per cm, lines/cm\n", "a_plus_b = 1/N_prime; // Grating element, cm\n", "n = 1; // Order of diffraction\n", "// Case 1\n", "theta = asind(n*lambda1/a_plus_b); // Angle of diffraction for D1 line, degree\n", "// Case 2\n", "theta_prime = asind(n*lambda2/a_plus_b); // Angle of diffraction for D2 line, degree\n", "printf('\nThe angle of diffraction for D1 and D2 lines of sodium are %5.2f dgree and %5.2f degree respectively.', theta, theta_prime);\n", "// From the condition for just resolution, lambda/d_lambda = n*N, solving for N\n", "N_min = lambda1/(d_lambda*n); // Minimum number of lines required on the grating\n", "if N_min < N then\n", " printf('\nThe two lines are well resolved.');\n", "else\n", " printf('\nThe two lines are not resolved.');\n", "end\n", "\n", "// Result\n", "// The angle of diffraction for D1 and D2 lines of sodium are 17.13 dgree and 17.15 degree respectively.\n", "// The two lines are well resolved. " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_305: Wavelength_of_the_spectral_line.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.5: Page-207 (2008)\n", "clc; clear;\n", "N = 4250; // Number of lines per cm of grating, lines/cm\n", "a_plus_b = 1/N; // Grating element, cm\n", "n = 2; // Order of diffraction\n", "theta = 30; // Angle of diffraction, degree\n", "lambda = sind(theta)*a_plus_b/n; // Wavelength of spectral line from diffraction condition, cm\n", "printf('\nThe wavelength of spectral line from diffraction condition = %4d angstrom', lambda/1e-008);\n", "\n", "// Result\n", "// The wavelength of spectral line from diffraction condition = 5882 angstrom " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_306: Number_of_lines_in_one_centimeter_of_the_grating_surface.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.6: Page-207 (2008)\n", "clc; clear;\n", "n = 2; // Order of diffraction\n", "lambda = 5e-005; // Wavelength of light, cm\n", "theta = 30; // Angle of diffraction, degree\n", "N = sind(theta)/(n*lambda); // Number of lines per cm of grating, lines/cm\n", "printf('\nThe number of lines per cm of grating = %4d per cm', ceil(N));\n", "\n", "// Result\n", "// The number of lines per cm of grating = 5000 per cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_307: Highest_order_spectrum_obtainable_with_the_given_diffraction_grating.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.7: Page-208 (2008)\n", "clc; clear;\n", "N = 5000; // Number of lines per cm ruled on grating, lines/cm\n", "lambda = 6e-005; // Wavelength of light, m\n", "a_plus_b = 1/N; // Grating element, m\n", "theta = 90; // Maximum angle of diffraction, degree\n", "n = a_plus_b*sind(theta)/lambda; // Order of diffraction\n", "printf('\nIn highest order spectrum obtainable with the given diffraction grating = %4.2f', n);\n", "\n", "// Result\n", "// In highest order spectrum obtainable with the given diffraction grating = 3.33 " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_308: Invisible_third_and_higher_order_principal_maxima_in_a_diffraction_grating.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.8: Page-208 (2008)\n", "clc; clear;\n", "lambda = 5.5e-007; // Wavelength of light, m\n", "a_plus_b = 1.5e-006; // Grating element, m\n", "theta = 90; // Maximum angle of diffraction, degree\n", "n = a_plus_b*sind(theta)/lambda; // Order of diffraction\n", "printf('\nIn this diffraction grating only %dnd order will be visible while %drd and higher orders are not possible.', n, n+1);\n", "\n", "// Result\n", "// In this diffraction grating only 2nd order will be visible while 3rd and higher orders are not possible. " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_309: Number_of_lines_per_cm_on_the_grating.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.9: Page-208 (2008)\n", "clc; clear;\n", "theta = 30; // Maximum angle of diffraction, degree\n", "lambda1 = 5400e-010; // Wavelength of light giving certain diffraction order, m\n", "lambda2 = 4050e-010; // Wavelength of light giving higher diffraction order, m\n", "n = poly(0, 'n');\n", "n = roots(lambda1*n-(n+1)*lambda2); // Order of diffraction for first wavelength\n", "a_plus_b = n*lambda1/sind(theta); // Grating element, m\n", "N = 1/a_plus_b; // Number of lines per cm ruled on grating, lines/cm\n", "printf('\nThe number of lines per cm on the diffraction grating = %d lines per cm', N/100);\n", "\n", "// Result\n", "// The number of lines per cm on the diffraction grating = 3086 lines per cm " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_310: Minimum_number_of_lines_on_the_diffraction_grating.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.10: Page-209 (2008)\n", "clc; clear;\n", "lambda = 5890e-008; // Wavelength of light, cm\n", "n = 1; // Order of diffraction\n", "d_lambda = 6e-008; // Difference in wavelengths of D1 and D2 lines, cm\n", "N = lambda/(n*d_lambda); // Number of lines on grating\n", "printf('\nThe minimum number of lines on the diffraction grating = %d', ceil(N));\n", "\n", "// Result\n", "// The minimum number of lines on the diffraction grating = 982 " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_311: Design_of_a_plane_transmission_diffraction_grating.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.11: Page-209 (2008)\n", "clc; clear;\n", "lambda = 6000e-008; // Wavelength of light, cm\n", "n = 2; // Order of diffraction\n", "d_lambda = 6e-008; // Difference in wavelengths of D1 and D2 lines, cm\n", "N = lambda/(n*d_lambda); // Number of lines on grating\n", "printf('\nThe minimum number of lines in the required diffraction grating = %d', N);\n", "\n", "// Result\n", "// The minimum number of lines in the required diffraction grating = 500 " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_312: EX3_d_312.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.12: Page-209 (2008)\n", "clc; clear;\n", "lambda = 5890e-008; // Wavelength of light, cm\n", "n = 2; // Order of diffraction\n", "d_lambda = 6e-008; // Difference in wavelengths of D1 and D2 lines, cm\n", "w = 2.5; // Width of the grating, cm\n", "N = lambda/(n*d_lambda); // Number of lines on grating\n", "printf('\nThe minimum number of lines per cm in the diffraction grating = %5.1f', N/w);\n", "\n", "// Result\n", "// The minimum number of lines per cm in the diffraction grating = 196.3 " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_313: Maximum_resolving_power_of_a_plane_transmission_grating.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.13: Page-210 (2008)\n", "clc; clear;\n", "lambda = 5000e-008; // Wavelength of light, cm\n", "theta = 90; // Angle of diffraction for the maximum resolving power, degree\n", "N = 40000; // Number of lines on grating\n", "a_plus_b = 12.5e-005; // Grating element, cm\n", "n = 2; // Order of diffraction\n", "n_max = N*a_plus_b*sind(theta)/lambda; // Maximum resolving power\n", "printf('\nThe maximum resolving power = %d', n_max);\n", "\n", "// Result\n", "// The maximum resolving power = 100000 " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.d_314: Maximum_number_of_lines_of_a_grating.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Scilab Code Ex3d.14: Page-209 (2008)\n", "clc; clear;\n", "lambda = 5890e-008; // Wavelength of light, cm\n", "n = 3; // Order of diffraction\n", "d_lambda = 6e-008; // Difference in wavelengths of D1 and D2 lines, cm\n", "N = lambda/(n*d_lambda); // Maximum number of lines of a grating\n", "printf('\nThe maximum number of lines of the grating = %d', N);\n", "\n", "// Result\n", "// The maximum number of lines of the grating = 327 " ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }