Develop an M-file that is expressly designed to locate a maximum with the golden-section search algorithm. In

Question:

Develop an M-file that is expressly designed to locate a maximum with the golden-section search algorithm. In other words, set it up so that it directly finds the maximum rather than finding the minimum of -f(x). Test your program with the same problem as Example 13.1. The function should have the following features:
• Iterate until the relative error falls below a stopping criterion or exceeds a maximum number of iterations.
• Return both the optimal x and f(x)?
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Numerical Methods for Engineers

ISBN: 978-9352602131

7th edition

Authors: Steven C. Chapra, Raymond P. Canale

Question Posted: