logo

Engineering Analysis for Fixed Point, Bisection and Secant Method

   

Added on  2023-04-23

11 Pages1787 Words426 Views
 | 
 | 
 | 
Running head: ENGINEERING ANALYSIS
ENGINEERING ANALYSIS
Name of the Student
Name of the University
Author Note
Engineering Analysis for Fixed Point, Bisection and Secant Method_1

1ENGINEERING ANALYSIS
Question 1:
Given equation
exp(x) -3x – 1 = 0
Here, f(x) = exp(x) -3x – 1.
Now, the equation is arranged in x = g(x) form
x = (exp(x) – 1)/3
or,
x = ln(3x+1)
Hence, in the rearranged equation g(x) = (exp(x) – 1)/3 or g(x) = ln(3x+1).
Now, the function f(x) is continuous in all x between -∞<x<∞ and if the function g(x)
converges to some point x=m in the interval then m is the fixed point of g(x) and hence x=m
is the solution of the f(x) in the interval (1,3) by fixed point algorithm. Now, the above two
expressions of g(x) gives two solutions of f(x). Now, the solution x= m1 and m2 is found
using fixed point algorithm.
The recursive iteration processes are
xn+1=(exp (xn) 1)/3
And xn+1=ln (3 xn +1)
The initial x value is assumed x = 2 which is in the domain (1,3).
MATLAB code:
Engineering Analysis for Fixed Point, Bisection and Secant Method_2

2ENGINEERING ANALYSIS
f = @(x) (exp(x) - 3*x -1);
tol = 1e-5; % tolerance is assumed 10^(-5) or the roots have 4 decimal place accuracy
x1(1) = 2;x2(1) = 2; i=1; % staring point is assumed to be x=2 for both g(x)
while abs((exp(x1(i)) - 3*x1(i) -1))>tol && abs(exp(x2(i)) - 3*x2(i) -1)>tol
x1(i+1) = log(3*x1(i)+1);
x2(i+1) = exp(x2(i) - 1)/3;
i=i+1;
end
plot(x1)
hold on
plot(x2)
title('Roots in each iteration of fixed point method')
xlabel('iteration number')
ylabel('roots')
format short
sprintf('The roots of the equations are %f and %f',x1(end),x2(end))
Output:
Engineering Analysis for Fixed Point, Bisection and Secant Method_3

3ENGINEERING ANALYSIS
0 2 4 6 8 10 12 14
iteration number
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
roots
Roots in each iteration of fixed point method
fixedpoint
ans =
'The roots of the equations are 1.903816 and 0.141227'
Hence, the root by fixed point method which lies in the range (1,3) is 1.9038 up to 4 decimal
places accuracy.
Question 2:
Given equation
xtan(x) =2.
=> xtan(x) – 2 = 0
Hence, f(x) = xtan(x) – 2
i) Bisection method
Engineering Analysis for Fixed Point, Bisection and Secant Method_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Mathematics for Economics Mathematics for Economics
|24
|1791
|310

Euler's number and integral: Trapezoidal float Part1 trap(float a, float b, float f)
|4
|660
|101

MENG 438 Engineering Analysis
|18
|1459
|84

Integral
|6
|513
|170

Design Optimisation for Manufacturing
|10
|1615
|51

Probability & Statistics
|8
|1323
|339