24小时热门版块排行榜    

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

715211229

木虫 (正式写手)

[求助] matlab拟合公式中未知系数

现在有2组数据,比较大,不方便贴出来,所以放附件了。
拟合给定的这2 个情况中f(x)中的系数ai。这个是我拟合的,效果不好,初值不知道该怎么调。

5、高速凸轮进气门上升段
f(x) = a6*(x^24)+a5*(x^22)+a4*(x^16)+a3*(x^12)+a2*(x^6)+a1*(x^2)+a0

       a0 =       5.675  (5.669, 5.68)
       a1 =      -9.946  (-9.978, -9.915)
       a2 =        6.59  (6.513, 6.667)
       a3 =       -3.32  (-3.421, -3.219)
       a4 =        1.42  (1.357, 1.482)
       a5 =     -0.2558  (-0.272, -0.2396)
       a6 =     0.08181  (0.07615, 0.08747)

6、高速凸轮进气门下降段  (效果不好)

       f(x) = a6*(x^26)+a5*(x^22)+a4*(x^20)+a3*(x^18)+a2*(x^5)+a1*(x^2)+a0

       a0 =       5.674  (5.625, 5.723)
       a1 =      -16.34  (-16.67, -16.01)
       a2 =       15.89  (15.25, 16.52)
       a3 =      -66.16  (-73.4, -58.92)
       a4 =         110  (97.04, 123)
       a5 =      -52.58  (-59.2, -45.96)
       a6 =       3.717  (3.193, 4.24)


[ Last edited by 715211229 on 2011-12-23 at 12:13 ]
回复此楼

» 本帖附件资源列表

  • 欢迎监督和反馈:小木虫仅提供交流平台,不对该内容负责。
    本内容由用户自主发布,如果其内容涉及到知识产权问题,其责任在于用户本人,如对版权有异议,请联系邮箱:xiaomuchong@tal.com
  • 附件 1 : 数据.rar
  • 2011-12-23 12:12:11, 4.31 K

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

我是蜗牛
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

引用回帖:
4楼: Originally posted by 715211229 at 2011-12-23 20:03:48:
是的,求给定公式的系数

第一个不用在改了,第二个加了权重
CODE:
>>  x=x4;y=h4;
w=1./(y+0.00001);
opts=fitoptions('method','NonlinearLeastSquares','Weights',(w).^(1/8),'Lower',[-Inf -Inf -Inf -Inf -Inf  -Inf -Inf],'Upper',[Inf Inf Inf Inf Inf Inf Inf]);
opts.StartPoint= [ 3.7168  -52.5824  110.0003  -66.1606   15.8861  -16.3403    5.6742];
ft_ = fittype('a6*(x^26)+a5*(x^22)+a4*(x^20)+a3*(x^18)+a2*(x^5)+a1*(x^2)+a0','dependent',{'y'},...
    'independent',{'x'},'coefficients',{'a6', 'a5','a4','a3','a2','a1','a0'},'options',opts);
[cf_,good]= fit(x,y,ft_)
plot(x,cf_(x),'or-',x, y, '* ');
legend('拟合图','原始数据')

cf_ =

     General model:
     cf_(x) = a6*(x^26)+a5*(x^22)+a4*(x^20)+a3*(x^18)+a2*(x^5)+a1*(x^2)+a0
     Coefficients (with 95% confidence bounds):
       a6 =       3.132  (2.697, 3.568)
       a5 =      -45.17  (-50.8, -39.54)
       a4 =       95.47  (84.3, 106.6)
       a3 =      -58.04  (-64.36, -51.72)
       a2 =        15.2  (14.57, 15.83)
       a1 =      -16.02  (-16.37, -15.67)
       a0 =       5.646  (5.59, 5.701)

good =

           sse: 4.3743
       rsquare: 0.9945
           dfe: 171
    adjrsquare: 0.9943
          rmse: 0.1599


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.
5楼2011-12-24 11:02:12
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 6 个回答

dbb627

荣誉版主 (著名写手)

一定要选你的公式吗
Linear model Poly9:
     f(x) = p1*x^9 + p2*x^8 + p3*x^7 + p4*x^6 +
                    p5*x^5 + p6*x^4 + p7*x^3 + p8*x^2 + p9*x + p10
Coefficients (with 95% confidence bounds):
       p1 =       2.661  (-3.745, 9.066)
       p2 =      -40.35  (-80.31, -0.3958)
       p3 =       196.5  (91.87, 301.1)
       p4 =        -447  (-596.2, -297.8)
       p5 =         526  (400.1, 652)
       p6 =      -319.1  (-383, -255.1)
       p7 =       99.43  (80.45, 118.4)
       p8 =      -24.38  (-27.42, -21.34)
       p9 =      0.7499  (0.5288, 0.971)
       p10 =       5.671  (5.666, 5.677)

Goodness of fit:
  SSE: 0.003105
  R-square: 1
  Adjusted R-square: 1
  RMSE: 0.00413

Linear model Poly9:
     f(x) = p1*x^9 + p2*x^8 + p3*x^7 + p4*x^6 +
                    p5*x^5 + p6*x^4 + p7*x^3 + p8*x^2 + p9*x + p10
Coefficients (with 95% confidence bounds):
       p1 =       396.8  (308.6, 485)
       p2 =       -2180  (-2675, -1684)
       p3 =        4874  (3706, 6042)
       p4 =       -5600  (-7100, -4100)
       p5 =        3365  (2225, 4506)
       p6 =      -888.2  (-1410, -366.8)
       p7 =        18.5  (-120.8, 157.8)
       p8 =       9.332  (-10.71, 29.38)
       p9 =      -2.033  (-3.344, -0.721)
       p10 =       5.711  (5.683, 5.739)

Goodness of fit:
  SSE: 0.07685
  R-square: 0.9999
  Adjusted R-square: 0.9999
  RMSE: 0.02139


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楼2011-12-23 15:09:47
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dingd

铁杆木虫 (职业作家)

【答案】应助回帖

感谢参与,应助指数 +1
715211229(金币+1): 有帮助 嗯,是的,用多项式拟合可以拟合的很好,只是这个问题给定了方程,所以有点别扭 2011-12-23 20:05:44
就原数据和模型公式而言,除非改变公式,一楼的结果应该就是最好的了。
3楼2011-12-23 16:05:27
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

715211229

木虫 (正式写手)

引用回帖:
2楼: Originally posted by dbb627 at 2011-12-23 15:09:47:
一定要选你的公式吗
Linear model Poly9:
     f(x) = p1*x^9 + p2*x^8 + p3*x^7 + p4*x^6 +
                    p5*x^5 + p6*x^4 + p7*x^3 + p8*x^2 + p9*x + p10
Coefficients (with 95% confidence boun ...

是的,求给定公式的系数
我是蜗牛
4楼2011-12-23 20:03:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 材料,纺织,生物(0856、0710),化学招生啦 +3 Eember. 2026-03-17 7/350 2026-03-17 20:20 by 花125533
[考研] 材料与化工求调剂 +6 为学666 2026-03-16 6/300 2026-03-17 20:15 by peike
[考研] 材料工程专硕调剂 +5 204818@lcx 2026-03-17 5/250 2026-03-17 17:27 by Little-xue
[考研] 302求调剂 +9 负心者当诛 2026-03-11 9/450 2026-03-17 17:13 by ruiyingmiao
[考研] 332求调剂 +6 Zz版 2026-03-13 6/300 2026-03-17 17:03 by ruiyingmiao
[考研] 285化工学硕求调剂(081700) +9 柴郡猫_ 2026-03-12 9/450 2026-03-17 10:18 by Sammy2
[考研] 机械专硕325,寻找调剂院校 +3 y9999 2026-03-15 5/250 2026-03-16 19:58 by y9999
[考研] 333求调剂 +3 文思客 2026-03-16 7/350 2026-03-16 18:21 by 文思客
[考研] 285求调剂 +6 ytter 2026-03-12 6/300 2026-03-16 15:05 by njzyff
[考研] 277材料科学与工程080500求调剂 +3 自由煎饼果子 2026-03-16 3/150 2026-03-16 14:10 by 运气yunqi
[考研] 327求调剂 +6 拾光任染 2026-03-15 11/550 2026-03-15 22:47 by 拾光任染
[考研] 297一志愿上交085600求调剂 +5 指尖八千里 2026-03-14 5/250 2026-03-14 17:26 by a不易
[考研] 材料080500调剂求收留 +3 一颗meteor 2026-03-13 3/150 2026-03-14 10:54 by peike
[考研] 学硕285求调剂 +13 Wisjxn 2026-03-12 46/2300 2026-03-14 10:33 by JourneyLucky
[考研] 0703,333分求调剂 一志愿郑州大学-物理化学 +3 李魔女斗篷 2026-03-11 3/150 2026-03-13 22:24 by JourneyLucky
[考研] 308求调剂 +5 是Lupa啊 2026-03-11 5/250 2026-03-13 22:13 by JourneyLucky
[考研] 304求调剂 +7 7712b 2026-03-13 7/350 2026-03-13 21:42 by peike
[考研] 311求调剂 +3 冬十三 2026-03-13 3/150 2026-03-13 20:41 by JourneyLucky
[考研] 085600材料与化工 309分请求调剂 +7 dtdxzxx 2026-03-12 8/400 2026-03-13 14:43 by jxchenghu
[考研] 070303一志愿西北大学学硕310找调剂 +3 d如愿上岸 2026-03-13 3/150 2026-03-13 10:43 by houyaoxu
信息提示
请填处理意见