Decision Optimization

 View Only
Expand all | Collapse all

Overflow occured use opl-run profile.

  • 1.  Overflow occured use opl-run profile.

    Posted Mon January 16, 2023 01:12 AM
    My optimization problem in C-PLEX is given below. When I executed my program, it showed an overflow occurred. Use oplrun-profile.I have also tried using oplrun, but it is not working. It appears to be a reference to the undefined variable C. A screenshot of the configuration window is also attached.


    int nb=14;
    int t=24;
    int nv=800;
    int l=14;
    range nbus=1..nb;
    range tavail =1..t;
    range nport=1..nv;
    //soc data
    float soc[nport][tavail]=...;
    //forcasted load data
    float pl[nbus][tavail]=...;
    //target load data
    float pt[nbus][tavail]=...;
    //generationfloat pg[nbus][tavail]=...;
    //price data
    float c[tavail]=[2.5,2.5,2.5,2.5,2.5,2.5,3.5,3.5,3.5,3.5,5,3.5,3.5,3.5,3.5,3.5,3.5,3.5,5,5,5,3.5,3.5,2.5];
    //decision variable charging power
    dvar float+ pevch[tavail][nport];
    //decision variable discharging power
    dvar float+ pevdis[tavail][nport];
    float G[nbus][nbus]=...;
    float B[nbus][nbus]=...;
    float deltacos[nbus][nbus][tavail];
    float deltasin[nbus][nbus][tavail];
    float v[tavail][nbus]=...;
    float ptt[tavail];
    float del[tavail][nbus]=...;
    //dvar float+ pevdist[tavail] in 0..10000000 ;
    //dvar float+ pevcht[tavail] in 0..10000000;
    //float plt[tavail];

    float p[tavail];
    float plnew[tavail];
    dvar float pbatch[tavail][nport];

    //execute fill_deltacos
    //{for(var i in nbus)for (var l in nbus)for(var j in tavail)deltacos[i][l][j]=Math.cos(del[j][i]-del[j][l]);
    //}
    //execute fill_deltasin
    //{for(var i in nbus)for (var l in nbus)for(var j in tavail)deltacos[i][l][j]=Math.sin(del[j][i]-del[j][l]);
    //}

    // objective function
    minimize sum(j in tavail)( sum(i in nbus)(pt[i][j]*1000000-pl[i][j]*1000000)+sum(k in nport)(pevch[j][k]-pevdis[j][k]));


    subject to

    {
    //constraint for discharging


    forall(i in nbus,j in tavail,k in nport)
    {ct1:if((c[j]==5 && 0.7<soc[k][j]<0.9)||(c[j]==3.5 && 0.7<soc[k][j]<0.9))
    {pevdis[j][k]==7700;
    }
    //else

    else
    {pevdis[j][k]==0;
    }
    }

    //constraint for charging
    forall(i in nbus, j in tavail, k in nport)
    {ct4: if(c[j]==2.5 && 0<soc[k][j]<0.7||c[j]==3.5 &&
    0.3<soc[k][j]<0.5||c[j]==5&&(0.5<=soc[k][j]<0.7))
    {pevch[j][k]==7700;
    }
    else
    {pevch[j][k]==0;}
    }

    forall(i in nbus, j in tavail, k in nport)

    {ct5: if((c[j]==5 && 0<soc[k][j]<=0.3)||(c[j]==3.5 && 0<soc[k][j]<=0.3))
    {pbatch[j][k]==7700;}
    else
    {pbatch[j][k]==0;}}

    //checking load limit

    forall(i in nbus, j in tavail, k in nport)
    {ctd:if(c[j]==5)
    {sum(i in nbus)pt[i][j]*1000000<=sum (k in nport)(pevch[j][k]-pevdis[j][k])+sum(i in nbus)(pl[i][j]*1000000)<=sum(i in nbus)(pl[i][j])*1000000;}
    forall(j in tavail)
    {cte:if(c[j]==3.5)
    {120000000<=sum (k in nport)(pevch[j][k]-pevdis[j][k])+sum(i in nbus)(pl[i][j])<=125000000;}
    }
    forall(i in nbus, j in tavail, k in nport)
    {ctf:if(c[j]==2.5)
    {sum(i in nbus)pl[i][j]<=sum (k in nport)(pevch[j][k]-pevdis[j][k])+sum(i in nbus)(pl[i][j])<=sum(i in nbus)pt[i][j];}
    }


    }}

    ------------------------------
    Haripriya M R
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Overflow occured use opl-run profile.

    Posted Mon January 16, 2023 04:14 AM
    Hi,

    can you share your .dat so that other users could try ?

    regards

    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------