In: Advanced Math
#MATLAB
The following table of values gives experimentally-determined values of the angles of incidence and refraction of light through water. The known index of refraction of water is sinθi/ sinθr = 1.33 in which θi is the angle of incidence and θr is the angle of refraction. Make a plot that shows the experimental values as well as the theoretical values for 0 ≤ θi ≤ π/2. Experimental values should be filled symbols and the theoretical values should be a smooth line. Give the plot appropriate x and y labels, a title, and a legend.
Experiment number | Angle of incidence (degrees) | Angle of refraction (degrees) |
1 | 33.5 | 24 |
2 | 12 | 3 |
3 | 17 | 10.5 |
4 | 41 | 20 |
5 | 22 | 10 |
6 | 30 | 15 |
Theoretical angle of refraction,
MATLAB Code
clc;clear all;
i=1:8;
Angle_inc=[33.5 12 17 41 22 30]; % Angle of incidence
Expt_Angle_refr=[24 3 10.5 20 10 15]; % Experimental Angle of
Refraction
theta_i=0:0.01:90; % Angle of incidence for theoretical
Theo_Angle_refr=(180/pi)*asin(sin(theta_i*pi/180)/1.33); %
theoretical angle of refraction
plot(Angle_inc, Expt_Angle_refr,'*r'); hold on;
plot(theta_i,Theo_Angle_refr);
xlabel('Angle of incidence(degrees)','fontsize',13);
ylabel('Angle of refraction(degrees)','fontsize',13);
legend('Experimental Value of Angle of Refraction',' Theoretical
value of Angle of Refraction');
title('Plot of Experimental values vs Theoretical values of Angle
of Refraction','fontsize',13);
set(gca,'fontsize',14);