数值方法课件NumericalMethods1章节

上传人:E**** 文档编号:90930364 上传时间:2019-06-20 格式:PPT 页数:93 大小:1.08MB
返回 下载 相关 举报
数值方法课件NumericalMethods1章节_第1页
第1页 / 共93页
数值方法课件NumericalMethods1章节_第2页
第2页 / 共93页
数值方法课件NumericalMethods1章节_第3页
第3页 / 共93页
数值方法课件NumericalMethods1章节_第4页
第4页 / 共93页
数值方法课件NumericalMethods1章节_第5页
第5页 / 共93页
点击查看更多>>
资源描述

《数值方法课件NumericalMethods1章节》由会员分享,可在线阅读,更多相关《数值方法课件NumericalMethods1章节(93页珍藏版)》请在金锄头文库上搜索。

1、Numerical Methods,Prof. Huang, Zhengdong ,Numerical Methods Using MATLAB, Fourth Edition By John H. Mathews and Kurtis D. Fink http:/,Textbook:,Software:,MATLAB , MathWorks Inc.,Plan for the Course,Time: 48h= 40h for lectures of the methods + 8h for Usage of MATLAB,Score: 30% from exercises and MATL

2、AB programming + 70% from the final examination,Please send me your homework, including exercises and programs, in electronic version.,Introduction,In engineering, we need : to calculate many complex mathematical expressions, such as ex, sin(x)ln(1+x2). to find the solutions of many equations, such

3、as design constraints distance(p1,p2)=2.0* distance(p1,p3). 3. to evaluate the performance of a designed product by solving some physical equations, such as differential equations for stress distributions and flow fields.,Introduction,We may already know the math expression, but we more concern the

4、values of variables which appears in engineering practices. This course will introduce the popular methods which let you obtain these values under the help of computers.,Introduction,General numerical methods: Discretion Continuous - Discrete Iteration xk+1=g(xk) Approximation Replaced by simpler on

5、e,Contents,Number representation and error analysis Solving nonlinear equations Solving linear equations Interpolation and approximation 5. Curve fitting Numerical differential Numerical integration Solving differential equations Eigenvalues and eigenvectors,Number Representation & Error Analysis,Bi

6、nary number,Decimal number,1563=1103+5102+6101+3100 =1000+500+60+3 =1563ten,1563=1210+129+028+027+026+025+124 +123+022+121+120 =1024+512+0+0+0+0+16+8+0+2+1 =11000011011two,The number is expressed as the sum of terms of ten to the power of n.,The number is expressed as the sum of terms of two to the

7、power of n.,1563=2781+1, b0=1 781=2390+1, b1=1 390=2195+0, b2=0 195=297+1, b3=1 97=248+1, b4=1 48=224+0, b5=0 24=212+0, b6=0 12=26+0, b7=0 6=23+0, b8=0 3=21+1, b9=1 1=20+1, b10=1 1563=b10b9b8b7b6b5b4b3b2b1b0=11000011011two,Compute binary numbers from decimal numbers:,bi is the remainder,2 is the div

8、isor,The quotient is divided further,The process is ended when the quotient is zero.,R=d12-1+d22-2+dn2-n+ =0.d1d2dn two =0.10110 0110 0110 0110two,Binary fractions:,2R=d1+d22-1+dn2-n+1+ d1=(int)(2R) F1=frac(2R)=d22-1+dn2-n+1+ d2=(int)(2F1) F2=frac(2F1) ,R=d12-1+d22-2+dn2-n+ =0.d1d2dn two R= =0.7=0.1

9、0110 0110 0110 0110two,2R =1.4 d1=int(1.4)=1, F1=frac(1.4)=0.4 2F1=0.8 d2=int(0.8)=0, F2=frac(0.8)=0.8 2F2=1.6 d3=int(1.6)=1, F3=frac(1.6)=0.6 2F3=1.2 d4=int(1.2)=1, F4=frac(1.2)=0.2 2F4=0.4 d5=int(0.4)=0, F5=frac(0.4)=0.4 2F5=0.8 d6=int(0.8)=0, F6=frac(0.8)=0.8 2F6=1.6 d7=int(1.6)=1, F7=frac(1.6)=0

10、.6,x=q2n q=0.d1d2dm two, d1=1 q is the mantissa, n is the exponent For a computer, the number m is fixed, e.g. 32. x=0.1d2dm2n,Machine Numbers,Single-precision real number (32 bits): q=24, n=8 Double-precision real number (64 bits): q=53, n=11,q,n,A binary digit,-0.11010011213,1,1,1,1,0,0,1,1,0,0,0,

11、1,1,1,13ten=+1101two,Floating-point: the binary point position is not fixed!,Machine Accuracy,Its machine number for a 32-bit mantissa machine,The error is the following:,(When chopping-off is adopted. The other is the method of rounding-off),Repeated,See the error from the following example (for 4-

12、bit mantissa):,1.00111 1.010,1.,Rounding:,Rounding:,0.11111*2-1 1.000*2-1=0.1000*20,Error Analysis,Absolute error: Ex=|x-x|, Relative error: Rx=|x-x|/|x|,Suppose x is the accurate number and x is the approximate number. (Suppose they are known),Significant digits, the largest d satisfying : Rx=|x-x|

13、/|x| 0.5101-d,x=3.141592, x=3.14, |x-x|/x=0.0005070.510-2, d=3 x=1,000,000, x=999,996,|x-x|/x=0.0000040.510-5, d=6 x=0.000012, x=0.000009, |x-x|/x=0.250.5100, d=1,x=3.141592, x=3.14, |x-x|/x=0.0005070.510-2, d=3 |3.141592-3.14 |/3.141592=0.000507 0.507*10-3=0.0507*10-20.510-2 - x=3.141592, x=3.1483,

14、 |x-x|/x=0.0021358970.005 =0.510-2 d=3 The two approximations have the same number of significant digits!,For example,The meaning of Significant Digits:,1. R is only determined by the fraction (mantissa) parts; 2. d is the number of the digits that should be maintained for the best approximation.,x=

15、0.343434 X=0.343678 d=4,0.343600 E=0.0001660.0005,The meaning of Significant Digits:,x=0.343434 X=0.343678 d=2, 0.340000 E=0.0034340.005 d=3, 0.343000 E=0.0004340.0005 d=4, 0.343600 E=0.0001660.0005 d=5, 0.343670 E=0.0002360.0005 d=6, 0.343678 E=0.0002440.0005,Effective digits, the largest d satisfying : E=|x-x| 0.510m-d, x= 0.a1a2an10m, a1!=0,Significant digits, the largest d satisfying : Rx=|x-x|/|x| 0.5101-d When x= 0.a1a2an10m, a1!=0 Replacing |x| with 0.110m=10m-1, E=|x-x|x|0.5101-d 10m-10.5101-d =0.510m-d,Eff

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 大学课件

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