Skip to content
Snippets Groups Projects
Commit c8c773fe authored by Yang Lee's avatar Yang Lee
Browse files

Update GM_Verhulst.m

parent a9b93e1a
No related branches found
No related tags found
No related merge requests found
%% Creating symbolic variables a (Development factor) and b (Volume of ash action)
syms a b;
c = [a b]';
%% Original series A
A = [0.240 0.711 2.305 5.403];
n = length(A);
%% The series B is obtained by cumulative subtraction of the original series A
for i = 2:n
H(i) = A(i) - A(i - 1);
end
H(1) = [];
%% Immediate neighbourhood mean generation for the original series A
for i = 2:n
C(i) = (A(i) + A(i-1))/2;
end
C(1) = [];
%% Constructing the data matrix
D = [-C; C.^2];
Y = H; Y = Y';
%% Calculation of parameters using the least squares method
% a (Development factor) and b (Volume of ash action)
c = inv(D*D')*D*Y;
c = c';
a = c(1); b = c(2);
%% Get the predicted data
F = []; F(1) = A(1);
for i = 2:(n+n)
F(i) = (a*A(1))/(b*A(1)+(a - b*A(1))*exp(a*(i-1)));
end
disp('Forecast data for:');
F
%% Plotting graphs
t1 = 0:n-1;
t2 = 0:2*n-1;
plot(t1, A, 'bo'); hold on;
plot(t2, F, 'b');
xlabel('Uniform sampling at each point of time/2h'); ylabel('Bacterial culture absorbance/OD600');
legend('Actual quantity','Forecast quantity');
title('S type growth curve of Escherichia coli culture');
grid on;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment