【问题标题】:Fitting Data in Mathematica在 Mathematica 中拟合数据
【发布时间】:2020-09-28 13:15:05
【问题描述】:

我想将此数据拟合到三角函数中,因为它是周期性的。 到目前为止,这个立方模型是我最准确的结果。

Data = {{0, 4.042704626}, {1, 2.078666417}, {2, 1.174751826}, {3, 
    0.3352687769}, {4, 0.2094025098}, {5, 0.0614347256}, {6, 
    0.06293313355}, {7, 0.1011425361}, {8, 0.2648436037}, {9, 
    0.385090841}, {10, 0.9986888931}, {11, 1.678591497}, {12, 
    2.508709496}, {13, 2.891178123}, {14, 3.06799026}, {15, 
    4.494100019}, {16, 6.881438472}, {17, 8.603483798}, {18, 
    9.519011051}, {19, 10.42667166}, {20, 11.2448024}, {21, 
    11.1889867}, {22, 10.53343323}, {23, 7.246675407}};
model = a*x^3 + b*x^2 + c*x + d;
fit = NonlinearModelFit[Data, model, {a, b, c, d}, x]
Show[ListPlot[Data, PlotStyle -> Red], Plot[fit[x], {x, 0, 23}]]

【问题讨论】:

  • 你还没有问过问题。

标签: wolfram-mathematica


【解决方案1】:

五次模型会更好。

model = a*x^5 + b*x^4 + c*x^3 + d*x^2 + e*x + f;
fit = NonlinearModelFit[Data, model, {a, b, c, d, e, f}, x]
Show[ListPlot[Data, PlotStyle -> Red], Plot[fit[x], {x, 0, 23}]]

【讨论】:

    猜你喜欢
    • 2012-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-07
    • 1970-01-01
    • 2021-10-06
    • 1970-01-01
    相关资源
    最近更新 更多