Plots
Completion requirements
3. Example
The following is the plot of concentration vs. time data of a chemical reaction.
Out of the above plots, the semilogY plot is giving a nice linear trend. This indicates \(\log(C_A)\) vs. \(t\) is linear. This is because of the data is that of first order reaction. \[ \begin{align*} -\frac{dC_A}{dt} &= kC_A \\ -\frac{dC_A}{C_A}
&= kdt \\ \ln \frac{C_A}{C_{A0}} &= -kt \\ \ln(C_A) &= \ln(C_{A0}) - kt \\ \end{align*} \]
% ReactionOrder.m
% Concepts: plot, subplot, loglog, semilogx, semilogy
% Done by Subramanian M
% on 6-June-2022
close all; clear; clc;
% define the row vector time in minutes
t = [1, 6, 11, 16, 21, 26, 50];
% define the row vector concentration (mol/L)
cA = [53.7, 31.3, 10.8, 7.8, 2.2, 1.65, 0.08];
subplot(2,2,1)
plot(t,cA,'o-')
grid on
xlabel('t (min)')
ylabel('C_A (mol/L)')
title('Linear Plot')
subplot(2,2,2)
loglog(t,cA,'o-')
grid on
xlabel('t (min)')
ylabel('C_A (mol/L)')
title('Log-Log Plot')
subplot(2,2,3)
semilogx(t,cA,'o-')
grid on
xlabel('t (min)')
ylabel('C_A (mol/L)')
title('SemiLogX Plot')
subplot(2,2,4)
semilogy(t,cA,'o-')
grid on
xlabel('t (min)')
ylabel('C_A (mol/L)')
title('SemiLogY Plot')
>> ReactionOrder
>>