added python code to plot minimizing function.