unit2_Approximations and Errors.pdf

27
8/10/2019 unit2_Approximations and Errors.pdf http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 1/27

Transcript of unit2_Approximations and Errors.pdf

Page 1: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 1/27

Page 2: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 2/27

HCMUT

Accuracy, Precision, Errors

Dr. Do Quang Khanh2

Page 3: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 3/27

HCMUT

Accuracy, Precision, Errors

Taylor series expansion for multi-variablefunction, Error Propagation

A new perspective: The result of acomputation is a multi-variable function ofthe input values

3 Dr. Do Quang Khanh

Page 4: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 4/27

HCMUT

...),(),( +∆∂

∂+∆

∂+=∆+∆+ y

y

f x

x

f y x f y y x x f

y y f x

x f f ∆

∂∂+∆

∂∂

≅∆

Error calculus (here ∆ is positive)

Two variables, first order Taylor Approximation:

4 Dr. Do Quang Khanh

Page 5: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 5/27

HCMUT

Derive

DERIVEWhat are the two partial derivatives of

f= x+y

f=x-yf = x*yf = x/y

For summation/substraction theabsolute errors are addedFor multiplication and division therelative errors are added

5 Dr. Do Quang Khanh

Page 6: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 6/27

HCMUT

Oil in Place

Advanced: Assuming undersaturated reservoir with formation volume factor

Bo = 1.63 resBbl/STB, calculate the oil in place.

Assuming $ 20/ STB (+/- 50 %) and Ultimate Recovery 32-48 %, expressthe reserve in US $ with the associated uncertainty (+/- $)

6 Dr. Do Quang Khanh

Page 7: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 7/27

HCMUT

Example: Find the error in a laboratory determination of the gas Z-factor, given that:

p = 3245 psi ∆ p = 3 psi (meaning: ± 3 psi) v = 1.977 ft 3 ∆ v = 0.003 ft 3

n = 1 lb_mole ∆n = 0.001 lb_mole T = 739.67 oR ∆T = 0.03 oR

Differentiating z = pv /( nRT ) we obtain

∆ ∆ ∆ ∆ ∆ zv

nRT

p p

nRT

v pv

n RT

n pv

nRT

T = + + −

+ −

2 2

A simpler form is

∆ ∆ ∆ ∆ ∆

z pv

nRT

p

p

v

v

n

n

T

T = + + +

= × −2 8 10 3.

(Does the result have any dimension? Why did we not use more decimal figures? Why do we use "absolute value"?

Why do we not use "absolute value" in the ∆ p term? Does it matter that T is in the denominator?

(Notice:lb_mole is a rather obsolete unit: it is 453.592 mol, or sometimes the mass or weight of it;

R = 10.73 psi ft 3 /(lb_mole o R) is the universal gas constant in the "English" or "field" system of units)

Class homework: Do the whole computation in SI changing all input data to SI first. R = 8.3144 J/(mol K) is the SI value for the universal gas constant(Submit HW into the submission folder of U02.)

7 Dr. Do Quang Khanh

Page 8: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 8/27

HCMUT

Total error: truncation and round-offError propagation in a numerical method:what happens with the error "inherited"

Stability of a computational algorithm:errors (originated from truncation andround-off) are not amplified from step tostep but are rather kept under controlA problem is ill-conditioned, if results arevery sensitive to input data (regardless ofthe method used)

8 Dr. Do Quang Khanh

Page 9: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 9/27

HCMUT

Accuracy, Precision, Errors

Taylor series expansion for multi-variablefunction, Error Propagation

A new perspective: The result of acomputation is a multi-variable function ofthe input values

9 Dr. Do Quang Khanh

Page 10: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 10/27

HCMUT

BASIC CONCEPTS

Existence and uniqueness of solutionGraphical versus numerical solutionAnalytical versus numerical method to get

the solution numericallyDirect vs iterative (explicit vs implicit)Iteration: convergence, divergence

Order of the methodSingle variable, multi variable Linear, nonlinear

10 Dr. Do Quang Khanh

Page 11: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 11/27

Page 12: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 12/27

HCMUT

Trade-Off Regarding "step-size"

Log "stepsize"

more steps less steps12 Dr. Do Quang Khanh

Page 13: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 13/27

HCMUT

Trade-Off Regarding Complexity

Higher order, morecomplex method

Less sophisticated,robust method

13 Dr. Do Quang Khanh

Page 14: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 14/27

HCMUT

COURSE STRUTURE

Single variable (nonlinear) methodsRoot of equationMinimum of function

Manipulation of functions (differentiation,integration)• functions given in form of expression or

algorithm• discrete data point (smoothing, curve

fitting + diff and int)Ordinary Differential Equation (ODE)

14 Dr. Do Quang Khanh

Page 15: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 15/27

HCMUT

Multi variable problemsLinear• Matrices, vectors• Systems of linear eqs.: direct, special, iterative

Nonlinear• System of nonlinear eqs.• Minimum of multi variable function (general and

least squares)System of ODEPartial Differential Equation• Reservoir simulation

COURSE STRUTURE

15 Dr. Do Quang Khanh

Page 16: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 16/27

HCMUT

The book has asomewhatdifferentstructure.

16 Dr. Do Quang Khanh

Page 17: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 17/27

HCMUT

Example Problem

A cylindrical tank is to store 1 bbl liquid.Express the surface area as a function of theratio= H/D, where H is the height and D isthe diameter.How should we select this ratio to obtain theleast surface area? (Least material neededto make the barrel.)What is the optimum diameter, height,surface area expressed in convenientlyselected units?What kind of problem is to find theoptimum?

What methods can we use?17 Dr. Do Quang Khanh

Page 18: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 18/27

HCMUT

CONVERGENCE

Mathematically a series converges to alimit if the difference of the n-th termand the limit can be made smaller thanany selected positive "epsilon" – by

selecting a "large enough" n.In numerical methods we do not knowthe limit. What we really see is hownear two subsequent approximations

are to each other.Convergence criterion is a requirementposed on the nearness of two (or more)subsequent approximants.

18 Dr. Do Quang Khanh

Page 19: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 19/27

HCMUT

Convergence criterion

Sometimes it make more sense to

require "near" in absolute terms,

sometimes in relative terms.It has to be related to the engineering

content. Do not forget the dimension!

19 Dr. Do Quang Khanh

Page 20: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 20/27

HCMUT

Question

What convergence criterion (relative?Absolute?) would you use if you have tofind the temperature of a stream fromenergy balance?a) The temperature you are looking for is expressed in Rankine

(or Kelvin) and you know, that the thermo functions used are

about 0.01 % accurate?

b) The temperature is expressed in Celsius and can be easilynear to the freezing point of water?

20 Dr. Do Quang Khanh

Page 21: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 21/27

HCMUT

Question

You solve an equation for bubble pointpressure. The subroutine is written in"strict SI" so the pressure is in Pascal.

Is it wise to use a convergence criterion:eps = 1E-6 ?

21 Dr. Do Quang Khanh

Page 22: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 22/27

HCMUT

Order of convergence error ~

Theoretical order of a methodone thing is order for the formulaother thing is order for the method (formula

repeated and errors inherited)Practical rate of convergence

If we plot estimates of errors on a log-log plot,what will we see, if the error is decreasing with• first power of "step-size"• second power of step size?

)( n xO ∆

22Dr. Do Quang Khanh

Page 23: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 23/27

Page 24: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 24/27

Page 25: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 25/27

HCMUT

1. Error propagation: borehole volumeA 6000 ft (± 1 %) deep borehole has adiameter: 5 inch (± 0.04 inch). What is thevolume in bbl? (Give your answer with errorestimate!)

2. Error propagation: one-gallon cubeWhat is the side length of a one-gallon (±5 %)cube? Indicate the unit and errorestimate of your answer!

ASSIGNMENTS, TEST PROBLEMS

25Dr. Do Quang Khanh

Page 26: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 26/27

HCMUT

3. Error propagation: barrelConsider a right circular cylinder that has avolume 1 BBL (British barrel) (±0.06 %).The height is exactly twice the diameter.Estimate the diameter, indicating the unitand the uncertainty.

ASSIGNMENTS, TEST PROBLEMS

26Dr. Do Quang Khanh

Page 27: unit2_Approximations and Errors.pdf

8/10/2019 unit2_Approximations and Errors.pdf

http://slidepdf.com/reader/full/unit2approximations-and-errorspdf 27/27

HCMUT

4. Error propagation: hydrocarbon volumeThe volume occupied by hydrocarbons in acertain reservoir can be calculated fromV

HC = V (1−S

w) where V is the reservoir volume,

is the porosity, and S w is the water saturation.Assuming V = 2.5 105 ft 3 (±15%) and S w = 0.65(± 0.12) calculate the hydrocarbon volume and

give both the absolute and the relative errors ofthe calculated value.Note that the water saturation error is given asan absolute error!

ASSIGNMENTS, TEST PROBLEMS

27Dr. Do Quang Khanh