Originally posted by: SystemAdmin
> Correct me if I am wrong, but doesn't for( k in 1..SampleN)
You are right, but there were brackets missing, and PeriodN was not defined.
Anyway, your speculation that CPLEX does not support expresions of the
form
x/y or
1/y where
x and
y are decision variables is correct.
(this is a nonlinear formulation)
You should either
(*) think about a reformulation of the problem in order to get a linear objective and linear constraints to use CPLEX
or
(*) use the CP-engine.
The following code snippet
using CP;
int SampleN=5;
int AssetN=3;// ; inserted
int PeriodN = 3; // added this line
int Beta[1..AssetN] = [1,2,3];
dvar int+ x[1..AssetN][1..PeriodN][1..SampleN];
dvar int+ w_end[1..SampleN];
dvar int+ Bsum[1..SampleN];
minimize // "minimize" instead if "Minimize"
sum(k in 1..SampleN) 1/SampleN*(w_end[k]/Bsum[k]);
subject to{ // added to code
forall(k in 1..SampleN)
Bsum[k] == sum(i in 1..AssetN)Beta[i]* (x[i][PeriodN][k]/w_end[k]);
}
is at least valid but far away from being easily solvable.
Hope this helps in any way.
Regards
Norbert
#DecisionOptimization#OPLusingCPLEXOptimizer