how to write this equation

Hi all!

I have the following:

set i /08/;
set j /1
7/;
set k /1*2/;

parameter g(k);

variable h(i,j,k);

I want to write an equation that says something like:

h(i,j,k) <= h(i,j-1,k) + g(k);

and I don’t know how to write the ‘j-1’ of the second member of the equation. Any idea??

Thank you in advance!

Fede


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi,
This equation can be modeled as follows:

set i /08/
j /1
7/
k /1*2/;

alias (jj,j);

parameter g(k);

variable h(i,j,k);

Equations Equ(i,j,jj,k);

Equ(i,j,jj,k)$((ord(j) GE 2)And(ord(jj) EQ ord(j)-1))…h(i,j,k) =L= h(i,jj,k) + g(k);


On Tue, May 17, 2011 at 8:12 PM, Federico Perea wrote:

Hi all!

I have the following:

set i /08/;
set j /1
7/;
set k /1*2/;

parameter g(k);

variable h(i,j,k);

I want to write an equation that says something like:

h(i,j,k) <= h(i,j-1,k) + g(k);

and I don’t know how to write the ‘j-1’ of the second member of the equation. Any idea??

Thank you in advance!

Fede


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

SaYa


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

cons(i,j,k)… h(i,j,k) =L= h(i,j-1,k)+ g(k);

It should work.

Date: Tue, 17 May 2011 17:42:44 +0200
Subject: how to write this equation
From: fedperea@gmail.com
To: gamsworld@googlegroups.com

Hi all!

I have the following:

set i /08/;
set j /1
7/;
set k /1*2/;

parameter g(k);

variable h(i,j,k);

I want to write an equation that says something like:

h(i,j,k) <= h(i,j-1,k) + g(k);

and I don’t know how to write the ‘j-1’ of the second member of the equation. Any idea??

Thank you in advance!

Fede


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

I did it just like Safar proposed. Thank you all!!

On Tue, May 17, 2011 at 10:02 PM, Safar Yarali wrote:

Hi,
This equation can be modeled as follows:

set i /08/
j /1
7/
k /1*2/;

alias (jj,j);


parameter g(k);

variable h(i,j,k);

Equations Equ(i,j,jj,k);

Equ(i,j,jj,k)$((ord(j) GE 2)And(ord(jj) EQ ord(j)-1))…h(i,j,k) =L= h(i,jj,k) + g(k);


On Tue, May 17, 2011 at 8:12 PM, Federico Perea wrote:

Hi all!

I have the following:

set i /08/;
set j /1
7/;
set k /1*2/;

parameter g(k);

variable h(i,j,k);

I want to write an equation that says something like:

h(i,j,k) <= h(i,j-1,k) + g(k);

and I don’t know how to write the ‘j-1’ of the second member of the equation. Any idea??

Thank you in advance!

Fede


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

SaYa


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.