Question

In: Computer Science

From optics, when light passes from one medium to another, it bends according to Snell’s law...

From optics, when light passes from one medium to another, it bends according to Snell’s law of refraction, until it reaches the critical angle, as defined by the ratio of the incident index of refraction to the outgoing index of refraction. Let light incident along the normal to the refracting surface be defined as having an angle of 0. Write a program that calculates the sine of the outgoing angle and plot it versus the sine of the incident angle for the following cases:
a. air incident on water
b. air incident on benzene
c. air incident on lead glass
d. air incident on diamond
Use a step size in incident angle of 0.02 radians up to the critical angle (note the critical angle will be different each in each case). Write the program to take the incident index of refraction and outgoing index of refraction as keyboard input. Also write the Snell’s law calculation as a function that is called within a loop. Then plot each one on the same plot

please answer using Jupyter notebook in python 3

Solutions

Expert Solution

Dear Student,

The refractive index of given elements is as follows:

  • R.I.(water) = 1.333
  • R.I.(benzene) = 1.5
  • R.I.(lead glass) = 1.7
  • R.I.(diamond) = 2.42

I cannot upload the jupyter notebook, hence I am attaching the code in each cell as a single .py file. Please find the attached code below:

# note that every empty line space indicates the code in one cell
# including all the necessary libraries
import matplotlib.pyplot as plt
import numpy as np

# definming the Refractive indices of the materials
water = 1.333
benzene = 1.5
lead_glass = 1.7
diamond = 2.42

# taking input of the angle of incidence (in radians)
i = float(input("Enter the angle of incidence: "))

# to plot for water
x_w = np.arange(i,np.arcsin(1/water),0.02)   # start,stop,step
y_w = []
for k in range(len(x_w)):
    ref = np.sin(x_w[k])/water
    y_w.append(ref)

# to plot for benzene
x_b = np.arange(i,np.arcsin(1/benzene),0.02)   # start,stop,step
y_b = []
for k in range(len(x_b)):
    ref = np.sin(x_b[k])/benzene
    y_b.append(ref)

# to plot for lead glass
x_lg = np.arange(i,np.arcsin(1/lead_glass),0.02)   # start,stop,step
y_lg = []
for k in range(len(x_lg)):
    ref = np.sin(x_lg[k])/lead_glass
    y_lg.append(ref)

# to plot for diamond
x_d = np.arange(i,np.arcsin(1/diamond),0.02)   # start,stop,step
y_d = []
for k in range(len(x_d)):
    ref = np.sin(x_d[k])/diamond
    y_d.append(ref)

plt.plot(x_w, y_w, label = "Water") 
plt.plot(x_b, y_b, label = "Benzene")
plt.plot(x_lg, y_lg, label = "Lead Glass")
plt.plot(x_d, y_d, label = "Diamond")
plt.xlabel('Angle of refraction')
# Set the y axis label of the current axis.
plt.ylabel('Angle of incidence')
# Set a title of the current axes.
plt.title('Refractive indices')
# show a legend on the plot
plt.legend()
# Display a figure.
plt.show()

Output: (for i = 0.4)

Thank you, please upvote!


Related Solutions

1. A ray of light passes from one substance (n1) into another (n2). In the scenario...
1. A ray of light passes from one substance (n1) into another (n2). In the scenario where n1 < n2, what is the relationship between the speed of light at n1 with respect to the speed of light at n2? greater than equal to less than n/a 2. When a ray of light hits a flat mirror, what is the relationship between the angle of incidence to the angle of reflection? greater than equal to less than dependent upon n...
When a vertical beam of light passes through a transparent medium, the rate at which its...
When a vertical beam of light passes through a transparent medium, the rate at which its intensity I decreases is proportional to I(t), where t represents the thickness of the medium (in feet). In clear seawater, the intensity 3 feet below the surface is 25% of the initial intensity I0 of the incident beam. What is the intensity of the beam 13 feet below the surface? (Give your answer in terms of I0. Round any constants or coefficients to five...
Snell’s law applies to all waves, not just light. The general form is sin(?1) /?1 =...
Snell’s law applies to all waves, not just light. The general form is sin(?1) /?1 = sin(?2) ⁄?2 where ??1 is the speed of the wave in medium 1, and ?2 is the speed of the wave in medium 2. A. Starting with Snell’s law in its familiar form ??1 sin(?1) = ?2 sin(?2) and the definition of the index of refraction ?≡ ? ⁄ ? for light, derive the general form above. One of the applications of Snell’s law...
When a wave passes through a boundary and into a new medium, which of the following...
When a wave passes through a boundary and into a new medium, which of the following characteristic of this wave don't change? And which do? a) wavelength b) Frequency c) speed d) both a and b e) none
Snell's Law and the Law of Reflection explain how light is redirected when it encounters a...
Snell's Law and the Law of Reflection explain how light is redirected when it encounters a surface between two media. In the extreme, light may only reflect at a boundary, and go back into the medium it was in. More often, some of it reflects and some goes through. If the boundary is plane and flat, then these laws are easy to interpret. When the boundary is curved, they describe happens at every point on the surface. One of the...
list the structure and fluids that light passes through from the cornea to the retina?
list the structure and fluids that light passes through from the cornea to the retina?
Light enters medium 2 from medium 1 whose refractive index is 1.5 at an angle of incidence of 50
Light enters medium 2 from medium 1 whose refractive index is 1.5 at an angle of incidence of 50. If the angle of refraction in medium 2 is 25, calculate the refractive index of medium 2.4.0424.3610.3542.7191.243When light enters a medium of refractive index 1.1from a medium of refractive index 2, for whichof the following angle of incidence would bothreflection and refraction take place? 36.4931.22637.60135.49934.802
Suppose the government passes a law making it more difficult for firms to fire workers. One...
Suppose the government passes a law making it more difficult for firms to fire workers. One example might be a law requiring severance pay for fired workers. The goal of this law is to reduce the rate of job separation without affecting the rate of job finding. Use this information to answer the following three questions. (Assume the size of the labor force remains constant.) 1. the natural rate of unemployment will (fall/rise). 2. The rate of job separation will...
Light coming from an unpolarized source passes through three polarizers. They are in series. Their transmissions...
Light coming from an unpolarized source passes through three polarizers. They are in series. Their transmissions axes are at 1=40, 2=60, 3= 90. The final intensity is I. Another polarizer is places between the source and the first polarizer at angle of 90. New final intensity of the system is I'. What is the ratio of I'/I.
List the order of all structures and locations through which light passes to get from the...
List the order of all structures and locations through which light passes to get from the outside world to where rods and cones receive light waves to depolarize.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT