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

Lab 3

The lab report details the application of various numerical methods to solve nonlinear equations, including the secant method, Newton-Raphson method, Bisection method, and Fixed-Point Iteration. Results indicate successful convergence to roots with high accuracy, demonstrating the effectiveness of these methods in handling nonlinear problems. The report emphasizes the importance of initial guesses and the characteristics of the functions in determining the convergence behavior of the methods used.

Uploaded by

tesfahun demisew
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)
12 views5 pages

Lab 3

The lab report details the application of various numerical methods to solve nonlinear equations, including the secant method, Newton-Raphson method, Bisection method, and Fixed-Point Iteration. Results indicate successful convergence to roots with high accuracy, demonstrating the effectiveness of these methods in handling nonlinear problems. The report emphasizes the importance of initial guesses and the characteristics of the functions in determining the convergence behavior of the methods used.

Uploaded by

tesfahun demisew
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

ADDIS ABABA UNIVERSITY

ADDIS ABABA INSTITUTE OF TECHNOLOGY


SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING

COMPUTATIONAL METHODS LAB REPORT

GROUP MEMBERS ID

TESFAHUN DEMISEW UGR/7272/15


ABENEZER EFREM UGR/8147/15
AMIR NASSIR UGR/4287/15

Submitted to: Yonas Y.


Submission date: December 9, 2024
1

LAB 3 Exercise 3.3

The given problem involves solving the nonlinear equation:

𝑥 −𝑥
𝑒 + 2 + 2𝑐𝑜𝑠(𝑥) − 6 = 0

using the secant method, an iterative root-finding technique. The approach begins with two
guesses x= 0.5 and x1= 1.0, and then iteratively improves the approximation of the root until the
method converges; that is, when the absolute difference between two consecutive
approximations is less than: 10^-6

Results

● Root found : x = 1.829384


● Value of f(x) at root : 1.63 * 10^-6
● Number of iterations: 13
● Tolerance achieved: |𝑥𝑛+1 − 𝑥𝑛| < 10^-6

Analysis and Theoretical Deduction:

● The secant method successfully converged to a root at x=1.829384 after 13 iterations.


● The convergence took a bit more iterations than expected (13 iterations); this is very
typical in nonlinear problems where the shape of the function is a complex one, or for
initial guesses not near to the root.
● The secant method's convergence is dependent on the initial guesses. Since 𝑓(𝑥) has
multiple roots, the initial values (𝑥0=0.5 , 𝑥1=1.0) led the method to converge to the root
near 𝑥=1.829384 This behavior aligns with the theoretical properties of the secant
method.
● The superlinear convergence rate is evident, though it required 13 iterations due to the
nonlinear nature of 𝑓(𝑥)
● The results show that it is important to pick good initial guesses for nonlinear equations
with multiple roots. Starting from other points may converge to another root of the
equation.
● The method effectively avoids derivative computations, making it suitable for solving
equations where derivative evaluation is complex or impractical.
2

LAB 3 Exercise 3.4

The Newton-Raphson method was used to solve two nonlinear equations:

𝑓(𝑥) = 2𝑐𝑜𝑠ℎ(𝑥/4) − 𝑥 : (a hyperbolic equation)


𝑓(𝑥) = 𝑠𝑖𝑛(𝑥) + 𝑥𝑐𝑜𝑠(𝑥): (a trigonometric equation)

Results:

For the first question or equation


● Root x ≈2.357551
● Function value : f(2.357551) ≈ 3.706×10−8

For the second equation


● Root x ≈ −4.913180
● Function value : f(−4.913180) ≈ 2.291×10−6

Analysis:

For the first equation which is the hyperbolic function the method converged quickly due to the
smoothness of the hyperbolic function and the well-behaved derivative. This behavior aligns
with theoretical expectations for the Newton-Raphson method when applied to such functions.

For the second function the periodic nature of the function ensures multiple roots. The
Newton-Raphson method identified one of these roots based on the initial guess. The rapid
convergence aligns with expectations, given the smooth behavior of trigonometric functions.
The extremely small function values at the computed roots indicate that the solutions are highly
accurate. The small nonzero values result from numerical precision limitations in floating-point
computations.

The updated results are the effectiveness of the Newton-Raphson method in solving nonlinear
equations. This shows its utility when the initial guesses are given with care for convergence to
very accurate roots. The roots obtained agree with theoretical expectations and demonstrate that
the method is capable of dealing with many types of nonlinear equations.
3

Assignment one

Question one
𝑥
The task is to solve the equation 𝑒 + 2𝑥 + 2 𝑐𝑜𝑠(𝑥) − 6 = 0 using the Bisection Method
in MATLAB. The Bisection Method is an iterative numerical technique that refines the interval
where the root lies, based on the sign change of the function at the interval's endpoints. The
method continues until the desired accuracy is achieved.

Results:

1. Root Found:
● X ≈ 1.065048x \approx 1.065048x≈1.065048
2. Number of Iterations:
● 17 iterations were required to reach the desired tolerance.
3. `Function Value at Root:
● f(1.065048) ≈−0.000001(which is very close to zero)

Analysis:

The root found, x≈1.065048 produces a function value of f(1.065048)≈−0.000001 which is


extremely close to zero. This indicates that the root is very accurate, within the tolerance of
10^-6 The small value of the function at the root confirms that the Bisection Method has
successfully approximated the root.

The method converged in 17 iterations. This is a reasonable number; therefore, the Bisection
Method is working efficiently. The method halves the interval size at every step, and for this
case, it reaches its desired accuracy in a very small number of iterations.
4

Question two
𝑥
We used the Fixed-Point Iteration method to solve the equation 𝑥𝑒 − 𝑥 = 0 which is
𝑥
equivalent to solving for the root of the function 𝑓(𝑥) = 𝑥𝑒 − 𝑥 We rearranged the equation
−𝑥
to the fixed-point form 𝑥 = 𝑒 which is commonly used for this type of equation. The method
−𝑥
iteratively applies the fixed-point function 𝑔(𝑥) = 𝑒 starting from an initial guess of x0=0.5,
with a tolerance of 1×10^−6 and a maximum of 100 iterations.

Analysis:
From the results, we can observe that the Fixed-Point Iteration converges to a root around
x = 0.567143 after 22 iterations. This value is very close to the theoretical root of the equation
−𝑥
𝑥= 𝑒 , which is known to be approximately 0.567143.

The method successfully converges within a few iterations, demonstrating that the rearranged
−𝑥
fixed-point equation 𝑥 = 𝑒 is well-suited for this problem. The convergence is quick due to
−𝑥
the fact that g′(x) = -𝑒 is always less than 1 in magnitude, which satisfies the convergence
condition of Fixed-Point Iteration

The root of the equation is known to be approximately 0.567143, which is consistent with the
result obtained from the Fixed-Point Iteration method. This confirms the correctness of the
method and the rearranged form.

You might also like