一元方程求解
大家看看这个方程有几个解,了解一下各软件求解能力和方便程度:f(x)=1+cos(x*0.5)*cosh(x*0.5)-1.2*x*(sin(x*0.5)*cosh(x*0.5)-cos(0.5*x)*sinh(x*0.5))/0.2-0.13885*x^3*(sin(x*0.5)*cosh(x*0.5)+cos(x*0.5)*sinh(0.5*x))/0.2+1.2*0.1388*x^4*(1-cos(0.5*x)*cosh(0.5*x))/0.04; 1# forcal
这个在于个人,不在于软件.
====================
该方程有无穷个解, 用Mathematica可以瞬间给出想要的解的任意精度位数...... 该问题的来源,参考:http://www.ilovematlab.cn/thread-112134-1-2.html
在simwe的一些讨论,参考:http://forum.simwe.com/thread-968241-1-1.html
或者:http://forum.simwe.com/archiver/tid-968241.html
还没有看到Mathematica 的结果,想必应该比matlab和maple好。 该问题用Forcal的一般解法,只得到8个解:f(x)=1+cos(x*0.5)*cosh(x*0.5)-1.2*x*(sin(x*0.5)*cosh(x*0.5)-cos(0.5*x)*sinh(x*0.5))/0.2-0.13885*x^3*(sin(x*0.5)*cosh(x*0.5)+cos(x*0.5)*sinh(0.5*x))/0.2+1.2*0.1388*x^4*(1-cos(0.5*x)*cosh(0.5*x))/0.04;
fcopt::isolve;-15.72816047166161 -5.21540641784668e-008
-9.49676657269838 5.020410753786564e-010
-2.238482381162303 7.105427357601002e-015
-1.154772991142475 7.771561172376096e-016
1.154772991142476 8.326672684688674e-016
2.238482381162303 -3.552713678800501e-015
9.49676657269838 5.020410753786564e-010
15.72816047166161 -5.21540641784668e-008
8.
调整一下参数,可求得-100~100之间有34个解,当然精度有一定限制。!using["fcopt"];
f(x)=1+cos(x*0.5)*cosh(x*0.5)-1.2*x*(sin(x*0.5)*cosh(x*0.5)-cos(0.5*x)*sinh(x*0.5))/0.2-0.13885*x^3*(sin(x*0.5)*cosh(x*0.5)+cos(x*0.5)*sinh(0.5*x))/0.2+1.2*0.1388*x^4*(1-cos(0.5*x)*cosh(0.5*x))/0.04;
isolve;-97.39279332593736 -1941737534652416
-91.10984398065315 -56459492589568.
-84.8269296373638 1983402475520.
-78.54405871945298 -53783560192.
-72.26124259348666 -441188352.
-65.97849698032296 50053120.
-59.69584426619086 137856.
-53.41331746501707 -40604.
-47.13096740011051 -222.
-40.84887664224738 -0.205078125
-34.56718923728097 -0.24176025390625
-28.2861777067671 2.534866333007813e-003
-22.00652335886718 -3.466010093688965e-005
-15.72816047166162 5.434267222881317e-007
-9.49676657269838 5.020410753786564e-010
-2.238482381162303 7.105427357601002e-015
-1.154772991142476 -5.828670879282072e-016
1.154772991142476 -5.828670879282072e-016
2.238482381162303 7.105427357601002e-015
9.49676657269838 5.020410753786564e-010
15.72816047166162 5.434267222881317e-007
22.00652335886718 -3.466010093688965e-005
28.2861777067671 2.534866333007813e-003
34.56718923728097 -0.24176025390625
40.84887664224738 -0.205078125
47.13096740011051 -222.
53.41331746501707 -40604.
59.69584426619086 137856.
65.97849698032296 50053120.
72.26124259348666 -441188352.
78.54405871945298 -53783560192.
84.8269296373638 1983402475520.
91.10984398065315 -56459492589568.
97.39279332593736 -1941737534652416
34.
-100~100之间共34个解。
验证最后一个解:97.39279332593736f;
f;结果:
-1941737534652416
1812476198912000
可见97.39279332593734~97.39279332593736之间有一个解。 本帖最后由 wayne 于 2011-1-17 16:54 编辑
4# forcal
(-100,100)内, 有34组解:
1.1547729911424755078246243321350814101271648017325,
2.2384823811623027923845144766754306207498027135950,
9.4967665726983808100241325052152900499639885613271,
15.728160471661613996898520315586684956165414771514,
22.006523358867182129325940472982980263853669774423,
28.286177706767095804624774592265217348798171608445,
34.567189237280965770300722081046396255978885779572,
40.848876642247376008486128034509104129462179112661,
47.130967400110504050981488674861495524437394017509,
53.413317465017085042820108603924135015173670501363,
59.695844266190861728373790341417142420162947296318,
65.978496980322946703706863008407331547112552620329,
72.261242593486653305043796548056800603569682893196,
78.544058719452988820724161806071330316301296775868,
84.826929637363818169547559811357128537696474681654,
91.109843980653165951086456813604972532581754586810,
97.392793325937347015611365003952158558839332903409
(-1000,1000) 内有320组解 5# wayne
恩,Forcal同样求得(-1000,1000) 内有320组解(为了准确,分段求解,没有给出结果,只显示解的个数)。!using["fcopt"];
f(x)=1+cos(x*0.5)*cosh(x*0.5)-1.2*x*(sin(x*0.5)*cosh(x*0.5)-cos(0.5*x)*sinh(x*0.5))/0.2-0.13885*x^3*(sin(x*0.5)*cosh(x*0.5)+cos(x*0.5)*sinh(0.5*x))/0.2+1.2*0.1388*x^4*(1-cos(0.5*x)*cosh(0.5*x))/0.04;
main(:i,k)=
{
k=0, i=-1000, while{i<=900,
k=k+isolve,
i=i+100
},
k
};320.
另外,能否给出Mathematica 代码? 本帖最后由 wayne 于 2011-1-17 17:21 编辑
6# forcal
很简单的, 把方程的小数换成分数,然后用Reduce函数就行了,附件里我把第一个根给出了5000位.
6# forcal
很简单的, 把方程的小数换成分数,然后用Reduce函数就行了,附件里我把第一个根给出了5000位.
2444
wayne 发表于 2011-1-17 17:20 http://bbs.emath.ac.cn/images/common/back.gif
谢谢!不过这个代码看不懂,没用过Mathematica ,呵呵。
Mathematica 的任意精度求解的确很强大。 8# forcal
好像对楼上的forcal库有点印象,论坛人气越来越旺了。 9# winxos
呵呵,谢谢您对Forcal的印象。:handshake
页:
[1]