clear all

% Plot product concentration for hypothetical substrate to product
% reaction S->P at long times showing deviation from zeroth-order kinetics
% with P_init=0M and S_init=1M. 
%
% Executes properly on MATLAB version 9.4.0.813654 (R2018a).
% Executes mostly properly on OCTAVE version 4.2.1.
% Joshua C. Vaughan 4/16/2020

k = 1.5e2;                          % Rate cosntant. Units are micromolar/second.

t_pts = [0.2 0.4 0.66 0.78 0.92];	% Time points. Units are seconds.

P_init = 0;                         % Initial product concentration. Units are micromolar.
S_init = 1000;                      % Initial substrate concentration. Units are micromolar.

P = P_init + k*t_pts;               % Integrated rate law for P(t).


% create plot

ax_lw = 2;
pl_lw = 2;
ax_fs = 24;
la_fs = 24;
markersize = 24;
fontname = 'Arial';

figure(1); clf
plot(t_pts,P,'r.','markersize',markersize)
xlabel('time (s)','fontsize',la_fs)
ylabel(['[P({\itt})] (' char(181) 'M)'],'fontsize',la_fs)
set(gcf,'color',[1 1 1])
set(gca,'linewidth',ax_lw)
set(gca,'fontsize',ax_fs)
set(gca,'tickdir','out')
set(gca,'fontname',fontname)
xlim([0 1])
ylim([0 1.1*max(P)])
set(gca,'LooseInset',get(gca,'TightInset'));