Hi there,
I want to set multiple variables equal to each other without having to define multiple equations for that. Is there a smooth way to do this?
I.e. something like this:
Neweq.. AI("1")=E=BI("1")=E=CI("1")=E=DI("1")
Thank you
Multiple Conditions in one Equation
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:
3. Do you only need to ensure equality of these multiple entities? And or do you know the value of each of them and are you trying to avoid multiple equations?
2. This is the general syntax for defining equation in GAMS:
Code: Select all
eqn_name(index_list)[$logical_condition(s)].. expression eqn_type expression;
Re: Multiple Conditions in one Equation
Hey,
It didn´t work the way I tried it with the multiple =E= signs.
And I don't know the value, I try to optimize different paths that diverge, but they need to be equal in the first period.
Thanks
It didn´t work the way I tried it with the multiple =E= signs.
And I don't know the value, I try to optimize different paths that diverge, but they need to be equal in the first period.
Thanks
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")

 User
 Posts: 1
 Joined: 8 months ago
Re: Multiple Conditions in one Equation
Thank you for solution, it worked for me.