Professional Documents
Culture Documents
Lab 04 NC
Lab 04 NC
Lab Report-04
Registration FA20-BEE-088
Number
Class/Section 7TH- B
1
Fixed Point Iteration Method
Introduction:
The Fixed-Point Iteration method is a numerical analysis technique employed to approximate
solutions for algebraic and transcendental equations. It operates on the principle of iteratively
refining a sequence of approximations until a fixed point is reached, ultimately converging
towards the solution.
The Method:
1. Initialization: Start with an initial guess xo.
2. Iteration: Use the iterative formula xn+1=g(xn), where g(x) is a function such that g
(solution)=solutiong(solution)=solution.
3. Convergence: Repeat the iteration until xn+1 is sufficiently close to xn, indicating
convergence.
2
Advantages:
• Simplicity: The method is open and straightforward, making it easy to implement.
• Applicability: Suitable for finding real roots of non-linear equations.
• Convergence under Conditions: Ensures convergence to the root under certain
conditions.
Disadvantages:
• Slow Convergence: The method may converge slowly, especially for certain types of
functions .
• Dependency on Initial Guess: Convergence heavily depends on the choice of the initial
guess.
• Not Universally Applicable: Some functions may not converge using this method.
3
Question: Find the solution of the following nonlinear equation by using
Fixed Point Iteration Method
def f(x):
return x**3-x**2 +7*x - 9
def g(x):
return 1/math.sqrt(1+x)
while condition:
x1 = g(x0)
data.append([step, x1, f(x1)])
x0 = x1
step += 1
if step > N:
flag = 0
break
if flag == 1:
4
print(tabulate(data, headers=header, tablefmt="grid"))
print('\nRequired root is: %0.8f' % x1)
else:
print('\nNot Convergent.')
# Input Section
x0 = float(input('Enter Guess: '))
e = float(input('Tolerable Error: '))
N = int(input('Maximum Step: '))
Output:
Enter Guess: 0
Tolerable Error: 3
Maximum Step: 5
5
Plot: