0 Up votes0 Down votes

4 views51 pagesPower point presenting some numerical integration metjods

Jul 07, 2015

© © All Rights Reserved

PPTX, PDF, TXT or read online from Scribd

Power point presenting some numerical integration metjods

© All Rights Reserved

4 views

Power point presenting some numerical integration metjods

© All Rights Reserved

- Probability Shortcut
- Complex Variables & Numerical Methods(2141905)
- Ramp Calculation
- Process Simulation Using MATLAB
- Procedural Generation of Parcels in Urban Modeling Appendix
- Diagram
- CE205_ODE
- BC0043-Computer Oriented Numerical Methods-MQP
- SSA Cuk Middlebrook
- MATHS
- Poster for Computation of Charge Collection Probability for Any Collecting Junction Shape
- Basic Dyn Con Textbook Free
- Face Recognition Algorithm Optimization
- pp11
- lec02.pdf
- COEM 6012 Coursework#2_2015
- cm8-4up
- cot4501sp17_hw3sol
- notes-Nov-8
- Python

You are on page 1of 51

Numerical Integration

Techniques

A Brief Introduction

+

Objectives

Start

Make

Make

CUDA acceleration

Lord, make me accurate and fast.

- Mel Gibson, Patriot

+

Schedule

+

Preliminaries

Basic

Calculus

Derivatives

Taylor series expansion

w dw

Basic

Programming Skills

Octave

+

Numerical Differentiation

Definition of Differentiation

df

f (x h) f (x)

f '(x) lim

h0

dx

h

+

Numerical Differentiation

Forward Difference

Approximation Formula

df

f (x h) f (x)

f '(x)approx

dx

h

Is it accurate?

+

Numerical Differentiation

Error Analysis

represent a function at some point accurately.

1 2

1 3

f(x h) f (x) hf '(x) h f ''(x) h f '''(x)

2

6

which implies

f (x h) f (x)

1

1 2

f '(x)approx

f '(x) hf ''(x) h f '''(x)

h

2

6

Truncation Error

1

1 2

et hf ''(x) h f '''(x) O(h)

2

6

+

Numerical Differentiation

Error Analysis

Roundoff Error

memory accurately.

proportional to itself.

Denoted

Total Error

er

e et er

10

+

Numerical Differentiation

Backward Difference

Definition

f (x) f (x h)

f '(x)approx

h

Truncation Error

1

1

et hf ''(x) h2 f '''(x) O(h)

2

6

No Improvement!

11

+

Numerical Differentiation

Central Difference

Definition

f (x h) f (x h)

f '(x)approx

2h

Truncation Error

1 2

1 4 (5)

et h f '''(x)

h f (x) O(h2 )

6

120

Difference

12

+

Numerical Differentiation

13

Example

f (x) ex

At point x=1.15

14

+

methods

Blue Error of Forward Difference

Green Error of Backward Difference

Red Error of Central Difference

+

Numerical Differentiation

Multi-dimensional & High-Order

Multi-dimensional

2

dx dx dx

4h2

High-Order

parameter

2

f

f f (x h, y h) f(x h, y h) f (x h, y h) f (x h, y h)

xy y x

4h2

15

+

Euler Method

16

IVP

The

Differential Equations

Initial Conditions

y(t0 ) y0

Problem

+

Euler Method

17

Consider

Forward Difference

y(t t) y(t)

y'(t)

t

Which

implies

+

Euler Method

18

Split

t0 0

ti i t

t t

n

The

+

Euler Method

Explicit Euler Method - Algorithm

19

+

Euler Method

20

Using

the truncation error at each step

2

etstep O(t )

2

We

sum of truncation error of each step

t

et O(t2 ) O(t)

t

This

+

Euler Method

21

Consider

Backward Difference

y(t) y(t t)

y'(t)

t

Which

implies

+

Euler Method

22

Split

The

solved to get the value of y(ti+1)

Extra computation

Sometimes worth because implicit method is

more accurate

+

Euler Method

23

A Simple Example

Try

to solve IVP

y'(t) et t

y(0) 1

What

The

analytical solution is

1 2

y e t 2

2

t

+

Euler Method

24

A Simple Example

Using

ti

yi1 yi dt(e ti )

We

choose

accuracy

dt2 0.05 t 0, 0.05, 0.1,..., 0.5

dt3 0.01 t 0, 0.01, 0.02,..., 0.5

+

Euler Method

25

A Simple Example

0.1

0.2

0.3

0.4

0.5

exact

dt=0.0

5

error

dt=0.0

25

error

dt=0.0

125

error

1.20126 1.20177 0.00050 1.20151 0.00024 1.20138 0.00011

1.30418 1.30525 0.00107 1.30470 0.00052 1.30444 0.00025

1.40968 1.41150 0.00182 1.41057 0.00089 1.41012 0.00044

1.51846 1.52121 0.00274 1.51982 0.00135 1.51914 0.00067

+

Euler Method

26

Instability

For

Euler method requires an extremely small dt

to make the result accurate

y'(t) ky(t), k 0

The

The

choice of t matters!

+

Euler Method

27

Instability

Assume

k=5

y'(t) 5y(t)

y(0) 1

Analytical

Solution is

5t

y(t) e

Try

28

Works!

1

0 1 tk 1 t

k

29

1

2

1 1 tk 0 t

k

k

30

Instability!

2

t 1 tk 1

k

+

Euler Method

31

an accurate result

exact

dt=0.5

0.4

0.135335

0.8

1.2

1.6

2

error

dt=0.2

5

error

dt=0.0

02

error

82.89722

0.018316

-1.5

5

0.015625 1.853096 0.017951 0.019933

906.7147

0.002479 2.25

85

0.000977 1.393973 0.002405 0.02975

10061.73

0.000335 -3.375

321

0.000061 1.181943 0.000322 0.039469

111507.9

0.000045 5.0625

831

0.000015 0.663903 0.000043 0.04909

+

Euler Method

32

Implicit

yi1 yi dt5yi1

Which

implies

yi

yi1

1 5dt

33

Choose dt=0.5,

Oscillation eliminated!

Not elegant, but works.

+

The Three-Variable Model

Single Cell

The

Differential Equations

tV (DV) (I fi I so I si ) I ext

tv (1 p)(1 v) / v pv/ v

w

(1

p)(1

w)

/

pw/

w

w

t

I fi vp(V Vc )(V Vm) / d

I so (V Vo )(1 p) / o p/ r

I si w(1 tanh[k(V Vcsi )]) / (2 si )

p

1 if V Vc

0 if V Vc

1 if V VV

0 if V VV

34

+

The Three-Variable Model

Single Cell

Simplify

the model

tV (I fi I so I si ) I ext

w (1 p)(1 w) /11 pw/ 667

t

I fi 0.04vp(V 72)(15 V)

I so (V 85)(1 p) / 8.3 2 p

I si w(1 tanh[0.1V]) / 0.897

p

1 if V 72

0 if V 72

1 if V 79.5

0 if V 79.5

35

+

The Three-Variable Model

Single Cell

Using

Select time slice length dt

Number of time slices is nt=T/dt

Initialize arrays vv(0, , nt), v(0, , nt), w(0, , nt)

to store the values of V, v, w at each time step

36

+

The Three-Variable Model

Single Cell

At

Compute Ifi, Iso, Ifi from values of vv, v, w of

previous time step

I so (vv(i 1) 85)(1 p) / 8.3 2 p

I si w(i 1)(1 tanh[0.1vv(i 1)]) / 0.897

37

+

The Three-Variable Model

Single Cell

At

new vv, v, and w

vv(i) vv(i 1) dt((I fi I so I si ) I ext )

v(i) v(i 1) dt(1 p)(1 v(i 1)) / (1000q19.2(1 q)) 0.3pv(i 1)

w(i) w(i 1) dt(1 p)(1 w(i 1)) /11 pw(i 1) / 667

38

39

+

Heat Diffusion Equations

The

Model

The

u

u

t

u f

t0

Constant is called thermal diffusivity

The

distribution

40

+

Heat Diffusion Equation

Laplace Operator

Laplace

Operator (Laplacian)

f 2 f (f )

Divergence

fields source or sink at some point

div( f ) f

Gradient

greatest rate of increase, the magnitude of the

gradient is the greatest rate

41

+

Heat Diffusion Equation

Laplace Operator

Meaning

u (u)

(thegradientof temperaturedistribution)

themagnitudeof temperaturechangeover space

Meaning

equals the thermal diffusivity times the magnitude of

the greatest temperature change over space

42

+

Heat Diffusion Equation

Laplace Operator

Cartesian

coordinates

x1, x2 ,, xn

n

2 f

f 2

i1 xi

1D

space (a cable)

2 f

f 2

x

43

+

Heat Diffusion Equation

Laplace Operator

Compute

Similar

to Numerical Differentiation

f 2

x

dx2

44

+

Heat Diffusion Equation

Laplace Operator

Boundaries

Assume

f

0

x x0

f (x) f (x)

0

2x

f (x) f (x)

Laplacian

at boundaries

f

x0

x2

x2

45

+

Heat Diffusion Equation

Exercise

Write a program in

Octave to solve the

following heat diffusion

equation on 1d space:

u

t u

u(x, 0) 10sin(

0 x 10

0.9

x

)

10

46

+

Heat Diffusion Equation

Exercise

TIPS:

Write a program in

Octave to solve the

following heat diffusion

equation on 1d space:

2d array, one dimension is

the time, the other is the

cable(space)

avoid instability

function to draw the 3d

graph

u

t u

u(x, 0) 10sin(

0 x 10

0.9

x

)

10

47

48

u(i,j) stores value of u at point x=xi, time t=tj.

u(i,j) is computed from u(i-1,j-1), u(i,j-1), and u(i+1,j+1).

+

Heat Diffusion Equation

Discrete Form

u(i, j) u(i, j 1) dt

dx2

2u(1, j 1) 2u(0, j 1)

u(0, j) u(0, j 1) dt

dx2

2u(n1, j 1) 2u(n, j 1)

u(n, j) u(n, j 1) dt

dx2

49

+

Heat Diffusion Equation

Stability

2dt

0 1

1

2

dx

2dt dx2

50

+

The END

Thank You!

51

- Probability ShortcutUploaded byvasu
- Complex Variables & Numerical Methods(2141905)Uploaded byNeel
- Ramp CalculationUploaded byvarsha
- Process Simulation Using MATLABUploaded bySunit Bhattacharya
- Procedural Generation of Parcels in Urban Modeling AppendixUploaded bytwak
- DiagramUploaded bysare
- CE205_ODEUploaded byRubaiya Kabir Orchi
- BC0043-Computer Oriented Numerical Methods-MQPUploaded byganeshnarke
- SSA Cuk MiddlebrookUploaded byHiren Patel
- MATHSUploaded byveronica_rachna
- Poster for Computation of Charge Collection Probability for Any Collecting Junction ShapeUploaded byOka Kurniawan
- Basic Dyn Con Textbook FreeUploaded byKaram Al Masri
- Face Recognition Algorithm OptimizationUploaded by23980hcasdjkn
- pp11Uploaded byBrinto Varghese
- lec02.pdfUploaded byHaydar Akdağ
- COEM 6012 Coursework#2_2015Uploaded byAaron Rampersad
- cm8-4upUploaded byAndrei Catalin Ilie
- cot4501sp17_hw3solUploaded byNathanael Hooper
- notes-Nov-8Uploaded byhelloye
- PythonUploaded byAndrea Gallo
- Ma 1201Uploaded byAnu Parthee
- Apex BMS Notes - QMB NOTES Transportation_ProblemsUploaded byAbhijeet Kulshreshtha
- Transportation Problem_finding Initial Basic Feasible SolutionUploaded bySushmita Shruti
- Ramp-calculation.pdfUploaded byvarsha
- contohUploaded byadeoktavia
- T_DE1Uploaded byAu Lam
- 2010-10!11!13-Finite Element Analysis LeafletUploaded bysamprof4vw
- Global Local Analysis WhitepaperUploaded byagniflame
- A Framework and Analysis for Cooperative Search Using UAV SwarmsUploaded byManish Patwari
- Queuing Theory 2010Uploaded byrocks271089

- Head and Neck CancerUploaded byFathurrahman Muiz
- Kavish BhatiaUploaded bypayalagrawal36
- 7262755 Bicycle CatalogUploaded bylatif11
- Fast Moving Consumer GoodsUploaded bymultibrands
- vocabulary-size-test-14000Uploaded byapi-338564165
- Blended wing bodyUploaded byDeepanguran j r
- Presentation - Seattle Design Commission - SR 520 Montlake Lid ReportUploaded byJustin Carder
- Problemario 2Uploaded byFrank Hurtado
- Homework 1 eBookUploaded byEmma Safwanah Sahirin
- CattailUploaded byapi-3707101
- Central-Maine-Power-Co-Renewable-RebateUploaded byGenability
- Secret Teachings of Secret BrotherhoodsUploaded byJohnoftheGentiles
- 100 cau trac nghiem tieng Anh Giai thich (Tap 2).pdfUploaded byNgọc Ánh
- D 731 – 95 R99 ;RDCZMQ__Uploaded byAtif Javaid
- D9Uploaded byLuis Jesus
- 177117092.pdfUploaded bysohebam
- 11360_mth108-mcq-for-practice.pdfUploaded byGowtham Chandrasekar
- Structured CablingUploaded byRonald Kim B. Torres
- Kosher Beers List Labor Day 2012Uploaded byKosherLawNY
- CBSE Sample Paper for Class 11 Physics Solutions - Set BUploaded byaglasem
- the rise of renewable energyUploaded byapi-235658421
- Testicular TorsionUploaded byVanessa Modi Alverina
- teak bulletinUploaded byLudwig Aaron Thomas
- The Shot by Gina MiliciaUploaded bysreerjvs
- F-18 Park Jet Construction Guide Rev AUploaded bySzymon Wójcik
- The Mirror Daily_ 01 July 2018 Newpapers.pdfUploaded byThit Htoo Lwin
- BTEC L3 Engineering Teaching BTECUploaded byNandhini Siva
- 72007 SAM4A TAB4AUploaded byBeloved Dhina
- Mineral Cementing MaterialsUploaded byBatul Bjartskular
- rumah limasUploaded bysyaqirah_top

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.