Lab 3
Lab 3
GROUP MEMBERS ID
𝑥 −𝑥
𝑒 + 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
Results:
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 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.