内容发布更新时间 : 2024/12/23 0:36:52星期一 下面是文章的全部内容请认真阅读。
2008信息与计算科学专业计算方法习题参考解答 江世宏编
又 y(xn?1)?y(xn)?y?(xn)h?11y??(xn)h2?y???(xn)h3?? 26欲使其具有尽可能高的局部截断误差,必须
2171从而 ??,?0?,?1??
424171于是数值计算公式为 yn?1?(yn?yn?1)?h(fn?fn?1)。
244该数值计算公式的局部截断误差的主项为
2??1,?0??1???1,
???1?1 21??5y(xn?1)?yn?1?(??1)y???(xn)h3???y???(xn)h3??
662247已知初值问题
?y??2x? ?y(0)?0?y(0.1)?0.01?取步长h?0.1,利用阿当姆斯公式yn?1?yn?h(3fn?fn?1),求此微分方程在[0,10]2上的数值解,求此公式的局部截断误差的首项。(阿当姆斯公式的应用) 解:假设yn?y(xn),yn?1?y(xn?1),利用泰勒展开,有
yn?y(xn),fn?y?(xn),fn?1?y?(xn?1)?y?(xn)?y??(xn)h?y???(xn)312??y(xn)h?h?? 24y???(xn)2h?? 2yn?1?y(xn)?y?(xn)h?11y??(xn)h2?y???(xn)h3?? 26115y(xn?1)?yn?1?(?)y???(xn)h3???y???(xn)h3??
64125y???(xn)h3。 该阿当姆斯两步公式具有2阶精度,其局部截断误差的主项为12取步长h?0.1,节点xn?0.1n(n?0,1,2,?,100),注意到f(x,y)?2x,其计算公
而y(xn?1)?y(xn)?y?(xn)h?式可改写为
0.1?(6xn?2xn?1)?yn?0.02n?0.01 2仅需取一个初值y0?0,可实现这一公式的实际计算。
yn?1?yn?其MATLAB下的程序如下: x0=0;%初值节点 y0=0;%初值
29
2008信息与计算科学专业计算方法习题参考解答 江世宏编
for n=0:99
y1=y0+0.02*n+0.01; x1=x0+0.1;
fprintf('x(=)=.8f,y(=)=.8f\\n',n+1,x1,n+1,y1); x0=x1; y0=y1; end
运行结果如下:
x( 1)=0.10000000,y( 1)=0.01000000 x( 2)=0.20000000,y( 2)=0.04000000 x( 3)=0.30000000,y( 3)=0.09000000 x( 4)=0.40000000,y( 4)=0.16000000 x( 5)=0.50000000,y( 5)=0.25000000 x( 6)=0.60000000,y( 6)=0.36000000 x( 7)=0.70000000,y( 7)=0.49000000 x( 8)=0.80000000,y( 8)=0.64000000 x( 9)=0.90000000,y( 9)=0.81000000 x( 10)=1.00000000,y( 10)=1.00000000 x( 11)=1.10000000,y( 11)=1.21000000 x( 12)=1.20000000,y( 12)=1.44000000 x( 13)=1.30000000,y( 13)=1.69000000 x( 14)=1.40000000,y( 14)=1.96000000 x( 15)=1.50000000,y( 15)=2.25000000 x( 16)=1.60000000,y( 16)=2.56000000 x( 17)=1.70000000,y( 17)=2.89000000 x( 18)=1.80000000,y( 18)=3.24000000 x( 19)=1.90000000,y( 19)=3.61000000 x( 20)=2.00000000,y( 20)=4.00000000 x( 21)=2.10000000,y( 21)=4.41000000 x( 22)=2.20000000,y( 22)=4.84000000 x( 23)=2.30000000,y( 23)=5.29000000 x( 24)=2.40000000,y( 24)=5.76000000 x( 25)=2.50000000,y( 25)=6.25000000 x( 26)=2.60000000,y( 26)=6.76000000 x( 27)=2.70000000,y( 27)=7.29000000 x( 28)=2.80000000,y( 28)=7.84000000 x( 29)=2.90000000,y( 29)=8.41000000 x( 30)=3.00000000,y( 30)=9.00000000 x( 31)=3.10000000,y( 31)=9.61000000 x( 32)=3.20000000,y( 32)=10.24000000 x( 33)=3.30000000,y( 33)=10.89000000 x( 34)=3.40000000,y( 34)=11.56000000 x( 35)=3.50000000,y( 35)=12.25000000 x( 36)=3.60000000,y( 36)=12.96000000 x( 37)=3.70000000,y( 37)=13.69000000 x( 38)=3.80000000,y( 38)=14.44000000 x( 39)=3.90000000,y( 39)=15.21000000 x( 40)=4.00000000,y( 40)=16.00000000 x( 41)=4.10000000,y( 41)=16.81000000 x( 42)=4.20000000,y( 42)=17.64000000 x( 43)=4.30000000,y( 43)=18.49000000 x( 44)=4.40000000,y( 44)=19.36000000 x( 45)=4.50000000,y( 45)=20.25000000 x( 46)=4.60000000,y( 46)=21.16000000 x( 47)=4.70000000,y( 47)=22.09000000
30
2008信息与计算科学专业计算方法习题参考解答 江世宏编
x( 48)=4.80000000,y( 48)=23.04000000 x( 49)=4.90000000,y( 49)=24.01000000 x( 50)=5.00000000,y( 50)=25.00000000 x( 51)=5.10000000,y( 51)=26.01000000 x( 52)=5.20000000,y( 52)=27.04000000 x( 53)=5.30000000,y( 53)=28.09000000 x( 54)=5.40000000,y( 54)=29.16000000 x( 55)=5.50000000,y( 55)=30.25000000 x( 56)=5.60000000,y( 56)=31.36000000 x( 57)=5.70000000,y( 57)=32.49000000 x( 58)=5.80000000,y( 58)=33.64000000 x( 59)=5.90000000,y( 59)=34.81000000 x( 60)=6.00000000,y( 60)=36.00000000 x( 61)=6.10000000,y( 61)=37.21000000 x( 62)=6.20000000,y( 62)=38.44000000 x( 63)=6.30000000,y( 63)=39.69000000 x( 64)=6.40000000,y( 64)=40.96000000 x( 65)=6.50000000,y( 65)=42.25000000 x( 66)=6.60000000,y( 66)=43.56000000 x( 67)=6.70000000,y( 67)=44.89000000 x( 68)=6.80000000,y( 68)=46.24000000 x( 69)=6.90000000,y( 69)=47.61000000 x( 70)=7.00000000,y( 70)=49.00000000 x( 71)=7.10000000,y( 71)=50.41000000 x( 72)=7.20000000,y( 72)=51.84000000 x( 73)=7.30000000,y( 73)=53.29000000 x( 74)=7.40000000,y( 74)=54.76000000 x( 75)=7.50000000,y( 75)=56.25000000 x( 76)=7.60000000,y( 76)=57.76000000 x( 77)=7.70000000,y( 77)=59.29000000 x( 78)=7.80000000,y( 78)=60.84000000 x( 79)=7.90000000,y( 79)=62.41000000 x( 80)=8.00000000,y( 80)=64.00000000 x( 81)=8.10000000,y( 81)=65.61000000 x( 82)=8.20000000,y( 82)=67.24000000 x( 83)=8.30000000,y( 83)=68.89000000 x( 84)=8.40000000,y( 84)=70.56000000 x( 85)=8.50000000,y( 85)=72.25000000 x( 86)=8.60000000,y( 86)=73.96000000 x( 87)=8.70000000,y( 87)=75.69000000 x( 88)=8.80000000,y( 88)=77.44000000 x( 89)=8.90000000,y( 89)=79.21000000 x( 90)=9.00000000,y( 90)=81.00000000 x( 91)=9.10000000,y( 91)=82.81000000 x( 92)=9.20000000,y( 92)=84.64000000 x( 93)=9.30000000,y( 93)=86.49000000 x( 94)=9.40000000,y( 94)=88.36000000 x( 95)=9.50000000,y( 95)=90.25000000 x( 96)=9.60000000,y( 96)=92.16000000 x( 97)=9.70000000,y( 97)=94.09000000 x( 98)=9.80000000,y( 98)=96.04000000 x( 99)=9.90000000,y( 99)=98.01000000 x(100)=10.00000000,y(100)=100.00000000
31
2008信息与计算科学专业计算方法习题参考解答 江世宏编
第七章 线性方程组的迭代解法
姓名 学号 班级
习题主要考察点:雅可比、高斯-塞德尔迭代法解线性方程组,及其收敛性讨论。 1证明:迭代格式错误!未找到引用源。x(k?1)?Bx(k)?f收敛,其中
?0.90??1?B??,f???。(迭代法收敛性判断) ??0.30.8??2?解:
?I?B???0.9?0.30?(??0.9)(??0.8)
??0.8因?(B)?0.9?1,故迭代收敛。
?a11x1?a12x2?b12若用雅可比迭代法求解方程组?(a11a22?0)迭代收敛的充要条件是
ax?ax?b2222?211a12a21?1。(雅可比迭代法的收敛性)
a11a22解:原线性方程组的等价方程组为
a12b1?x?x?12??a11a11 ?ab221?x1?x2??a22?a22其雅可比迭代式为
x(k?1)??0????a21??a22?a12??b1?a11?(k)?a11??x???
?b2?0?????a22??????I?B???a21??a22a12?aaa11????2?1221
a11a22????a12a21aa?1,即1221?1。
a11a22a11a22其收敛的充要条件是?(B)?3 用雅可比、高斯-塞德尔迭代法,求解方程组
?x1?2x2?3 ?3x?2x?42?1
32