Search code examples
optimizationsumlinear-programmingcplex

CPLEX Sum in Sum


I am new to CPLEX and I would like to ask how can I code the following objective function in CPLEX. I have tried few ways but none seemed to work.

1

Where N and S are indexes, WP and WL are variables and LCP and LCP are model parameters.


Solution

  • You could start with

    int N=2;
    int S=3;
    
    int LCP[i in 1..S]=i;
    int LCL[i in 1..S]=i*2;
    
    dvar int+ WP[1..N][1..S];
    dvar int+ WL[1..N][1..S];
    
    minimize sum(n in 1..N,s in 1..S) (WP[n,s]*LCP[s]+WL[n,s]*LCL[s]);
    subject to
    {
    
    }