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

tend = 1;
tt = linspace(0,tend,500); N = length(tt);
ep = 0.01; mu = 0.2; lam = 0.21;
p = [ep,mu,lam];
[te,ye] = ode23(@MMspode,tt,[1;0],[],p);
[to,xo] = ode23(@MMspxoode,tt,[1],[],p);
yo = xo./(xo + lam);
xi = ones(N,1);
yi = (1/(lam+1))*(1 - exp(-(lam+1)*tt/ep));
xu = xo;
yu = xo'./(xo' + lam) - (1/(lam+1))*exp(-(lam+1)*tt/ep);

subplot(1,2,1)
plot(te,ye(:,1),'r-','LineWidth',1.5);  
hold on                           
plot(to,xo(:),'-','color',[0.8,0.6,0],'LineWidth',1.5);
plot(tt,xi(:),'-','color',[0.6,0,0.2],'LineWidth',1.5);
plot(tt,xu(:),'r:','LineWidth',1.5);
grid                                % Adds Gridlines
h1 =legend('Exact, $x_e$', 'Outer $x_o$',...
    'Inner, $x_i$', 'Uniform $x_u$','Location','southeast');
set(h1,'Interpreter','latex')
text(0.22,0.97,'$\varepsilon = 0.01$','FontSize',14,...
    'interpreter','latex');
hold off
xlim([0 tend]);
ylim([0.9 1.02]);
mytitle1 = 'Subtrate, $S$'; 
xlab1 = '$t$'; 		 
ylab1 = '$S$';
xlabel(xlab1,'FontSize',14,'FontName','Times New Roman',...
    'interpreter','latex');  
ylabel(ylab1,'FontSize',14,'FontName','Times New Roman',...
    'interpreter','latex');  
title(mytitle1,'FontSize',16,'FontName',...
    'Times New Roman','interpreter','latex');

subplot(1,2,2)
plot(te,ye(:,2),'b-','LineWidth',1.5);
hold on
plot(to,yo(:),'-','color',[0.5 0.5 0.8],'LineWidth',1.5);
plot(tt,yi(:),'-','color',[0 0.3 0.6],'LineWidth',1.5);
plot(tt,yu(:),'b:','LineWidth',1.5);
grid
h2 =legend('Exact, $y_e$', 'Outer $y_o$',...
    'Inner, $y_i$', 'Uniform $y_u$','Location','southeast');
set(h2,'Interpreter','latex')
text(0.4,0.65,'$\varepsilon = 0.01$','FontSize',14,...
    'interpreter','latex');
hold off
xlim([0 tend]);
ylim([0 1]);
mytitle2 = 'Enzyme Complex, $C$'; 
xlab2 = '$t$'; 		 
ylab2 = '$C$';
xlabel(xlab2,'FontSize',14,'FontName','Times New Roman',...
    'interpreter','latex');  
ylabel(ylab2,'FontSize',14,'FontName','Times New Roman',...
    'interpreter','latex');  
title(mytitle2,'FontSize',16,'FontName',...
    'Times New Roman','interpreter','latex'); 
set(gca,'FontSize',12);         % Axis tick font size
print -depsc MMesp01S_plot.eps		% Create figure as EPS file

