I am trying to use the nonlinear fitting routines of MINPACK for fitting a rather complicated equation of state to a set of experimental data. A subset of the data is fitted fairly well to a simplified form of the EoS, which gives me some confidence that the implementation is, in principle, working. However, it seems to be impossible to fit the entire dataset to the extended form of the EoS, although the dataset is quite smooth and of good quality, and although my initial guesses are close to the expected solution and already give a decent fit.
Here is what irritates me most: The return status of the fit encoded by the INFO parameter is not too elucidating. I have the impression that INFO=1 or 2 is deemed ok; according to the comments in the code it means "algorithm estimates that the relative error in the sum of squares is at most tol= 0.149E-07" or "algorithm estimates that the relative error between x and the solution is at most tol= 0.149E-07", respectively. However, I get this return status for very different solutions (using different starting guesses). Then there is the status INFO=4, "fvec is orthogonal to the columns of the jacobian to machine precision", which I don't really understand. I often get it when there are only 5 iterations (for 4 fitting parameters, where it seems that 4 iterations vary each of the parameters individually by a small amount to probe the local surroundings of the solution). This can happen for different initial guesses, close or not so close to the expected solution for a good fit.
Can somebody explain this behavior and tell me if it possible, for instance, to change the size of those initial test variations of each parameter or to put constraints (bounds) on the range of each parameter? What I do right now is simply to force each parameter to lie between given bounds with max and min statements before each call of the model function by lmdif1.