Question: I have a Matlab coding homework that I am stuck on. It is related to process dynamic bisection and I am not sure how to
I have a Matlab coding homework that I am stuck on. It is related to process dynamic bisection and I am not sure how to start the code and need help with solving this Matlab coding exercise, with these few sections. Thank you so much! the following screenshot is all I am provided on the homework question


Suppose you are given a function f(x)'. Let us find the roots of the equation f(x)=0 using the bisection method. 1. We start by choosing a lower and upper guess of the roots, let's say xl and xu. One important condition to proceed further is that f(xL)*f(xU) 0, then the root must lie between xr and xu. Hence, set xi = XR for the next iteration and go back to step 2. c. If f(xl)*f(xR)=0, then xr is a root of the equation f(x)=0. Terminate the computation. In most cases, it is not possible to get the exact roots of an equation using this method. Instead, we continue our iterations till the relative error between successive iterations becomes smaller than some acceptable limit. The relative error between two successive guesses is calculated by the formula: Ea new wold XR XR new XR * 100 (%) |XU - XL IxU + x * 100 (%) Eq. 2 (How?) This relative error between successive guesses is always higher than the relative error between the current guess and the actual root of the equation(Why?). Hence, this error can be taken as an upper bound for the error between our estimate of the root and the actual root. We carry on with steps 1-3 in the bisection method till Ea becomes smaller than a specified limit. Now that you know how the bisection method works, perform the following tasks on MATLAB: 1. Write a function with the definition: function y Prelab (x) This function should perform the following operation : y = 4.1 x2 2.3 x 5.2 Eq.3 2. Write another function with the definition: function y = PrelabBisection (xL, XU, Ea) This function should accept as its arguments initial guesses for the root Xl, XU (xl is the lower estimate and xu is the higher estimate) and the upper limit on the error Ea (given in percent). Using the description of the bisection method that has been provided to you, complete defining the function that will be able to return a root of the equation described in Q.1 for given initial guesses, whose relative error from the actual root is less than Ea%. You can use the function that you defined in Q.1 to define this function. Check if your function works by comparing the roots of the given equation that you find using your function and the quadratic formula. Suppose you are given a function f(x)'. Let us find the roots of the equation f(x)=0 using the bisection method. 1. We start by choosing a lower and upper guess of the roots, let's say xl and xu. One important condition to proceed further is that f(xL)*f(xU) 0, then the root must lie between xr and xu. Hence, set xi = XR for the next iteration and go back to step 2. c. If f(xl)*f(xR)=0, then xr is a root of the equation f(x)=0. Terminate the computation. In most cases, it is not possible to get the exact roots of an equation using this method. Instead, we continue our iterations till the relative error between successive iterations becomes smaller than some acceptable limit. The relative error between two successive guesses is calculated by the formula: Ea new wold XR XR new XR * 100 (%) |XU - XL IxU + x * 100 (%) Eq. 2 (How?) This relative error between successive guesses is always higher than the relative error between the current guess and the actual root of the equation(Why?). Hence, this error can be taken as an upper bound for the error between our estimate of the root and the actual root. We carry on with steps 1-3 in the bisection method till Ea becomes smaller than a specified limit. Now that you know how the bisection method works, perform the following tasks on MATLAB: 1. Write a function with the definition: function y Prelab (x) This function should perform the following operation : y = 4.1 x2 2.3 x 5.2 Eq.3 2. Write another function with the definition: function y = PrelabBisection (xL, XU, Ea) This function should accept as its arguments initial guesses for the root Xl, XU (xl is the lower estimate and xu is the higher estimate) and the upper limit on the error Ea (given in percent). Using the description of the bisection method that has been provided to you, complete defining the function that will be able to return a root of the equation described in Q.1 for given initial guesses, whose relative error from the actual root is less than Ea%. You can use the function that you defined in Q.1 to define this function. Check if your function works by comparing the roots of the given equation that you find using your function and the quadratic formula
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
