Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sec:4.2 ERROR PROPAGATION.

Similar presentations


Presentation on theme: "Sec:4.2 ERROR PROPAGATION."โ€” Presentation transcript:

1 Sec:4.2 ERROR PROPAGATION

2 Sec:4.2 ERROR PROPAGATION
The purpose of this section is to study how errors in numbers can propagate through mathematical functions. Why? Example: = round-off errors are directly related to the manner in which numbers are stored in a computer. * Numbers such as ฯ€, e, or cannot be expressed by a fixed number of significant figures *numbers on the computer are represented with a binary, or base-2, system. *binary system ๏ƒ  floating point numbers โŠ‚๐‘…๐‘’๐‘Ž๐‘™ ๐‘›๐‘ข๐‘š๐‘๐‘’๐‘Ÿ๐‘  *the gap between adjacent numbers are in a relative sense never larger that eps (machine epsilon). Ex: (1+eps/2)-1 Error = relative error = =2.1๐‘’โˆ’16 *round-off errors originate from the fact that computers retain only a fixed number of significant figures during a calculation.

3 โˆ†๐’‡ ๐’™ =๐’‡โ€ฒ( ๐’™ )๐šซ ๐’™ Sec:4.2 ERROR PROPAGATION
Assume that ๐’™ is an approximation of x. Assume that ๐’™ is an approximation of x. โˆ† ๐’™ =๐’™โˆ’ ๐’™ โˆ† ๐’™ =๐’™โˆ’ ๐’™ Suppose that we want to calculate ๐‘“(๐’™) Suppose that we want to calculate ๐Ÿ๐’™ we would like to estimate ๐’‡(๐’™)โˆ’๐’‡( ๐’™ ) ๐‘ณ๐’†๐’•: โˆ†๐’‡ ๐’™ =๐’†๐’”๐’•๐’Š๐’Ž๐’‚๐’•๐’† ๐’๐’‡ ๐’‡(๐’™)โˆ’๐’‡( ๐’™ ) ๐Ÿโˆ† ๐’™ =๐Ÿ๐’™โˆ’๐Ÿ ๐’™ Zero-order approximation of ๐’‡ the error of the multiplication by 2 is double the error in x ๐’‡ ๐’™ =๐’‡ ๐’™ +๐’‡โ€ฒ(๐ƒ)(x- ๐’™ ) Rearranging terms yields ๐’‡ ๐’™ โˆ’ ๐’‡ ๐’™ =๐’‡โ€ฒ(๐ƒ)(x- ๐’™ ) Example: Given a value of ๐‘ฅ = 2.5 with an error of โˆ† ๐‘ฅ = 0.01, estimate the resulting error in the function, f (x) = ๐‘ฅ 3 . =๐’‡โ€ฒ(๐ƒ)๐šซ ๐’™ โ‰ˆ๐’‡โ€ฒ( ๐’™ )๐šซ ๐’™ Error Propagation in a Function of a Single Variable โˆ†๐’‡ ๐’™ =๐’‡โ€ฒ( ๐’™ )๐šซ ๐’™ โˆ†๐’‡ ๐’™ =๐’‡โ€ฒ( ๐’™ )๐šซ ๐’™ =๐Ÿ‘ (2.5) ๐Ÿ ๐ŸŽ.๐ŸŽ๐Ÿ =๐ŸŽ.๐Ÿ๐Ÿ–๐Ÿ•๐Ÿ“

4 Sec:4.2 ERROR PROPAGATION
If we have a function of two independent variables u and v, the Taylor series can be written as ๐‘“ ๐‘ข ๐‘– +โ„Ž, ๐‘ฃ ๐‘— +๐‘˜ =๐‘“ ๐‘ข ๐‘– , ๐‘ฃ ๐‘— + ๐œ•๐‘“ ๐œ•๐‘ข โ„Ž+ ๐œ•๐‘“ ๐œ•๐‘ฃ ๐‘˜+ 1 2! ๐œ• 2 ๐‘“ ๐œ• ๐‘ข 2 โ„Ž 2 + ๐œ• 2 ๐‘“ ๐œ• ๐‘ฃ 2 ๐‘˜ 2 + ๐œ• 2 ๐‘“ ๐œ•๐‘ข๐œ•๐‘ฃ โ„Ž๐‘˜ +โ€ฆ ๐‘“ ๐‘ข ๐‘–+1 , ๐‘ฃ ๐‘—+1 =๐‘“ ๐‘ข ๐‘– , ๐‘ฃ ๐‘— + ๐œ•๐‘“ ๐œ•๐‘ข ๐‘ข ๐‘–+1 โˆ’ ๐‘ข ๐‘– + ๐œ•๐‘“ ๐œ•๐‘ฃ (๐‘ฃ ๐‘—+1 โˆ’ ๐‘ฃ ๐‘— ) + 1 2! ๐œ• 2 ๐‘“ ๐œ• ๐‘ข ๐‘ข ๐‘–+1 โˆ’ ๐‘ข ๐‘– ๐œ• 2 ๐‘“ ๐œ• ๐‘ฃ 2 (๐‘ฃ ๐‘—+1 โˆ’ ๐‘ฃ ๐‘— ) 2 + ๐œ• 2 ๐‘“ ๐œ•๐‘ข๐œ•๐‘ฃ ๐‘ข ๐‘–+1 โˆ’ ๐‘ข ๐‘– (๐‘ฃ ๐‘—+1 โˆ’ ๐‘ฃ ๐‘— ) +โ€ฆ โˆ†๐’‡ ๐’–, ๐’— = ๐๐’‡ ๐๐’– ๐šซ ๐’– + ๐๐’‡ ๐๐’— ๐šซ ๐’— โˆ†๐’‡ ๐’™ ๐Ÿ , ๐’™ ๐Ÿ ,โ€ฆ, ๐’™ ๐’ = ๐๐’‡ ๐ ๐’™ ๐Ÿ ๐šซ ๐’™ ๐Ÿ + ๐๐’‡ ๐ ๐’™ ๐Ÿ ๐šซ ๐’™ ๐Ÿ +โ€ฆ+ ๐๐’‡ ๐ ๐’™ ๐’ ๐šซ ๐’™ ๐’

5 Sec:4.2 ERROR PROPAGATION
โˆ†๐’‡ ๐’™ ๐Ÿ , ๐’™ ๐Ÿ ,โ€ฆ, ๐’™ ๐’ โ‰ˆ ๐๐’‡ ๐ ๐’™ ๐Ÿ ๐šซ ๐’™ ๐Ÿ + ๐๐’‡ ๐ ๐’™ ๐Ÿ ๐šซ ๐’™ ๐Ÿ +โ€ฆ+ ๐๐’‡ ๐ ๐’™ ๐’ ๐šซ ๐’™ ๐’ Example: ๐‘ญ(๐’™,๐’š,๐’›)= ๐’™ ๐’š ๐Ÿ‘ ๐Ÿ–๐’› Given: ๐‘ฅ = with โˆ† ๐‘ฅ = 30, ๐‘ฆ = with โˆ† ๐‘ฆ = 0.03, ๐‘ง = with โˆ† ๐‘ง = , estimate the resulting error in the function, F

6 โ‰ˆ Sec:4.2 ERROR PROPAGATION Example:
Stability and Condition The condition of a mathematical problem relates to its sensitivity to changes in its input values. Example: How small is ๐œ‹ ๐‘ฅ ๐‘ฅโˆ’22=0 ๐‘ฅ 1 ๐‘ฅ 2 ๐‘ฅ 1 โˆ’ ๐‘ฅ 1 ๐‘ฅ 1 ( โ€ฆ3) ๐‘ฅ ๐‘ฅโˆ’22=0 ๐‘ฅ 2 ๐‘ฅ 2 โˆ’ ๐‘ฅ 2 We would like to drive an equation similar to : We say that a computation is numerically unstable if small changes in the input values produce correspondingly large changes in the final results Condition Number: Relative error in ๐‘“(๐‘ฅ) constant Relative error in ๐‘ฅ โ‰ˆ

7 โ‰ˆ Sec:4.2 ERROR PROPAGATION ๐’™ ๐’‡โ€ฒ( ๐’™ ) ๐’‡ ๐’™
We would like to drive an equation similar to : Condition Number: Condition Number: ๐’™ ๐’‡โ€ฒ( ๐’™ ) ๐’‡ ๐’™ Relative error in ๐‘“(๐‘ฅ) constant Relative error in ๐‘ฅ โ‰ˆ The condition number provides a measure of the extent to which a change in x is magnified by f (x). A value of 1 tells us that the functionโ€™s relative error is identical to the relative error in x. A value greater than 1 tells us that the relative error is amplified Zero-order approximation of ๐’‡ ๐’‡ ๐’™ =๐’‡ ๐’™ +๐’‡โ€ฒ(๐ƒ)(x- ๐’™ ) ๐’‡ ๐’™ โˆ’๐’‡ ๐’™ ๐’‡ ๐’™ โ‰ˆ ๐’™ ๐’‡โ€ฒ( ๐’™ ) ๐’‡ ๐’™ ๐’™โˆ’ ๐’™ ๐’™ Functions with very large values are said to be ill-conditioned.

8 โ‰ˆ โ‰ˆ Sec:4.2 ERROR PROPAGATION Problem 4.12/p105: Sol:
Evaluate and interpret the condition numbers for ๐‘“ ๐‘ฅ = ๐‘ฅโˆ’1 +1 ๐‘ฅ = Sol: ๐‘“ 1 = 1 ๐‘“ = ๐‘ฅโˆ’ ๐‘ฅ ๐‘ฅ =1๐‘’โˆ’5 (Relative error in x) ๐‘“โ€ฒ ๐‘ฅ = (๐‘ฅโˆ’1)/ ๐‘ฅโˆ’ ๐‘ฅโˆ’1 Cond = ๐‘ฅ ๐‘“โ€ฒ( ๐‘ฅ ) ๐‘“ ๐‘ฅ = โˆ— =157.6 (condition number) Relative error in ๐‘“(๐‘ฅ) 157.6 Relative error in ๐‘ฅ โ‰ˆ โ‰ˆ (estimate relative error in f(x)) 1.576๐‘’โˆ’3 (actual relative error in f(x)) ๐‘“ โˆ’๐‘“ 1 ๐‘“ 1 =3.162๐‘’โˆ’3


Download ppt "Sec:4.2 ERROR PROPAGATION."

Similar presentations


Ads by Google