Professional Documents
Culture Documents
1. (25 p) To find the inverse of a number ‘a’, one can use the equation
1
f (c ) = a − =0
c
where c is the inverse of ‘a’.
Use the Newton-Raphson method of finding roots of equations to
a) Find the inverse of 2.5. Conduct three iterations to estimate the root of the above equation.
b) Find the absolute relative approximate error at the end of each iteration, and
c) The number of significant digits at least correct at the end of each iteration
2.(25 p) An investigator has reported the data tabulated below for an experiment to determine the growth rate
of bacteria k (per d), as a function of oxygen concentration c (mg/L). It is known that such data can be
modeled by the following equation:
k c2
k = max 2
cs + c
where cs and kmax are parameters. Use a transformation to linearize this equation. Then use linear regression
to estimate cs and kmax and predict the growth rate at c = 2 mg/L.
Data:
c 0.5 0.8 1.5 2.5 4
k 1.1 2.4 5.3 7.6 8.9
3.(25 p) The velocity v (m/s) of air flowing past a flat surface is measured at several distances y (m) away from the
surface. Determine the shear stress τ (N/m2) at the surface (y = 0),
dv
τ =µ
dy
∫ (1 − x − 4 x )
+ 2 x 5 dx
3
−2
(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) Simpson’s 3/8 rule. For each of the numerical estimates (b)
through (e), determine the percent relative error based on (a).
Prof. Dr. Hüseyin Oğuz MATH302 Spring 08-09 ResitExam_26-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
− −
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 ( x0 ) + f ( x1 )
I ≈ (b − a ) ; sin gle Trapezoidal Rule
2
n −1
f ( x 0 ) + 2∑ f ( xi ) + f ( x n )
i =1
I ≈ (b − a ) ; composite Trapezoidal Rule
2n
I≈
h
[ f ( x0 ) + 4 f ( x1 ) + f ( x2 )] = (b − a) f ( x0 ) + 4 f ( x1 ) + f ( x2 ) ; 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 ( x0 ) + 3 f ( x1 ) + 3 f ( x 2 ) + f ( x3 )] = (b − a) f ( x0 ) + 3 f ( x1 ) + 3 f ( x2 ) + f ( x3 ) ; single Simpson' s 3/8 Rule
8 8
3h n−2 n −3
I≈ f ( x 0 + 3 ∑ [ f ( xi ) + f ( xi +1 )] + 2 ∑ f ( x j ) + f ( x n ) ; composite Simpson' s 3/8 Rule
8 i =1, 4, 7 j = 3, 6 , 9
f (c i )
ci +1 = ci −
f ′(c )
1
a−
ci
= ci −
1
ci2
1
= ci − ci2 a −
ci
= ci − ci2 a + ci
∴ ci +1 = 2ci − ci2 a
Iteration #1
The estimate of the root is co= 0.5
∴ c1 = 2c0 − c02 a
1 c 1 1
= s +
k k max c 2 k max
Consequently, a plot of 1/k versus 1/c should yield a straight line with an intercept of 1/kmax and a slope of cs/kmax
5(4.399338) − 6.229444(1.758375)
a1 = = 0.202489
5(18.66844) − (6.229444) 2
1.758375 6.229444
a0 = − 0.202489 = 0.099396
5 5
Therefore, kmax = 1/0.099396 = 10.06074 and cs = 10.06074(0.202489) = 2.037189, and the fit is
10.06074c 2
k=
2.037189 + c 2
The equation can be used to compute
10.06074(2) 2
k= = 6.666
2.037189 + (2) 2
3. The velocity at the surface can be computed by using second order Lagrange polynomial function as
x0 = 0 f(x0) = 0
x1 = 0.002 f(x1) = 0.287
x2 = 0.006 f(x2) = 0.899
f 2 (x ) =
(x − x1 )(x − x2 ) f (x ) + (x − x0 )(x − x2 ) f (x ) + (x − x0 )(x − x1 ) f (x )
(x0 − x1 )(x0 − x2 ) 0 (x1 − x0 )(x1 − x2 ) 1 (x2 − x0 )(x2 − x1 ) 2
′ 2 x − ( x1 + x 2 ) 2 x − ( x0 + x 2 ) 2 x − ( x0 + x1 )
f 2 (x ) = f ( x0 ) + f ( x1 ) + f (x )
(x0 − x1 )(x0 − x 2 ) (x1 − x0 )(x1 − x2 ) (x2 − x0 )(x2 − x1 ) 2
2(0) − 0.002 − 0.006 2(0) − 0 − 0.006 2(0) − 0 − 0.002
f ' ( 0) = 0 + 0.287 + 0.899
(0 − 0.002)(0 − 0.006) (0.002 − 0)(0.002 − 0.006) (0.006 − 0)(0.006 − 0.002)
= 0 + 215.25 − 74.9167 = 140.3333
Therefore, the shear stress can be computed as
N ⋅s 1 N
τ = 1.8 × 10 −5 140.3333 = 0.00253 2
m2 s m
4. (a) Analytical solution:
4
4 x2 x6
∫ (1 − x − 4 x + 2 x ) dx = x − − x 4 + = 1104
3 5
−2 2 3 −2
− 29 + 2(−2) + 1789
I = (4 − (−2)) = 2634 ε t = 138.59%
4