Topic
1 reply Latest Post - ‏2013-09-05T08:24:55Z by DanielJunglas
LindaKing
LindaKing
1 Post
ACCEPTED ANSWER

Pinned topic How to model iterative process?

‏2013-09-04T11:36:27Z |

Hello, all

I need to model a multi-period problem. In every period, I should judge whether the increasing(decreasing) ratio between two periods is beyond a given threshold or not.

For instance, cost(t) and  cost(t-1) are the cost of current and previous periods, respectively. The condition is: [cost(t)-cost(t-1)]/cost(t-1) <=10%?

I refer to the model "mulprod" for flow control.

main{

...

if (Math.abs(cplex.getObjValue() - 393.5)>=0.01) {

status = -1;

}

...

}

 

But how can I express this condition in an math model?

Can this be included in a constraint?

  • DanielJunglas
    DanielJunglas
    111 Posts
    ACCEPTED ANSWER

    Re: How to model iterative process?

    ‏2013-09-05T08:24:55Z  in response to LindaKing

    Sorry, I am not exactly clear what you are trying to do. Do you want to have the condition '[cost(t)-cost(t-1)]/cost(t-1) <=10%' as sort of constraint in your model and add some restrictions if that condition is met (or not met)? In that case I think you can use the implication operator (see also "logical constraints" in the user manual):

    (cost(t)-cost(t-1) <= 0.1*cost(t-1)) => ... // additional constraint here

    Is that what you are looking for?