提问:数值分析是做什么用的? 输入复杂问题或运算 数值 Ax= b 分析 ∫(x)dx ∫(x), 近似解计算机 +×
• 提问:数值分析是做什么用的? 数值 分析 输入复杂问题或运算 ( ) , ( ), ...... , , ln , , f x dx d f x dx x a x Ax b b a x = + − 近似解 计算机
第一章误差/Eror §1误差的背景介绍/ ntroduction 来源与分类/ Source& Classification 从实际问题中抽象出数学模型 模型误差 Modeling Error- 通过测量得到模型中参数的值 观测误差/ Measurement error 求近似解—方法误差(截断误差/ Truncation Error+) >机器字长有限—舍入误差/* Roundoff error
第一章 误差 /* Error */ §1 误差的背景介绍 /* Introduction */ 1. 来源与分类 /* Source & Classification */ ➢ 从实际问题中抽象出数学模型 —— 模型误差 /* Modeling Error */ ➢ 通过测量得到模型中参数的值 —— 观测误差 /* Measurement Error */ ➢ 求近似解 —— 方法误差 (截断误差 /* Truncation Error */ ) ➢ 机器字长有限 —— 舍入误差 /* Roundoff Error */
8 1 Introduction: Source Classification The following problem can be solved either the easy way or the hard way. Two trains 200 miles apart are moving toward each other; each one is going at a speed of 50 miles per hour. a fly starting on the front of one of them flies back and forth between them at a rate of 75 miles per hour. It does this until the trains collide and crush the fly to death. what is the total distance the fly has flown? The fly actually hits each train an infinite number of times before it gets crushed, and one could solve the problem the hard way with pencil and paper by summing an infinite series of distances. The easy way is as follows: Since the trains are 200 miles apart and each train is going 50 miles an hour it takes 2 hours for the trains to collide. Therefore the fly was flying for two hours. Since the fly was flying at a rate of 75 miles per hour, the fly must have flown 150 miles. That 's all there is to it When this problem was posed to John von Neumann, he immediately replied, 150 miles. It is very strange, said the poser,"but nearly everyone tries to sum the infinite series wWhat do you mean, strange?asked Von Neumann Thats how i did it
§1 Introduction: Source & Classification The following problem can be solved either the easy way or the hard way. Two trains 200 miles apart are moving toward each other; each one is going at a speed of 50 miles per hour. A fly starting on the front of one of them flies back and forth between them at a rate of 75 miles per hour. It does this until the trains collide and crush the fly to death. What is the total distance the fly has flown? The fly actually hits each train an infinite number of times before it gets crushed, and one could solve the problem the hard way with pencil and paper by summing an infinite series of distances. The easy way is as follows: Since the trains are 200 miles apart and each train is going 50 miles an hour, it takes 2 hours for the trains to collide. Therefore the fly was flying for two hours. Since the fly was flying at a rate of 75 miles per hour, the fly must have flown 150 miles. That's all there is to it. When this problem was posed to John von Neumann, he immediately replied, "150 miles." "It is very strange," said the poser, "but nearly everyone tries to sum the infinite series." "What do you mean, strange?" asked Von Neumann. "That's how I did it!
1 Introduction: Source Classification 例:近似计算。e dx=0.747. 解法之一:将e作 Taylor展开后再积分 ed=(1-x2+ 十 2!3:4! 32!53!74!9 取Jd≈S4, 4 R/* Remainder *I 则R由留下部分截断误差/ Truncation Error r* included terms * 这里灬,引起 由截去部分 I excluded terms * S,=1 ≈1-0.333+0.1 1042 引起 舍入误差/ Roundoff error+|<00009×2=0001 计算∫”的总体误差000100
§1 Introduction: Source & Classification e dx x − 1 0 2 例:近似计算 大家一起猜? − e dx 2 x 1 0 1 / e 1 解法之一:将 作Taylor展开后再积分 2 x e − = − + − + − = − + − + − − 9 1 4! 1 7 1 3! 1 5 1 2! 1 3 1 1 ) 2 ! 3! 4! (1 1 0 4 6 8 2 1 0 dx x x x e dx x 2 x S4 R4 , /* Remainder */ 1 0 4 − e dx S 2 x 取 则 = − + 11 1 5! 1 9 1 4! 1 R4 称为截断误差 /* Truncation Error */ 0 005 9 1 4! 1 4 这里 R . 1 0 333 0 1 0 024 0 743 42 1 10 1 3 1 S4 = 1− + − − . + . − . = . | 舍入误差 /* Roundoff Error */ | 0.0005 2 = 0.001 0 005 0 001 0 006 1 0 2 e dx . . . -x + = 计 算 的总体误差 = 0.747… … 由截去部分 /* excluded terms */ 引起 由留下部分 /* included terms */ 引起
1 Introduction: Spread accumulation 2.传播与积累/ Spread& Accumulation 例:蝴蝶效应——纽约的一只蝴蝶翘膀一拍,风和日丽的北京 就利起台风来了?! BJ 以上是一个病态问题/i- posed problem 关于本身是病态的问题,我们还是留给数学家去头痛吧
§1 Introduction: Spread & Accumulation 2. 传播与积累 /* Spread & Accumulation */ 例:蝴蝶效应 —— 纽约的一只蝴蝶翅膀一拍,风和日丽的北京 就刮起台风来了?! NY BJ 以上是一个病态问题 /* ill-posed problem*/ 关于本身是病态的问题,我们还是留给数学家去头痛吧!