Professional Documents
Culture Documents
Assignment No. 01
(8 th semester)
1
Lab Assignment
Convergence Method
1- Secant Method
Example:
We will use four decimal digit arithmetic to find a solution and the resulting
iteration is shown in Table No. 01.
Table No: 01
Thus, with the last step, both halting conditions are met, and therefore, after six
iterations, our approximation to the root is -0.6595.
2- Broyden Method
Example:
2
Lab Assignment
Consider,
Assume that x is positive, without any loss of generality, then the parametric form
of this equation is as follows [4, 6]:
3
Lab Assignment
4
Lab Assignment
3- Newton-Raphson Method
Example:
Let us solve x 3 − x − 1 = 0 for x.
In this case f(x) = x3 − x − 1, so f 0 (x) = 3x2 − 1.
So the recursion formula (1) becomes
xn+1 = xn − (x3n − xn − 1)/3x2n − 1
Need to decide on an appropriate initial guess x0 for this problem. A rough graph
can help. Note that f(1) = −1 < 0 and f(2) = 5 > 0. Therefore, a root of f(x) = 0 must
exist between 1 and 2. Let us take x0 = 1 as our initial guess. Then
and with the value just found for x2, we find x3 = 1.32520. Carrying on, we find
that x4 = 1.32472, x5 = 1.32472, etc. We can stop when the digits stop changing
to the required degree of accuracy. We conclude that the root is 1.32472 to 5
decimal places.
5
Lab Assignment
Formulate the SQP sub problem for the candidate point x = (2, 2, 0) T and the
candidate Lagrange multiplier y = 2.
The general form of NLO problem is
min f(x)
s.t. hj (x) = 0, j = 1, . . . , m.
The Lagrange function is
where yj = R, j = 1, . . . , m.
In our case the Lagrange function is
The gradient and Hessian of the Lagrange function with respect to x are:
6
Lab Assignment