function kinetics3
clear all
clc
%实验数据
B = [1.319 1.3161 1.3112 1.2892 1.2695 1.2601 1.2485 1.2389 1.2245 1.2052 1.181 1.1456 1.1402 1.1134 1.0827 1.036 0.9634];
C= [0.0813 0.0957 0.1188 0.1532 0.1877 0.2089 0.2333 0.2621 0.2891 0.3323 0.3738 0.4275 0.4464 0.4916 0.5393 0.6141 0.7114];
r = [0.02286 0.02244 0.02202 0.0216 0.02118 0.02076 0.02034 0.01992 0.0195 0.01908 0.01866 0.01796 0.01726 0.01656 0.01586 0.01376 0.01166];
% 用多变量线性回归方法估计动力学参数
R =B./r;
y = R;
X = [ones(size(y)) B C];
b = X\y % 或[b,bint] = regress(y,X,0.05);
KZ = 1/b(1);
KB = b(2)*KZ;
KC = b(3)*KZ;
% 用lsqnonlin()--求解非线性最小二乘法(非线性数据拟合)问题
beta0 = [KZ KB KC];
lb = [1 1 1];
ub = [+inf +inf +inf];
[beta,resnorm,resid,exitflag,output,lambda,jacobian] =