0% found this document useful (0 votes)
7 views

3 RootsOptimization Tutorial2

Uploaded by

ce21b017
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

3 RootsOptimization Tutorial2

Uploaded by

ce21b017
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CE 5225: Numerical Techniques in Civil Engineering Tutorial 6

Tutorial 11: Roots and optimization (part 2)


(Total = 100 points)
Due date: 20-04-2024 (End of class)

Your submitted files should contain the following things: your function files as ‘.m’ files,
the results summary (data, or figures) for all the problems in order as one single ‘.pdf’ file
with file name as your roll number ‘CE******.pdf’. These files are to be zipped into one file
and submitted as one zipped file ‘CE******.zip’.

1. (40 Points) The modified secant method is similar to the Newton-Raphson method.
However, it computes the gradient of the function numerically using a first order Taylor
series approximation, instead of computing it analytically. Use the modified secant
method to approximate the root of function f (x) = exp−x −x. Use a perturbation ∆x
value of 0.01 (to compute the gradient), and an initial guess of xguess = 1.0. Compute
the solution upto a relative error of xtol value of 0.01%. The function for computing the
modified secant approximation should have the following input and output arguments:

[xSecant,flag] = callSecant(callf,xGuess,xDelta,xTol)

where; ‘callf’ is a function, ‘xGuess’ is the initial guess (scalar), ‘xDelta’ is the perturba-
tion in x (scalar), ‘xTol’ is the relative error tolerance in percentage (scalar), ‘xSecant’
is the approximate root output (scalar), and ‘flag’ is an exit flag which tells us whether
we have converged (flag=0) with the given criteria, or we have not converged (flag=1).
Submit the main file as ‘t11p01.m’.
2. (30 points) Solve part 1 using the fixed point iteration method. The function for
computing the fixed point iteration approximation should have the following input
and output arguments:
[xFixedPoint,flag] = callFixedPoint(callg,xGuess,xTol)

where; ‘callg’ is a function such that x = g(x), ‘xGuess’ is the initial guess (scalar),
‘xTol’ is the relative error tolerance in percentage (scalar), and ‘xFixedPoint’ is the
approximate root output (scalar).
Submit the main file as ‘t11p02.m’.
3. (30 points) Solve part 1 using the false-position method. The function for computing
the false-position approximation should have the following input and output arguments:

[xFalsePosition,flag] = callFalsePosition(callf,xLeft,xRight,xTol)

where; ‘callf’ is a function, ‘xLeft’, and ‘xRight’ are the initial left and right brackets
(scalar), ‘xTol’ is the relative error tolerance in percentage (scalar), and ‘xFalsePosition’
is the approximate root output (scalar).
Submit the main file as ‘t11p03.m’.

Dr. Venkatraman Srinivasan and Dr. Alagappan Ponnalagu, IIT Madras Page 1 of 1

You might also like