Sei sulla pagina 1di 8

EKC 245

MATHEMATICAL METHODS FOR


CHEMICAL ENGINEERING

Group 17

Group members name Matric number


Nanthini A/P Mohanasuntharam 141283
Lyana Sabrina Binti Azmi 141589
Goh Zi Qi 143887
Loh Li Sin 141256
Zainur Fazira Binti Nurdin 143392

LECTURER’S NAME : PROF. MADYA DR. TYE CHING


THIAN
Solution :

f(X) = - X4- 2X3- 8X2- 5X

a) Using Golden Section Search ( Xl = -2, Xu = 1, ƹs =1% )

First iteration :

First of all, find the value of d, using the formula :

d = [(√5 - 1)/2 ]×[Xu - Xl ]

= [(√5 - 1)/2 ]×[1-(-2)]

= 1.8541

Next, find the value of X1 and X2 :

X1 = Xl + d

= -2 + 1.8541
= -0.1459

X2 = Xu - d

= 1- 1.8541
= -0.8541

Error %

xu  xl
Ɛa = a  (1  R ) | | 100%
xopt

5  1 1  (  2)
 [1  ]| | 100%
2  0.1459

= 785.4 %

Then, we have to find the value of f(X1) and f(X2)

f(X1) = -(-0.1459)4- 2(-0.1459)3 - 8(-0.1459)2 -5(-0.1459)


= 0.5650

f(X2) = -(-0.8541)4- 2(-0.8541)3- 8(-0.8541)2 -5(-0.8541)


= -0.8514

f(X1) > f(X2) , Xu new = 1


Xl new = -0.8541
Second Iteration :

dnew = [(√5 - 1)/2 ]×[1-(-0.8541)]


= 1.1459

X1 new = -0.8541 + 1.1459


= 0.2918

Xu new = 1-1.1459
= -0.1459

Error %
xu  xl
a  (1  R) | | 100%
xopt

5  1 1  (0.8541)
=  [1  ]| | 100%
2  0.1459

= 485. 4 %
a) Golden Section Search

Iteration Xl F(Xl) X2 F(X2) X1 F(X1) Xu F(Xu) d Ɛa


1 -2 -22 -0.854101966 -0.85144945-0.145898034 0.564958415 1 -16 1.854101966 785.4101966
2 -0.854101966 -0.85144945 -0.1458980340.564958415 0.291796068-2.197079479 1 -16 1.145898034 485.4101966
-2.19707947
3 -0.854101966 -0.85144945 -0.416407865 0.80921575-0.145898034 0.564958415 0.291796068 9 0.708203932 105.1118718
4 -0.854101966 -0.85144945 -0.583592135 0.47484721-0.416407865 0.80921575 -0.145898034 0.564958415 0.437694101 64.9627094
5 -0.583592135 0.47484721-0.416407865 0.80921575-0.313082304 0.833016249 -0.145898034 0.564958415 0.270509831 53.39946334
6 -0.416407865 0.80921575-0.3130823040.833016249-0.249223595 0.776320574 -0.145898034 0.564958415 0.16718427 33.00268332
7 -0.416407865 0.80921575-0.352549156 0.8406076-0.313082304 0.833016249 -0.249223595 0.776320574 0.103325561 18.11341982
8 -0.416407865 0.80921575-0.3769410130.834955805-0.352549156 0.8406076 -0.313082304 0.833016249 0.063858709 11.1947091
9 -0.3769410130.834955805-0.352549156 0.8406076 -0.33747416 0.84015873 -0.313082304 0.833016249 0.039466852 6.91871072
10 -0.3769410130.834955805-0.3618660160.839377399-0.352549156 0.8406076 -0.33747416 0.84015873 0.024391856 4.275998383
11 -0.3618660160.839377399-0.352549156 0.8406076 -0.34679102 0.840792534 -0.33747416 0.84015873 0.015074996 2.68659207
12 -0.352549156 0.8406076 -0.346791020.840792534-0.343232296 0.840686688 -0.33747416 0.84015873 0.00931686 1.660405213
13 -0.352549156 0.8406076-0.3489904320.840773836 -0.34679102 0.840792534 -0.343232296 0.840686688 0.005758136 1.026186857
14 -0.3489904320.840773836 -0.346791020.840792534-0.345431709 0.840771967 -0.343232296 0.840686688 0.003558724 0.636714075

X optimum =
-0.3468
b) Using Parabolic Interpolation (𝑥0 =− 2 ,𝑥1 =− 1 ,𝑥2 = 1, iteration = 10)
𝑓 𝑥 =− 𝑥4 − 2𝑥3 − 8𝑥2 − 5𝑥
Use initial guess
𝑥0 =− 2
4 3 2
𝑓 𝑥 = 𝑓 − 2 =− − 2 −2 −2 −8 −2 − 5( − 2) =− 22

𝑥1 =− 1
4 3 2
𝑓 𝑥 = 𝑓 − 1 =− − 1 −2 −1 −8 −1 − 5( − 1) =− 2

𝑥2 = 1
4 3 2
𝑓 𝑥 = 𝑓 1 =− 1 −2 1 −8 1 − 5(1) =− 16

𝑓 𝑥0 𝑥21 − 𝑥22 + 𝑓 𝑥1 𝑥22 − 𝑥20 + 𝑓 𝑥2 𝑥20 − 𝑥21


𝑥3 =
2𝑓 𝑥0 𝑥1 − 𝑥2 + 2𝑓 𝑥1 𝑥2 − 𝑥0 + 2𝑓 𝑥2 𝑥0 − 𝑥1
− 22 − 1 2 − 12 + − 2 12 − ( − 2)2 + − 16 ( − 2)2 − ( − 1)2
=
2 − 22 − 1 − 1 + 2 − 2 1 − ( − 2) + 2 − 16 ( − 2) − − 1
=− 0.3889

𝑓 𝑥3 = 𝑓 − 0.3889
4 3 2
=− − 0.3889 − 2 − 0.3889 − 8 − 0.3889 − 5( − 0.3889)
= 0.8293

For new interval


𝑥0 =− 1
𝑥1 =− 0.3889
𝑥2 = 1

Error %
𝑥1 −𝑥0
𝜀𝑎 = × 100%
𝑥1

= |-0.3889-(-1)| /(-0.3889) x 100%


= 157.14 %
B) Parabolic Interpolation

Iteration X0 F(X0) X1 F(X1) X2 F(X2) X3 F(X3)


1 -2 -22 -1 -2 1 -16 -0.388888889 0.829322893
2 -1 -2 -0.388888889 0.829322893 1 -16 -0.417987468 0.807760464
3 -0.3888888890.829322893 -0.417987468 0.807760464 1 -16 -0.362578906 0.839235941
4 -0.4179874680.807760464 -0.362578906 0.839235941 1 -16 -0.3591259 0.839858527
5 -0.3625789060.839235941 -0.3591259 0.839858527 1 -16 -0.351080454 0.840696569
6 -0.35912590.839858527 -0.351080454 0.840696569 1 -16 -0.349471316 0.840761192
7 -0.3510804540.840696569 -0.349471316 0.840761192 1 -16 -0.348108897 0.840789043
8 -0.3494713160.840761192 -0.348108897 0.840789043 1 -16 -0.347687793 0.840792665
9 -0.3481088970.840789043 -0.347687793 0.840792665 1 -16 -0.347434606 0.84079371
10 -0.3476877930.840792665 -0.347434606 0.84079371 1 -16 -0.347338804 0.840793883

Xoptimum = -0.3473
c) Using Newton’s Method (𝑥0 =− 1 , 𝜀𝑎 = 1%)

𝑓'(𝑥𝑖 )
𝑥𝑖+1 = 𝑥𝑖 −
𝑓"(𝑥𝑖 )
𝑓 𝑥 =− 𝑥4 − 2𝑥3 − 8𝑥2 − 5𝑥
𝑓' 𝑥 =− 4𝑥3 − 6𝑥2 − 16𝑥 − 5
𝑓'' 𝑥 =− 12𝑥2 − 12𝑥 − 16

Use initial guess


𝑥0 =− 1
4 3 2
𝑓 − 1 =− − 1 −2 −1 −8 −1 − 5( − 1) =− 2
𝑓' − 1 =− 4 − 1 3
−6 −1 2
− 16 − 1 − 5 = 9
2
𝑓"( − 1) =− 12 − 1 − 12( − 1) − 16 =− 16

𝑓'(𝑥0 )
𝑥1 = 𝑥0 −
𝑓"(𝑥0 )
9
=− 1 −
− 16
=− 0.4375

Error %
𝑥1 −𝑥0
𝜀𝑎 = × 100%
𝑥1

− 0.4375 − − 1
= × 100%
− 0.4375
= 128.57%

𝑓 𝑥1 = 𝑓 − 0.4375
4 3 2
=− − 0.4375 − 2 − 0.4375 − 8 − 0.4375 − 5 − 0.4375
= 0.7871
𝑓' 𝑥1 = 1.1865
𝑓"(𝑥1 ) =− 13.0468
C) Newton’s Method

f ( x)   x 4  2 x 3  8 x 2  5 x

f ' ( x )   4 x 3  6 x 2  16 x  5

f ' ' ( x )   12 x 2  12 x  16

i xi xi+1 f'(x) f''(x) error (%)


1 -1 -0.4375 9 -16 128.5714286
2 -0.4375 -0.346556886 1.186523438 -13.046875 26.24190065
3 -0.346556886 -0.3472504 -0.009211622 -13.28253747 0.199715747
4 -0.3472504 -0.347250467 -8.84268E-07 -13.27998928 1.91754E-05

Xopt = -0.3473

Potrebbero piacerti anche