% LEP 9-1 : The Stern-Volmer Equation
%

k1=0.3;
k2=0.5;
k3=2;
k4=1;
CS2=10;
M=10;
display('Note: Do not use CS2 slider for I_0 graph as CS2 is on X axis')
X=linspace(0,10,200);
CS2a=linspace(0,10,200);
for i=1:200
I(i)=k4*k1*CS2*M/(k2*M+k3*X(i)+k4);
I0(i)=k4*k1*CS2a(i)*M/(k2*M+k4);
Iratio(i)=1+(k3*X(i)/(k2*M+k4));
end
tiledlayout(2,2)
set (gcf,'Position',[0,0.1,800,600])
nexttile
plot(X(1:200),I(1:200),'LineWidth',2)
xlabel('X(Alcohol)')
ylabel('Intensity, I')
leg=legend('I');
leg.ItemTokenSize=[10,10];
axis([0 10 1 30])
title('Intensity in the presence of Alcohol')
grid on
nexttile
plot(CS2a(1:200),I0(1:200),'LineWidth',2)
xlabel('CS_2')
ylabel('Intensity, I_0')
leg=legend('I_0');
leg.ItemTokenSize=[10,10];
axis([0 10 0 5])
title('Intensity in the absence of Alcohol')
grid on
nexttile
plot(X(1:200),Iratio(1:200),'LineWidth',2)
xlabel('X(Alcohol)')
ylabel('Intensity Ratio')
leg=legend('I_0/I');
leg.ItemTokenSize=[10,10];
axis([0 10 0 5])
title('Intensity Ratio in the presence of Alcohol')
grid on

%