Professional Documents
Culture Documents
20BCM0082
CHE3001
EXPERIMENT 2
AIM
where, m = mass of the parachutist= 68 kg, g = gravitational acceleration 9.81 m/s2, v = velocity
= 40 m/s and t = 10 s. Develop bisection and regula falsi methods code to determine the drag
THEORY
In numerical analysis, Newton's method, also known as the Newton–Raphson method, named after Isaac
Newton and Joseph Raphson, is a root-finding algorithm that produces successively better approximations
to the roots (or zeroes) of a real-valued function.
The Newton Raphson method is for solving equations of the form f(x) = 0. We make an initial guess for
the root we are trying to find and call this initial guess x0. The sequence x0, x1, x2, x3, . . . generated in
the manner described below should converge to the exact root
The order of convergence of Newton Raphson method is 2 or the convergence is quadratic. It converges
if |f(x).f’’(x)| < |f’(x)|2. Also, this method fails if f’(x) = 0
Page 1 of 6
Vignesh Bala K
20BCM0082
Secant method:
The secant method is also a recursive method for finding the root for the polynomials by successive
approximation. It’s similar to the Regular-falsi method but here we don’t need to check f(x1)f(x2)<0 again
and again after every approximation. This method approximates the neighborhood roots by a secant line
or chord to the function f(x). It’s also advantageous of this method that we don’t need to differentiate the
given function f(x), as we do in the Newton-raphson method.
Y-Y1=m(X-X1)
Here, m=slope
As we’re finding the root of function f(x) so, Y=f(x)=0 in Equation (1), and the point where the secant
line cut the x-axis is,
• The speed of convergence of the secant method is faster than that of the Bisection and Regula falsi
method.
• It uses the two most recent approximations of the root to find new approximations, instead of using
only those approximations which bound the interval to enclose the root.
Since convergence is not guaranteed, we should limit the maximum number of iterations while
implementing this method on a computer.
Page 2 of 6
Vignesh Bala K
20BCM0082
MATHEMATICAL MODEL
FLOWCHART
Page 3 of 6
Vignesh Bala K
20BCM0082
Secant Method:
Page 4 of 6
Vignesh Bala K
20BCM0082
MATLAB INPUT CODE (Newton Raphson Method):
clc
clear
% Newton Raphson Method
disp('Student Name: Vignesh Bala K');
disp('Registration number: 20BCM0082');
fx=input("Enter the given function using independent variable x:",'s');
fprime=input('Enter the first derivative of the function: ','s');
xold=input('Enter the initial guess: ');
x=xold; fvalue=eval(fx);
fprimevalue=eval(fprime);
if fprime==0
disp('Division by zero error');
else
es=0.001;
for i=1:50
xnew=xold-(fvalue/fprimevalue);
x=xnew;
fvalue=eval(fx);
fprimevalue=eval(fprime);
ea=abs((xnew-xold)/xnew)*100;
if ea<=es
fprintf('The terminal velocity of the parachutist is %0.8f kg/s',xnew);
fprintf('\nConverged in %d Iterations',i);
break;
end
xold=xnew;
end
end
MATLAB OUTPUT
Page 5 of 6
Vignesh Bala K
20BCM0082
MATLAB INPUT CODE (Secant Method):
clc
clear
% Secant Method
disp('Student Name: Vignesh Bala K');
disp('Registration number: 20BCM0082');
a=input("Enter the given function using independent variable x:",'s');
f=inline(a);
x(1)=input('Enter first point of guess interval: ');
x(2)=input('Enter second point of guess interval: ');
n=input('Enter allowed error in calculation: ');
it=0;
for i=3:50
MATLAB OUTPUT
RESULT
• The terminal velocity of the parachutist is 43.72866940 kg/s and converged in 2 Iterations
(Newton-Raphson Method)
• The terminal velocity of the parachutist is 43.728669 kg/s and converged in 2 Iterations. (Secant
Method)
• The terminal velocity of the parachutist is 43.7286694 kg/s. (Exact Solution)
Page 6 of 6