####### constrained and unconstrained minimization ###### F90 translated version of plato.asu.edu/ftp/other_software/bobyqa.zip and newuoa Powell 2009 Method http://www.damtp.cam.ac.uk/user/na/NA_papers/NA2009_06.pdf AL Sept 2012/2020: translated to F90, changed to input "funkk" class function argument to minimize rather than calfun subroutine as original Typical Usage (typically Npt= 2*dimension+1), to get best fit in params(:) starting from guess Type(TBOBYQA) :: Minimize !bounded minimization if (Minimize%BOBYQA(this_class, class_function, dimension, Npt, params,param_min, & param_max, step_radius, tolerance, DebugLevel, max_eval)) ... Type(TNEWUOA) :: Minimize !unbounded minimization if (Minimize%NEWUOA(this_class, class_function, dimension, Npt, param_guess, step_radius, & tolerance, DebugLevel, max_eval)) ... The class_function is of the form real(dp) function func(this, x) class(TMyType) :: this real(dp), intent(in) :: x(:) func = ...f(x)... end function func