title: Why does scipy.optimize.minimize (default) report success without moving with Skyfield?
body: <p><code>scipy.optimize.minimize</code> using default method is returning the initial value as the result, without any error or warning messages. While using the Nelder-Mead method as suggested by <a href="https://stackoverflow.com/a/28002287/3904031">this answer</a> solves the problem, I would like to understand:</p>
  
  <p><em>Why does the default method returns <s>the wrong answer without warning</s> the starting point as the answer - and is there a way I can <s>protect against "wrong answer without warning"</s>  avoid this behavior in this case?</em></p>
  
  <p>Note, the function <code>separation</code> uses the python package <a href="http://rhodesmill.org/skyfield/" rel="nofollow noreferrer">Skyfield</a> to generate the values to be minimized which is not guaranteed smooth, which may be why Simplex is better here.</p>
  
  <p>RESULTS:</p>
  
  <p>test result:  [ <strong>2.14159739</strong>] 'correct':  <strong>2.14159265359</strong> initial:  0.0</p>
  
  <p>default result:  [ <strong>10000.</strong>] 'correct':  13054 initial:  <strong>10000</strong></p>
  
  <p>Nelder-Mead result:  [ <strong>13053.81011963</strong>] 'correct':  <strong>13054</strong> initial:  10000</p>
  
  <pre><code>FULL OUTPUT using DEFAULT METHOD:
     status: 0
    success: True
       njev: 1
       nfev: 3
   hess_inv: array([[1]])
        fun: 1694.98753895812
          x: array([ 10000.])
    message: 'Optimization terminated successfully.'
        jac: array([ 0.])
        nit: 0
  
  FULL OUTPUT using Nelder-Mead METHOD:
    status: 0
      nfev: 63
   success: True
       fun: 3.2179306044608054
         x: array([ 13053.81011963])
   message: 'Optimization terminated successfully.'
       nit: 28
  </code></pre>
  
  <p>Here is the full script:</p>
  
  <pre><code>def g(x, a, b):
      return np.cos(a*x + b)
  
  def separation(seconds, lat, lon):
      lat, lon, seconds = float(lat), float(lon), float(seconds) # necessary it seems
      place = earth.topos(lat, lon)
      jd = JulianDate(utc=(2016, 3, 9, 0, 0, seconds))
      mpos = place.at(jd).observe(moon).apparent().position.km
      spos = place.at(jd).observe(sun).apparent().position.km
      mlen = np.sqrt((mpos**2).sum())
      slen = np.sqrt((spos**2).sum())
      sepa = ((3600.*180./np.pi) *
              np.arccos(np.dot(mpos, spos)/(mlen*slen)))
      return sepa
  
  from skyfield.api import load, now, JulianDate
  import numpy as np
  from scipy.optimize import minimize
  
  data = load('de421.bsp')
  
  sun   = data['sun']
  earth = data['earth']
  moon  = data['moon']
  
  x_init = 0.0
  out_g = minimize(g, x_init, args=(1, 1))
  print "test result: ", out_g.x, "'correct': ", np.pi-1, "initial: ", x_init    # gives right answer
  
  sec_init = 10000
  out_s_def = minimize(separation, sec_init, args=(32.5, 215.1))
  print "default result: ", out_s_def.x, "'correct': ", 13054, "initial: ", sec_init
  
  sec_init = 10000
  out_s_NM = minimize(separation, sec_init, args=(32.5, 215.1),
                   method = "Nelder-Mead")
  print "Nelder-Mead result: ", out_s_NM.x, "'correct': ", 13054, "initial: ", sec_init
  
  print ""
  print "FULL OUTPUT using DEFAULT METHOD:"
  print out_s_def
  print ""
  print "FULL OUTPUT using Nelder-Mead METHOD:"
  print out_s_NM
  </code></pre>