Thank you very much. The problem is that although the program is now running, it is far from finding the actual solution. It always gets stuck at a local minima. Does anyone have an idea which solver works better? The problem is a system of some 6-8 equations (depends on specification), and there is no easy way of updating the variables in order to find the solution mechanically. This is why I tried with some solver in the first place. Apparently it does not do any better... Any help would be greatly appreciated.