I created a model that is nonlinear and nonconvex through the BARON solver with optcr=0.001.

Im exploring different parameter combination instances through MATLAB which then calls my GAMS script (that contains the NLP/nonconvex model) to solve the model. Once the optimal solution or a feasible solution that meets the specified termination criteria is found, results are stored as variables and saved to my MATLAB script. So far, I’ve been able to store my solution (decision variables & obj val), theoretical upper bound, and total run time. The disadvantage to my method is that the lst and log files are not saved since these files are overwritten every time MATLAB calls the GAMS file to solve a specified instance.

The few times I’ve directly ran my model in GAMS, I’ve been able to look at the iteration log and noticed that the best solution is found relatively quickly (e.g., the best solution was found in 5 min, but the solver for ran for several hours more because it hasn’t satisfied the specified optcr or reslim). This is an important metric to record for my analysis.

I cant find anything that explains how to save time of best solution was found. Additionally, it would also be nice to save all log and lst files (possibly have GAMS specify a unique file name to prevent it from overwriting each time). Any help on this is greatly appreciated!

I don’t think there is a general “time saving” option in BARON. Even though your best incumbent is found quickly BARON still needs to move the dual bound to reach the optimality tolerance. That can sometimes take a long time, even if you already know and hold the optimal solution. If you could share a typical instance perhaps someone (perhaps even the BARON developer) can experiment with this and see if there are some good options to improve the running time.

Hi Michael, thanks for replying! When you mean to share an instance, do you mean to share the entire GAMS script here?

I’m still getting used to the GAMS syntax. Is it possible to name the file based on a given parameter? For example, say we set the parameter ‘instance’=6. When the log or lst file is saved, it will be titled “ResultsV6.log” or “ResultsV6.lst” . This way I can loop through several test instances using the same MATLAB code and ill have a folder with several log files corresponding with the different test instances. (I.e., ResultsV1.log, ResultsV2.log,…).

Issue:
The code above produces the log file titled ‘ResultsV$instance$.log’ instead of ‘ResultsV456.log’.
Furthermore, it seems the $call… line is producing thousands on folders in the current directory that I cannot terminate without having to turn the computer off.