EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

Size: px
Start display at page:

Download "EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science"

Transcription

1 EAD 115 Numerical Solution of Engineering and Scientific Problems David M. Rocke Department of Applied Science

2 Computer Representation of Numbers Counting numbers (unsigned integers) are the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, In almost all computers, these numbers are represented in binary (base 2) rather than decimal. We count 0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001,

3

4 Fixed length Integers Data storage is generally in bytes, where 1 byte = 8 bits. With one-byte integers, the smallest integer that can be stored is 0, and the largest is = = 255. Internet IP addresses consist of four bytes, so that no part of an IP address exceeds 255 (UC Davis is ).

5 The IP address looks like this in binary:

6 More Unsigned Integers Two-byte or 16 bit short integers can represent any whole number from 0 to 65,535 Long integers of four bytes or 32 bits can represent any whole number from 0 to 4,294,967,296 If each disk block has an address of a long integer, and each disk block has 4,196 bytes, then the disk can hold 16TB

7 Application: Digital Audio Uncompressed digital audio can be represented as a sequence of loudness levels A pure tone has a sequence that evolve as a sine wave The loudness levels can be represented as unsigned integers, giving all possible values

8 Pure Tone

9 6-bit Audio

10 Sampling Rate The sampling rate is the number of times per second that a loudness measure is taken CD s are 44,100 times per second (44.1 khz) Digital recordings are typically 44.1, 48, 96, or 192 khz

11 Word Length 8-bit audio has loudness levels that exist in 2 8 = 256 discrete levels. This is crude 16-bit audio has 2 16 = 65,536 loudness levels. This is what is used for CD s Audio is often now recorded in 24-bit audio, which has 16,777,216 levels, and is difficult to distinguish from the smooth original

12 Loudest Sound In 16-bit audio, the loudest sound that can be recorded has a numerical value of 65,536 If the input in a recording goes over this level, it is still recorded at 65,536 This leads to distorted sound, which is much more unpleasant than analog overload distortion (as with Jimi Hendrix)

13 Pure Tone with no Headroom

14 Signed integers 16 bit signed integers can represent any whole number from -32,767 to 32,767

15 Integer Overflow Suppose we are using one-byte signed integers, which can represent any whole number from -128 to 128. What happens when we add 100 and 100? The answer should be 200, but = which has nine bits, so is probably truncated to or 72

16 Decimal Numbers Decimal numbers or floating point (vs. fixed point) are represented in scientific notation. 1,437,526 = Exponent +7 mantissa We represent this in binary on a computer

17 Typical single/double precision: 1 sign bit 8/11 exponent bits (one sign) 23/52 bit mantissa

18 Hypothetical 7-bit Reals 1 sign bit 3 exponent bits 3 mantissa bits Mantissa normalized to be between 0.5 and 1 to avoid wasting bits (we don t want to use a mantissa of 001 when we could use a mantissa of 100 instead since 100 and 101 (for example) look the same when truncated. (We could omit leading 1.)

19

20 Smallest Positive Number Sign 0 (positive) Exponent sign 1 (negative) Exponent magnitude 11 (3 in decimal) Mantissa, smallest normalized is 100 (next smallest is 011 which has a leading 0). 100 represents 2-1 = 0.5 in decimal. Smallest positive number is = 2-4 = 1/16 If we divide this by 2 we get 0 (underflow)!

21 Largest Positive Number Sign 0 (positive) Exponent sign 0 (positive) Exponent magnitude 11 (3 in decimal) Mantissa, largest normalized is = =0.875 in decimal. Largest positive number is = 7 If we multiply this by 2 we get overflow!

22 Many Numbers Cannot be Represented Exactly 1/3 in our 7-bit real has the following representation: This is.3125 instead of because that is as close as it can get When multiplied by 3, the result is instead of 1 (3)(1/3) = !

23 Limitations of Floating Point There is a limited range of quantities that can be represented There is only a finite number of quantities that can be represented in a given range Chopping = truncation or rounding of numbers that cannot be represented exactly

24 Machine Epsilon Machine epsilon is the largest computer number ε such that (1 + ε) - 1 = 0 Excel uses double precision, which has 52 bit mantissa. Machine epsilon is about this size:

25 Some Excel Arithmetic ε (1 + ε) - 1 1E-13 1E-13 1E E-14 5E E-15 1E-15 0

26 Precision and Accuracy Precision means the variability between estimates Accuracy means the amount of deviation between the estimate and the true value

27

28 Errors of approximation True Value = Approximation + Error E T = TV Approx (True) Relative error is ε T = E T / TV Absolute (relative) error is the absolute value of the (relative) error ε A = E A / Approximation Both the error and the relative error can matter

29 Example True Value = 20 Approximation = 20.5 E T = TV Approximation = -0.5 (True) Relative error is ε T = E T / TV = -0.5/20 = or -2.5% E A = E T = 0.5 ε A = or 2.5%

30 (Series) truncation error e e x x 2 3 x x = 1+ x ! 2 3 x x 1+ x !

31 Roundoff Error Results from the approximate representation of numbers in a computer Accumulation over many computations Addition or subtraction of small and large numbers

32 n -1 x = n å xi i= 1 n = ( -1) å ( i - ) i= 1 s n x x n = - å i - i + i= 1 s ( n 1) ( x 2 xx x ) n n = ( -1) å i -2( - 1) å i + ( -1) i= 1 i= 1 s n x n x x n nx n = ( -1) å i -2( - 1) + ( -1) i= 1 s n x n nx n nx n = ( -1) å i -( -1) i= 1 s n x n nx

33 Shortcut or Mistake? The variance of the data set {1,2,3,4,5} is 2.5. The variance of the data set (100,000,001, 100,000,002, ) is the same because the spacing has not changed The shortcut formula gives 2 for the variance in Excel If the sequence starts 1,000,000,001, the variance by the shortcut is 0!

34 Taylor s Theorem Can often approximate a function by a polynomial The error in the approximation is related to the first omitted term There are several forms for the error We will use this kind of analysis extensively in this course

35 ( n) f ''( a) 2 f ( a) n f ( x) = f( a) + f '( a)( x- a) + ( x- a) + + ( x- a) + R 2! n! x n ( x-t) ( n+ 1) Rn = f () t dt R= ò a n! ( x-a) ( n + 1)! n+ 1 ( n+ 1) x is between x and a f ( x) n ( n) f ''( x) 2 f ( x) n f ( x+ h) = f( x) + f '( x) h+ h + + h + R 2! n! n+ 1 h ( n+ 1) R= f ( x) ( n + 1)! n

36 Series Truncation Error In general, the more terms in a Taylor series, the smaller the error In general, the smaller the step size h, the smaller the error Error is O(h n+1 ), so halving the step size should result in a reduction of error that is on the order of 2 n+1 In general, the smoother the function, the smaller the the error

37

38 Taylor Series Approximation of a Polynomial f x =- x - x - x - x ( ) f (0) = 1.2 f (1) = 0.2 f (1) = 1.2 f '(0) =-0.25 f f f (1) = f(0) (1) = = 0.95 ''(0) =-1 2 (1) (1) = = = !

39 f x =- x - x - x - x ( ) f(0) = 1.2; f '(0) =- 0.25; f ''(0) =- 1; f '''(0) =-0.9 f f n ( n) ''''(0) =- 2.4; (0) = 0, > 4 f( x) ( x) ( 1/2)( x) 2 = (- 0.9 / 6)( x) + (-2.4 / 24)( x) 3 4 f ( x) = ( x) + (-1/2)( x) 2 f x =- x -.25x ( )

40 f x =- x - x - x - x ( ) f(1) = 0.2; f '(1) =- 0.25; f ''(1) =- 2.2; f '''(1) =-3.3 f =- f = n> ( n) ''''(1) 2.4; (1) 0, 4 2 = f( x) ( x 1) ( 2.2 / 2)( x 1) (-3.3/ 6)( x- 1) + (-2.4 / 24)( x-1) 3 4 f x = - x+ - x + x ( ) f x x x 2 2( ) =

41 Approximating Polynomials Any fourth degree polynomial has a fifth derivative that is identically zero The remainder term for the order four Taylor series contains the fourth derivative at a point. Thus the order four Taylor series approximation is exact; that is, it is the polynomial itself.

42 The Taylor approximation of order n to a function f(x) at a point a is the best polynomial approximation to f() at a in the following sense: It is a polynomial It is of order n or less (no terms higher than x n It matches the value and first n derivatives of f() at a. ˆ f n ( x; a)

43 Taylor Series and Euler s Method dv c = g- v dt m v''( x) v'''( x) vx ( h) vx ( ) v'( xh ) h h 2! 3! c v'( x) = g- v( x) m = c gc æcö v''( x) =- v'( x) =- + ç v( x) m m çèm ø 2

44 dv dt = g- c m v dv vt ( ) = vt ( ) + ( t - t) + R dt i+ 1 i i+ 1 i 1 æ c ö vt ( ) vt ( ) + g vt ( ) ç - t -t çè m ø ( ) i+ 1 i i i+ 1 i v''( x) ( ) 2 v''( x) R = t - t = h 2 = O( h 2 ) 1 i+ 1 i 2! 2

45 Nonlinearity and Step Size For the first-order Taylor approximation, the more nearly linear the function is, the better the approximation The smaller the step size, the better the approximation

46 f( x) = x m f '( x) = mx m-1 f ( x+ h) = f( x) + f '( x) h+ R m m- m f ''( x) ( 1) x R = h = h 1 2! 2! 1

47

48 Numerical Differentiation f ( xi+ 1) = f( xi) + f '( xi)( xi+ 1- xi) + Oé êë ( xi+ 1-xi) f '( xi)( xi+ 1- xi) = f( xi+ 1) - f( xi) + Oé êë ( xi+ 1-xi) f( x )- f( x ) f x Oé x x ù û i+ 1 i '( i) = + ( i+ 1 - i) ( xi+ 1 - xi) ë Dfi f '( xi ) = + O( h) h 2 2 ù úû ù úû First Forward Difference

49 f ( x ) = f( x )- f '( x ) h+ O( h ) i-1 i i f( x )- f( x ) f '( x ) = i i-1 + O( h) i h f f '( x ) = i + O( h) i h 2 First Backward Difference

50 f x f x f x h f x h O h 2 3 ( i+ 1) = ( i) + '( i) ''( i) + ( ) f x f x f x h f x h O h 2 3 ( i-1 ) = ( i) - '( i) ''( i) + ( ) f x f x f x h O h 3 ( i+ 1) - ( i-1) = 2 '( i) + ( ) f( xi+ 1) - f( xi- 1) = f x + O h 2h f( x )- f( x ) f x = + O h 2h 2 '( i ) ( ) i+ 1 i-1 2 '( i ) ( ) First Centered Difference

51

52 f x =- x - x - x - x ( ) h= 0.5; x = 0.5 i f(0.5) =.925; f '(0.5) = f(0) = 1.2; f(1) = 0.2 f '(0.5) ( ) /.5 =-1.45 e =- ( ) /.9125 =.589 f '(0.5) ( ) /.5 =-.55 e =- ( ) /.9125 =.397 f '(0.5) ( ) / (2)(.5) =-1.00 e =- ( ) /.9125 =.096

53 f x =- x - x - x - x+ h ( ) = 0.25; x = 0.5 i f(0.5) =.925; f '(0.5) = f(.25) = ; f(.75) = f '(0.5) ( ) /.5 = e =- ( ) /.9125 =.265 f '(0.5) ( ) /.5 =-.714 e =- ( ) /.9125 =.217 f '(0.5) ( ) /.5 = e =- ( ) /.9125 =.024

54 Summary of Example h = 0.5 h = 0.25 Forward Backward Centered Relative Error

55 Second Differences f x f x h h f x f x ''( i) D ( i) / = D ( i+ 1) - ( i) ( ) f x h é êë f x f x f x f x -2 f ''( xi) h éf( xi+ 2) - 2 f( xi+ 1) + f( xi) ù ë û -2 ''( i) ( i+ 2) - ( i+ 1) - ( i+ 1) - ( i) ( ) ( ) ù úû

56 D f = f - f If i Ff i i i+ 1 i = = f i+ 1 ( F- I) f = f - f D= ( F-I) i f i i+ 1 i D = ( F - I) = F - 2FI+ I = F - 2F+ I

57 f = f - f = ( I-B) f i i i-1 i f = ( I- B) f = ( I- 2 B+ B ) f i i i 2 fi = fi- 2 fi- 1+ fi D = - + = - + B ( F 2 F I) B ( F 2 I B) 2 2 = - + = - + F ( I 2 B B ) F ( F 2 I B) f = f - f = ( F-B) f i i+ 1 i-1 i i i i 2 f = ( F- B) f = ( F - 2 FB+ B ) f f = f - 2 f + f i i+ 2 i i-2

58 Second Derivatives f x f x f x h f x h O h 2 3 ( i+ 2) = ( i) + '( i)(2 ) ''( i)(2 ) + ( ) f x f x f x h f x h O h 2 3 ( i+ 1) = ( i) + '( i)( ) ''( i)( ) + ( ) f( xi+ 1) = 2 f( xi) + 2 f '( xi)( h) + f ''( xi)( h) + O( h ) f x f x f x f x h O h 2 3 ( i+ 2) - 2 ( i+ 1) =- ( i) + ''( i)( ) + ( ) f( xi+ 2) - 2 f( xi+ 1) + f ''( xi ) = 2 h 2 D fi f ''( xi ) = + O( h) 2 h f( x ) i + Oh ( ) Second Forward Difference

59 Second Derivatives f( x )- 2 f( x ) + f( x ) f x O h h 2 fi f ''( xi ) = + O( h) 2 h i i-1 i-2 ''( i ) = + ( ) 2 Second Backward Difference

60 Second Derivatives f( xi+ 1) - 2 f( xi) + f( xi- 1) f ''( xi ) = + O( h) 2 h 2 fi f ''( xi ) = + O( h) 2 h Second Centered Difference

61 Propagation of Error Suppose that we have an approximation of the quantity x, and we then transform the value of x by a function f(x). How is the error in f(x) related to the error in x? How can we determine this if f is a function of several inputs?

62 x x x = x+ e f ''( x) f( x ) = f( x) + f '( x) e+ e 2 + 2! f( x )- f( x) f '( x) e If the error is bounded e < B f( x )- f( x) < f '( x) B If the error is random with standard deviation SD( x ) = s s SD( f ( x )) f '( x) s

63 x x x = x + e x x x = x + e f( x, x ) = f( x, x ) + f ( x, x ) e + f ( x, x ) e f( x, x )- f( x, x ) f ( x, x ) e + f ( x, x ) e If the errors are bounded e i < B i f( x, x ) f( x, x ) f ( x, x ) B f ( x, x < ) B2

64 Stability and Condition If small changes in the input produce large changes in the answer, the problem is said to be ill conditioned or unstable Numerical methods should be able to cope with ill conditioned problems Naïve methods may not meet this requirement The condition number is the ratio of the output error to the input error

65 x = x+ e The error of the input is e. e/ x e/ x is the relative error of the input. The error of the output is f( x )- f( x) e f '( x) and the relative error of the output is f( x ) - f( x) ef '( x) ef '( x ) f( x) f( x) f( x ) The ratio of the output RE to the input RE is f ( x ) - f ( x) e f '( x) xf '( x) xf '( x ) = ( e/ x) f( x) ( e/ x) f ( x) f ( x) f ( x )

Notes for Chapter 1 of. Scientific Computing with Case Studies

Notes for Chapter 1 of. Scientific Computing with Case Studies Notes for Chapter 1 of Scientific Computing with Case Studies Dianne P. O Leary SIAM Press, 2008 Mathematical modeling Computer arithmetic Errors 1999-2008 Dianne P. O'Leary 1 Arithmetic and Error What

More information

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460 Notes for Part 1 of CMSC 460 Dianne P. O Leary Preliminaries: Mathematical modeling Computer arithmetic Errors 1999-2006 Dianne P. O'Leary 1 Arithmetic and Error What we need to know about error: -- how

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

Mathematical preliminaries and error analysis

Mathematical preliminaries and error analysis Mathematical preliminaries and error analysis Tsung-Ming Huang Department of Mathematics National Taiwan Normal University, Taiwan September 12, 2015 Outline 1 Round-off errors and computer arithmetic

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Chapter 1 Error Analysis

Chapter 1 Error Analysis Chapter 1 Error Analysis Several sources of errors are important for numerical data processing: Experimental uncertainty: Input data from an experiment have a limited precision. Instead of the vector of

More information

Floating-point Computation

Floating-point Computation Chapter 2 Floating-point Computation 21 Positional Number System An integer N in a number system of base (or radix) β may be written as N = a n β n + a n 1 β n 1 + + a 1 β + a 0 = P n (β) where a i are

More information

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic Computer Arithmetic MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Fall 2013 Machine Numbers When performing arithmetic on a computer (laptop, desktop, mainframe, cell phone,

More information

Notes on floating point number, numerical computations and pitfalls

Notes on floating point number, numerical computations and pitfalls Notes on floating point number, numerical computations and pitfalls November 6, 212 1 Floating point numbers An n-digit floating point number in base β has the form x = ±(.d 1 d 2 d n ) β β e where.d 1

More information

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le Floating Point Number Systems Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le 1 Overview Real number system Examples Absolute and relative errors Floating point numbers Roundoff

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Introduction CSE 541

Introduction CSE 541 Introduction CSE 541 1 Numerical methods Solving scientific/engineering problems using computers. Root finding, Chapter 3 Polynomial Interpolation, Chapter 4 Differentiation, Chapter 4 Integration, Chapters

More information

Chapter 1: Introduction and mathematical preliminaries

Chapter 1: Introduction and mathematical preliminaries Chapter 1: Introduction and mathematical preliminaries Evy Kersalé September 26, 2011 Motivation Most of the mathematical problems you have encountered so far can be solved analytically. However, in real-life,

More information

1 ERROR ANALYSIS IN COMPUTATION

1 ERROR ANALYSIS IN COMPUTATION 1 ERROR ANALYSIS IN COMPUTATION 1.2 Round-Off Errors & Computer Arithmetic (a) Computer Representation of Numbers Two types: integer mode (not used in MATLAB) floating-point mode x R ˆx F(β, t, l, u),

More information

Chapter 1 Mathematical Preliminaries and Error Analysis

Chapter 1 Mathematical Preliminaries and Error Analysis Numerical Analysis (Math 3313) 2019-2018 Chapter 1 Mathematical Preliminaries and Error Analysis Intended learning outcomes: Upon successful completion of this chapter, a student will be able to (1) list

More information

Chapter 1: Preliminaries and Error Analysis

Chapter 1: Preliminaries and Error Analysis Chapter 1: Error Analysis Peter W. White white@tarleton.edu Department of Tarleton State University Summer 2015 / Numerical Analysis Overview We All Remember Calculus Derivatives: limit definition, sum

More information

Lecture 7. Floating point arithmetic and stability

Lecture 7. Floating point arithmetic and stability Lecture 7 Floating point arithmetic and stability 2.5 Machine representation of numbers Scientific notation: 23 }{{} }{{} } 3.14159265 {{} }{{} 10 sign mantissa base exponent (significand) s m β e A floating

More information

Chapter 4 Number Representations

Chapter 4 Number Representations Chapter 4 Number Representations SKEE2263 Digital Systems Mun im/ismahani/izam {munim@utm.my,e-izam@utm.my,ismahani@fke.utm.my} February 9, 2016 Table of Contents 1 Fundamentals 2 Signed Numbers 3 Fixed-Point

More information

Number Representation and Waveform Quantization

Number Representation and Waveform Quantization 1 Number Representation and Waveform Quantization 1 Introduction This lab presents two important concepts for working with digital signals. The first section discusses how numbers are stored in memory.

More information

Numerical Analysis and Computing

Numerical Analysis and Computing Numerical Analysis and Computing Lecture Notes #02 Calculus Review; Computer Artihmetic and Finite Precision; and Convergence; Joe Mahaffy, mahaffy@math.sdsu.edu Department of Mathematics Dynamical Systems

More information

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Numbering Systems Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Addition & Subtraction using Octal & Hexadecimal 2 s Complement, Subtraction Using 2 s Complement.

More information

Introduction and mathematical preliminaries

Introduction and mathematical preliminaries Chapter Introduction and mathematical preliminaries Contents. Motivation..................................2 Finite-digit arithmetic.......................... 2.3 Errors in numerical calculations.....................

More information

Errors. Intensive Computation. Annalisa Massini 2017/2018

Errors. Intensive Computation. Annalisa Massini 2017/2018 Errors Intensive Computation Annalisa Massini 2017/2018 Intensive Computation - 2017/2018 2 References Scientific Computing: An Introductory Survey - Chapter 1 M.T. Heath http://heath.cs.illinois.edu/scicomp/notes/index.html

More information

Chapter 1 Computer Arithmetic

Chapter 1 Computer Arithmetic Numerical Analysis (Math 9372) 2017-2016 Chapter 1 Computer Arithmetic 1.1 Introduction Numerical analysis is a way to solve mathematical problems by special procedures which use arithmetic operations

More information

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science EAD 115 Numerical Solution of Engineering and Scientific Problems David M. Rocke Department of Applied Science Taylor s Theorem Can often approximate a function by a polynomial The error in the approximation

More information

Chapter 1 Mathematical Preliminaries and Error Analysis

Chapter 1 Mathematical Preliminaries and Error Analysis Chapter 1 Mathematical Preliminaries and Error Analysis Per-Olof Persson persson@berkeley.edu Department of Mathematics University of California, Berkeley Math 128A Numerical Analysis Limits and Continuity

More information

Round-off Errors and Computer Arithmetic - (1.2)

Round-off Errors and Computer Arithmetic - (1.2) Round-off Errors and Comuter Arithmetic - (.). Round-off Errors: Round-off errors is roduced when a calculator or comuter is used to erform real number calculations. That is because the arithmetic erformed

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors 3-1 Roundoff errors and floating-point arithmetic

More information

Numerical Algorithms. IE 496 Lecture 20

Numerical Algorithms. IE 496 Lecture 20 Numerical Algorithms IE 496 Lecture 20 Reading for This Lecture Primary Miller and Boxer, Pages 124-128 Forsythe and Mohler, Sections 1 and 2 Numerical Algorithms Numerical Analysis So far, we have looked

More information

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b.

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b. CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5 GENE H GOLUB Suppose we want to solve We actually have an approximation ξ such that 1 Perturbation Theory Ax = b x = ξ + e The question is, how

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors Roundoff errors and floating-point arithmetic

More information

Mathematics for Engineers. Numerical mathematics

Mathematics for Engineers. Numerical mathematics Mathematics for Engineers Numerical mathematics Integers Determine the largest representable integer with the intmax command. intmax ans = int32 2147483647 2147483647+1 ans = 2.1475e+09 Remark The set

More information

Numerical Methods - Preliminaries

Numerical Methods - Preliminaries Numerical Methods - Preliminaries Y. K. Goh Universiti Tunku Abdul Rahman 2013 Y. K. Goh (UTAR) Numerical Methods - Preliminaries 2013 1 / 58 Table of Contents 1 Introduction to Numerical Methods Numerical

More information

How do computers represent numbers?

How do computers represent numbers? How do computers represent numbers? Tips & Tricks Week 1 Topics in Scientific Computing QMUL Semester A 2017/18 1/10 What does digital mean? The term DIGITAL refers to any device that operates on discrete

More information

Examples MAT-INF1100. Øyvind Ryan

Examples MAT-INF1100. Øyvind Ryan Examples MAT-INF00 Øyvind Ryan February 9, 20 Example 0.. Instead of converting 76 to base 8 let us convert it to base 6. We find that 76//6 = 2 with remainder. In the next step we find 2//6 = 4 with remainder.

More information

ACM 106a: Lecture 1 Agenda

ACM 106a: Lecture 1 Agenda 1 ACM 106a: Lecture 1 Agenda Introduction to numerical linear algebra Common problems First examples Inexact computation What is this course about? 2 Typical numerical linear algebra problems Systems of

More information

Introduction to Numerical Analysis

Introduction to Numerical Analysis Introduction to Numerical Analysis S. Baskar and S. Sivaji Ganesh Department of Mathematics Indian Institute of Technology Bombay Powai, Mumbai 400 076. Introduction to Numerical Analysis Lecture Notes

More information

8/13/16. Data analysis and modeling: the tools of the trade. Ø Set of numbers. Ø Binary representation of numbers. Ø Floating points.

8/13/16. Data analysis and modeling: the tools of the trade. Ø Set of numbers. Ø Binary representation of numbers. Ø Floating points. Data analysis and modeling: the tools of the trade Patrice Koehl Department of Biological Sciences National University of Singapore http://www.cs.ucdavis.edu/~koehl/teaching/bl5229 koehl@cs.ucdavis.edu

More information

Jim Lambers MAT 610 Summer Session Lecture 2 Notes

Jim Lambers MAT 610 Summer Session Lecture 2 Notes Jim Lambers MAT 610 Summer Session 2009-10 Lecture 2 Notes These notes correspond to Sections 2.2-2.4 in the text. Vector Norms Given vectors x and y of length one, which are simply scalars x and y, the

More information

1 Floating point arithmetic

1 Floating point arithmetic Introduction to Floating Point Arithmetic Floating point arithmetic Floating point representation (scientific notation) of numbers, for example, takes the following form.346 0 sign fraction base exponent

More information

ECS 231 Computer Arithmetic 1 / 27

ECS 231 Computer Arithmetic 1 / 27 ECS 231 Computer Arithmetic 1 / 27 Outline 1 Floating-point numbers and representations 2 Floating-point arithmetic 3 Floating-point error analysis 4 Further reading 2 / 27 Outline 1 Floating-point numbers

More information

1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS

1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS Chapter 1 NUMBER REPRESENTATION, ERROR ANALYSIS 1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS Floating-point representation x t,r of a number x: x t,r = m t P cr, where: P - base (the

More information

Numerics and Error Analysis

Numerics and Error Analysis Numerics and Error Analysis CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Numerics and Error Analysis 1 / 30 A Puzzle What

More information

1 Backward and Forward Error

1 Backward and Forward Error Math 515 Fall, 2008 Brief Notes on Conditioning, Stability and Finite Precision Arithmetic Most books on numerical analysis, numerical linear algebra, and matrix computations have a lot of material covering

More information

Midterm Review. Igor Yanovsky (Math 151A TA)

Midterm Review. Igor Yanovsky (Math 151A TA) Midterm Review Igor Yanovsky (Math 5A TA) Root-Finding Methods Rootfinding methods are designed to find a zero of a function f, that is, to find a value of x such that f(x) =0 Bisection Method To apply

More information

ESO 208A: Computational Methods in Engineering. Saumyen Guha

ESO 208A: Computational Methods in Engineering. Saumyen Guha ESO 208A: Computational Methods in Engineering Introduction, Error Analysis Saumyen Guha Department of Civil Engineering IIT Kanpur What is Computational Methods or Numerical Methods in Engineering? Formulation

More information

Finding small factors of integers. Speed of the number-field sieve. D. J. Bernstein University of Illinois at Chicago

Finding small factors of integers. Speed of the number-field sieve. D. J. Bernstein University of Illinois at Chicago The number-field sieve Finding small factors of integers Speed of the number-field sieve D. J. Bernstein University of Illinois at Chicago Prelude: finding denominators 87366 22322444 in R. Easily compute

More information

Numerical Methods in Physics and Astrophysics

Numerical Methods in Physics and Astrophysics Kostas Kokkotas 2 November 6, 2007 2 kostas.kokkotas@uni-tuebingen.de http://www.tat.physik.uni-tuebingen.de/kokkotas Kostas Kokkotas 3 Error Analysis Definition : Suppose that x is an approximation to

More information

INTRODUCTION TO COMPUTATIONAL MATHEMATICS

INTRODUCTION TO COMPUTATIONAL MATHEMATICS INTRODUCTION TO COMPUTATIONAL MATHEMATICS Course Notes for CM 271 / AMATH 341 / CS 371 Fall 2007 Instructor: Prof. Justin Wan School of Computer Science University of Waterloo Course notes by Prof. Hans

More information

Math 128A: Homework 2 Solutions

Math 128A: Homework 2 Solutions Math 128A: Homework 2 Solutions Due: June 28 1. In problems where high precision is not needed, the IEEE standard provides a specification for single precision numbers, which occupy 32 bits of storage.

More information

Numerical Analysis. Yutian LI. 2018/19 Term 1 CUHKSZ. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 1 / 41

Numerical Analysis. Yutian LI. 2018/19 Term 1 CUHKSZ. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 1 / 41 Numerical Analysis Yutian LI CUHKSZ 2018/19 Term 1 Yutian LI (CUHKSZ) Numerical Analysis 2018/19 1 / 41 Reference Books BF R. L. Burden and J. D. Faires, Numerical Analysis, 9th edition, Thomsom Brooks/Cole,

More information

Tu: 9/3/13 Math 471, Fall 2013, Section 001 Lecture 1

Tu: 9/3/13 Math 471, Fall 2013, Section 001 Lecture 1 Tu: 9/3/13 Math 71, Fall 2013, Section 001 Lecture 1 1 Course intro Notes : Take attendance. Instructor introduction. Handout : Course description. Note the exam days (and don t be absent). Bookmark the

More information

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2 2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2 REVIEW Lecture 1 1. Syllabus, Goals and Objectives 2. Introduction to CFD 3. From mathematical models to numerical simulations (1D Sphere in 1D flow)

More information

DSP Design Lecture 2. Fredrik Edman.

DSP Design Lecture 2. Fredrik Edman. DSP Design Lecture Number representation, scaling, quantization and round-off Noise Fredrik Edman fredrik.edman@eit.lth.se Representation of Numbers Numbers is a way to use symbols to describe and model

More information

Homework 2 Foundations of Computational Math 1 Fall 2018

Homework 2 Foundations of Computational Math 1 Fall 2018 Homework 2 Foundations of Computational Math 1 Fall 2018 Note that Problems 2 and 8 have coding in them. Problem 2 is a simple task while Problem 8 is very involved (and has in fact been given as a programming

More information

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation Lecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80

More information

BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES

BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES No. of Printed Pages : 5 BCS-054 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 058b9 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES Time : 3 hours Maximum Marks

More information

One-Sided Difference Formula for the First Derivative

One-Sided Difference Formula for the First Derivative POLYTECHNIC UNIVERSITY Department of Computer and Information Science One-Sided Difference Formula for the First Derivative K. Ming Leung Abstract: Derive a one-sided formula for the first derive of a

More information

Ex code

Ex code Ex. 8.4 7-4-2-1 code Codeconverter 7-4-2-1-code to BCD-code. When encoding the digits 0... 9 sometimes in the past a code having weights 7-4-2-1 instead of the binary code weights 8-4-2-1 was used. In

More information

MAT 460: Numerical Analysis I. James V. Lambers

MAT 460: Numerical Analysis I. James V. Lambers MAT 460: Numerical Analysis I James V. Lambers January 31, 2013 2 Contents 1 Mathematical Preliminaries and Error Analysis 7 1.1 Introduction............................ 7 1.1.1 Error Analysis......................

More information

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations. EE 260: Introduction to Digital Design Number Systems Yao Zheng Department of Electrical Engineering University of Hawaiʻi at Mānoa Overview n Digital Computers n Number Systems n Representations n Conversions

More information

F O R SOCI AL WORK RESE ARCH

F O R SOCI AL WORK RESE ARCH 7 TH EUROPE AN CONFERENCE F O R SOCI AL WORK RESE ARCH C h a l l e n g e s i n s o c i a l w o r k r e s e a r c h c o n f l i c t s, b a r r i e r s a n d p o s s i b i l i t i e s i n r e l a t i o n

More information

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013 Number Systems III MA1S1 Tristan McLoughlin December 4, 2013 http://en.wikipedia.org/wiki/binary numeral system http://accu.org/index.php/articles/1558 http://www.binaryconvert.com http://en.wikipedia.org/wiki/ascii

More information

A Brief Introduction to Numerical Methods for Differential Equations

A Brief Introduction to Numerical Methods for Differential Equations A Brief Introduction to Numerical Methods for Differential Equations January 10, 2011 This tutorial introduces some basic numerical computation techniques that are useful for the simulation and analysis

More information

ALU (3) - Division Algorithms

ALU (3) - Division Algorithms HUMBOLDT-UNIVERSITÄT ZU BERLIN INSTITUT FÜR INFORMATIK Lecture 12 ALU (3) - Division Algorithms Sommersemester 2002 Leitung: Prof. Dr. Miroslaw Malek www.informatik.hu-berlin.de/rok/ca CA - XII - ALU(3)

More information

Applied Numerical Analysis (AE2220-I) R. Klees and R.P. Dwight

Applied Numerical Analysis (AE2220-I) R. Klees and R.P. Dwight Applied Numerical Analysis (AE0-I) R. Klees and R.P. Dwight February 018 Contents 1 Preliminaries: Motivation, Computer arithmetic, Taylor series 1 1.1 Numerical Analysis Motivation..........................

More information

Fall 2014 MAT 375 Numerical Methods. Numerical Differentiation (Chapter 9)

Fall 2014 MAT 375 Numerical Methods. Numerical Differentiation (Chapter 9) Fall 2014 MAT 375 Numerical Metods (Capter 9) Idea: Definition of te derivative at x Obviuos approximation: f (x) = lim 0 f (x + ) f (x) f (x) f (x + ) f (x) forward-difference formula? ow good is tis

More information

Introductory Numerical Analysis

Introductory Numerical Analysis Introductory Numerical Analysis Lecture Notes December 16, 017 Contents 1 Introduction to 1 11 Floating Point Numbers 1 1 Computational Errors 13 Algorithm 3 14 Calculus Review 3 Root Finding 5 1 Bisection

More information

Analysis of Finite Wordlength Effects

Analysis of Finite Wordlength Effects Analysis of Finite Wordlength Effects Ideally, the system parameters along with the signal variables have infinite precision taing any value between and In practice, they can tae only discrete values within

More information

Numerical Mathematical Analysis

Numerical Mathematical Analysis Numerical Mathematical Analysis Numerical Mathematical Analysis Catalin Trenchea Department of Mathematics University of Pittsburgh September 20, 2010 Numerical Mathematical Analysis Math 1070 Numerical

More information

AIMS Exercise Set # 1

AIMS Exercise Set # 1 AIMS Exercise Set #. Determine the form of the single precision floating point arithmetic used in the computers at AIMS. What is the largest number that can be accurately represented? What is the smallest

More information

Math 411 Preliminaries

Math 411 Preliminaries Math 411 Preliminaries Provide a list of preliminary vocabulary and concepts Preliminary Basic Netwon s method, Taylor series expansion (for single and multiple variables), Eigenvalue, Eigenvector, Vector

More information

Lecture Notes 7, Math/Comp 128, Math 250

Lecture Notes 7, Math/Comp 128, Math 250 Lecture Notes 7, Math/Comp 128, Math 250 Misha Kilmer Tufts University October 23, 2005 Floating Point Arithmetic We talked last time about how the computer represents floating point numbers. In a floating

More information

hexadecimal-to-decimal conversion

hexadecimal-to-decimal conversion OTHER NUMBER SYSTEMS: octal (digits 0 to 7) group three binary numbers together and represent as base 8 3564 10 = 110 111 101 100 2 = (6X8 3 ) + (7X8 2 ) + (5X8 1 ) + (4X8 0 ) = 6754 8 hexadecimal (digits

More information

An Introduction to Differential Algebra

An Introduction to Differential Algebra An Introduction to Differential Algebra Alexander Wittig1, P. Di Lizia, R. Armellin, et al. 1 ESA Advanced Concepts Team (TEC-SF) SRL, Milan Dinamica Outline 1 Overview Five Views of Differential Algebra

More information

Introduction to Scientific Computing Languages

Introduction to Scientific Computing Languages 1 / 19 Introduction to Scientific Computing Languages Prof. Paolo Bientinesi pauldj@aices.rwth-aachen.de Numerical Representation 2 / 19 Numbers 123 = (first 40 digits) 29 4.241379310344827586206896551724137931034...

More information

Introduction to Finite Di erence Methods

Introduction to Finite Di erence Methods Introduction to Finite Di erence Methods ME 448/548 Notes Gerald Recktenwald Portland State University Department of Mechanical Engineering gerry@pdx.edu ME 448/548: Introduction to Finite Di erence Approximation

More information

ECE 372 Microcontroller Design

ECE 372 Microcontroller Design Data Formats Humor There are 10 types of people in the world: Those who get binary and those who don t. 1 Information vs. Data Information An abstract description of facts, processes or perceptions How

More information

An Introduction to Numerical Analysis. James Brannick. The Pennsylvania State University

An Introduction to Numerical Analysis. James Brannick. The Pennsylvania State University An Introduction to Numerical Analysis James Brannick The Pennsylvania State University Contents Chapter 1. Introduction 5 Chapter 2. Computer arithmetic and Error Analysis 7 Chapter 3. Approximation and

More information

QUADRATIC PROGRAMMING?

QUADRATIC PROGRAMMING? QUADRATIC PROGRAMMING? WILLIAM Y. SIT Department of Mathematics, The City College of The City University of New York, New York, NY 10031, USA E-mail: wyscc@cunyvm.cuny.edu This is a talk on how to program

More information

Numerical Methods - Lecture 2. Numerical Methods. Lecture 2. Analysis of errors in numerical methods

Numerical Methods - Lecture 2. Numerical Methods. Lecture 2. Analysis of errors in numerical methods Numerical Methods - Lecture 1 Numerical Methods Lecture. Analysis o errors in numerical methods Numerical Methods - Lecture Why represent numbers in loating point ormat? Eample 1. How a number 56.78 can

More information

Introduction to Scientific Computing Languages

Introduction to Scientific Computing Languages 1 / 21 Introduction to Scientific Computing Languages Prof. Paolo Bientinesi pauldj@aices.rwth-aachen.de Numerical Representation 2 / 21 Numbers 123 = (first 40 digits) 29 4.241379310344827586206896551724137931034...

More information

What does such a voltage signal look like? Signals are commonly observed and graphed as functions of time:

What does such a voltage signal look like? Signals are commonly observed and graphed as functions of time: Objectives Upon completion of this module, you should be able to: understand uniform quantizers, including dynamic range and sources of error, represent numbers in two s complement binary form, assign

More information

4.2 Floating-Point Numbers

4.2 Floating-Point Numbers 101 Approximation 4.2 Floating-Point Numbers 4.2 Floating-Point Numbers The number 3.1416 in scientific notation is 0.31416 10 1 or (as computer output) -0.31416E01..31416 10 1 exponent sign mantissa base

More information

CS 257: Numerical Methods

CS 257: Numerical Methods CS 57: Numerical Methods Final Exam Study Guide Version 1.00 Created by Charles Feng http://www.fenguin.net CS 57: Numerical Methods Final Exam Study Guide 1 Contents 1 Introductory Matter 3 1.1 Calculus

More information

UNIT V FINITE WORD LENGTH EFFECTS IN DIGITAL FILTERS PART A 1. Define 1 s complement form? In 1,s complement form the positive number is represented as in the sign magnitude form. To obtain the negative

More information

Applied Mathematics 205. Unit 0: Overview of Scientific Computing. Lecturer: Dr. David Knezevic

Applied Mathematics 205. Unit 0: Overview of Scientific Computing. Lecturer: Dr. David Knezevic Applied Mathematics 205 Unit 0: Overview of Scientific Computing Lecturer: Dr. David Knezevic Scientific Computing Computation is now recognized as the third pillar of science (along with theory and experiment)

More information

MTH303. Section 1.3: Error Analysis. R.Touma

MTH303. Section 1.3: Error Analysis. R.Touma MTH303 Section 1.3: Error Analysis R.Touma These lecture slides are not enough to understand the topics of the course; they could be used along with the textbook The numerical solution of a mathematical

More information

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri MATH 1101 haalshehri@ksu.edu.sa 1 Introduction To Number Systems First Section: Binary System Second Section: Octal Number System Third Section: Hexadecimal System 2 Binary System 3 Binary System The binary

More information

Binary floating point

Binary floating point Binary floating point Notes for 2017-02-03 Why do we study conditioning of problems? One reason is that we may have input data contaminated by noise, resulting in a bad solution even if the intermediate

More information

ENGIN 112 Intro to Electrical and Computer Engineering

ENGIN 112 Intro to Electrical and Computer Engineering ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems Overview Hexadecimal numbers Related to binary and octal numbers Conversion between hexadecimal, octal and binary Value

More information

Chapter 1. Numerical Errors. Module No. 1. Errors in Numerical Computations

Chapter 1. Numerical Errors. Module No. 1. Errors in Numerical Computations Numerical Analysis by Dr. Anita Pal Assistant Professor Department of Mathematics National Institute of Technology Durgapur Durgapur-73209 email: anita.buie@gmail.com . Chapter Numerical Errors Module

More information

1 + lim. n n+1. f(x) = x + 1, x 1. and we check that f is increasing, instead. Using the quotient rule, we easily find that. 1 (x + 1) 1 x (x + 1) 2 =

1 + lim. n n+1. f(x) = x + 1, x 1. and we check that f is increasing, instead. Using the quotient rule, we easily find that. 1 (x + 1) 1 x (x + 1) 2 = Chapter 5 Sequences and series 5. Sequences Definition 5. (Sequence). A sequence is a function which is defined on the set N of natural numbers. Since such a function is uniquely determined by its values

More information

Numerical Methods School of Mechanical Engineering Chung-Ang University

Numerical Methods School of Mechanical Engineering Chung-Ang University Part 5 Chapter 19 Numerical Differentiation Prof. Hae-Jin Choi hjchoi@cau.ac.kr 1 Chapter Objectives l Understanding the application of high-accuracy numerical differentiation formulas for equispaced data.

More information

Compute the behavior of reality even if it is impossible to observe the processes (for example a black hole in astrophysics).

Compute the behavior of reality even if it is impossible to observe the processes (for example a black hole in astrophysics). 1 Introduction Read sections 1.1, 1.2.1 1.2.4, 1.2.6, 1.3.8, 1.3.9, 1.4. Review questions 1.1 1.6, 1.12 1.21, 1.37. The subject of Scientific Computing is to simulate the reality. Simulation is the representation

More information

Conversions between Decimal and Binary

Conversions between Decimal and Binary Conversions between Decimal and Binary Binary to Decimal Technique - use the definition of a number in a positional number system with base 2 - evaluate the definition formula ( the formula ) using decimal

More information

NUMERICAL AND STATISTICAL COMPUTING (MCA-202-CR)

NUMERICAL AND STATISTICAL COMPUTING (MCA-202-CR) NUMERICAL AND STATISTICAL COMPUTING (MCA-202-CR) Autumn Session UNIT 1 Numerical analysis is the study of algorithms that uses, creates and implements algorithms for obtaining numerical solutions to problems

More information

Introduction to Scientific Computing

Introduction to Scientific Computing (Lecture 2: Machine precision and condition number) B. Rosić, T.Moshagen Institute of Scientific Computing General information :) 13 homeworks (HW) Work in groups of 2 or 3 people Each HW brings maximally

More information

1 Solutions to selected problems

1 Solutions to selected problems Solutions to selected problems Section., #a,c,d. a. p x = n for i = n : 0 p x = xp x + i end b. z = x, y = x for i = : n y = y + x i z = zy end c. y = (t x ), p t = a for i = : n y = y(t x i ) p t = p

More information