📄 enzymekinetest.m
字号:
function EnzymeKinetEst
% Enzyme Kinetics Parameter Estimation
%
% Author: HUANG Huajiang
% Copyright 2003 UNILAB Research Center,
% East China University of Science and Technology, Shanghai, PRC
% $Revision: 1.0 $ $Date: 2003/05/16 $
%
% [Ref]: Englezos & Kalogerakis. Applied Parameter Estimation for
% Chemical Engineers. Marcel Dekker, 2000(p.323)
clear all
clc
S = [20 15 10 5 2.5]';
rate = [330 300 260 220 110]';
% 线性回归
y = 1./rate;
X = [ones(size(y)) 1./S];
[b,bint,r,rint,stats] = regress(y,X);
rmax_LinReg = 1/b(1);
Km_LinReg = rmax_LinReg * b(2);
R2_LinReg = stats(1); % R2_LinReg:相关系数的平方值
% 非线性回归
x = S;
y = rate;
b0 = [rmax_LinReg Km_LinReg]; % 以线性回归的结果作为非线性回归的初值
[beta,resid,J] = nlinfit(x,y,@myfun, b0);
ci = nlparci(beta,resid,J);
ratec = myfun(beta, S); % 速率拟合值(计算值)
% 非线性拟合效果图(实验与拟合的比较)
S4plot = linspace(S(1),S(end),300);
rate4plot = myfun(beta, S4plot);
plot(x,y,'o',S4plot,rate4plot,'-')
legend('Exp','Model')
xlabel('S(μM)')
ylabel('r(μM/min)')
% 残差关于拟合值的残差图
figure
plot(ratec,resid,'*')
xlabel('拟合(μM/min)')
ylabel('残差R (μM/min)')
refline(0,0)
% 参数辨识结果
fprintf('Estimated Parameters by Linear Regression:\n')
fprintf('\trmax = %.1f\n',rmax_LinReg)
fprintf('\tKm = %.3f\n',Km_LinReg)
fprintf('\tR2 = %.3f\n',R2_LinReg)
fprintf('Estimated Parameters by Nonlinear Regression:\n')
fprintf('\trmax = %.1f\n',beta(1))
fprintf('\tKm = %.3f\n',beta(2))
% ------------------------------------------------------------------
function yhat = myfun(beta, x)
yhat = beta(1)*x./(beta(2)+x); % beta(1) = rmax, beta(2) = Km
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -