You are on page 1of 1

% File name: phase_velocity.

m
% Illustrative plot of phase velocity
clear all
N_max = 101; % number of points for plot
t = linspace(0,30d-15,N_max); % creation of theta arguments
%
c = 3d14; % velocity of light in microns/s
n = 3.4; % refractive index
v_p = c/n; % phase velocity
lambda = 1.0; % microns
k = 2*pi/lambda;
frequency = v_p/lambda;
z = 0.6; % distance in microns
omega = 2*pi*frequency;
A = sin(k*z - omega*t);
plot(t,A,'LineWidth',1.5);
xlabel('Time','FontSize',14);
ylabel('Amplitude','FontSize',14);
set(gca,'FontSize',14); % size of tick marks on both axes
axis([0 30d-15 -1.5 2])
text(17d-15, 1.3, 'z(t)','Fontsize',16)
line([1.53d-14,2d-14],[1,1],'LineWidth',3.0) % drawing arrow
line([1.9d-14,2d-14],[1.1,1],'LineWidth',3.0)
line([1.9d-14,2d-14],[0.9,1],'LineWidth',3.0)
pause
close all

You might also like