Sei sulla pagina 1di 10

TUTORIAL WEEK 5

NEWTON RAPHSON METHOD

P R E P A R E D B Y : D R . S I T I N U R U L ’A I N B I N T I Y U S O P
EXAMPLE 1
• A spherical storage tank contains oil. The tank has a diameter of 6ft.
Calculate the height, h to which a dipstick with 8 ft long would be
wet with oil when immersed in the tank when it contains 6ft3 of oil
by using Newton Raphson method. Given that the equation that
gives the height, h of the liquid in the spherical tank for the given
volume and radius is:
• 𝑓 ℎ = ℎ3 − 9ℎ2 + 3.8197 = 0
• use the initial h, ho= 1
• Calculate until the percentage error less than 5%
EXAMPLE 1 - SOLUTION
𝑓(ℎ)
(1) Formula of Newton Raphson method: ℎ1 = ℎ𝑜 −
𝑓′ (ℎ)
(2) 𝑓 ℎ = ℎ3 − 9ℎ2 + 3.8197 = 0
(3) 𝑓 ′ ℎ = 3ℎ2 − 18ℎ differentiate f(h)

(4) Iteration 1: ℎ𝑜 = 1
(1)3 −9 1 2 +3.8197 −4.1803
ℎ1 = 1 − =1− = 0.7213
3(1)2 −18(1) −15

(5) Calculate % error:


ℎ1 − ℎ𝑜 0.7213 − 1
× 100 = × 100 = 38.64%
ℎ1 0.72131
the question asked
to get less than 5%
error, hence
proceed to 2nd
iteration.
EXAMPLE 1 - SOLUTION
• Use the new value obtained in iteration 1 (h1) as your
hold .
(6) Iteration 2: ℎ1 = 0.7213 • You can still use notation ho if you want, but to avoid
confusion, the notation hnew will follow the number of
iteration.

(0.7213)3 −9 0.7213 2 +3.8197


ℎ2 = 0.7213 −
3(0.7213)2 −18(0.7213)
−0.4876
= 0.7213 − = 0.6786
−11.423

(7) Calculate % error:


ℎ2 − ℎ1 0.6786 − 0.7213
× 100 = × 100 = 6.29%
ℎ2 0.6786
More than 5%,
hence proceed to 3rd
iteration.
EXAMPLE 1 - SOLUTION
(8) Iteration 3: ℎ2 = 0.6786 new value obtained in iteration 2 (h2)

(0.6786)3 −9 0.6786 2 +3.8197


ℎ3 = 0.6786 −
3(0.6786)2 −18(0.6786)
−0.012536
= 0.6786 − = 0.6775
−10.834

(9) Calculate % error:


ℎ3 − ℎ2 0.6775 − 0.6786
× 100 = × 100 = 0.17%
ℎ3 0.6775
Less than 5%, hence the answer is
0.6775ft. (final answer)

You can try one more iteration to


make sure you get constant value.
Answer for Iteration 4: h4 =
0.6775ft.
EXAMPLE 2(a)
• Van der Waals equation can be used to determine properties of
gases at specific temperature and pressure. The equation is given as
below:
𝑎
• 𝑝+ v − b = RT
𝑣2
• As a chemical engineering student, you are required to accurately
estimate the molal volume (v) of oxygen (O2 ) at 300K and 1 atm
using Newton Raphson method. An initial guess of the molal volume
of O2 is 24.6162L.mol. (obtain from the calculation of molal volume
using ideal gas law) – calculation as below:
𝑉 𝑅𝑇
𝑃𝑉 = 𝑛𝑅𝑇, 𝑣 = =
𝑛 𝑃
𝑅𝑇 (0.0882054×300)
𝑃 = 1 𝑎𝑡𝑚, 𝑇 = 300𝐾 𝑣= = = 24.62𝐿/𝑚𝑜𝑙
𝑃 1
• Calculate until the percentage error less than 0.001%
EXAMPLE 2(a) - SOLUTION
𝑓 𝑣
(1) Formula of Newton Raphson method: 𝑣1 = 𝑣𝑜 −
𝑓′ 𝑣
𝑎
(2) 𝑓 𝑣 = 𝑝 + 𝑣2 v − b − RT = 0 to get f(v), the equation must equal
to zero.
𝑎 𝑎𝑏
= 𝑝𝑣 − 𝑝𝑏 + − − 𝑅𝑇 = 0 Expand the equation and
𝑣 𝑣2 differentiate.

(3) Insert constant values of P, R, and T.


Given that P = 1 atm, T = 300K, R = 0.082054 L.atm/(mol.K)
a = 1.36, b = 0.03183
1.36 1.36 0.03183
𝑓 𝑣 = 1 𝑣 − 1 0.03183 + −
𝑣 𝑣2
− 0.082054 300

1.36 0.0433
𝑓 𝑣 = 𝑣 − 0.03183 + − − 24.6162
𝑣 𝑣2
1.36 0.0865
(4) 𝑓 ′ 𝑣 = 1 − +
𝑣2 𝑣3
EXAMPLE 2(a) - SOLUTION
(5) Iteration 1: initial guess, 𝑣𝑜 = 24.62𝐿/𝑚𝑜𝑙
1.36 0.0433
𝑓(𝑣) 24.62−0.03183+24.62− −24.6162
24.622
𝑣1 = 𝑣𝑜 − = 24.62 − 1.36 0.0865
𝑓′ (𝑣) 1− +
24.622 24.623
24.62−0.03183+0.0552−0.0000714−24.6162
= 24.62 −
1−0.00224+0.0000058
0.0271
= 24.62 −
0.9978
= 24.59𝐿/𝑚𝑜𝑙

𝑣1 −𝑣𝑜 24.59−24.62
(6) Calculate % error: × 100 = × 100 = 0.001%
𝑣1 24.59

(7) Try to iterate one more time to get constant value.


EXAMPLE 2(b) – try it yourself
• From example 2(a), by using the same equation, estimate molal
volume of:
• (a) CO2 at T = 300K, and P = 1 atm (use the same initial guess of vo
in example 2(a). Final answer: 24.5126 L/mol
• (b) O2 at T = 300K and P = 10 atm a = 1 (use the same initial guess
of vo in example 2(a). Final answer: 2.4384 L/mol
REFERENCES
• Newton Raphson Method Examples, Autar Kaw, 2009.
University of Fluorida.
• Lecture Notes: Chapter 3: Roots of Equations; Universiti
Teknologi Malaysia (UTM)

Potrebbero piacerti anche