clear				% Clear previous definitions
figure(1)           % Assign figure number
clf                 % Clear previous figures
hold off            % Start with fresh graph

mytitle = 'Boundary Layer Problem'; 	% Title
xlab = '$x$'; 		                % X-label
ylab = '$y$'; 	                    % Y-label
xx = linspace(0,1,500);
ep = 0.05;
y1 = (exp(-xx) - exp(-xx/ep))./(exp(-1) - exp(-1/ep));
y1a = exp(1-xx) - exp(1-xx/ep);
y2 = exp(1-xx);
y3 = exp(1) - exp(1-xx/ep);
plot(xx,y2,'r-','LineWidth',1.5);  
hold on                           
plot(xx,y3,'b-','LineWidth',1.5);
plot(xx,y1a,'-','color',[0,0.6,0],'LineWidth',1.5);
plot(xx,y1,'k:','LineWidth',1.5);
plot([0.07 0.07],[0 3],'b:','LineWidth',1.5);
plot([0.18 0.18],[0 3],'r:','LineWidth',1.5);
arrow([0.54 2.5],[0.43 2.72],'color','b');  
arrow([0.49 2.0],[0.4 1.82],'color','r');
arrow([0.29 0.8],[0.12 0.8]);
arrow([0.29 1.15],[0.11 2.11]);
arrow([0.29 1.3],[0.13 2.18],'color',[0,0.6,0]);
arrow([0.21 0.25],[0.04 0.4],'color','b');
% Adds Gridlines
%h =legend('Exact', 'Outer Approx',...
%    'Inner Approx','Location','southeast');
%set(h,'Interpreter','latex')
text(0.55,2.5,'inner approximation','FontSize',12,'color','b');
text(0.22,0.25,'inner layer','FontSize',12,'color','b');
text(0.3,0.8,'overlap domain','FontSize',12);
text(0.5,2.0,'outer approximation','FontSize',12,'color','r');
text(0.55,0.6,'outer layer','FontSize',12,'color','r');
text(0.3,1.3,'match approximation','FontSize',12,'color',[0,0.6,0]);
text(0.3,1.15,'actual solution','FontSize',12);
xlim([0 1]);
ylim([0 3]);
fontlabs = 'Times New Roman';   % Font in labels
xlabel(xlab,'FontSize',14,'FontName',fontlabs,...
    'interpreter','latex');  
ylabel(ylab,'FontSize',14,'FontName',fontlabs,...
    'interpreter','latex');  
title(mytitle,'FontSize',16,'FontName',...
    'Times New Roman','interpreter','latex'); 
set(gca,'FontSize',12);         % Axis tick font size
print -depsc bvpmatchxx_plot.eps		% Create figure as EPS file

hold off
figure(101)

mytitle2 = 'Error of Approximation'; 	% Title		                % X-label
ylab2 = 'Error';
err = y1a-y1;
plot(xx,err,'r-','LineWidth',1.5);
xlim([0 1]);
ylim([-0.1 0.1]);
ylabel(ylab2,'FontSize',14,'FontName',fontlabs,...
    'interpreter','latex');  
title(mytitle2,'FontSize',16,'FontName',...
    'Times New Roman','interpreter','latex'); 
set(gca,'FontSize',12);         % Axis tick font size
print -depsc bvpmatcherr_plot.eps	
