Answered step by step
Verified Expert Solution
Question
1 Approved Answer
An alternative way to compute stationary points of a function f is the brute-force global minimum and global maximum search method of Lab 3 .
An alternative way to compute stationary points of a function f is the "brute-force" global minimum and global maximum search method of Lab 3 . 3. (9 pt) Implement a function that computes, using the global minimum and global maximum search method, an approximation of the local minimum (stationary point) of an arbitrary function f(x). We assume that the search interval is such that it contains one stationary point (local minimum or maximum) and that that local minimum/maximum is the global minimum/maximum. - The arguments of the 'global minimum/maximum search function' should receive a given search interval, the names of the python functions implementing f and its derivative f (both defined for a single input argument x, single return value f(x) or f(x) ), the tolerance for verifying the value of the derivative, and a maximum number of iterations. - Adapt the method of Lab 3 such that the number n of sub-domains is doubled if the absolute value of the derivative at the approximate stationary point (minimum or maximum) does not yet satisfy the given tolerance. The first iteration should evaluate the midpoint of the initial search interval (n=1). - The function should return the same quantities as the bisection function, i.e., the root (position of minimum), the value of f at this root, the number of iterations and the number of function evaluations (which should be the sum of the evaluations of the function f and its derivative f). - Test your implementation of the brute-force method to find the minimum of f(x)=exp(x2), on a non-symmetric interval of search around 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started