[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Constraint!
From: |
Carlos HERRERA |
Subject: |
[Help-glpk] Constraint! |
Date: |
Tue, 18 Dec 2007 10:33:24 +0100 |
Hello!
How I can write this constraint in MathProg/AMPL?,
(Mathematical form)
sum(j=1 to t) sum(i=1 to I) b_ik * x_ij <= sum(j=1 to t) s_kj,
t = 1,2,...,J; k = 1,2,...,K).
EXAMPLE:
J=1,2,3,4; I=1,2,3; K=1,2;
--------
t=1, k=1
--------
b_11*x_11 + b_21*x_21 + b_31*x_31 <= s_11
--------
t=2, k=1
--------
b_11*x_11 + b_21*x_21 + b_31*x_31 + <= s_11 + s_12
b_11*x_12 + b_21*x_22 + b_31*x_32
--------
t=3, k=1
--------
b_11*x_11 + b_21*x_21 + b_31*x_31 + <= s_11 + s_12 + s_13
b_11*x_12 + b_21*x_22 + b_31*x_32 +
b_11*x_13 + b_21*x_23 + b_31*x_33
--------
t=4, k=1
--------
b_11*x_11 + b_21*x_21 + b_31*x_31 + <= s_11 + s_12 + s_13 + s_14
b_11*x_12 + b_21*x_22 + b_31*x_32 +
b_11*x_13 + b_21*x_23 + b_31*x_33 +
b_11*x_14 + b_21*x_24 + b_31*x_34
The same way for k=2.
The problem is to change the index for the next constraint for to obtain
the "joint constraints". I probe with "FOR", but this is not permitted
for the constraint.
Thanks.
- [Help-glpk] Constraint!,
Carlos HERRERA <=