数值分析例题

?.?????.??????(?.????)?1.37662 x???.????.?????.??????????.????????.?????????(?.???????.??)?148881 x???.???????????.???????.???????.????.????.???????.???????? x???.???????(?.???????.????)??146348 ?????.???????.???????.???????.??????.????????.???????? x???.???????(?.???????.????)??1.46553 ?????.???????.???????.???????.?????取x?1.46553,f(1.46553)?-0.000145 练习.用单点弦截法解方程

?f(x)?xex?1?0,要求xk?1?xk?0.5?10?5。

(x4=x5=0.56714,过程略)

第五、六章

例1 解线性方程组

?2x1? x2?3x3?1??4x1 ?2x2?5x3?4 ?x?2x ?72?1解:方程的系数矩阵的增广矩阵为

?2-131??1-0.51.50.5??101.3750.75?A??425 4???04-1 2???01?0.25 0.5??????? ∴ xT=( 9,-1,-6 ) ??????1207??02.5-1.56.5??00?0.8755.25???1009???010 ?1?????001?6??例2 解线性方程组

? x1? x2? x3?6? ?12x1?3x2?3x3?15 (6-3)

??18x?3x? x??15123?解 先消去方程组(6-3)中后两个方程中的变量

x1,得同解方程组

?? ???x1?x2?x3?6?15x2?9x3??57 (6-4) 21x2?17x3?93再消去方程组(6-4)中第三个方程中的变量

x2,又得(6-3)的同解方程组

???????x1?x2?x3?6?15x2?9x3??572266x3?55这是一个三角形方程组。由(6-5)容易解出。

x3?3,x2?2,x1?1

例. 用高斯消元法解线性方程组

??x??x???x???????x???x??x????x??x??x???????

解:

3r2?r1?(?)21r3?r1?(?)24?1??214?1??21[A?b]??3214???????00.5?55.5????????124?1???01.52?0.5?? 4?1??211.5r3?r2?(?).5???0???00.5?55.5?????0017?17??

于是有同解方程组

?2x1?x2?4x3??1??0.5x2?5x3?5.5 ? 17x3??17?

回代得解

x3=-1,x2=1,x1=1,原线性方程组的解为X=(1,1,-1)T.

?2x1?x2?4x3??2练习. 用高斯消元法解线性方程组 ?3x?2x?x?2

?123?x?2x?4x??323?1答案:原线性方程组的解为X=(1,0,-1)T.

例 求解线性方程组

?0.5x1?1.1x2?3.1x3?6.0??2.0x1?4.5x2?0.36x3?0.020 (6-12) ?5.0x?0.96x?6.5x?0.96123?式中所有系数均有2位有效数字。

解: 为减小误差,计算过程中保留3位有效数字。按Gauss消去法步骤,第一次消元得同解方程组

?0.5x1?1.1x2?3.1x3?6.0?0.100x2?12.0x3??24.0?

??10.0x2?24.5x3??59.0?第二次消元得

?0.5x1?1.1x2?3.1x3?6.0?0.100x2?12.0x3??24.0 ???1220x3??2460?回代得解

x3?2.02,x1??2.60,x2?2.40,x2?1.00,x1??5.80 x3?2.00

容易验证,方程组(6-12)的准确解为

显然两者相差很大。但若在解方程组前,先把方程的次序交换一下,如把(6-12)改写成

?5.0x1?0.96x2?6.5x3?0.96??2.0x1?4.5x2?0.36x3?0.020 (6-13) ?0.5x?1.1x?3.1x?6.0123?再用Gauss消去法求解,消元后得同解方程组

?5.0x1?0.96x2?6.5x3?0.96?4.12x2?2.24x3??0.364 ??2.99x3?5.99?回代得解

x3?2.00,x2?1.00,x1??2.60

与准确解相同。

例 用列主元素求解线性方程组

x1?x2?x3?6???12x1?3x2?3x3?15??18x?3x?x??15

123?计算过程保留三位小数。

解 按列主元素法,求解过程如下:

116??1?12?3315??? ???183?1?15????183?1?15???第一行与第三行互换????????12?3315??

?116??1?3?1?15???18??第一次消元?????0?12.3335??

??01.1670.9445.167??3?1?15???18?、三行互换?第二??????01.1670.9445.167??

??12.3335??0?3?1?15???18??第二次消元?????01.1670.9445.167??

?03.1429.428??0?

由回代过程得解

x3?3.001,x2?2.000,x1?1.000

??326??x1??4?练习 用高斯列主消去法解线性方程组?10?70??x2???7?

????????5?15????x3????6??答案 x1?0 x2??1 x3?1

??3264??10?707??10-707?r1?r2A??10?70 7???????326 4???????0-0.16 6.1???????????5?156???5?156???02.552.5???10-707??10-707?1r3?(?)r2r2?r325 ?????02.55 2.5???????02.55 2.5????????0-0.166.1???006.26.2?? ? x3?1 x2??1 x1?0例4:用追赶法解三对角线方程组

3r2?(?)r1105r3?r110解:由三对角分解公式有

?1?2x1?x2??x?2x?x?0?123??x2?2x3?x4?0???x3?2x4?1 ?l11?a11?2

u12?a12l11??12 而由“追”公式有 l21?a21??1

l22?a22?l21u12?2?12?32 u23?a23l22??23 l32?a32??1

l33?a33?l32u23?43 u34?a34l33??34 l43?a43??1

l44?a44?l43u34?54

x4?y4?1 x3?y3?u34x4?1 x2?y2?u23x3?1

最后,由“赶”公式得原方程组的解

x1?y1?u12x2?1

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4