0% found this document useful (0 votes)
8 views5 pages

Modelling Simulation Assignment Help

Uploaded by

Thảo Nguyên
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Modelling Simulation Assignment Help

Uploaded by

Thảo Nguyên
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Solution to Question 4: Root-finding problem (Bisection,

Secant, and Newton-Raphson Methods)


We need to find the height h of the liquid in the spherical storage tank such that the volume is 60
ft³. The equation governing the height h is:

3V
f (h) = h3 − 3Rh2 + =0
π

6
R= 2
​ = 3 ft (radius of the spherical tank, given the diameter is 6 ft)
V = 60 ft3 (volume of oil in the tank)

The modified equation becomes:


180
f (h) = h3 − 9h2 + =0
π

Now, we will solve for h using three numerical methods (Bisection, Secant, and Newton-Raphson),
performing three iterations for each method.

Step 1: Bisection Method


The Bisection method involves narrowing down the root by repeatedly dividing the interval into
two halves. It requires two initial guesses a and b such that f (a) ⋅ f (b) < 0.

1st iteration:
Choose a = 0 and b = 3.
180 180
f (0) = ≈ 57.2958, f (3) = 33 − 9(3)2 + = −54 + 57.2958 = 3.2958
π π
​ ​

Since f (0) > 0 and f (3) > 0, we need to choose a better interval. Let’s try a = 2.
f (2) = 23 − 9(2)2 + 180
π

= −38.7042.

Now, we have f (2) < 0 and f (3) > 0. Hence, the root lies between a = 2 and b = 3.

1st iteration midpoint:

a+b 2+3
c1 = = = 2.5
2 2
​ ​

180
f (2.5) = 2.53 − 9(2.5)2 + ≈ −16.2042
π

Since f (2.5) < 0, update a = 2.5.

2nd iteration midpoint:

2.5 + 3
c2 = = 2.75
2
​ ​

180
f (2.75) = 2.753 − 9(2.75)2 + ≈ −7.2042
π

Update a = 2.75.

3rd iteration midpoint:

2.75 + 3
c3 = = 2.875
2
​ ​

180
f (2.875) = 2.8753 − 9(2.875)2 + ≈ −1.4542
π

Update a = 2.875.

After three iterations, the estimated root is around 2.875 ft. Continue iterations until the desired
precision is reached.

Step 2: Secant Method


The Secant method uses two initial guesses to approximate the root:

f (hn )(hn − hn−1 )


hn+1 = hn −
​ ​ ​

f (hn ) − f (hn−1 )
​ ​ ​

​ ​

Start with h0 ​ = 2 and h1 = 3.


1st iteration:

f (3)(3 − 2) 3.2958(1)
h2 = 3 − =3− ≈ 2.918
f (3) − f (2) 3.2958 + 38.7042
​ ​ ​

2nd iteration: Use h1 ​ = 3 and h2 = 2.918.



f (2.918)(2.918 − 3)
h3 = 2.918 −
f (2.918) − f (3)
​ ​

Calculate f (2.918) and proceed similarly for three iterations.

Step 3: Newton-Raphson Method


The Newton-Raphson method uses the derivative of the function:

f (hn )
hn+1 = hn −

f ′ (hn )
​ ​ ​

f ′ (h) = 3h2 − 18h

Start with h0 ​ = 3.

1st iteration:

f (3) 3.2958
h1 = 3 − = 3 − ≈ 2.8
f ′ (3) 3(3)2 − 18(3)
​ ​ ​

Proceed similarly for the next two iterations.

Solution to Question 5: Numerical Integration using Euler


and Runge-Kutta Methods
We need to find the concentration of salt x after 3 minutes, given:

dx
= 37.5 − 3.5x
dt

with x(0) = 50 g/L.

We’ll use Euler’s method and Runge-Kutta methods (2nd and 4th order) with a step size h = 1.5
min.
Euler's Method
Euler’s method is:

xn+1 = xn + h ⋅ f (tn , xn )
​ ​ ​ ​

1st step (t0 ​ = 0, x0 = 50):


x1 = 50 + 1.5 ⋅ (37.5 − 3.5 ⋅ 50) = 50 + 1.5 ⋅ (−137.5) = 50 − 206.25 = −156.25


2nd step (t1 ​


= 1.5, x1 = −156.25):

x2 = −156.25 + 1.5 ⋅ (37.5 − 3.5 ⋅ (−156.25))


Continue similarly until t = 3 min.

Runge-Kutta 2nd Order Method


The RK2 method is:

k1 = h ⋅ f (tn , xn )
​ ​ ​

h k1
k2 = h ⋅ f ( t n + , xn + )

2 2
​ ​ ​ ​

xn+1 = xn + k2
​ ​ ​

Compute k1 and k2 for each step.


​ ​

Runge-Kutta 4th Order Method


The RK4 method is:

k1 = h ⋅ f (tn , xn )
​ ​ ​

h k1
k2 = h ⋅ f ( t n + , xn + )

2 2
​ ​ ​ ​

h k2
k3 = h ⋅ f ( t n + , xn + )

2 2
​ ​ ​ ​

k4 = h ⋅ f (tn + h, xn + k3 )
​ ​ ​ ​
k1 + 2k2 + 2k3 + k4
xn+1 = xn +
​ ​ ​ ​

6
​ ​ ​

After applying these methods for three iterations, you'll have the salt concentration after 3 minutes.
Let me know if you need further calculations or clarifications!

You might also like