Question: Write a user - defined function in MatLab named RegulaFalsiRootMod 1 that solves the nonlinear equation f ( x ) = 0 with modified Regula

Write a user-defined function in MatLab named RegulaFalsiRootMod1 that solves the nonlinear equation f(x)=0 with modified Regula Falsi method (see Fig.2). The function should check if the endpoints stay the same. If an endpoint stays the same for three iterations, the value of the function at that point should be divided by 2. If the value of the point stays the same for three more iterations the value of the function at that point should be divided again by 2(the true value is now divided by 4), and so on. The function should have as input arguments, the function (function handle), two values that bracket the root and the error. The function should stop when the Estimated
Relative Error EREi=|xNS(i)-xNS(i-1)xNS(i-1)| becomes smaller or equal to the error (inserted as an input argument). If the input arguments are less than 4, the function should automatically define the error equal to 0.0001. The maximum number of iterations should be imax =100 and when it has been reached the program should print a message that states that the solution has not been derived in imax iterations should be shown.
Use the function RegulaFalsiRootMod1 you wrote, to find the smallest positive root of the polynomial x3+12x2-100x-6=0 with the initial two values to be 4 and 6. Compare the result you obtained by using MatLab build-in functions f zero and roots. Use format long to compare as many figures as possible.
For the RegulaFalsiRootModl function you are allowed to use the following build-in functions of MatLab: feval, nargin, error, rem, abs, fprintf. Submit a MatLab files with explanations and report with comparisons and explanations.
 Write a user-defined function in MatLab named RegulaFalsiRootMod1 that solves the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!