Modeling with BARON in GAMS Studio

Problems with modeling
Post Reply
rickyc2000
User
User
Posts: 2
Joined: 1 year ago

Modeling with BARON in GAMS Studio

Post by rickyc2000 »

Hello, I am trying to run a non-linear optimizing problem using the BARON solver in GAMS:

The code is the following:

Code: Select all

option optcr=0.0, optca=0.0, solver=baron;

$ontext
Nonlinear optimization problem solved with BARON
$offtext

Set i;
Set j;

Parameter s(i) 'demand rate for each SKU';
Parameter d(j) 'stockout probability of each SKU';

$onDelim
$include C:\Users\ricardo.cabral\Documents\Project\demand_rate.csv
$offDelim

$onDelim
$include C:\Users\ricardo.cabral\Documents\Project\data.csv
$offDelim

Positive Variable a(i,j) "Substitution rate between intrinsics i and substitutes j";
Positive Variable l(i) "Intrinsic demand for each SKU";

Equation obj 'objective function';

obj.. sum(j$(j <> i), a(i,j)*l(j)*d(j)) + l(i) - s(i) =e= 0;

Model nlopt 'Nonlinear optimization problem' /all/;
nlopt.obj = obj;
nlopt.l = l;
nlopt.a = a;
nlopt.s = s;
$nlopt.moptions.LimTime=1800;
$solver BARON nlopt min;
However, specially in the objective function I am obtaining lots of errors, such as errors 148,149,135 and 171.

Can someone help me please?
User avatar
bussieck
Moderator
Moderator
Posts: 1042
Joined: 7 years ago

Re: Modeling with BARON in GAMS Studio

Post by bussieck »

I suggest to go through the tutorial material of the GAMS documentation: https://www.gams.com/latest/docs/UG_MAI ... l_Examples. The GAMS Tutorial by Rick Rosenthal is very helpful.

-Michael
Post Reply