flying_23
2009-10-23, 13:30
条件t=[0.0100 0.6800 1.1000 1.6300 2.0700 2.6700 3.0900 3.6400 4.6500
5.1000 5.5800 6.1100 6.6300 7.0600 7.6200 8.6600 9.0400 9.6300];
y=[2.3291 3.8513 4.5009 6.7492 9.1121 9.6917 11.1693 10.9145 16.4428
18.2962 21.6399 25.7861 26.3428 26.5058 27.6395 35.0276 35.5562 36.1039];
方程Dy=-k*y*z+0.095*b*z , Dz=-b*z-0.222*z, y(0)=0, z(0)=5300
z只知道初始值,过程值无法测定,要求通过方程拟合得出k和b的值
通过[y,z]=dsolve('Dy=-k*y*z+0.995*b*z','Dz=-b*z-0.222*z','y(0)=0,z(0)=5300','t')得出y的表达式,
y =
(199/200*b/k*exp(-2650000*k/(500*b+111)*exp(-1/500*(500*b+111)*t))-199/200*b/exp(5300*k/(500*b+111))^500/k)*exp(2650000*k/(500*b+111)*exp(-1/500*(500*b+111)*t))
z =5300*exp((-b-111/500)*t)
然后
myfunc=inline('(199./200.*beta(2)./beta(1).*exp(-2650000.*beta(1)./(500.*beta(2)+111).*exp(-1./500*(500.*beta(2)+111).*t))-199./200.*beta(2)./exp(5300.*beta(1)/(500.*beta(2)+111)).^500/beta(1)).*exp(2650000.*beta(1)/(500.*beta(2)+111).*exp(-1./500*(500.*beta(2)+111).*t))','beta','t')
采用nlinfit拟合
beta=nlinfit(t,y,myfunc,[0.1 0.1])
出现以下错误
??? Error using ==> nlinfit>checkFunVals at 357
MODELFUN has returned Inf or NaN values.
Error in ==> nlinfit>LMfit at 304
if funValCheck && ~isfinite(sse), checkFunVals(r); end
Error in ==> nlinfit at 167
[beta,J,lsiter,cause] = LMfit(X,y, model,beta,options,verbose,maxiter);
请各位帮忙解决一下这个问题,非常急切需要
5.1000 5.5800 6.1100 6.6300 7.0600 7.6200 8.6600 9.0400 9.6300];
y=[2.3291 3.8513 4.5009 6.7492 9.1121 9.6917 11.1693 10.9145 16.4428
18.2962 21.6399 25.7861 26.3428 26.5058 27.6395 35.0276 35.5562 36.1039];
方程Dy=-k*y*z+0.095*b*z , Dz=-b*z-0.222*z, y(0)=0, z(0)=5300
z只知道初始值,过程值无法测定,要求通过方程拟合得出k和b的值
通过[y,z]=dsolve('Dy=-k*y*z+0.995*b*z','Dz=-b*z-0.222*z','y(0)=0,z(0)=5300','t')得出y的表达式,
y =
(199/200*b/k*exp(-2650000*k/(500*b+111)*exp(-1/500*(500*b+111)*t))-199/200*b/exp(5300*k/(500*b+111))^500/k)*exp(2650000*k/(500*b+111)*exp(-1/500*(500*b+111)*t))
z =5300*exp((-b-111/500)*t)
然后
myfunc=inline('(199./200.*beta(2)./beta(1).*exp(-2650000.*beta(1)./(500.*beta(2)+111).*exp(-1./500*(500.*beta(2)+111).*t))-199./200.*beta(2)./exp(5300.*beta(1)/(500.*beta(2)+111)).^500/beta(1)).*exp(2650000.*beta(1)/(500.*beta(2)+111).*exp(-1./500*(500.*beta(2)+111).*t))','beta','t')
采用nlinfit拟合
beta=nlinfit(t,y,myfunc,[0.1 0.1])
出现以下错误
??? Error using ==> nlinfit>checkFunVals at 357
MODELFUN has returned Inf or NaN values.
Error in ==> nlinfit>LMfit at 304
if funValCheck && ~isfinite(sse), checkFunVals(r); end
Error in ==> nlinfit at 167
[beta,J,lsiter,cause] = LMfit(X,y, model,beta,options,verbose,maxiter);
请各位帮忙解决一下这个问题,非常急切需要