%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file is used to run the function fiber_mode_calc, which
% calculates the effective index of a step index optical fiber
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a=1.8e-6; %core radius in meters
core=2; %number for the core material
clad=1; %number for the cladding material
[neff, Lambda, n_core, n_clad] = fiber_mode_calc(a, core, clad)
V=2*pi./Lambda*a.*sqrt(n_core.^2-n_clad.^2);
subplot(2,1,1)
plot(V, neff)
subplot(2,1,2)
b=(neff.^2-n_clad.^2)./(n_core.^2-n_clad.^2);
plot(V, b)