Gin Gin Ginanjar Optik2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Nama : Gin Gin Ginanjar

NPM : 140310180001
Tugas Optik
Buat grafik Refektansi (R) sebagai fungsi dari sudut datang (theta) untuk sistem ATR (lihat
file tugas detailnya). Tugas yang dikumpulkan berupa list-program dan grafik R terhadap
theta.
Program yang digunakan adalah Matlab
a. Listing program

% Input data indeks bias, panjang gelombang, dan ketebalan


fprintf('Reflektansi (R) sebagai fungsi dari sudut cahaya datang untuk kasus
ATR dengan polarisasi gelombang TM (p) \n')
n1=1.75;
n2=1.50;
n3x=1.00;
n3y=1.01;
lamda=633;
d=50;
z=sqrt(-1);
phi=3.14;

% Sudut cahaya datang


thetamin=0;
thetamax=90;
inkremen=0.01;

theta=thetamin:0.01:thetamax

costheta1=cosd(theta)
costheta2=sqrt (1-((n1/n2)*(sind(theta))).^2);
theta2=acosd(costheta2);
costheta3x=sqrt(1-((n2/n3x)*(sind(theta2))).^2);
theta3x=acosd(costheta3x);
costheta3y=sqrt(1-((n2/n3y)*(sind(theta2))).^2);
theta3y=acosd(costheta3y);
r12=(((n1*costheta2)-(n2*costheta1))/((n1*costheta2)+(n2*costheta1)));
r23x=(((n2*costheta3x)-(n3x*costheta2))/((n2*costheta3x)+(n3x*costheta2)));
r23y=(((n2*costheta3y)-(n3y*costheta2))/((n2*costheta3y)+(n3y*costheta2)));

tshi=(((2*phi)/lamda)*n2*d*costheta2);
beta1=2*(-z)*tshi;
rpmsx=(r12+r23x.*exp(beta1))./(1+r12.*r23x.*exp(beta1));
rpmscx=conj(rpmsx);
Reflecx=rpmsx.*rpmscx;
rpmsy=(r12+r23y.*exp(beta1))./(1+r12.*r23y.*exp(beta1));
rpmscy=conj(rpmsy);
Reflecy=rpmsy.*rpmscy;

indexmin=find(min(Reflecx)==Reflecx);
xmin=theta(indexmin);
ymin=Reflecx(indexmin);

indexmax=find(max(Reflecx)==Reflecx);
xmax=theta(indexmax);
ymax=Reflecx(indexmax);

plot(theta,Reflecx,'linewidth',2)
hold on

indexmin=find(min(Reflecy)==Reflecy);
xmin=theta(indexmin);
ymin=Reflecy(indexmin);

indexmax=find(max(Reflecy)==Reflecy);
xmax=theta(indexmax);
ymax=Reflecy(indexmax);

plot(theta,Reflecy,'linewidth',2)
xlabel('Sudut Datang');
ylabel('Reflektansi');
title('grafik Refektansi sebagai fungsi dari sudut cahaya datang untuk kasus
ATR dengan polarisasi gelombang TM (p)')
grid off
hold off

b. Hasil

Grafik 1.1 Hasil dari matlab

You might also like