%Fig1_4.m
%Essential Electron Transport for Device Physics
%monatomic linear chain dispersion;
clear;
clf;
FS      = 12;	%label fontsize 18
FSN     = 12;	%number fontsize 16
LW      = 1;	%linewidth

% Change default axes fonts.
set(0,'DefaultAxesFontName', 'Times');
set(0,'DefaultAxesFontSize', FSN);

% Change default text fonts.
set(0,'DefaultTextFontname', 'Times');
set(0,'DefaultTextFontSize', FSN);

kappa=1;								%spring constant
m1=1;									%mass of particle

ymax=(4*kappa/m1)^0.5;					%maximum frequency

x=[-pi:.01:pi];							%wave vector [start:increment:stop]   
y21=sqrt(4*kappa/m1)*abs(sin(x(:)/2));	%the acoustic branch

figure(1);
plot(x,y21,'b');						%the acoustic branch
axis([-pi,pi,0,1.1*ymax]);
temp2=['\rmFig1.4a, \kappa = ',num2str(kappa),', m = ',num2str(m1)];
title(temp2);
xlabel(['Wave vector, q/L']);
ylabel(['Frequency, \omega(q)']);

x=[0.01:.01:2*pi];						%wave vector [start:increment:stop]   
vg=sqrt(4*kappa/m1)*(cos(x(:)/2))/2;      %group velocity
vp=sqrt(4*kappa/m1)*(sin(x(:)/2))./x(:);       %phase velocity

figure(2);
plot(x,vg,'b');						%group velocity
hold on
plot(x,vp,'r');                     %phase velocity
%axis([0,2*pi,1.1*min(vg),1.1*max(vg)]);
axis([0,pi,0,1.1*max(vg)]);
temp2=['\rmFig1.4b, \kappa = ',num2str(kappa),', m = ',num2str(m1)];
title(temp2);
xlabel(['Wave vector, q/L']);
ylabel(['\upsilon_g (blue), \upsilon_p (red), ( \kappa/m )^{1/2}L']);

