This page is for general questions about using the MATLAB/BARON interface and solutions to common error messages. For further technical support, please contact info@minlp.com.
Getting Started
Where can I purchase the MATLAB/BARON Interface?
You don’t need to purchase it—the MATLAB/BARON interface is free of charge and can be downloaded from the MATLAB-BARON Interface page on our website.
Does BARON work with MATLAB 2017/2018?
Yes. If you run into issues, use the filekp option to generate the scratch directory (including the .bar file) and send it to support so they can diagnose the problem.
How do I use my license for the newest version of BARON with the MATLAB/BARON interface?
Put the BARON executable and your license file on your system PATH (the MATLAB path alone may not be enough), and install the interface by following the included installation instructions.
Usage Tips
Can I use an older version of BARON with a newer version of the MATLAB/BARON interface?
The interface should work with all BARON versions. However, licenses typically cover the BARON version available when the license was issued and any newer versions released during the maintenance period, so your license may not work with older BARON versions.
Can I use a factorial function with the MATLAB/BARON interface?
The MATLAB interface may accept the algebraic structure, but BARON does not accept factorial directly. Loops cannot depend on the value of a decision variable.
If the variable is a bounded integer, you can model factorial exactly using binary variables to select among known factorial values for each possible integer value.
Can I use the MATLAB/BARON interface for black-box functions where the model is unknown?
No. BARON requires an algebraic model (explicit equations), so black-box/unknown models are not supported.
Can I use BARON with IBM CPLEX if I’ve already installed CPLEX?
Yes—BARON’s interface is generally backward/forward compatible with many CPLEX versions. See CplexLibName option in the BARON User Manual and provide the full path to the CPLEX library file (.dll / .dylib / .so).
How can I successfully run parallel instances of BARON with the MATLAB/BARON interface?
Avoid naming conflicts by setting barscratch to something unique per run (e.g., random value or based on the process id (pid)).
How do I make parallel instances save temporary files in different locations?
The interface uses a scratch directory with a default name unless you override it. Control the scratch directory name/location using barscratch.
How can I create a large set of nonlinear constraints in the MATLAB/BARON interface?
The OPTI Toolbox page lists methods for efficiently building large nonlinear constraint sets (e.g., programmatic construction patterns).
Error Messages and Support
What if I get: “A valid BARON license is required for this model”?
You need to purchase a BARON license. Alternatively, you can run BARON for free via the NEOS server (subject to NEOS limits/policies).
What if I get an error saying my license file is not valid for this BARON version?
Putting the license file on the MATLAB path is not sufficient. Ensure you specify the complete path to the license file in the BARON options.
What if I get an error saying the license file cannot be found?
You may be running an older BARON executable while your license only supports newer versions. Remove/avoid the old executable or reorder your PATH so the newest BARON is found first.
What if I installed the interface, but it fails to install the license after I added the license path?
Most commonly: (1) your BARON executable version is incompatible with the license you’re using, or (2) the license path is specified incorrectly.
What if I get an error in MATLAB after adding the barin executable file to the Interface folder?
Confirm:
- You copied the BARON executable into the Interface folder.
- Install with root/admin privileges if possible (to avoid repeated installation). Then:
- Rename the executable from
barontobarin. - Put a copy of your BARON license somewhere on your PATH (if unsure, place it next to
barinin the interface folder).
What if I get an error message saying there was an error opening the timing output file?
Run BARON directly from the system command line to confirm the license works and the executable wasn’t corrupted. Example on Windows: open cmd, navigate to the BARON folder, and run baron.exe path-to-file-to-run.
How do I get out of demo mode while using MATLAB/BARON with CPLEX?
Demo mode indicates you need a valid BARON license. Contact sales@minlp.com to purchase a license.
What if I run the examples included in matbar.zip and the BARON executable does not work?
Place the Intel library in the same directory as the BARON executable (which becomes barin.exe after renaming).
How can I get further technical support?
Email info@minlp.com. Include:
A screenshot of warnings/errors
If BARON runs, use
filekpto generate the scratch directory and send it, including the.barfile so support can reproduce and diagnose the issue.