Implement themodified zeroinalgorithm inA modified Brents method for finding zeros offunctions, by G. Wilkins and M. Gu, inNumerische Mathematik, vol. 123, 2013.You should turn in a .m...

1 answer below »
Implement themodified zeroinalgorithm inA modified Brents method for finding zeros offunctions, by G. Wilkins and M. Gu, inNumerische Mathematik, vol. 123, 2013.You should turn in a .m filemodifiedbrentxxx.mwhich contains a matlab function of theformfunction[root,info] = modifiedbrentxxx(@func,Int,params)where xxx is your student id. On input,funcis a function handle,Intis the initial intervalcontaining a root, andparamsis an object that contains at least three fieldsparams.roottol,params.functolandparams.maxit. Your algorithm should terminate once the interval contain-ing the root is at mostparams.roottolin length, or the function value at the current iterateis at mostparams.functolin absolute value. On output,rootis the computed root, andinfoshould have at least one fieldinfo.flag, which is 0 for a successful execution, and 1 otherwise.Your programcan notuse the matlab built-in functionfzero. It will be tested against a fewfunctions of our choice, against the following criteria:1. (60 points) A zero is found within given tolerances for each function tested.2. (40 points) All zeroes are found within the right number of function calls.Your program will receive 0 points if the stringfzero, case in-sensitive, shows up anywhere inyour .m file.Submit your .m file to your GSI by 1:00AM, Nov. 7, 2019.


Prof. Ming Gu, 861 Evans, tel: 2-3145 Office Hours: TuTh 2:30-4:00PM Email: [email protected] http://www.math.berkeley.edu/∼mgu/MA128A2019F Math128A: Numerical Analysis Programming Assignment, Due Nov. 6, 2019 Implement the modified zeroin algorithm in A modified Brents method for finding zeros of functions, by G. Wilkins and M. Gu, in Numerische Mathematik, vol. 123, 2013. You should turn in a .m file modifiedbrentxxx.m which contains a matlab function of the form function [root,info] = modifiedbrentxxx(@func,Int,params) where xxx is your student id. On input, func is a function handle, Int is the initial interval containing a root, and params is an object that contains at least three fields params.root tol, params.func tol and params.maxit. Your algorithm should terminate once the interval contain- ing the root is at most params.root tol in length, or the function value at the current iterate is at most params.func tol in absolute value. On output, root is the computed root, and info should have at least one field info.flag, which is 0 for a successful execution, and 1 otherwise. Your program can not use the matlab built-in function fzero. It will be tested against a few functions of our choice, against the following criteria: 1. (60 points) A zero is found within given tolerances for each function tested. 2. (40 points) All zeroes are found within the right number of function calls. Your program will receive 0 points if the string fzero, case in-sensitive, shows up anywhere in your .m file. Submit your .m file to your GSI by 1:00AM, Nov. 7, 2019.
Answered Same DayOct 09, 2021

Answer To: Implement themodified zeroinalgorithm inA modified Brents method for finding zeros offunctions, by...

Kshitij answered on Oct 12 2021
135 Votes
modifiedbrentxxx-bvgk2pcu.m
function [root info] = modifiedbrentxxx(func, int, params)
info=0;
N
= params.maxit;
tol=params.root_tol;
x = zeros(1, N+1); % Pre-allocate
x1=int.x1;
x2=int.x2;
for n = 2:N,
if x1 == x2
root = 'f';
return
end
x(1) = x1; x(2) = x2;
x(n+1) =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here