### Welcome to the OpenSolver on-line help.

We hope that most of your questions will be answered on the Using OpenSolver page. However, if you still have a question, please post it below.

## Building Linear Programming models

Writing optimisation models that only use linear mathematical equations and inequalities is not easy. However, most of the time you want to build these “linear programming” models (and avoid non-linear models) because these are easier and more reliable to solve using packages such as OpenSolver. (OpenSolver uses CBC by default to solve these linear programmes.) Check out this Wiki page on linear programming.

The AIMMS folks have a great online chapter describing how to take non-linear requirements (local copy of pdf) and model them using linear programming. (Thanks to Stu Mitchell of PuLP fame for pointing out this resource.) The NEOS guide is also a great resource. If you still have a modelling question (e.g., how do I express this requirement using the rules for a linear program), please ask it on https://www.or-exchange.org/.

## Common Software Problems

Excel can have problems dealing with add-ons. Visit http://www.add-ins.com/how_to_repair_office.htm for a guide on fixing these.

### 1. OpenSolver not loading – July 2016 Office update (no error message)

In July 2016, MicroSoft released an update to Office 365 which prevents OpenSolver from loading unless the .zip file is “unblocked” before the files are extracted. (We expect this change to appear in other versions of Excel.) The symptoms are simply that OpenSolver does not appear in the Data tab; there is no error message shown. To fix this, delete your old OpenSolver files (but not the downloaded .zip file), right click the downloaded OpenSolver .zip file, choose Properties, and click the Unblock button which will show if the file is blocked. Once the file is unblock, close the properties dialog, and then un-zip the files and open up OpenSolver.xlam as usual.

### 2. Unable to find the external solver …

If OpenSolver reports this problem, then it could not find a solver file that comes with OpenSolver. Please check that you have extracted (i.e. un-zipped or uncompressed) all the files from the OpenSolver download.

### 3. The solver did not create a solution file.

If this error is reported, then it is likely that OpenSolver was unable to run the solver executable. This may happen if the OpenSolver files are in an ‘untrusted’ location, and so Windows will not let them be run. First check whether the solver is shown as found in the “About OpenSolver” form. If not, go to the folder identified in the “About OpenSolver” form and double click on this solver file. You should then see a command window open that gives the solver name and version information etc. If you don’t see this, then Windows should give you an error message to help you diagnose the problem. It may help to move the OpenSolver folder (and all the files it contains) into a location such as your Documents, or even into Program Files, and try again.

### 4. Solver crashes; OpenSolver reports no solution file

The files in the “Solver” folder provided with OpenSolver contain the actual solver code. These solvers are being continually upgraded as bugs are reported and fixed. If OpenSolver reports that no solution file was generated, then the solver may have crashed. This can happen on big problems when the solver runs out of memory, but also on smaller problems that happen to hit a solver bug. In such cases, you should check if a newer version of OpenSolver is available since we regularly update the solvers included with OpenSolver as they are released.

With CBC, a typical OpenSolver error for thois problem message might be: ‘The CBC solver did not complete, but aborted with the error code -1073741510’

If needed, you can download the latest version of CBC, Bonmin or Couenne from AMPL. Download the either the Windows or Mac version as appropriate. For Windows, get the 32-bit version if you have 32-bit Windows, or the 64-bit version otherwise. (The 64 bit version will solve much larger problems than the standard 32 bit version included in OpenSolver, so always choose this if possible. Right-clicking on Computer, and choosing Properties, will tell you if have a 32 or 64 bit system type.) Right click on the downloaded .zip file, choose Properties, and click the Unblock button if there is one. Then, open the .zip file, and drag the files into the right location in your OpenSolver Solvers folder (the win32, win64 or osx folder as appropriate), replacing the existing files. This may fix your problem.

**Report a CBC bug**

If after installing the latest version of CBC, CBC still crashes on you, then you may wish to report a bug. Please be sure to include the .lp file produced by OpenSolver; you can open this file using “View Last Model .lp File”. CBC bugs can be reported by either:

- The online CBC TRAC bug reporting system (which you will have to register for), or
- The CBC mail list

**Switch from CBC to Gurobi**

Since August 2014, OpenSolver has also supported solving models using the Gurobi solver. You can obtain a copy of this solver at no charge if you are at a university. Gurobi is faster and more stable than CBC, and comes highly recommended.

### 5. Repairing Excel

Sometimes it is useful (if all else fails) to repair your Office installation:

**Windows**

See these Microsoft Office 2010 and later instructions (or in Excel 2007, use Excel’s application menu, then Excel Options, then Resources, then “run Microsoft Office Diagnostics”). You might also want to look at http://support.microsoft.com/kb/166273, which talks about this.

**Mac**

Unfortunately there is no easy way to repair the Office 2011 installation. The best option is to follow these instructions to completely uninstall Office. You can then install Office again from scratch to get a clean version installed.

### 6. ‘Can’t find project or library’ : Missing Reference Errors

OpenSolver uses the “RefEdit” control, which we need but which can cause problems because of missing references caused by version changes. To check for missing references, using the VBA editor (which you access using Alt-F11), select OpenSolver (openSolver.xlam) in the Project window, choose Tools… References, and look for a “Missing:” line. If you see this, un-check that line, close the dialog, and choose File … Save OpenSolver.xlam to update the file. If this doesn’t help, try the above steps for repairing Excel.

**7. Error 70: Unable to delete the file: C:\Users\XXXXXX\AppData\Local\Temp\log1.tmp**

This errors happens if Excel crashes while OpenSolver is running, leaving log1.tmp open. Please restart your computer, which will close this file, and try again.

I am using OpenSolver to test models with different levels of data granularity (i.e no of rows = number of constraints where result must be <= 1 + a few other constraints) . Although I can quite easily find the cpu run time, most of the time is taken in the setting up of the model.

Does OpenSolver record model set up time anywhere ?

I don’t think this is recorded, sorry. Please double check the model.lp file to be sure. Andrew

Is there a list of compatible excel functions that OpenSolver can interpret in non-linear models? Is there a known list of functions it cannot interpret?

Same question, but how about in linear models?

Linear models are not “parsed” and so work with all formulae. We don’t have a list of non-linear functions, sorry; perhaps you can look into the code to find this? Andrew

I’m having a problem with a MIP. When I solve with opensolver using the default solver, the optimisation reports that there is no feasible integer solution.

However, I can ‘force’ my own feasible integer solution and have tested it extensively. I did this with the following.

First, for some background, My objective is equal to one of my variable cells, and is to minimise the value of the cell. The rest of the model are constraints around this.

If I remove the objective cell from the variable cell, and hardcode the objective, opensolver behaves correctly and effectively solves the constraint problem for the selected value of my ‘objective’. Yet, when it is free to change the value of the objective, it says the problem is infeasible which seems to be clearly not true.

Any ideas?

Please look at the .LP files for these two models. If they are both correct, then this is likely a CBC bug. If so, please report this; see https://projects.coin-or.org/Cbc for more details. Note that having no objective, or having a target objective, is not a common CBC usage. Andrew. PS: Feel free to post the two .lp files here if they are not too big.

Just picked this up. Trying to use constraints on the single variable cell. If variable cell goes to zero, divide-by-zeros propagate throughout, and the solver quits. I’ve set constraints on the variable cell to be >= 1.0. Still, the solver sets this to 0.0, and stops on error.

I thought perhaps I misunderstood the constraints, and set it <= 1.0, but still the variable cell was set to zero, and the divide-by-zero error occurred again.

As I'm new to this, I may be doing something stupid.

This model is non-linear and so cannot be solved using the CBC solver which OpenSolver uses by default. Try another way of writing the model or try another solver. Andrew

I am trying to force 3 of a category. The decision variable is handling quantity of the category. For instance, 0 to 5 units where as I am also trying to run a count to make sure that there are 3 different items of units in the category.

What is the best implementation of this? I was trying to using countifs (which would multiple 1 * if the item had quantity in it over 0) and that works fine if I say it needs to be =3, it gives an error about an instance not depending on the decision variable. However, it is depending on it if it is in the category and I can put a quantity in all items and get 11 (that is total items in the category, but there are multiple categories).

You cannot use countif. Look up binary variables for integer programming. Hope this helps. Andrew

Yes, I have used where the decision is binary. However, in this case, the solver is not trying to just solve for yes or no if the item should be selected but rather the quantity of the item if selected. Thus, I can’t just 1 or 0 for the units. I have those set to integers with low and high constraints. I need a way to set the unique items in the mix in that problem while having the solver focus on quantity. If I wasn’t setting quantity, then the binary option would be easy to handle the counts, but if the solver is working on quantity, I need another method to handle the binary component constraint within the solver.

Look up a book on integer programming modeling. Andrew

Hi, I really appreciate the open solver it accommodates my LP model, which has more than 200 variables. However, I have a problem with my current model that I desperately need to solve. (FYI my background is not in the data or programming, so I will really appreciate the help).

My model is to Max Y

By changing variable X

Where:

X=B

and X<=X+C

It keeps telling me that "WARNING : The following constraint(s) do not appear to be linear", where I believe this warning is referring to X<=X+C. is it because it is circular reference?

Thank you.

Your model makes no sense sorry. X < = X+C is always true if C>0. And there is no connection between X and Y. Andrew

Hallo,

I’m a frequent user of Open Solver, and very much appreciate all the work and effort you guys put in to it!

I currently working with the solver from VBA, and from here solving in a loop while adjusting the model with different target values. which overall works great. but I’m having an issue with the error message ‘no feasible solution’, is there any way from VBA to automate process of clicking “OK” to the error message? The error message itself is fine, I just need the solver to continue the script.

Kind regards,

Martin

Perhaps our code does not handle this condition correctly? We’d welcome improvements to the VBA code to fix this. Andrew (on holiday with no computer)

Hi! I love what you do! I came across an interesting issue…

I tried to use OpenSolver to develop a VBA script which would find all of the values needed to get a defined sum.

Since Frontline’s Excel Solver is limited to 200 variables and OpenSolver seems to be faster in some problems, it seemed to be a perfect tool. However, there’s a problem – OpenSolver with CBC seems to find no feasible solution, while Excel Solver has no issues with this type of problem.

Here’s a link to simple example of the problem in Excel file (with Frontline and OpenSolver solutions):

https://we.tl/t-h8QwQoe947

Looking forward to your answer,

Vedran

Although I haven’t looked at your model (I will leave someone else to do so), this is almost certainly a tolerance problem; please try to avoid numbers close to zero or of very different sizes in the same equation/model. Andrew

I have had another look at this. It does indeed seem to be a CBC bug. It would be great if you could submit this example as a possible bug (with the .lp file produced by OpenSolver, and available under “View Last Model File”) to the CBC email list on email hidden; JavaScript is required. Please change the variables to be binary as that is more natural. Note that it is unusual to run CBC to seek a value and not optimise a value, and so this case will be less tested. Thanks for taking the trouble to let us know. Andrew

Thanks for the prompt reply!

I will definitely send a report to the CBC team. I truly appreciate your time and effort .

Br,

Vedran

Thanks. It may be a good idea to test with the latest version of CBC which you can find at http://coin-or.org Andrew

Good morning I am receiving this error:

sorry we couldn’t find c:\users\xx\AppData\Local\Microsoft\INetCache\Content\MSO\44D8A4E3.xlam. Is it possible it was moved,renamed or deleted?

How can I resolve this issue?

I’ve never seen that error; probably not caused by OpenSolver. Andrew

I am using the opensolver to find an optimal solution of my work. The solver is running over 30 hours and keep showing “solving model” in the status bar. I found that the “Time elapsed” is keep counting from -ve (around 80k seconds) to +ve and after reaching a certain 10k seconds and then back to -ve …….

The status bar of my worksheet also showing the message “11480 vars, 7840 int vars (7840 bin), 180 rows, 2147483647 iterations, 0 tolerance.”

Can I know what is going on and is there any possible way to fix it?

Thanks.

You have a hard problem where branch and bound is exploring a large fraction of all the possible 2^7480 solutions; you need a better representation of your problem. Andrew

Hi Andrew,

i try to use open solver but it doesn’t load my complete Model.

Are there Limits? Is there Chance to mark all constraints and load them?

Thanks for your help!

There are no limits that we are aware of. It should load all the constraints. Andrew

Hello,

I’m attempting to use GRANULARITY with NOMAD, but OpenSolver doesn’t seem to accept my input.

Error Message: The Parameter ‘GRANULARITY’ was not understood by NOMAD etc…

I’ve checked the NOMAD manual and seem to be doing the correct thing. I use the parameter table for other options (VNS_SEARCH etc) so OpenSolver is parsing the data through correctly. To be specific, the table left hand column contains “GRANULARITY” and the right hand column contains “5 0.001” (without quotation marks) to control the 6th variable.

Am I misunderstanding something? Any help would be appreciated.

Thanks you

Gary

I suggest you check our VBA source code to confirm the data layout. Perhaps you need the numbers in 3 columns? Or maybe we did not anticipate pairs if values. Andrew

Hi ,

I am using Opensolver (CBC) to run an optimization problem containing ~6000 variables. I run it for ~1000 different sets of data (resetting the problem and storing the output 100 times). I am facing the following issue:

When I run the solver manually (paste data in the model manually and run using the command in the excel ribbon), the solver sets up the problem relatively quicker (reading 100 variables per second).

But if I iterate the model using VBA (using VBA to paste data , initiate run command and store output), the model setup time increases drastically (it only reads 12-13 variables in one sec).

Is there a way I can increase the setup speed even while using VBA to run the model.

Thanks.

We have noticed this. It is a commonly reported problem in VBA programming that is not specific to OpenSolver. Let us know if you find a fix. Andrew

if i get prompted “out of memory” is this an opensolver limitation or my computer?

if its a solver issue- can someone advise me how to reduce my model? is there a limitation to the number of variable cells and/or constraints?

No limits. Possibly an Excel limitation. Or was the solver giving the error… solving problems with integer variables can need a lot of memory. Andrew

Hi,

I use the Couenne as a Solver Engine and I obtain this Error.

26 Aug 18 20:02:28 [OpenSolver.xlam] SolverCommon.RunLocalSolver: Line 7

26 Aug 18 20:02:28 [OpenSolver.xlam] SolverCommon.SolveModel: Line 44

26 Aug 18 20:02:29 [OpenSolver.xlam] OpenSolverAPI.RunOpenSolver: Line 11

Error -2147220504: The Couenne solver did not complete, but aborted with the error code -1.

The last log file can be viewed under the OpenSolver menu and may give you more information on what caused this error.

Solver: Couenne

OpenSolver version 2.9.0 (2017.11.10); Distribution=Advanced

Location: “C:\Users\DELL\AppData\Roaming\Microsoft\AddIns\OpenSolver.xlam”

Excel 16.0; build 10325; 32-bit; VBA7

Excel product code = {90160000-000F-0000-0000-0000000FF1CE}

Excel language: English – US

OS: Windows 10.0; 64-bit

Username: DELL

CBC v2.9.4 (64-bit) at “C:\Users\DELL\AppData\Roaming\Microsoft\AddIns\Solvers\win64\cbc.exe”

No Gurobi installation was detected. The value of %GUROBI_HOME% was not set.

Bonmin v1.8.4 (64-bit) at “C:\Users\DELL\AppData\Roaming\Microsoft\AddIns\Solvers\win64\bonmin.exe”

Couenne v0.5.6 (64-bit) at “C:\Users\DELL\AppData\Roaming\Microsoft\AddIns\Solvers\win64\couenne.exe”

NOMAD v3.7.1 (32-bit) using OpenSolverNomad v1.3.1 at “C:\Users\DELL\AppData\Roaming\Microsoft\AddIns\Solvers\win32\OpenSolverNomad.dll”

Please advice, Thank you so much.

I suggest you try Googling the error number or contacting the Couenne developers. Andrew