title: GEKKO NL Solver gives fitting values that are not corresponding to the reference values
body: <p>I'm trying to find the parameters values for best fitting of the follow model function with a given set of points.</p>
  <pre><code>Model:
                   x
    y = ------------------------
         1- (a1*x)^2 + (a2*x)^4
  
  where parameters are:  a1, a2 
  </code></pre>
  <p>(1) I used the found optimized parameters values with this equation but it gives around y=~0 for any x (red graph).</p>
  <p><a href="https://i.stack.imgur.com/G9ODz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G9ODz.png" alt="enter image description here" /></a></p>
  <p>(3) Surprisingly, using a model with only one parameter as follow gives much better fitting.</p>
  <pre><code>Model:
              x
    y = -------------
         1- (a1*x)^2
  
  where parameters are:  a1 
  </code></pre>
  <p><a href="https://i.stack.imgur.com/WcLLt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WcLLt.png" alt="enter image description here" /></a></p>
  <p>Here is my code (I followed the code for non linear regression as shown here: <a href="https://github.com/BYU-PRISM/GEKKO/blob/master/docs/examples.rst" rel="nofollow noreferrer">https://github.com/BYU-PRISM/GEKKO/blob/master/docs/examples.rst</a>)</p>
  <p>Note: I played with initial values until got one where the solver didn't fire exception of &quot;Non Solution Found&quot;. The values I used are 0.3 for each parameter (I have no idea why this is a good value if at all)</p>
  <p>Measure points file can be downloaded from here: <a href="https://www.dropbox.com/s/ai5vbd2u5gx8r17/measure.npy?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/ai5vbd2u5gx8r17/measure.npy?dl=0</a></p>
  <pre><code>import numpy as np
  import math
  import os.path
  
  import matplotlib.pyplot as plt
  from gekko import GEKKO
  
  # Model:
  #                x
  # y = ------------------------
  #      1- (a1*x)^2 + (a2*x)^4
  #
  
  # measured data (file exist at https://www.dropbox.com/s/ai5vbd2u5gx8r17/measure.npy?dl=0)
  measure_data = np.load(&quot;C:/measure.npy&quot;)
  xm = measure_data[0]
  ym = measure_data[1]
  
  # GEKKO model
  m = GEKKO()
  
  # parameters
  x = m.Param(value=xm)
  a = [m.FV(value=0.3) for i in range(2)]
  for par in a:
      par.STATUS=1
  
  # variables
  y = m.CV(value=ym)
  y.FSTATUS=1
  
  m.Equation( y==x/(1-(a[0]*x)**2+(a[1]*x)**4) )
      
  # regression mode
  m.options.IMODE = 2
  
  # optimize
  m.solve(disp=False)
  
  
  p = [par.value[0] for par in a] 
  optimized_y = xm/(1-(p[0]*xm)**2+(p[1]*xm)**4)
  
  
  plt.figure(1)
  
  plt.plot(xm,ym,'k', label = &quot;measurements&quot;)
  plt.plot(xm,optimized_y,'r', label = &quot;optimized_y&quot;)
  
  plt.xlabel('x')
  plt.ylabel('y')
  plt.legend()
  plt.show()
  </code></pre>