CODE:
function k1k2k3
format long
clear all
clc
tspan = 0:12:144;
x0 = [0.35 0 99.8];
k0 = [0.5 8 1.5 2 -0.5 0.1 0.5 5 -0.01]; %k的初值,最需要调节
lb = [1 1 1 1 1 1 1 1 1 ]*-inf;
ub = [1 1 1 1 1 1 1 1 1]*inf;
data=...
[
12 2.75 0.55 88.96
24 4.6 3.72 73.49
36 6.27 8.19 61.57
48 8.07 14.12 47.38
60 9.73 19.37 33.63
72 10.41 22.54 24.65
84 10.7 27.61 11.19
96 10.53 32.49 3.2
108 10.56 35.62 0
120 10.59 37.58 0
132 10.4 38.44 0
144 10.77 39.88 0
];
yexp = data(:,2:4);
options=optimset('MaxFunEvals',1500);
[k,resnorm,residual,exitflag,output,lambda,jacobian] = ...
lsqnonlin(@ObjFunc,k0,lb,ub,options,tspan,x0,yexp);