24小时热门版块排行榜    

查看: 1648  |  回复: 10
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

anjb99

木虫 (小有名气)

[求助] 非线性拟合-参数求解,matlab,origin!!!!

实验数据:
1.8        1.279
2        1.282
2.4        1.291
2.9        1.331
3.35        1.344
4.3        1.336
5.4        1.339
6.8        1.34
7.5        1.33
8        1.296
8.5        1.221
9.5        1.128
10.5        1.091
11        1.067
11.4        1.065
第一列为溶液pH值,换算为氢离子浓度为([H+]=0.1的pH值次方),第二列为公式中A值,A是[H+]的函数,求参数A1,A2,A3,pKa1和pKa2?非常感谢各位!!!


[ Last edited by dbb627 on 2012-8-1 at 10:39 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dingd

铁杆木虫 (职业作家)


csgt0: 金币+1, 多谢应助 2012-08-01 15:46:45
用1stOpt求解试试:
CODE:
Function  y=(A1*x^2+A2*x+A3*Ka1*Ka2)/(x^2+Ka1*x+Ka1*Ka2);
Data;
xdata=0.1*[1.8,2,2.4,2.9,3.35,4.3,5.4,6.8,7.5,8,8.5,9.5,10.5,11,11.4];
ydata=[1.279,1.282,1.291,1.331,1.344,1.336,1.339,1.34,1.33,1.296,1.221,1.128,1.091,1.067,1.065];

均方差(RMSE): 0.0131572173413872
残差平方和(SSE): 0.0025966855225275
相关系数(R): 0.991831111193116
相关系数之平方(R^2): 0.983728953130572
决定系数(DC): 0.983728953130572
卡方系数(Chi-Square): 0.0010006654437817
F统计(F-Statistic): 153.647151290385

参数        最佳估算
----------        -------------
a1        1.18544583254516
a2        -2.07683603846454
a3        1.27388100838787
ka1        -1.68649267034603
ka2        -0.464865470003857


11楼2012-08-01 15:07:37
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 11 个回答

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

★ ★ ★
感谢参与,应助指数 +1
csgt0: 金币+3, 多谢应助 2012-08-01 13:30:30
A1=p1
A2ka1=p2
A3ka1ka2=p3
ka1=q1
ka1ka2=q2

A=[1.8        1.279
2        1.282
2.4        1.291
2.9        1.331
3.35        1.344
4.3        1.336
5.4        1.339
6.8        1.34
7.5        1.33
8        1.296
8.5        1.221
9.5        1.128
10.5        1.091
11        1.067
11.4        1.065];
x=10.^(-A(:,1));
y=A(:,2);
===========
matlab cftool拟合如下
General model Rat22:
     f(x) = (p1*x^2 + p2*x + p3) / (x^2 + q1*x + q2)
Coefficients (with 95% confidence bounds):
       p1 =  4.247e-014  (fixed at bound)
       p2 =      0.4073  (0.2814, 0.5331)
       p3 =   6.55e-010  (fixed at bound)
       q1 =      0.3049  (0.2092, 0.4007)
       q2 =  6.088e-010  (fixed at bound)

Goodness of fit:
  SSE: 0.002082
  R-square: 0.987
  Adjusted R-square: 0.9859
  RMSE: 0.01266

[ Last edited by dbb627 on 2012-8-1 at 10:40 ]
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
2楼2012-08-01 10:29:54
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)


csgt0: 金币+1, 多谢应助 2012-08-01 13:30:39
拟合结果如图所示,稍作计算可得参数的值


The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
3楼2012-08-01 10:31:22
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

csgt0

荣誉版主 (著名写手)

彩色挂图

【答案】应助回帖

感谢参与,应助指数 +1
可拟合的参数多,比较难找到合适的吧,一般有大概初值比较好
CODE:
function anj
xdata0=[1.8,2,2.4,2.9,3.35,4.3,5.4,6.8,7.5,8,8.5,9.5,10.5,11,11.4];
xdata=0.1.^xdata0;
ydata=[1.279,1.282,1.291,1.331,1.344,1.336,1.339,1.34,1.33,1.296,1.221,1.128,1.091,1.067,1.065];
x0=ones(5,1)+rand(5,1);

opts = optimset('Algorithm','trust-region-reflective');
problem = createOptimProblem('lsqcurvefit','objective',@fun,...
    'x0',x0,'xdata',xdata,'ydata',ydata,'options',opts);
gs = MultiStart;
[x,f] = run(gs,problem,50)
end


function y=fun(x,xdata)
y=(x(1)*xdata.^2+x(2)*x(4)*xdata+x(3)*x(4)*x(5))./(xdata.^2+x(4)*xdata+x(4)*x(5));
end

showmethemoney
4楼2012-08-01 10:48:28
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
信息提示
请填处理意见