Non-linear NOMAD integration

My student, Matthew, has just succeeded in getting OpenSolver running with the NOMAD non-linear solver from the Gerad group. Many thanks to Jonathon Currie & David Wilson, creators of the OPTI Matlab toolbox (which also includes NOMAD), for letting us learn from your experiences in compiling this (and the COIN-OR code) under Visual Studio.

Matthew’s code is very much beta, but it shows that we can make it all work to get a powerful non-linear solver working with Excel. The challenge has been getting our VBA code to call the NOMAD C++ code which then has to call back into a thin C++ layer which runs our VBA code which re-calculates the spreadsheet for each new set of variable values; trivial, really! We initially created an XLL Excel add-in to help with this, but it turns out any DLL can do this using the Microsoft XLL interface libraries, so we now simply create a DLL that is linked into our OpenSolver VBA add-in.

Well done, Matthew, in getting this all to work, given minimal previous experience in C (and none in C++)! It’s a real privilege to work with such excellent Engineering Science students.

This will be released in the next beta version, coming soon….

32 thoughts on “Non-linear NOMAD integration”

  1. Dear Andrew,

    1. Please how can one automate the OpenSolver features through vba? I have a sizable numerous of variables and constraints that require me automating the process.
    2. If vba codes are available to exploit the features of the OpenSolver, does statement such as “if … then” reduce the efficiency of the solver?
    2. How many decision variables and constraints is the OpenSolver limited to?
    3. If the optimization model assumes a quadratic form with equality and inequality constraints, which of the OpenSolver engines is the best for this model?

    Many thanks,

    David

    1. Thanks for your questions.
      1/ See our online VBA documentation under Help
      2/ This doesn’t make much sense to me sorry as your VBA cod does not run once the model is set up.
      3/ Limited by time and memory
      4/ Gurobi might do quadratoc constraints. Otherwise bonmin or couenne.
      Good luck.
      Andrew

  2. Dear Andrew,
    I downloaded the file and extracted and then added the add in into excel file. the problem is that when i want to use NOMAD (nonlinear solver) , Coin-Or … The ok button is not active and says that opensolvernomad.dll couenne.exe cannot be find in the folder, however I downloaded the last version.

    Best regards,
    Amin

      1. Dear Andrew,
        I just downloaded the OpenSolver. It works good on the NEOS using Bodmin (non-linear). In fact, it gave me the correct results in one go than the built-in Excel Solver. However, i could not use the NOMAD solver engine as it was not found. Please how could i download the NOMAD solver?
        Many thanks,

        David

          1. Dear Andrew,
            I downloaded the OpenSolver (from the download website it is not specified whether it is linear or non-linear; but it gives the user the choice of choosing either a linear or non-linear solver engines). I believe OpenSolver is an interface for various solver engines. My problem is how to access the NOMAD solver engine.
            Thanks.

            1. Please download the Advanced Non-Linear OpenSolver; this includes NOMAD. Andrew

            2. Dear Andrew,

              I have just seen the OpenSOLVER advanced, which contains the NOMAD engine.
              Many thanks for your kind efforts.

  3. How do we install nomad for open solver?
    I’m no programmer…but i know excel pretty much that’s it.
    Thanks

  4. Hey Andrew,
    Great product!!
    I was not satisfied with my NOMAD results and so used NEOS using Bomin & NEOS using couenne, both of which give me the same error message as “Type mismatch(at line 5388)(at line 5104)(at line 4840)(at line 7144)(at line 2816) Source= OpenSolver ErrNumber=13”. What does this mean?

    Also I have observed that while running NOMAD the optimization ends at around 3.2K iterations, why is it happening?
    Note: I have 20 sets of 20 variables that i try to set as ‘Variable Cells’, 1 set(20 variables) at a time. In each of those 20 optimizations, my program ends at around 3.2K iterations.
    I tried setting all 20×20 variables as my ‘Variable Cells’ as well, and the program still ended at 3.2K iterations.
    Could it be Memory Issues? I feel it could give me more accurate answers if the no. of iterations could increase. My current Max iterations is set at 10K.
    accuarte
    I run Windows on a Virtual machine with 2GB memory. Intel core i5. windows 7. Excel 2007 32 bit. when running the optimization my task manager shows ‘Physical Memory= 34%’.

    1. Sorry, but I am not sure why NOMAD is stopping – it is not a tool that we have a lot of experience in. However, NOMAD always starts from the current solution, so running at a second time may improve the solution. We would like to fix that NEOS error message – do you mind emailing us your spreadsheet to a dot mason at auckland dot ac dot nz. Also, you can run Couenne and Bonmin locally without relying on NEOS; this may give you the same error, but worth a try. Thanks, Andrew

    2. In my experience NOMAD is very prone to stopping at locally optimal solutions, which would explain why it’s only running for 3.2k iterations. Like Andrew said, running it from different starting solutions might help to find different solutions.

      If you send us the sheet for us to look into the error, I’ll also see if I can see any obvious problems with how NOMAD is behaving, but again like Andrew said we don’t have a lot of experience with its inner workings

  5. Hi,

    I made a quite simple nonlinear optimization problem for NOMAD to solve (see the link below). But it seems that NOMAD can’t compute an optimal solution. A more optimal solution than the one NOMAD produces can easily be figured out. In the model the aim was to create the nonlinearity by making the sum of binaries from different “sources” to be multiplying the cost. After entering manually any more optimal variable values NOMAD seems to be satisfied with the results. The default GRG solver of Excel could not produce much better solutions either, but slightly better. Can someone enlighten me why the problem is difficult for the solver to solve and if there is some other method I could use?

    I’m using the latest experimental version of OpenSolver 2.6 advanced. Ran the same model in Office 2013 (64-bit) and Office 2010 (32-bit) on two different computers with same results.

    http://oi59.tinypic.com/2nbrju8.jpg

    Thank you already in advance!

    1. NOMAD is only a heuristic; no solution quality guarantee is given. Have you tried Bonmin? Or tried CBC (if you model is linear)? Andrew

    1. We already provide 32 and 64 bit versions of NOMAD… OpenSolver automatically chooses the correct one to match the version of Office that you are running. Does this answer your question? Andrew

      1. Of course right after posting I noticed it was already included with the “advanced” version… Thank you and thank you for the great application.

      2. I have NOMAD and OpenSolver installed. When I open OpenSolver and I try to select NOMAD, I get an error message “Unable to find the Nomad DLL file ‘OpenSolverNomad.dll’ in the folder that contains ‘OpenSolver.xlam. What do i have to do? I dont know how to put that file into the OpenSolver.xlam because I cant find that file on my computer anywhere

          1. Hi Pablo,

            Thanks for the message. We strongly recommend that you don’t do this, the version on Github is the latest experimental version of NOMAD for OpenSolver and won’t necessarily work with the released version of OpenSolver (as of writing it will not work). You should use the “Advanced” version of the OpenSolver download which includes NOMAD. Please let us know if this isn’t working.

                1. What am I doing wrong. I’ve download the application and simply unzip it. Do I need to do anything else?

Leave a Reply to Miika Cancel reply

Your email address will not be published. Required fields are marked *