Hi
I tried to use the alglib Levenberg-Marquardt algorithm - Nonlinear least squares fitting: Hessian-based or Hessian-free and it works well.
http://www.alglib.net/interpolation/leastsquares.ph p#header1
I need to solve a equation where it gives the best output value C which makes the slope close to 1. It does works however i need to put a constraint to restrict the C value ratio 1 > value >...