Skip to main content

MATLAB-BARON Frequently Asked Questions

Welcome, Anonymous

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

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.

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.

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.

Not currently—only executables are provided. DLLs will be added in the future, but many users run BARON via Pyomo, JuMP, or the MATLAB interface in the meantime.

Usage Tips

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.

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.

No. BARON requires an algebraic model (explicit equations), so black-box/unknown models are not supported.

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).

Avoid naming conflicts by setting barscratch to something unique per run (e.g., random value or based on the process id (pid)).

The interface uses a scratch directory with a default name unless you override it. Control the scratch directory name/location using barscratch.

The OPTI Toolbox page lists methods for efficiently building large nonlinear constraint sets (e.g., programmatic construction patterns).

Error Messages and Support

You need to purchase a BARON license. Alternatively, you can run BARON for free via the NEOS server (subject to NEOS limits/policies).

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.

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.

Most commonly: (1) your BARON executable version is incompatible with the license you’re using, or (2) the license path is specified incorrectly.

Confirm:

  1. You copied the BARON executable into the Interface folder.
  2. Install with root/admin privileges if possible (to avoid repeated installation). Then:
  • Rename the executable from baron to barin.
  • Put a copy of your BARON license somewhere on your PATH (if unsure, place it next to barin in the interface folder).

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.

Demo mode indicates you need a valid BARON license. Contact sales@minlp.com to purchase a license.

Place the Intel library in the same directory as the BARON executable (which becomes barin.exe after renaming).

Email info@minlp.com. Include:

  • A screenshot of warnings/errors

  • If BARON runs, use filekp to generate the scratch directory and send it, including the .bar file so support can reproduce and diagnose the issue.