数值分析喻文健部分习题答案

上传人:zw****58 文档编号:42381886 上传时间:2018-06-01 格式:DOC 页数:5 大小:51.50KB
返回 下载 相关 举报
数值分析喻文健部分习题答案_第1页
第1页 / 共5页
数值分析喻文健部分习题答案_第2页
第2页 / 共5页
数值分析喻文健部分习题答案_第3页
第3页 / 共5页
数值分析喻文健部分习题答案_第4页
第4页 / 共5页
数值分析喻文健部分习题答案_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《数值分析喻文健部分习题答案》由会员分享,可在线阅读,更多相关《数值分析喻文健部分习题答案(5页珍藏版)》请在金锄头文库上搜索。

1、第一题:第一题: clear; x=logspace(-16,0); loglog(x,x/2,r-); hold on loglog(x,1./(mldivide(2*10-17,x),b-); loglog(x,x/2+1./(mldivide(2*10-17,x),g-); xlabel(步长 h); ylabel(误差); text(10-12,10-13,截断误差); text(10-5.5,10-13,舍入误差); text(10-10,10-6,总误差限);第四题:第四题: clear; k=1:20; n=10.k; e=(1+1./n).ne =1 至 9 列2.5937 2

2、.7048 2.7169 2.7181 2.7183 2.7183 2.7183 2.7183 2.718310 至 18 列2.7183 2.7183 2.7185 2.7161 2.7161 3.0350 1.0000 1.0000 1.000019 至 20 列1.0000 1.0000 y=e-exp(1)y =1 至 9 列-0.1245 -0.0135 -0.0014 -0.0001 -0.0000 -0.0000 -0.0000 -0.0000 0.000010 至 18 列0.0000 0.0000 0.0002 -0.0022 -0.0022 0.3168 -1.7183 -

3、1.7183 - 1.718319 至 20 列-1.7183 -1.7183 plot(k,y) grid on由图可知,误差并不是随 n 的增大而降低。第五题第五题(1) clear; x=input(enter a number:); enter a number:1 y1=1+x+x2/factorial(2); y2=exp(1); f1=y1-exp(1); e1=abs(f1)/exp(1); disp(f1)-0.2183 disp(e1)0.0803 y3=1+x+x2/factorial(2)+x3/factorial(3); f2=y3-exp(1); e2=abs(f2

4、)/exp(1); disp(f2)-0.0516 disp(e2)0.0190 y4=1+x+x2/factorial(2)+x3/factorial(3)+x4/factorial(4); f3=y4-exp(1); e3=abs(f3)/exp(1); disp(f3)-0.0099 disp(e3)0.0037 y5=1+x+x2/factorial(2)+x3/factorial(3)+x4/factorial(4)+x5/factorial(5); f4=y5-exp(1); e4=abs(f4)/exp(1); disp(f4)-0.0016 disp(e4)5.9418e-04

5、根据以上绝对误差和相对误差的数据分析选四阶泰勒展开式为判停标准。(2) for x=-20:20;if rem(x,5)=0 f1=1+x+x2/factorial(2)+x3/factorial(3)+x4/factorial(4); f2=exp(1); f=f1-f2; disp(f); end end5.5116e+031.6427e+03288.281710.9901-1.718362.6567641.61512.7977e+038.2183e+03(3)不能,正负交替出现抵消现象,计算结果误差较大。 (改程序在琢磨中)(4)当 x clear; tic; p=input(please input p(x)=); please input p(x)=7 6 2 6 3 x=input(please input x=); please input x=2 n=length(p); s(1)=p(1); for i=1:n-1 s(i+1)=s(i)*x+p(i+1); end p=s(n); toc;时间已过 196.889093 秒。

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号