0% found this document useful (0 votes)
152 views

NumericalMethods FinalExamQ&As

1. The document is a math exam containing 4 problems. The first problem involves using the Newton-Raphson method to determine the depth a water tank must be filled to hold 30 cubic meters, given the tank radius is 3 meters. 2. The second problem involves fitting a power law equation to surface area and weight data from human subjects to predict surface area for a 95 kg person. 3. The third problem involves estimating the flow rate of water through a pipe by measuring volume changes over time. 4. The fourth problem involves evaluating several integrals analytically and numerically.

Uploaded by

wifle
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views

NumericalMethods FinalExamQ&As

1. The document is a math exam containing 4 problems. The first problem involves using the Newton-Raphson method to determine the depth a water tank must be filled to hold 30 cubic meters, given the tank radius is 3 meters. 2. The second problem involves fitting a power law equation to surface area and weight data from human subjects to predict surface area for a 95 kg person. 3. The third problem involves estimating the flow rate of water through a pipe by measuring volume changes over time. 4. The fourth problem involves evaluating several integrals analytically and numerically.

Uploaded by

wifle
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Page 1 / 6

EUROPEAN UNIVERSITY OF LEFKE


FACULTY OF ARCHITECTURE AND ENGINEERING
MATH 302 NUMERICAL METHODS SPRING 08-09 FINAL EXAM
Date: 10. 06. 2009 Instructor: Prof. Dr. Hüseyin Oğuz
Duration:09:30-11:30
Student Registration No:___________________
Student Name-Surname:__________________________________
Important Note: Your own scientific calculator is allowable to use during exam with forbidding of its exchange.
Formula sheet is given on the backside of your exam paper.

1. (25 p) You are designing a spherical tank to hold water for a small village in a developing country. The volume of
liquid it can hold can be computed as:

V = πh 2
[3R − h]
3
where V= volume [m3], h = depth of water in tank [m], and R = the tank radius [m]. If R =3 m, what depth must the
tank be filled to so that it holds 30 m3? Use three (3) Newton-Raphson iterations to determine your answer. Determine
the absolute relative approximate error ε a as percentage after each iteration. For Newton-Raphson method to be used,
an initial guess of R will always converge.

2.(25 p) On average, the surface area A of human beings is related to weight W and height H . Measurements on a
number of individuals of height 180 cm and different weights (kg) give values of A (m2) in the following table:

W (kg) 70 75 77 80 82 84 87 90
2
A (m ) 2.10 2.12 2.15 2.20 2.22 2.23 2.26 2.30

Show that a power law A = αW β fits these data reasonably well. Evaluate the constants α and β , and predict what the
surface area is for a 95 kg person.

3.(25 p) You have to measure the flow rate of water through a small pipe. In order to do it, you place a bucket at the
pipe’s outlet and measure the volume in the bucket as a function of time as tabulated below. Estimate the flow rate
 dV 
  at t = 7 s.
 dt 
Time, t [s] 0 1 5 8
Volume, V [cm3] 0 1 8 16.4

4.(25 p) Evaluate the following integral:


4

∫ (1 − e )dx
−2 x

(a) analytically, (b) single application of the trapezoidal rule, (c) composite trapezoidal rule with n =2 and 4,
(d) single application of Simpson’s 1/3 rule, (e) composite Simpson’s 1/3 rule with n = 4, and (f) single
application of Simpson’s 3/8 rule. For each of the numerical estimates (b) through (f), determine the percent
relative error based on (a).

Prof. Dr. Hüseyin Oğuz MATH302 Spring 08-09 FinalExam_10-06-09


Page 2 / 6
FORMULA SHEET

Interpolation:
Newton Interpolating Polynomial;
f n −1 ( x) = b1 + b2 ( x − x1 ) + .... + bn ( x − x1 )( x − x 2 )...( x − x n −1 )
b1 = f ( x1 ); b2 = f [ x 2 , x1 ] ; b3 = f [ x3 , x 2 , x1 ] ;……….; bn −1 = f [ x n −1 , x n − 2 ,...., x1 ] ; bn = f [ x n , x n−1 ,...., x 2 , x1 ]

[
f xi , x j =] f ( xi ) − f (x j )
[
; f xi , x j , x k = ] [
f xi , x j − f x j − x k ] [ ]
xi − x j xi − x k
f [ x n , x n −1 ,........, x 2 ] − f [ x n −1 , x n − 2 ,........, x1 ]
f [x n , x n −1 ,...., x 2 , x1 ] =
x n − x1

Lagrange Interpolating Polynomial;


n n x − xj
f n ( x) = ∑ Li ( x) f ( xi ); Li ( x) = ∏
i =0 j =0 xi − x j
j ≠i
n n n

− −
n ∑ x i y i − ∑ xi ∑ y i
i =1 i =1 i =1
Regression: y = a 0 + a1 x, a 0 = y − a1 x ; a1 = 2
n
  n
n ∑ x −  ∑ xi 
2
i
i =1  i =1 
Newton-Raphson formula:

f ( xi )
xi +1 = xi −
f ′ (x )
i

Integration:

f ( a ) + f (b )
I ≈ (b − a ) ; single Trapezoida l Rule
2
n −1
f ( x 0 ) + 2∑ f ( xi ) + f ( x n )
i =1
I ≈ (b − a ) ; composite Trapezoida l Rule
2n

I ≈
h
[ f ( x 0 ) + 4 f ( x1 ) + f ( x 2 )] = (b − a ) f ( x 0 ) + 4 f ( x1 ) + f ( x 2 ) ; single Simpson' s 1/3 Rule
3 6
n −1 n−2
f ( x0 ) + 4 ∑
i =1, 3, 5
f ( xi ) + 2 ∑ f (x
j = 2, 4,6
j ) + f ( xn )
I ≈ (b − a ) ; composite Simpson' s 1/3 Rule
3n

I ≈
3h
[ f ( x 0 ) + 3 f ( x1 ) + 3 f ( x 2 ) + f ( x3 )] = (b − a ) f ( x 0 ) + 3 f ( x1 ) + 3 f ( x 2 ) + f ( x3 ) ; single Simpson' s 3/8
8 8

3h  n−2 n −3 
I ≈  f ( x 0 + 3 ∑ [ f ( x i ) + f ( x i +1 ) ] + 2 ∑ f ( x j ) + f ( x n )  ; composite Simpson' s 3/8 Rule
8  i =1, 4 , 7 j = 3, 6 , 9 

Prof. Dr. Hüseyin Oğuz MATH302 Spring 08-09 FinalExam_10-06-09


Page 3 / 6

MATH 302 NUMERICAL METHODS SPRING 08-09 FINAL EXAM SOLUTIONS (10. 06. 2009)

1. The equation to be solved is


π 
f (h) = πRh 2 −  h 3 − V
3
π 
πRhi2 −  hi3 − V
hi +1 = hi − 3
2πRhi − πhi2

Substituting the parameter values,


π 
f ( h) = πRh 2 −   h 3 − V
3
π 
π 3hi2 −  hi3 − 30
hi +1 = hi − 3
2π 3hi − πhi2

i = 0; h0 = 3 m:

π  π 
π 3h02 −  h03 − 30 π 3(3) 2 −  (3) 3 − 30
h1 = h0 − 3 = 3− 3 = 2.061033
2π 3h0 − πh02 2π 3(3) − π (3) 2
h1 − h0 2.061033 − 3
εa = × 100 = × 100 = 45.558%
h1 2.061033

i = 1; h1 = 2.061033 m:

π  π 
π 3h12 −  h13 − 30 π 3(2.061033) 2 −  (2.061033) 3 − 30
h2 = h1 − 3 = 2.061033 − 3 = 2.027042
2π 3h1 − πh12 2π 3(2.061033) − π (2.061033) 2
h2 − h1 2.027042 − 2.061033
εa = × 100 = × 100 = 1.667%
h2 2.027042

i = 2; h2 = 2.027042 m:

π  π 
π 3h22 −  h23 − 30 π 3(2.027042) 2 −  (2.027042) 3 − 30
h3 = h2 − 3 = 2.027042 − 3 = 2.026906
2π 3h2 − πh22 2π 3(2.027042) − π (2.027042) 2
h2 − h1 2.026906 − 2.027042
εa = × 100 = × 100 = 0.007%
h2 2.026906

Thus, after only three iterations, the root is determined to be 2.026906 with an approximate relative error of 0.007%.

2. The power fit can be linearized by taking its base-10 logarithm (or its natural logarithm) to give

Prof. Dr. Hüseyin Oğuz MATH302 Spring 08-09 FinalExam_10-06-09


Page 4 / 6
log A = log α + β log W
log A = y; log W = x
y = a 0 + a1 x
a 0 = log α → α = 10 a0
a1 = β

a0 and a1 will be determined by using linear regression as follows:

i Wi (kg) Ai (m2) logWi logAi (logWi)2 (logWi)( logAi)


1 70 2.10 1.845098 0.322219 3.404387 0.594526
2 75 2.12 1.875061 0.326336 3.515854 0.611900
3 77 2.15 1.886491 0.332438 3.558848 0.627141
4 80 2.20 1.903090 0.342423 3.621752 0.651662
5 82 2.22 1.913814 0.346353 3.662684 0.662855
6 84 2.23 1.924279 0.348305 3.702850 0.670236
7 87 2.26 1.939519 0.354108 3.761734 0.686799
8 90 2.30 1.954243 0.361728 3.819066 0.706904
∑ 15.241595 2.73391 29.04718 5.212023

n n n n n n
n ∑ x i y i − ∑ xi ∑ y i n∑ (log Wi )(log Ai ) − ∑ (log Wi )∑ (log Ai )
i =1 i =1 i =1 i =1 i =1 i =1
a1 = 2
= 2
n
 n
  n n
n ∑ x −  ∑ xi  2
i n∑ (log Wi ) 2 −  ∑ (log Wi ) 
i =1  i =1  i =1  i =1 
8(5.212023) − (15.241595)(2.73391)
a1 = = 0.3796 = β
8(29.04718) − (15.241595) 2
n n

_ _ ∑ (log A )
i =1
i ∑ (log W )
i =1
i
2.73391 15.241595
a 0 = y − a1 x = − a1 = − (0.3796) = −0.3815
n n 8 8
− 0.3815
α = 10 = 0.4154
A = α (W ) β = 0.4154(W ) 0.3796 = 0.4154(95) 0.3796 = 2.34m 2

3. The flow rate is equal to the derivative of volume with respect to time. One way to handle unequally spaced
data is to fit a Lagrange or Newton interpolating polynomial from the formula sheet to a set of adjacent points that
bracket the time value of t =7 s at which you want to evaluate the derivative (dV/dt). The polynomial can then be
differentiated analytically to yield a formula to estimate the derivative. The three adjacent points to fit a second-
order Lagrange polynomial:
x0 = 1; f(x0) = 1
x1=5; f(x1) = 8
x2 =8; f(x2)=16.4

2 n x − xj
f 2 ( x) = ∑ Li ( x) f ( xi ) = L0 ( x) f ( x0 ) + L1 ( x) f ( x1 ) + L2 ( x) f ( x 2 ); Li ( x) = ∏
i =0 j =0 xi − x j
j ≠i

 x − x1  x − x 2   x − x0  x − x 2   x − x0  x − x1 
L0 ( x) =   ; L1 ( x) =   ; L2 ( x) =   
 x0 − x1  x0 − x 2   x1 − x0  x1 − x 2   x 2 − x0  x 2 − x1 
 x − x1  x − x 2   x − x0  x − x 2   x − x0  x − x1 
f 2 ( x) =    f ( x 0 ) +    f ( x1 ) +    f ( x 2 )
 x 0 − x1  x0 − x 2   x1 − x0  x1 − x 2   x 2 − x0  x 2 − x1 

Prof. Dr. Hüseyin Oğuz MATH302 Spring 08-09 FinalExam_10-06-09


Page 5 / 6
2 x − x1 − x 2 2 x − x0 − x 2 2 x − x0 − x1
f ′( x) = f ( x0 ) + f ( x1 ) + f ( x2 )
( x0 − x1 )( x 0 − x 2 ) ( x1 − x 0 )( x1 − x 2 ) ( x 2 − x 0 )( x 2 − x1 )
2( 7 ) − 5 − 8 2( 7 ) − 1 − 8 2( 7 ) − 1 − 5
f ′(7) = (1) + (8) + (16.4) = 0.035714 − 3.33333 + 6.247619 = 2.95
(1 − 5)(1 − 8) (5 − 1)(5 − 8) (8 − 1)(8 − 5)

The flow rate is equal to 2.95 cm3/s.

4. (a) The analytical solution can be evaluated as

∫ (1 − e
−2 x
[
)dx = x + 0.5e − 2 x ]4
0 = 4 + 0.5e − 2( 4 ) − 0 − 0.5e − 2( 0) = 3.500167731
0

(b) single application of the trapezoidal rule:


f (a ) + f (b) 0 + 0.999665 3.500167731 − 1.99933
I ≈ (b − a ) = ( 4 − 0) = 1.99933; ε t = × 100 = 42.88%
2 2 3.500167731
(c) composite Trapezoidal rule:
b−a 4−0
n =2 (number of segments); h= = =2
n 2
n −1
f ( x 0 ) + 2∑ f ( x i ) + f ( x n )
i =1 f ( x 0 ) + 2 f ( x1 ) + f ( x 2 ) f ( 0) + 2 f ( 2) + f ( 4)
I ≈ (b − a ) = ( 4 − 0) = ( 4 − 0)
2n 4 4
0 + 2(0.981684) + 0.999665 3.500167731 − 2.96303
I ≈ ( 4 − 0) = 2.96303; ε t = × 100 = 15.35%
4 3.500167731

b−a 4−0
n =4(number of segments); h= = =1
n 4
n −1
f ( x 0 ) + 2∑ f ( xi ) + f ( x n )
i =1 f ( x0 ) + 2 f ( x1 ) + 2 f ( x 2 ) + 2 f ( x3 ) + f ( x 4 )
I ≈ (b − a) = ( 4 − 0) =
2n 8
f (0) + 2 f (1) + 2 f (2) + 2 f (3) + f (4) 0 + 2(0.86466 + 0.981684 + 0.99752) + 0.999665
I ≈ ( 4 − 0) = ( 4 − 0)
8 8
I ≈ 3.3437
3.500167731 − 3.3437
εt = × 100 = 4.47%
3.500167731

(d) single application of Simpson’s 1/3 rule:


b−a 4−0
h= = =2
n 2
I≈
h
[ f ( x0 ) + 4 f ( x1 ) + f ( x 2 )] = (b − a ) f ( x0 ) + 4 f ( x1 ) + f ( x 2 ) = (4 − 0) f (0) + 4 f ( 2) + f (4)
3 6 6
0 + 4(0.981684 ) + 0.999665
I ≈ ( 4 − 0) = 3.28427
6
3.500167731 − 3.28427
εt = × 100 = 6.17%
3.500167731
(e) composite Simpson’s 1/3 rule (n =4)

Prof. Dr. Hüseyin Oğuz MATH302 Spring 08-09 FinalExam_10-06-09


Page 6 / 6
b−a 4−0
h= = =1
n 4
f ( x 0 ) + 4[ f ( x1 ) + f ( x3 )] + 2 f ( x 2 ) + f ( x 4 ) f (0) + 4[ f (1) + f (3)] + 2 f (2) + f (4)
I ≈ (b − a) = (4 − 0)
12 12
0 + 4(0.86466 + 0.99752) + 2(0.981684) + 0.999665
I ≈ ( 4 − 0) = 3.47059
12
3.500167731 − 3.47059
εt = × 100 = 0.85%
3.500167731

(f) single application of Simpson’s 3/8 rule:

b−a 4−0
h= = = 1.33333
n 3
3h f ( x 0 ) + 3 f ( x1 ) + 3 f ( x 2 ) + f ( x3 )
I ≈ [ f ( x0 ) + 3 f ( x1 ) + 3 f ( x 2 ) + f ( x3 )] = (b − a )
8 8
4  4  4
f ( 0) + 3 f   + 3 f  2  + f  3 
I ≈ ( 4 − 0) 3  3  3  = (4 − 0) 0 + 3(0.930517 + 0.995172) + 0.999665 = 3.388366
8 8
3.500167731 − 3.388366
εt = × 100 = 3.19%
3.500167731

Prof. Dr. Hüseyin Oğuz MATH302 Spring 08-09 FinalExam_10-06-09

You might also like