- 注册时间
- 2009-2-12
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 22697
- 在线时间
- 小时
|
发表于 2019-5-11 08:25:59
|
显示全部楼层
跟KeyTo9_Fans答案不一致的原因找到了,原因是前面的拟合函数报了warning,没关注,设置更高的计算精度后就跟KeyTo9_Fans完全一样。
nlm = NonlinearModelFit[data, E^(a + c n) Cos[b + d n], {a, b, c, d}, n, WorkingPrecision -> 50] 我来秀一下:
这个是Fans的结果:
$a=-1.27483729+0.35498486i$,$b=0.93338020+1.13248522i$
这个是我的:
\[ a = -1.2748373416548137601939656027607260609539677534973 +
0.354984875064525930534409910078275152662157966757 I\]
\[ b =0.9333801995869310465628603640680169309656399643975 +
1.1324852222262455048500390346150772548588801289209 I\]
拟合效果很好,误差全部都在1左右【怀疑是某人有意引入的常熟噪声】。
- ans = nlm["FitResiduals"];
- Table[{data[[i]], Round[nlm[i]], N[ans[[i]], 10]}, {i, Length[data]}] // Column
复制代码- {{1,0},-2,1.591923058}
- {{2,-1},0,-0.7739055108}
- {{3,2},3,-1.006494478}
- {{4,5},6,-1.099349367}
- {{5,4},5,-0.9108724352}
- {{6,-5},-4,-1.031123080}
- {{7,-19},-18,-1.014406800}
- {{8,-26},-25,-0.9730619182}
- {{9,-9},-8,-1.016659604}
- {{10,38},39,-0.9980678063}
- {{11,89},90,-0.9939394848}
- {{12,83},84,-1.006150156}
- {{13,-38},-37,-0.9974832616}
- {{14,-251},-250,-0.9993258140}
- {{15,-388},-387,-1.001752911}
- {{16,-185},-184,-0.9987936791}
- {{17,489},490,-1.000231692}
- {{18,1310},1311,-1.000359288}
- {{19,1391},1392,-0.9995810055}
- {{20,-226},-225,-1.000196346}
- {{21,-3419},-3418,-1.000024360}
- {{22,-5897},-5896,-0.9998877202}
- {{23,-3646},-3645,-1.000086009}
- {{24,5893},5894,-0.9999775836}
- {{25,18852},18853,-0.9999794945}
- {{26,22499},22500,-1.000028182}
- {{27,1397},1398,-0.9999850943}
- {{28,-45850},-45849,-0.9999998346}
- {{29,-88601},-88600,-1.000007064}
- {{30,-66650},-66649,-0.9999939538}
- {{31,66401},66402,-1.000001961}
- {{32,267499},267500,-1.000001108}
- {{33,356346},356347,-0.9999981293}
- {{34,89093},89094,-1.000001107}
- {{35,-601156},-601155,-0.9999999091}
- {{36,-1314097},-1314096,-0.9999995648}
- {{37,-1158383},-1158382,-1.000000419}
- {{38,667774},667775,-0.9999998385}
- {{39,3741407},3741408,-0.9999999452}
- {{40,5546110},5546111,-1.000000122}
- {{41,2295309},2295310,-0.9999999193}
- {{42,-7659985},-7659984,-1.000000013}
- {{43,-19242814},-19242813,-1.000000026}
- {{44,-19424251},-19424250,-0.9999999714}
- {{45,5183236},5183237,-1.000000013}
- {{46,51510283},51510284,-1.000000002}
- {{47,84994109},84994110,-0.9999999918}
- {{48,47724838},47724839,-1.000000005}
- {{49,-93962793},-93962792,-0.9999999986}
- {{50,-278192026},-278192025,-0.9999999991}
- {{51,-316948183},-316948182,-1.000000003}
- {{52,7481795},7481796,-0.9999999999}
- {{53,696584794},696584795,-0.9999999990}
- {{54,1284243205},1284243206,-0.9999999969}
- {{55,897124796},897124797,-0.9999999949}
- {{56,-1091185001},-1091185000,-0.9999999990}
- {{57,-3969137799},-3969137798,-1.000000008}
- {{58,-5059320802},-5059320801,-1.000000016}
- {{59,-896122801},-896122800,-1.000000014}
- {{60,9223520798},9223520799,-0.9999999918}
- {{61,19148102197},19148102198,-0.9999999553}
- {{62,15880024999},15880025000,-0.9999999350}
- {{63,-11595475198},-11595475197,-0.9999999736}
- {{64,-55847123195},-55847123194,-1.000000086}
- {{65,-79279775196},-79279775195,-1.000000212}
- {{66,-27717201805},-27717201804,-1.000000210}
- {{67,119005171781},119005171782,-0.9999999461}
- {{68,281849271974},281849271975,-0.9999994672}
- {{69,269841077191},269841077192,-0.9999991377}
- {{70,-103296164762},-103296164761,-0.9999995225}
- {{71,-773991685711},-773991685710,-1.000000903}
- {{72,-1222385870117},-1222385870116,-1.000002628}
- {{73,-614939096838},-614939096837,-1.000002938}
- {{74,1484734623749},1484734623750,-0.9999999669}
- {{75,4096051276412},4096051276413,-0.9999939224}
- {{76,4448641619615},4448641619616,-0.9999890064}
- {{77,-517205183711},-517205183710,-0.9999924168}
- {{78,-10546632703490},-10546632703489,-1.000008637}
- {{79,-18574120415809},-18574120415808,-1.000031128}
- {{80,-11958924148226},-11958924148225,-1.000038933}
- {{81,17679034154781},17679034154782,-1.000007427}
- {{82,58758711422303},58758711422304,-0.9999345878}
- {{83,71612721831554},71612721831555,-0.9998665814}
- {{84,7133900402693},7133900402694,-0.9998907161}
- {{85,-140916567005948},-140916567005947,-1.000071188}
- {{86,-278421900662501},-278421900662500,-1.000347949}
- {{87,-216251955890803},-216251955890802,-1.000484478}
- {{88,195952611374950},195952611374951,-1.000176844}
- {{89,831543034934199},831543034934200,-0.9993527179}
- {{90,1130264280112550},1130264280112551,-0.9984870565}
- {{91,319020589694201},319020589694202,-0.9985699039}
- {{92,-1838739336727501},-1838739336727500,-1.000424856}
- {{93,-4119567241468454},-4119567241468453,-1.003566762}
- {{94,-3730112774547707},-3730112774547706,-1.005524463}
- {{95,1909173213954044},1909173213954045,-1.002882415}
- {{96,11597592566697703},11597592566697704,-0.9944231374}
- {{97,17538099368759817},17538099368759818,-0.9845957242}
- {{98,7761446362655774},7761446362655775,-0.9834961411}
- {{99,-23283418786755793},-23283418786755792,-1.000202792}
- {{100,-60180557084869090},-60180557084869089,-1.031362254}
- {{101,-62196684029528891},-62196684029528890,-1.054257476}
- {{102,13505845479440215},13505845479440216,-1.036373343}
- {{103,159166505380593986},159166505380593987,-0.9642556037}
- {{104,268037901015551749},268037901015551750,-0.8739259150}
- {{105,157562234185046436},157562234185046437,-0.8486311619}
- {{106,-283148017690539517},-283148017690539516,-0.9611227490}
- {{107,-867914658271731691},-867914658271731690,-1.186396681}
- {{108,-1010366775781790362},-1010366775781790361,-1.366501964}
- {{109,-16866334004565593},-16866334004565592,-1.305411751}
- {{110,2144563117739495974},2144563117739495975,-0.9635325647}
- {{111,4039710885797583617},4039710885797583618,-0.5664322777}
- {{112,2922380877844443595},2922380877844443595,-0.4212084115}
- {{113,-3245026791688070406},-3245026791688070405,-0.5076415375}
- {{114,-12351681673069593595},-12351681673069593595,-0.3547032737}
- {{115,-16068746645023550404},-16068746645023550404,0.2155862028}
- {{116,-3394419058110330001},-3394419058110330001,-0.2155862028}
复制代码
由此可以至少得出两个结论,
1)这些数据是经过Fans的执果索因,精心设计和模拟出来的。
2)Fans的计算很准确,只是不够精确而已,应该用高精度计算。这个算是回答了根本问题了吧,
|
|