sc lecture 0 2014

Post on 12-Jan-2016

239 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

SC Lecture 0 2014

TRANSCRIPT

An introduction of Scientific Computing

Chin-Tien Wu Institute of Mathematics Modelling and

Scientific Computing

2014

Why scientific computing?

• Simulation of natural phenomena • Virtual prototyping of engineering designs • More insights from unknown phenomenon • Much more

What is scientific computing? Design and analysis of algorithms for numerically solving mathematical problems in science and engineering. Traditionally called numerical analysis Distinguishing features of scientific computing Approximate continuous quantities by discrete quantities. Considers effects of approximations including error and sensitivity

What should be cared in scientific computing?

Sources of approximation

Example 1

Error measurement

Where numerical errors come from?

More about error (I)

More about the error (II)

( ) ( ) ( )ˆ

ˆ( ) sup

ˆxx

f x f x f xcond f

x x x−

=−

( ) ( ) ( )relative input error

ˆ ˆ( )xf x f x f x cond f x x x− ≤ ⋅ −

Condition number of a function f at variable value x is defined as:

Relative propogated error (rounding error) can be estimated by:

Relative computational error (truncation error) can be estimated by:

( ) ( ) ( ) ( ) ( ) ( )

( )( )

relative backward error

ˆ ˆ ˆˆ ˆ ˆ

ˆ ˆˆ ˆ ˆ( )x

f x f x f x f x f x f x

f xcond f x x x

f x

− = −

≤ ⋅ ⋅ −

Evaluate the forward error, backward error and the condition number:

( ) ( ) ( )( ) ( )

( )( )( )

( ) ( ) ( )

ˆEvaluate function for approximate input instead ofthe true input , we have

Absolute forward error =

Relative forward error =

Condition number supx

f x x xx

f x x f x f x x

f x x f x f xx

f xf x

f x x f x f xx∆

= + ∆

′+ ∆ − ≈ ∆

+ ∆ − ′≈ ∆

+ ∆ −=

∆( )( )

f xx

x f x′

In what condition the backward error can be controlled?

( )( )

''Clearly, when , and ,cond f

ff x

< ∞ < ∞ < ∞ˆ 0

x xf f

x−

→ ⇔ →

( ) ( ) ( ) ( )

( )( ) ( )( )

( ) ( ) ( ) ( )

2

ˆ

12

ˆ when ~ .

f x f x f x f x

f x x x f x x x

x xf x f x f x cond f x x

x

− = −

′ ′′= − + −

−⇒ − ≈ ⋅

Consider:

Moreover, the backward error can be estimated by

Relative forward errorRelative backward Condition number

An algorithm is said to be well-posed if or well-conditioned if f̂

ˆ( ) for all xcond f x<< ∞

Relative error in the solution (output) is insensitive to the relative small change in the input.

A problem f is said to be well-posed if or well-conditioned if ( ) for all xcond f x<< ∞

A problem f or an algorithm is said to be stable if the

relative backward error is small f̂

Accurate numerical solution can be obtained only when a problem and computational algorithm are well-conditioned and stable

example2

( ) 2

2

tan sec tan2 2 22

condπ ε

π π π πε ε ε ε ε−

≈ − − − ≈ −

The reason is as following:

example3

example 4 ( ) ( )( ) ( ) ( )

( )

2-x 2

0

ˆConsider approximating =e by 1 ˆ ˆ ˆFor 1 , we have , this implies ln .

1 lnClearly, the backward error at x=1 is lim

1

ˆThe approximation to is unstable near x=1.

f x f x x

x f x f x x

f f

ε

ε ε ε

ε ε

ε→

= −

= − = = = −

− − −= ∞

Exercise: Could you explain why the estimation is nothing close to the real error? Could you give an upper bound for the relative error , where and the input error is less than 0.0001.

( )ˆ ˆ( )

( )f x f x

f x− ( )0.5,1x∈

top related