Professional Documents
Culture Documents
PUTRAJAYA CAMPUS
TEST 1
SEMESTER 2 2011/2012
PROGRAMME
SUBJECT CODE
: COEB223/MATB324
SUBJECT
DATE
TIME
INSTRUCTIONS TO CANDIDATES:
1.
2.
3.
Write all answers in the answer booklet provided. Show ALL your workings.
4.
5.
Please use FOUR (4) decimal points for your answers whenever possible.
1
0.5
2
1.7
3
3.4
4
5.7
Fit a straight line to the x and y value using linear regression method. Find the standard
estimate of error,
S y /x
(17 marks)
2. Solve for the following matrix system using the LU decomposition method:
]{ } { }
6 8 12 x
466
2 3 4 y = 160
3 5 7 z
265
(18 marks)
3. You are designing a spherical tank to hold water for small village. The volume of the
liquid the tank can hold can be computed as
V = h2
3 Rh
3
Page 2 of 10
4. The rate of change of a scalar quantity z (in g/m3) in a tank system can be written as:
dz
V =FQzkVz 2
dt
Where V is the volume of the system = 12 m3, F is the input feed rate =175g/min, Q is the
outflow rate =1.0 m3/g/min and k a second-order reaction rate=0.15m3/g/min. It is
expected that for the given system, the steady state value for z is obtained about 6 minutes
after the system is switched on.
Given z(3.0) = 6.8, use the Eulers Method with a time step of 0.5 to find the value of z at
t=6 minutes. Find the error of approximation for each iteration.
(25 marks)
5. The ministry of housing is in the process of determining the population growth trend of a
city and adjacent suburb. The population of the urban area is declining with the time
according to
Pu ( t )=Pu , max ek t + Pu ,min
u
Ps ( t ) =
1+
Ps , max
1 ek t
P0
s
Where Pu,max, ku, Ps,max, P0, and ks = empirically derived parameters. Determine the time
and corresponding value of Pu(t) and Ps(t) when the suburban has 20% larger
population than the city
The parameter value are Pu,max = 75,000 people, ku = 0.045/year, Pu,min = 100,000 people, Ps,max
= 300,000 people, P0 = 10,000 people, ks = 0.08/year. Use False Position Method with initial
guess of tL = 0, tU = 50. Do 3 iterations.
(25 marks)
6.
Page 3 of 10
True error:
True percent relative error:
t =
true valueapproximation
100
true value
Stopping criterion:
Terminate computation when a < s where s is the desired percent relative error
Taylor Series
Taylor series expansion
(n)
where remainder
f (n+1 ) ( ) n+1
Rn=
h
( n+1 ) !
or
Rn=O ( h n+1 )
Error propagation
For n independent variables x1, x2, , xn having errors
error in the function f can be estimated via
Page 4 of 10
~
x1
~
x2
, ,
~
xn
, the
| | | |
f=
| |
f
f ~
f
~
x1+
x2 ++
~
xn
x1
x2
xn
Page 5 of 10
False Position
Newton Raphson
Secant
Formulation
x r=
x l+ x u
2
x r=x u
f ( x u ) ( x lx u )
f ( x l ) f ( x u )
x i+1=x i
x i+1=x i
If
f ( x l ) f ( xr ) <0,
set
x u=x r
If
f ( x l ) f ( xr ) >0,
set
x l=x r
If
f ( x l ) f ( xr ) <0,
set
x u=x r
If
f ( x l ) f ( xr ) >0,
set
x l=x r
f ( xi )
f ' ( xi )
f ( x i ) ( x i1 xi )
f ( x i1 )f ( xi )
][
b ' ' 33
a' ' 33
b1
b ' a ' 23 x 3
b ' 2 x3 = 2
a' 22
b' ' 3
b a x a x
x 3= 1 12 2 13 3
a11
Back
Substitution
LU
decomposition
Decomposition
Page 6 of 10
x3 =
] [ ]{ } { } [
]{ } { } { }
Forward Substitution
Page 7 of 10
Gauss-Seidel method
x1j =
With relaxation,
new
old
x new
i = x i +(1 )x i
Formulation
y=a0+ a1 x
Errors
S y / x=
where
n
i=1
i=1
S r = e 21= ( y ia0a1 x i )2
a1=
n x i yi x i y i
S t = ( y i y ) 2
S t S r
St
where:
n x i ( x i )
a0 = ya 1 x
Polynomial
Regression
r 2=
Sr
n2
S y / x=
Sr
n( m+ 1 )
where
n
2 2
S r = ( y ia0a1 x ia2 x i )
i=1
Page 8 of 10
r 2=
S t S r
St
where:
S t = ( y i y ) 2
[
Multiple
Linear
Regression
xi
x2i
xi x 2i
x2i x 3i
x3i xi4
]{ } { }
a0
a1 =
a2
yi
xi y i
x2i y i
y=a0+ a1 x1 ++a m x m
S y / x=
Sr
n( m+ 1 )
r 2=
S t S r
St
where
n
S r = ( y ia0a 1 x 1a2 x 2 )
where:
S t = ( y i y ) 2
i=1
[
Newtons
divided
difference
interpolating
polynomial
x 1i x 2i
x 21i x 1 i x 2 i
x 1 i x 2 i x 22i
n
x1 i
x2 i
]{ } { }
a0
a1 =
a2
yi
x1 i yi
x 2 i yi
f (3) ( )
R2=( xx 0 ) ( xx 1 ) ( xx 2 )
For third order:
6
f 3 ( x )=b 0+ b1 ( xx 0 )+ b2 ( xx 0 )( xx1 ) + b3 ( xx 0 )( x x1 ) ( xx 2 )
or
where
R2=( xx 0 ) ( xx 1 ) ( xx 2 ) f [ x3 , x 2 , x
b0 =f ( x 0 )
b1=f [ x1 , x 0 ]
b2=f [ x 2 , x 1 , x 0 ]
b3 =f [ x 3 , x 2 , x 1 , x 0 ]
Lagrange
interpolating
polynomial
f n ( x ) = Li ( x ) f ( x i )
i=0
where,
Page 9 of 10
Li ( x ) =
j=0
j i
xx j
x ix j
Page 10 of 10