MENG 438/602 Engineering Analysis: Root Finding, Vibration Analysis

Verified

Added on  2023/04/23

|11
|1787
|426
Homework Assignment
AI Summary
This document presents the solution to an Engineering Analysis assignment involving numerical methods for solving equations. It covers three main problems: finding a root of the equation exp(x) - 3x - 1 = 0 using the fixed-point iteration method, determining the root of x*tan(x) = 2 using both the bisection and secant methods, and performing vibration analysis to find the value of 'k' in a car suspension system using the secant method. The solutions are implemented using MATLAB, with code and results provided for each problem, demonstrating the application of numerical techniques in engineering analysis.
Document Page
Running head: ENGINEERING ANALYSIS
ENGINEERING ANALYSIS
Name of the Student
Name of the University
Author Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
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:
Document Page
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:
Document Page
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
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4ENGINEERING ANALYSIS
Recursive iterative relation is
xn+1= ( x¿¿ n+ xn 1 )
2 ¿, where either f( xn1 ¿ >0 and f( xn ¿ <0 or f( xn+1 ¿ <0 and f( xn ¿ >0.
Now, the root of f(x) which is in x=(0,π/2) is required to be found.
Now, from observation it is seen that
f(0) = -2
Hence, x=0 is one point for bisection method. The other endpoint is calculated in MATLAB
and then bisection method is applied.
MATLAB code:
x(1) = 0;h = 0.1;
f =@(x) x*tan(x) - 2;i=1;
% finding x for which f(x)> 0. This is also known as binary search
% algorithm
while f(x(i)) <= 0
x(i+1) = x(i)+h;
i=i+1;
end
a = x(1); % f(a)<0
b = x(end); % f(b)> 0
% bisection method
Document Page
5ENGINEERING ANALYSIS
c = (a+b)/2;
while abs(f(c)) >= 1e-10 && c < pi/2 % tolerance < 10^(-10) and root lies in the domain
(0,pi/2)
if f(c) > 0
b=c;
c = (a+b)/2;
elseif f(c)< 0
a = c;
c = (a+b)/2;
end
end
sprintf('The root of f(x) in the domain (0,pi/2) is %f and value of the function at that point is
%f by bisection method',c,f(c))
Output:
bisection
ans =
'The root of f(x) in the domain (0,pi/2) is 1.076874 and value of the function at that point is
-0.000000 by bisection method'.
ii) The secant method is given by the iterative relation
xi+1=xif ( xi )xixi1
f ( x ¿¿ i)f (xi1) ¿
Document Page
6ENGINEERING ANALYSIS
Initial points x0 = 0 and x1 = 1 are assumed. The values of x in each iteration and the value
of the function is shown below.
MATLAB function:
x(1) = 0; x(2) = 1; %% initial values are assumed 0 and 1
f =@(x) x*tan(x) - 2;
x(3) = x(2) - (f(x(2))*(x(2)-x(1)))/(f(x(2)) - f(x(1))); % secant method
i=1;
func(1) = f(x(1));func(2) = f(x(2));
% implementing in loop
while abs(f(x(end))) >= 1e-10 && x(end)<pi/2 % tolerance is 10^(-10)
x(i+2) = x(i+1) - (f(x(i+1))*(x(i+1)-x(i)))/(f(x(i+1)) - f(x(i)));
func(i+2) = f(x(i+2));
i=i+1;
end
x
func
Output:
x =
0 1.0000 1.2842 1.0449 1.0636 1.0777 1.0769 1.0769 1.0769
func =
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7ENGINEERING ANALYSIS
-2.0000 -0.4426 2.3572 -0.1996 -0.0859 0.0057 -0.0002 -0.0000 0.0000
Hence, by secant method the root of the equation f(x) is x = 1.0769 (in domain 0<x<pi/2) at
which tolerance is below 10^(-10).
Question 3:
The vibration analysis equation of the car suspension system is given by,
cos ( 0.05 k
m c2
4 m2 ) + c
4 kmc2 sin ( 0.05 k
m c2
4 m2 )=0
m = 1.2*10^(3) kg
c = 10^(4) kg/s.
We have assumed the tolerance of 10^(-10) that is the error in the root is ±10^(-10).
Assumed initial guesses for k are 3*10^(10) and 4*10^(10) for applying the secant method.
MATLAB code:
m = 1.2*1e3; % mass
c = 1e4; % c = 10^(4) kg/s
f = @(k) cos(0.05*sqrt(k/m - c^2/(4*m^2))) + (c/sqrt(4*k*m-c^2))*sin(0.05*sqrt(k/m -
c^2/(4*m^2)));
k(1) = 3e10; k(2) = 4e10; %% initial values are assumed 3*10^(10) and 4*10^(10)
k(3) = k(2) - (f(k(2))*(k(2)-k(1)))/(f(k(2)) - f(k(1))); % secant method
i=1;
func(1) = f(k(1));func(2) = f(k(2));
Document Page
8ENGINEERING ANALYSIS
% implementing in loop
while abs(f(k(end))) >= 1e-10 % tolerance is 10^(-10)
k(i+2) = k(i+1) - (f(k(i+1))*(k(i+1)-k(i)))/(f(k(i+1)) - f(k(i)));
func(i+2) = f(k(i+2));
i=i+1;
end
format shortG
k=k'
func =func'
Output:
k =
3e+10
4e+10
2.6563e+10
3.3249e+10
3.0239e+10
4.58e+10
6.5277e+10
5.7402e+10
6.3165e+10
Document Page
9ENGINEERING ANALYSIS
6.2649e+10
6.322e+10
6.3187e+10
6.3198e+10
6.3198e+10
6.3198e+10
func =
0.2401
0.93862
-0.92958
0.76133
0.94393
0.52472
-0.35619
0.97203
-0.095596
-0.99995
0.060835
-0.033063
1.2104e-05
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
10ENGINEERING ANALYSIS
-1.6539e-09
-4.4364e-15
Hence, the root of the vibration equation or the value of k which satisfies the vibration
equation is found using secant method is 6.3198*10^(10).
chevron_up_icon
1 out of 11
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]