Anda di halaman 1dari 6

Vittor Ferreira!

Student ID - 802187!
EGM07 - Optimisation and Reliability!

Coursework 1!
Problem 1!
Approximate the real root of!
x3 +5x3=0!
to four decimal places using the Newton-Raphson technique. Marks will be
awarded for explanation as well as computational accuracy.!
Resolution:!
The Newton-Raphson method is an iterative process to approach with accuracy
one root of a function. The root that is found depends on a arbitrary initial value of a xvalue. So, the basic algorithm is to calculate the iteration below after choosing arbitrarily
a x0 initial value.!

xn+1 = xn

f (xn )
f '(xn )

By choosing x0=0.5!
We compute,!

!
!
!
!

f (0.5) = 0.5 3 + 5(0.5) 3 = 0.3750

f '(0.5) = 3x0.5 2 + 5 = 5.7500

x1 = x0

f (x0 )
0.3750
= 0.5
= 0.5652
f '(x1 )
5.7500

And continuing the iterations we find the values below at the table!

!
1

y(x)

y`(x)

-0.3750 5.7500 0.5000 0.5652

0.0067 5.9584 0.5652 0.5641

0.0000 5.9546 0.5641 0.5641


Table 1: Newton-Raphson Values!

The iteration stops when the fourth decimal place of the last 2 results are equal.!

!
Problem 2!
Consider the figure below. The cross-sectional area, A, of a gutter with equal
base and edge length of 2 units is given by:!
A = 4sin(1+cos)!

Use the Dichotomous method to estimate the value of that maximises the

cross- sectional area, taking the initial interval for as [0, /2], and the final accuracy =
0.2.!
Verify your answer using an independent method.!
Resolution:!
The Dichotomous method is used to find the minimum or maximum of a function.
It consists of establishing an initial interval and a mid point of this interval, evaluatig the

function in points of this interval and keep reducing this interval progressively until a sufficiently small range is obtained.!
The algorithm is:!
1- Define the interval [a,b]!
2- Define the accuracy !
3- Calculate !

!
!
!

a+b

2
2
a+b
x2 =
+
2
2
x1 =

4- Compute f(x1) and f(x2)!


5- If f(x1)>f(x2), then the new interval is [a,x2]!
6- If f(x1)<f(x2), then the new interval is [x1,b]!
7- Repeat steps 3 to 6 until your interval is smaller than !
So, we define!

!
!
!

a=0

= 1.5708
2
= 0.2
b=

and calculate!

!
!
!
!

0 + 1.5708 0.2

= 0.6854
2
2
0 + 1.5708 0.2
x2 =
+
= 0.8854
2
2
x1 =

following we compute!

!
!

f (x1 ) = 4 sin(0)(1+ cos(0)) = 4.4921


f (x2 ) = 4 sin(1.5708)(1+ cos(1.5708)) = 5.0568
1

f(x1)<f(x2), so the new interval is [0.6854,1.5708]!


To compute the range of the interval there is a formula:!

!
!
!

1
Ik = I0
2

Where Io is the range of the initial interval (a b) and k is the number of the iteration, so for the first iteration, k=0.!
Then continuing the iterations we find the values showed in the table below!

A(x

A(x

Ik

1.5708 0.6854 0.8854 4.4921 5.0568 1.5708

0.6854 1.5708 1.0281 1.2281 5.1942 5.0334 0.4427

0.6854 1.2281 0.8567 1.0567 5.0025 5.1957 0.1357


Table 2: Results for Dichotomous method!

!
Using the Golden Search Method:!
The Golden Search Method is used to fin the maximum and minimum of functions
as well as the Dichotomous method.!
This method uses the golden ratio K=1.618034 to calculate the intervals of iterations along the algorithm.!
The algorithm is:!
1- Determine a1, b1 and !
2- Assign I1= b1 a1, K=1.618034!
3-Compute!

!
!

I
I2 = 1
K
xa,1 = b1 I 2
xb,1 = a1 + I 2

4- Compute !

I k+2

I k+1
=
K

5- If f(xa)f(xb) then,!

!
!
!
!
!

ak+1 = xa,k
bk+1 = bk
xa,k+1 = xb,k
xb,k+1 = ak+1 + I k+2

6- If f(xa)f(xb) then,!

!
!
!
!
!

ak+1 = ak
bk+1 = xb,k
xa,k+1 = bk+1 I k+2
xb,k+1 = xa,k

7- Repeat steps 4 to 6 until Ik+2 is less than the accuracy !


So we determine !

!
!
!
!

a1 = 0

= 1.5708
2
= 0.2
I1 = 1.5708 0 = 1.5708
K = 1.618034
b1 =

And compute!

!
!
!
!

I 1.5708
I2 = 1 =
= 0.9708
K 1.618304
xa,1 = b1 I 2 = 1.5708 0.9708 = 0.6
xb,1 = a1 + I 2 = 0.9708
0.9708
I
I k+2 = I 3 = 2 =
= 0.6
K 1.618304
1

Evaluating the function at xa,1 and xb,1!

!
!
!

f (xa,1 ) = (1)4 sin(0.6)(1+ cos(0.6)) = 4.1226


f (xb,1 ) = (1)4 sin(0.9708)(1+ cos(0.9708)) = 5.1654

note that now f(x) is multiplied by -1 because the algorithm is based on finding the
minimum, so to find the maximum just multiplies the original function by -1 and apply the
rules normally.!
So, f(xa,1)>f(xb,1) then,!

!
!
!
!
!

a2 = xa,1 = 0.6
b2 = b1 = 1.5708
xa,2 = xb,1 = 0.9708
xb,2 = a2 + I 3 = 0.6 + 0.6 = 1.2

Continuing the iterations until Ik+2 reach some value less than 0.2 we found the
results in the table below!
n

Ik

1.5708 1.5708 0.6000 0.9708 -4.1226 -5.1654

0.6000

1.5708 0.9708 0.9708 1.2000 -5.1654 -5.0791

0.6000

1.2000 0.6000 0.8292 0.9708 -4.9418 -5.1654

0.8292

1.2000 0.3708 0.9708 1.0583 -5.1654 -5.1955

0.9708

1.2000 0.2292 1.0583 1.1124 -5.1955 -5.1743

0.9708

1.1124 0.1416

A(x

A(x

Table 3: Results of Golden Search Method

Anda mungkin juga menyukai