Develop an M-file to implement parabolic interpolation to locate a minimum. Test your program with the same problem as Example 13.2. The function should have the following features:
• Base it on two initial guesses, and have the program generate the third initial value at the midpoint of the interval.
• Check whether the guesses bracket a maximum. If not, the function should not implement the algorithm, but should return an error message.
• Iterate until the relative error falls below a stopping criterion or exceeds a maximum number of iterations.
• Return both the optimal x and
• Use a bracketing approach (as in Example 13.2) to replace old values with new values.
Want to see the full answer?
Check out a sample textbook solutionChapter 15 Solutions
Numerical Methods for Engineers
Additional Math Textbook Solutions
Advanced Engineering Mathematics
Basic Technical Mathematics
Fundamentals of Differential Equations (9th Edition)
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageAlgebra: Structure And Method, Book 1AlgebraISBN:9780395977224Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. ColePublisher:McDougal Littell
- Glencoe Algebra 1, Student Edition, 9780079039897...AlgebraISBN:9780079039897Author:CarterPublisher:McGraw Hill