Search found 6 matches

by femibode
3 weeks ago
Forum: Modeling
Topic: a scenario run yields different results when run singly and in a loop of others
Replies: 2
Views: 241

a scenario run yields different results when run singly and in a loop of others

Hi there wondering if somebody can help me understand why a model scenario gives different results when ran singly and when run in a loop with other scenarios. For example, when I run it singly, my set up is as follow: Loop(scenario$(ord(scenario) lt 3 and ord(scenario) eq 2), if(ord(scenario) eq 1,...
by femibode
3 months ago
Forum: Modeling
Topic: Finding average
Replies: 1
Views: 170

Re: Finding average

I managed with the following but would like to know if there's other means as I need to find median as well
aveX = sum([i,j], X(i,j)) / (card(i)*card(j));
aveY = sum([i,j,k], Y(i,j,k)) / (card(i)*card(j)*card(k));
by femibode
3 months ago
Forum: Modeling
Topic: Finding average
Replies: 1
Views: 170

Finding average

I would appreciate if anyone can help me. I'm struggling to write equation to compute average of a set that has more than one dimensions. E.g how do I find average of
X(i,j)
Y(i,j,k)

Thanks
by femibode
11 months ago
Forum: Modeling
Topic: Multiple Conditions in one Equation
Replies: 4
Views: 771

Re: Multiple Conditions in one Equation

then I would try this:

Code: Select all

 Neweq.. AI("1")$(BI("1") = CI("1") and CI("1") = DI("1") ) =E= BI("1") 
by femibode
11 months ago
Forum: Modeling
Topic: Multiple Conditions in one Equation
Replies: 4
Views: 771

Re: Multiple Conditions in one Equation

1. If GAMS allows using multiple mathematical operators in an equation, yes but if not, no. 2. This is the general syntax for defining equation in GAMS: eqn_name(index_list)[$logical_condition(s)].. expression eqn_type expression; 3. Do you only need to ensure equality of these multiple entities? An...