Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

1.

1 Presentation of Numbers on a Computer


Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Topic 1. Introduction in the theory of


errors

Do Ngoc Diep

November 28, 2019

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Background
Computers and Programming
Representation of numbers on a computer
Review of Calculus
Exercises

µmg
F =
cos θ + µ sin θ
F = Newton force, µ = coefficient of static friction, m =
mass of the block, g = gravitational constant,

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Background
Computers and Programming
Representation of numbers on a computer
Review of Calculus
Exercises

Example 1.1. pendulum

P Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Background
Computers and Programming
Representation of numbers on a computer
Review of Calculus
Exercises

Setting: P¯ 2
1. Governing equation: F = −cL dθ dt
− mg sin θ = mL ddt 2θ
Initial condition θ(0) = θ0 and dθ |
dt t=0
= 0.
d 2θ dθ
2. Method of solution. ML dt 2 + cL dt + mg θ = 0.
θ0 = 5o , sin θ ≈ θ + some error.

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Background
Computers and Programming
Representation of numbers on a computer
Review of Calculus
Exercises

decimal number: 60, 724.3125 = 6 × 104 + 7 × 102 + 2 ×


101 + 4 × 100 + 3 × 10−1 + 1 × 10−2 + 2 × 10−3 + 5 × 10−4 .
Example 1.4

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Background
Computers and Programming
Representation of numbers on a computer
Review of Calculus
Exercises

Example 1.5.

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Background
Computers and Programming
Representation of numbers on a computer
Review of Calculus
Exercises

Underesflow and Overflow

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions Round-Off Errors
Computers and Programming Trancation Errors
Review of Calculus Total Errors
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions Round-Off Errors
Computers and Programming Trancation Errors
Review of Calculus Total Errors
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions Round-Off Errors
Computers and Programming Trancation Errors
Review of Calculus Total Errors
Exercises

Taylor’s series expansion:

x3 x5 x7
sin(x) = x − + − + ...
3! 5! 7!
Trancation:
x3 x5 x7
sin(x) = x − , E TR = − + ...
3! 5! 7!
Remainder formula
1
f (x2 ) − f (x1 ) = f (k+1) (ξ)(x2 − x1 ).
(k + 1)!

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions Round-Off Errors
Computers and Programming Trancation Errors
Review of Calculus Total Errors
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Write a computer program in C,C++, Pascal, MATLAB,


Python to compute the value of π up to n term. Example:
∞  
X 1 1 1 1 1 1
π=4 (−1)n−1 =4 1− + − + − + ...
n=1
2n − 1 3 5 7 9 11

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Limit of a function at a point limx→x0 f (x) = L

Continuous function on a set X


limx→x0 f (x) = f (x0 ), ∀x0 ∈ X
Do Ngoc Diep Topic 1. Introduction in the theory of errors
1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Convergent Sequence
limn→∞ xn = x ⇐⇒ ∀ε > 0, ∃N = N(ε); ∀n ≥ N, |xn − x| < ε.
Theorem
If f is a function defined on a set X of real numbers, x0 ∈ X ,
then the following statement are equivalent:
a. f is continuous at x0
b. For any sequence xn → x0 in X , lim f (xn ) = f (x0 ).

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Theorem
If the function f is differentiable at x0 then f is continuous at
x0 .

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Geometric meaning of derivative.

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Rolle’s Theorem

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Intermediate Value Theorem

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Riemann Integral

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

An Example of Pseudo-code

Do Ngoc Diep Topic 1. Introduction in the theory of errors


1.1 Presentation of Numbers on a Computer
Errors in Numerical Solutions
Computers and Programming
Review of Calculus
Exercises

Home Works

1.1, 1.3, 1.4, 1.10, 1.18, 1.19, 1.21, 1.30

Do Ngoc Diep Topic 1. Introduction in the theory of errors

You might also like