Lastname, Firstname MECH 1314 Homework #12-Bisection Due: 4/22/2019 Instructions: Submit your scr...
Lastname, Firstname MECH 1314 Homework #12-Bisection Due: 4/22/2019 Instructions: Submit your script in a file named hwk12.m to the dropbox before 11:59 pm on the due date 20 pts The "root" of an equation, y f(x), is a value of x for which y has a value of zero and it is often "the answer" for a practical engineering problem. For example, ion Algebra you learned the Quadratic Equation, an equation that allows you to compute the value of each of the two roots of a 2nd-Order Polynomial. Determining the answer to practical engineering problems sometimes requires computing the roots of equations for which cannot be written. Many numerical methods have been developed to compute the values of such roots The Bisection method is one of the simplest and most robust numerical methods for computing an approximate value for a root of a function. An explanation of the Bisection method is presented on the following page Craft a UDF that performs the following tasks. 1. Accepts as an input argument a 4-element vector containing the lower bound for the search interval - the upper bound for the search interval a value of f(x) close enough to zero to accept x as an approximate value for a root - the maximum number of iterations before termination of execution. Calls another UDF, myFunction, saved in a different m-file, to compute values of the dependent variable from values of the independent variable. No credit will be earned for this assignment if you do not use the specified function name Reports to the CW in an easily understood format one of the two possible outcomes. a) If a root is found, the approximate value of the root and the corresponding value of the 2. 3. function b) That an approximate value for a root has not been found after xx iterations where "xx" is the number of iterations conducted The file you submit to the dropbox should have only the UDF that performs the bisection. It must not produce any display to the CW other than the display required by task #3
Lastname, Firstname MECH 1314 Homework #12-Bisection Due: 4/22/2019 Instructions: Submit your script in a file named hwk12.m to the dropbox before 11:59 pm on the due date 20 pts The "root" of an equation, y f(x), is a value of x for which y has a value of zero and it is often "the answer" for a practical engineering problem. For example, ion Algebra you learned the Quadratic Equation, an equation that allows you to compute the value of each of the two roots of a 2nd-Order Polynomial. Determining the answer to practical engineering problems sometimes requires computing the roots of equations for which cannot be written. Many numerical methods have been developed to compute the values of such roots The Bisection method is one of the simplest and most robust numerical methods for computing an approximate value for a root of a function. An explanation of the Bisection method is presented on the following page Craft a UDF that performs the following tasks. 1. Accepts as an input argument a 4-element vector containing the lower bound for the search interval - the upper bound for the search interval a value of f(x) close enough to zero to accept x as an approximate value for a root - the maximum number of iterations before termination of execution. Calls another UDF, myFunction, saved in a different m-file, to compute values of the dependent variable from values of the independent variable. No credit will be earned for this assignment if you do not use the specified function name Reports to the CW in an easily understood format one of the two possible outcomes. a) If a root is found, the approximate value of the root and the corresponding value of the 2. 3. function b) That an approximate value for a root has not been found after xx iterations where "xx" is the number of iterations conducted The file you submit to the dropbox should have only the UDF that performs the bisection. It must not produce any display to the CW other than the display required by task #3