Don’t pass the gradient as NULL, take that part out. I was able to use a global algorithm in my own work without any problems. Just read up on the specific algorithm and make changes to your code, such as removing the reference to the gradient.
Dale Smith, Ph.D. Senior Financial Quantitative Analyst Financial & Risk Management Solutions Fiserv Office: 678-375-5315 www.fiserv.com<http://www.fiserv.com/> From: milind d [mailto:[email protected]] Sent: Friday, August 22, 2014 9:51 AM To: Smith, Dale (Norcross) Cc: [email protected] Subject: Re: [NLopt-discuss] Search methods Dear Sir, Thanks for the reply I regret for the vagueness perhaps I should have approached in more detailed. However, the program in the link which you have shared works very well with the gradient based methods which I have been using it for most of my applications. But lately I wanted to try the Global optimization algorithms i.e.derivative free method, so I dont understand what changes should be made to use derivative free algorithm if I try to use the same example code which is there in the link. When I try to solve the same example by just changing in "opt = nlopt_create(NLOPT_LD_MMA, 2); /* algorithm and dimensionality */" to "NLOPT_GN_ISRES" and giving the grad calculation to NULL it compiled well, but while running i got the error "nlopt failed!". Hence I knew I am missing something in the code but not exactly understanding what changes should be made. Thanks & Regards On Fri, Aug 22, 2014 at 7:07 PM, Smith, Dale (Norcross) <[email protected]<mailto:[email protected]>> wrote: Sorry, but your question is simply too vague to answer. There are many global algorithms supported by nlopt. Which one(s) did you try? What do you mean by “invalid”? Perhaps you need to read the wiki, which was what I used to get started. Can you implement a program which solves the problem on the tutorial page and get the same result? Try different algorithms with it as well. http://ab-initio.mit.edu/wiki/index.php/NLopt_Tutorial The Algorithms page is also very useful. Dale Smith, Ph.D. Senior Financial Quantitative Analyst Financial & Risk Management Solutions Fiserv Office: 678-375-5315 www.fiserv.com<http://www.fiserv.com/> From: NLopt-discuss [mailto:[email protected]<mailto:[email protected]>] On Behalf Of milind d Sent: Thursday, August 21, 2014 5:48 PM To: [email protected]<mailto:[email protected]> Subject: [NLopt-discuss] Search methods Hi, I wanted to ask if someone has a small sample or tutorial example which uses Global optimization algorithm. It would be very helpful as I am trying to use it but it keeps saying invalid. I just want an easy sample program as in the documentation of the NLOPT site there is only example which uses derivatives. It would be very helpful if anyone could share the sample program. Thanks -- Milind Dhake Engineering Mechanics Unit Jawaharlal Nehru Centre for Advanced Scientific Research Bangalore -- Milind Dhake Engineering Mechanics Unit Jawaharlal Nehru Centre for Advanced Scientific Research Bangalore
_______________________________________________ NLopt-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
