# How to calculate rate constant if population vs time table data is given?

6 views (last 30 days)
Arun on 13 Sep 2022
Commented: Sam Chak on 13 Sep 2022
I have to determine the rate constant of the first order kinetics growth of a population. For a period of 70 seconds, the population growth data has been provided something like this, N = [1 2 3 4.5 7 10 16 29 56 104 and so on..]
The equation is dN/dT = rN
I have plotted the graph in MATLAB but I have no idea how to calculate the rate constant using the curve or the equation. Is it as simple as determining the slope for the graph over a region or do I have to use ode45?
Sam Chak on 13 Sep 2022
@Arun, Based on an educated guess, the population dynamics should be
Can you provide the full data of t from 0 to 70, and N all the way up to the Carrying Capacity K (Kapazitätsgrenze)?

David Hill on 13 Sep 2022
N=[1 2 3 4.5 7 10 16 29 56 104];
fit((1:length(N))',N','exp1')
ans =
General model Exp1: ans(x) = a*exp(b*x) Coefficients (with 95% confidence bounds): a = 0.2322 (0.1555, 0.3088) b = 0.61 (0.5757, 0.6444)

Sam Chak on 13 Sep 2022
Edited: Sam Chak on 13 Sep 2022
Hi @Arun,
Looks like you want to find the value of r to fit the data into the differential equation:
The analytical solution is given by
I have found by taking and solving for .
T = linspace(0, 70, 10); % just an assumption, maybe not linearly-spaced
N = [1 2 3 4.5 7 10 16 29 56 104];
r = 1/70*(3*log(2) + log(13));
odefcn = @(t, n) r*n;
[t, n] = ode45(odefcn, [0 70], 1);
plot(t, n, T, N, 'p'),
grid on, xlabel('t'), ylabel('N'), legend('fitted', 'data')

Torsten on 13 Sep 2022
Edited: Torsten on 13 Sep 2022
I assume N is given after 1 second each and starts at t=0 with N(0) = 1.
t = 1:9;
N = [2 3 4.5 7 10 16 29 56 104];
fun = @(p,t)exp(p(1)*t);
fun1 = @(p,t)fun(p,t)-N;
p0 = 0.1;
p = lsqnonlin(@(p)fun1(p,t),p0)
Local minimum possible. lsqnonlin stopped because the final change in the sum of squares relative to its initial value is less than the value of the function tolerance.
p = 0.5108
hold on
plot([0,t],[1,N])
plot([0,t],fun(p,[0,t]))
hold off

### Categories

Find more on Particle & Nuclear Physics in Help Center and File Exchange

R2022a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!