11、 对于积分En?nx?1x?edx(n=0,1,2…)为何用递推公式En?1?nEn,计算不稳定,0应如何改进?(计算过程保留六位有效数字)
11n解:利用分部积分En?容易算出E1??x0ex?1dx?xenx?110?n?xn?1ex?1dx?1?nEn?1
01,取六位有效数字0.367879推出: eE2?0.264242 …… E9??0.0684800
?0?xnex?1?1 故E9?0绝对错误,现分析误差传播: E1?E1??
'E2?1?2E1?1?2(E1??)?1?2E1?2??E2?2? E3?1?3E2?1?3(E2?2?)?1?2E2?3?2??E3?2?3?
依此类推E9?E9?9!?,误差急剧放大。 改进算法:En?1?计算结果如下:
?''''''19!若任取E20?0为出发值,误差可变为原来的倍,(1?En),
n20!?E20?0
E19?0.05000 0… E9?0.0916123?E9
N?12、 对很大的正数N,如何构造算法,使
N?1N?1dx的计算过程稳定 21?x解:
N?1dx?arctan(N?1)?arctanN 1?x2tan(???)?tan??tan?tan??tan? ????arctan
1?tan?tan?1?tan?tan?x?y 1?xy令x?tan?,y?tan?,则arctanx?arctany?arctanN?1?
N?1111dx?arctan?arctan? 2221?N(N?1)1?xNN
xndx(n=0,1,2…)并说明两种方法的优劣 3、 构造两种递推公式计算In??x?50解:In?5In?11xn?5xn?11??dx??xn?1dx?,从而得出两种递推公式:
x?5n0011 算法1:In?1?5In?1,取I0?ln1.2,有误差?,到In误差放大了(?5)n倍,算n法不好
算法2:In?1?11(?In),任取I2n,即使有误差?,到In的时候,缩小到了原5n1n来的(?),算法很好
5
?11??x1??6??4??????4、 用平方根法解方程组??14.252.75??x2????0.5?
?12.753.5??x??1.25????3????11??4??4?1?16?0 解:A???14.252.75? ?1?4?0,?2??14.25?12.753.5????3?detA?16?0,故A对称正定 l11??a11?1222?a?a?,l21???21l?,l22?a22?l21,l31?31l
11??11??1l32?a?ll??323121l22,l33?a33?l?231?l322?
12?2???由Cholesky分解求得L???0.52?
?0.51.51???由Ly?b解得y??30.5?1?,再由LTx?y解得x??211?
TT
5、 为什么在用Gauss消去法解线性方程组时,选主元法稳定,试举例说明。
解:主元是Gauss消去法消元与回代过程中的分母,分母过小会放大误差,故应选绝对
值最大者为主元。现举例说明:
计算过程保留两位有效数字 解??0.0010x1?0.12x2??0.24
0.10x?0.24x?0.5912?~?0.0010增广矩阵为A,b???0.10???0.12?0.24?
0.240.59??回代x2?25?0.24?0.12?2.1?2.1,x1??12 120.10与准确解x1?1.07?,x2?2.00?相差很远 现改为选主元的方法:
?0.10?0.0010?回代x2?
0.59??0.100.240.59?? ????0.12?0.24??0?0.12?0.25?0.24?0.250.59?0.2?2.10.59?0.50?2.1,x1???0.90
?0.120.100.10可得到比较接近准确的解。
?30?2???8、设A??021?,若用Gauss-Seidel方法解方程Ax?b时,是否收敛?
??212??? 解:对Gauss-Seidel方法迭代矩阵
2??00???13?300??002????????1 G??020??00?1??00??
?2???212??000??11??????00?12??112113 det(?I?G)?????0 ?1,2?0,?3?
12121 ?(G)?,故Gauss-Seidel法收敛。
12
?x1?0.4x2?0.4x3?1?9、设方程组?0.4x1?x2?0.8x3?2,试考察用Jacobi法求解的收敛性
?0.4x?0.8x?x?3123?
?10.40.4??? 解:A?0.410.8?D?L?U ????0.40.81???1??1?
其中D?diag?111? , E????1???00??0?00.40.4????? L???0.400? U???000.8?
?0.40.80??000????? Jacobi法迭代矩阵
?0.4?0.4??0???10?0.8? B?D(L?U)???0.4??0.4?0.80???? det(?I?B)?0.40.40.4?0.8?(??0.8)(?2?0.8??0.32)?0
0.40.8? 故?1?0.8,?2,3??0.4?0.48 ?(B)?0.4?0.48?1.09?1 故用Jacobi法解此方程组不收敛。
4x1?x2??2x?4x?x?12310、用追赶法求解线性方程组??2x2?4x3?x4?2x3?4x4??41??1?241??l???2解:??241?????24??? u1?b1 , li? 计算出后回代
?4?3?2?1c2u3??? c3??u4??a1?2??b1?4 ?c?1?1(过程可用分数计算)
1l31l4??u1c1??u2??????1??ai , i?2,3,4 ui?bi?lici?1 , i?2,3,4 ui?1?x?y4?y1?f1u4?4 ? ?
(y?cx)i?3,2,1ii?1?yi?fi?liyi?1i?2,3,4?xi?iui?
11、已知函数的观测数据为右表:
利用Newton均差求解插值多项式N3(x)
x y 0 5 1 -9 2 -5 3 35 解:N3(x)?f(x0)?f?x0,x1?(x?x0)?f?x0,x1,x2?(x?x0)(x?x1)
?f?x0,x1,x2,x3?(x?x0)(x?x1)(x?x2)
其中f?x0,x1??f(x0)?f(x1)f(x0)?f(x2) , f?x0,x2??
x0?x1x0?x2 f?x0,x3??f(x0)?f(x3)
x0?x3f?x0,x1??f?x0,x2?f?x0,x1??f?x0,x3? , f?x0,x1,x3??
x1?x2x1?x3f?x0,x1,x2??f?x0,x1,x3?
x2?x3 f?x0,x1,x2?? f?x0,x1,x2,x3??
13、已知函数的观测数据为右表:
求解Lagrange插值多项式L3(x) 解:L3(x)?x y 0 5 1 -9 2 -5 3 35 (x?x1)(x?x2)(x?x3)f(x0)
(x0?x1)(x0?x2)(x0?x3)(x?x0)(x?x2)(x?x3)f(x1)
(x1?x0)(x1?x2)(x1?x3)(x?x0)(x?x1)(x?x3)f(x2)
(x2?x0)(x2?x1)(x2?x3)(x?x0)(x?x1)(x?x2)f(x3)
(x3?x0)(x3?x1)(x3?x2) ? ? ?
14、设已知函数f(x)的数值如下: