MATLAB Answers

How do you solve the non-growth rate of yeast using non-linear regression analysis?

7 views (last 30 days)
pp1459
pp1459 on 23 Nov 2020
Commented: pp1459 on 25 Nov 2020
This question was flagged by John D'Errico
-----------------------------------------------------------------------
clc
clear all
format long
x = [2 1 0.666666667 0.5 0.4 0.33333 0.285714 0.25 0.22222 0.2];
y = [4.4661998 3.09281539 2.685948193 2.784406211 3.011748832 3.591154269 4.108564714 4.306224216 5.041999859 5.766547107 ];
%data values
p = polyfit(x,y,3)
kk= polyval(p,x)
plot(x,y,x,kk,'o')
------------------------------------------------------------------------------
clc
clear all
format long
N= 50;
aa = [2 1 0.666666667 0.5 0.4 0.33333 0.285714 0.25 0.22222 0.2];
cd = [4.4661998 3.09281539 2.685948193 2.784406211 3.011748832 3.591154269 4.108564714 4.306224216 5.041999859 5.766547107 ];
%data values
aa_ini = 0; aa_end=2;
aa_vector = linspace(aa_ini, aa_end, N);
cd_ls = interp1(aa, cd, aa_vector);
cd_cs = spline(aa, cd, aa_vector);
cd_aa13_ls = cd_ls(49)
cd_aa13_cs = cd_cs(49)
% Plotting data points and interpolation line
figure(1)
plot(aa, cd,'o'); hold on
plot(aa_vector, cd_ls, '--');
plot(aa_vector, cd_cs);
plot(aa_vector(8), cd_aa13_cs, 'square');
plot(aa_vector(8), cd_aa13_ls, '+');

  4 Comments

Show 1 older comment
Matt J
Matt J on 23 Nov 2020
Anyone with editing priviliges can still edit back your original question from the Google cache.
Yes, here it is:
It is known that the non-growth rate of yeast(k) has the following relationship with the food concentration(x)
k = 𝑎𝑥 /(𝑏 + 𝑐𝑥 + 𝑑𝑥^2 + 𝑒𝑥^3)
According to this equation, due to the limitation of food volume, growth approaches zero at very low concentrations. It also approaches zero at high concentrations due to the effects of toxic effects.
(1) The nonlinear regression analysis of the rough experimental data finds the coefficients a, b, c, d, and e.
(2) Plots the data in the [0 5] area.
(3) Obtain the concentration from k(x) that makes k the maximum.
The answer I wrote for 3 hours is as below.
I tried to get X,k by using the reciprocal.
-----------------------------------------------------------------------
clc
clear all
format long
x = [2 1 0.666666667 0.5 0.4 0.33333 0.285714 0.25 0.22222 0.2];
y = [4.4661998 3.09281539 2.685948193 2.784406211 3.011748832 3.591154269 4.108564714 4.306224216 5.041999859 5.766547107 ];
%data values
p = polyfit(x,y,3)
kk= polyval(p,x)
plot(x,y,x,kk,'o')
------------------------------------------------------------------------------
clc
clear all
format long
N= 50;
aa = [2 1 0.666666667 0.5 0.4 0.33333 0.285714 0.25 0.22222 0.2];
cd = [4.4661998 3.09281539 2.685948193 2.784406211 3.011748832 3.591154269 4.108564714 4.306224216 5.041999859 5.766547107 ];
%data values
aa_ini = 0; aa_end=2;
aa_vector = linspace(aa_ini, aa_end, N);
cd_ls = interp1(aa, cd, aa_vector);
cd_cs = spline(aa, cd, aa_vector);
cd_aa13_ls = cd_ls(49)
cd_aa13_cs = cd_cs(49)
% Plotting data points and interpolation line
figure(1)
plot(aa, cd,'o'); hold on
plot(aa_vector, cd_ls, '--');
plot(aa_vector, cd_cs);
plot(aa_vector(8), cd_aa13_cs, 'square');
plot(aa_vector(8), cd_aa13_ls, '+');
---------------------------------------------------------------------------------------------------
You can untie it with the top. Isn't it impossible to get a coefficient?

Sign in to comment.

Answers (1)

Alan Stevens
Alan Stevens on 23 Nov 2020
You can do it as follows. Notice that there are, in effect, only four paramters to fit:
x = 0:0.5:5; % mg/L
k = [0, 0.223904, 0.323333, 0.372308, 0.359143, 0.332033, 0.278462, ...
0.243394, 0.232222, 0.198334, 0.173414]; % d^-1
% In the following function r(1) = b/a, r(2) = c/a, r(3) = d/a, r(4) = e/a
f = @(x, r) x./(r(1) + r(2)*x + r(3)*x.^2 + r(4)*x.^3);
r0 = ones(4,1);
r = fminsearch(@(r) fcn(r,x,k,f),r0);
xx = 0:0.01:5;
kfit = f(xx,r);
plot(x,k,'o',xx,kfit),grid
xlabel('x'),ylabel('k')
legend('data','curvefit')
function F = fcn(r,x,k,f)
y = f(x,r);
F = norm(y-k);
end
This results in the following

Community Treasure Hunt

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

Start Hunting!