Weve been over what GSS is in part 1 and how exactly to use GSS in part 2. Now we need to know when we can use GSS and explore a real world example. So if you noticed our example was pretty simple. The minimum could be found by simple inspection or some derivative tests. Another thing to notice is that the function had exactly one minimum, which ended up being the global minimum of the function. However, lets look what happens to our search method when we have two minimum in our interval.
Lets take a look at the function: y=x^4-6x^2+3x+7. This function has two local minimums very close to each other, one of which is the global minimum of the function. The function is plotted below.

Here you can clearly tell there are two minimum one around -2 and other other around 2. However, the minimum at -2 seems to be lower than that at 2. Lets see how our GSS tackles this problem. I am going to expand our interval to [-3,5]. This produces the following plot with each step a different color.

As you can see the GSS seems to be closing in on one of our minimum. This is one limitation of the GSS it is not a global minimum search. GSS can find a minimum but there is no guarantee that that minimum is not just a local minimum. What happens if we change our interval. I will reduce our interval to [-3.3] and run the gss again. This produces the following plot with each step a different color.

This interval produces a very different search. Simply changing the interval we search over switches which minimum the gss converges on. This is not exactly something we want to look for in a search method. However, in both intervals the method did converge to a minimum which is something we want to look for in a search method.Local vs global minimum explains a major issue with GSS. One of the main requirements for GSS is that a function must be unimodal. Now what does unimodal mean? This basically means that the function has a single local extremum. As we saw above this becomes important in terms of converging to the correct (and if unimodal, only) minimum.To review, when should be use GSS: Function has one minimum (unimodal), you have an idea of the interval that contains the minimum, the function is of one variable.Hopefully this gave you a better understanding of a basic search method. This is only the beginning. I will clean up my code and post it below, for both matlab and python. I will also post it to my github at github.com/mgric.-Marcello