function plots(pot) n = 300; xmin = -10; xmax = 10; B = -2; if pot == 0; %no potential LxtU = pots(n,xmin,xmax,0,0,0,.2,0); % first entry is potential type, second is B, third is pot strength s NLxtU = pots(n,xmin,xmax,0,B,0,.2,0); else if pot == 1; %step potential NLxtU1 = pots(n,xmin-2,xmax+2,1,B,100,1,0); %mostly absorbed NLxtU2 = pots(n,xmin-2,xmax+2,1,B,-500,.6,0); %half/half NLxtU3 = pots(n,xmin-2,xmax+2,1,B,10000,.4,0); %mostly reflected else %parabolic potential %LxtU = pots(n,-1,1,2,0,500,.1); %NLxtU = pots(n,-1,1,2,B,500,.1); end end figure; if pot == 0; subplot(2,1,1) surf(LxtU.*conj(LxtU)); text(100,50,20,'linear dispersion'); subplot(2,1,2) surf(NLxtU.*conj(NLxtU)); text(150,50,20,'nonlinear soliton'); else if pot == 1; subplot(3,2,1) surf(NLxtU1.*conj(NLxtU1)); text(400,200,200,'positive potential step'); subplot(3,2,3) surf(NLxtU2.*conj(NLxtU2)); text(300,200,100,'negative potential step'); subplot(3,2,5) surf(NLxtU3.*conj(NLxtU3)); text(200,200,400,'near total reflection'); subplot(3,2,2) imagesc(NLxtU1'); set(gca,'ydir','normal'); colorbar; subplot(3,2,4) imagesc(NLxtU2'); set(gca,'ydir','normal'); colorbar; subplot(3,2,6) imagesc(NLxtU3'); set(gca,'ydir','normal'); colorbar; else %surf(LxtU.*conj(LxtU)); %surf(NLxtU.*conj(NLxtU)); end end colorbar