%This m-file (2dRTplot) plots the reflection and
%transmission of a barrier as a function of energy
%(in units of V) of incoming particle and the length
%of the barrier.

%Define the barrier
V=1;

%Define vectors with the energies and lengths
E=0.001:V/10:3*V;
L=0.001:.1:10;

%Define reflection (R) and transmission (T) matrices
%with zeros

R=zeros(length(L),length(E));
T=R;

%Calculate the reflection and transmission for
%each energy and length

for cnE=1:length(E)
	E(cnE)
	for cnL=1:length(L)
		[R(cnL,cnE) T(cnL,cnE)]=RTbarr(E(cnE),L(cnL),V);
	end
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Now some different ways to show this 2D-data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Clear the graph window
clf
%Make sure it is the standard colormap
colormap hsv
mesh(E,L,T)
grid
xlabel('Energy of incoming particles in units of V (E/V)')
ylabel('Length of barrier (units ?)')
zlabel('Transmission')
title('Transmission of a barrier as a function energy. L=V=1')

'Hit a button!'
pause

colormap(hot)

'Hit a button!'
pause

surf(E,L,T)
xlabel('Energy of incoming particles in units of V (E/V)')
ylabel('Length of barrier (units ?)')
zlabel('Reflection')
title('Reflection of a barrier as a function energy. L=V=1')

'Hit a button!'
pause

%To smooth the picture
shading interp

'Hit a button!'
pause

%A top-view that may be informative
pcolor(E,L,T)
xlabel('Energy of incoming particles in units of V (E/V)')
ylabel('Length of barrier (units ?)')
zlabel('Reflection')
title('Reflection of a barrier as a function energy. L=V=1')

'Hit a button!'
pause

shading interp

'Hit a button!'
pause

colormap copper
