% MATLAB file used in the solution of Activity 15.1 of 
% "A First Course on Kinetics and Reaction Engineering."

% Data provided in the problem statement, in consistent units
V = 750.; % mL
CA0 = 1.0; % mol/L
T = 70 + 273.15; % K
t = [1
2
3
4
5
6
7
8
9
10
12
15
20]; % min
CA = [0.874
0.837
0.800
0.750
0.572
0.626
0.404
0.458
0.339
0.431
0.249
0.172
0.185]; % mol/L

% calculate nA0 and nA
nA0 = CA0*V;
nA = CA*V;

% calculate x and y
x = -t;
y_hat = log(nA/nA0);
FitLinmSR;
