Dependent Variable

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Dependent Variable

Post by Archiver »


Hi everyone,

I would like to define a dependent variable. How can I do it?
Here is a simple example:

C(t+1)=C(t)+Y(t+1)
C(1)=C_base_year

Where, t is a set (shows the year), Y is a binary variable and C is a dependent variable.
It is clear that C is fixed in the base year(t=1) and it depends on Y variable for t>1.
If I define it as a variable, it is constant for other years too(C(t)=C_base_year). So, how should I define C?

Thanks
Masoud

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Dependent Variable

Post by Archiver »


It is necessary to mention that C is not a parameter and there are some constraints on it.

On Wednesday, March 23, 2016 at 7:02:46 PM UTC+4:30, Masoud wrote:

Hi everyone,

I would like to define a dependent variable. How can I do it?
Here is a simple example:

C(t+1)=C(t)+Y(t+1)
C(1)=C_base_year

Where, t is a set (shows the year), Y is a binary variable and C is a dependent variable.
It is clear that C is fixed in the base year(t=1) and it depends on Y variable for t>1.
If I define it as a variable, it is constant for other years too(C(t)=C_base_year). So, how should I define C?

Thanks
Masoud

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Dependent Variable

Post by Archiver »


Hi Masoud,

You need to use the conditional operator ($) for the constraints:

constraint_ini.. C('1') =e= C_base_year;
constraints(t)$(ord(t) > 1).. C(t+1) =e= C(t) + Y(t+1);


Cheers,
Pedro

On Wed, Mar 23, 2016 at 3:35 PM, Masoud wrote:

It is necessary to mention that C is not a parameter and there are some constraints on it.


On Wednesday, March 23, 2016 at 7:02:46 PM UTC+4:30, Masoud wrote:

Hi everyone,

I would like to define a dependent variable. How can I do it?
Here is a simple example:

C(t+1)=C(t)+Y(t+1)
C(1)=C_base_year

Where, t is a set (shows the year), Y is a binary variable and C is a dependent variable.
It is clear that C is fixed in the base year(t=1) and it depends on Y variable for t>1.
If I define it as a variable, it is constant for other years too(C(t)=C_base_year). So, how should I define C?

Thanks
Masoud

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.




--
PEDRO JAVIER RAMÍREZ TORREALBA
Mobile: +44-(0)75-8069-3119
London, UNITED KINGDOM

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Dependent Variable

Post by Archiver »


Dear Pedro,
Thanks for your response. As I said, when I consider C such as what you suggested, C becomes constant for every t:
C(t)=C_base_year
I don't know whether the problem is in my definition or anything else(such as the solver)?
I used CPLEX(MIP)...

And one other question:
Does software solve all equations together? If so, is there any way to force software solve equations in sequence?
For example, solve C(t+1) =e= C(t) + Y(t+1) after C(t) =e= C(t-1) + Y(t)...

Thanks



On Thursday, March 24, 2016 at 11:28:10 AM UTC+4:30, PowerChile wrote:

Hi Masoud,

You need to use the conditional operator ($) for the constraints:

constraint_ini.. C('1') =e= C_base_year;
constraints(t)$(ord(t) > 1).. C(t+1) =e= C(t) + Y(t+1);


Cheers,
Pedro

On Wed, Mar 23, 2016 at 3:35 PM, Masoud wrote:

It is necessary to mention that C is not a parameter and there are some constraints on it.


On Wednesday, March 23, 2016 at 7:02:46 PM UTC+4:30, Masoud wrote:

Hi everyone,

I would like to define a dependent variable. How can I do it?
Here is a simple example:

C(t+1)=C(t)+Y(t+1)
C(1)=C_base_year

Where, t is a set (shows the year), Y is a binary variable and C is a dependent variable.
It is clear that C is fixed in the base year(t=1) and it depends on Y variable for t>1.
If I define it as a variable, it is constant for other years too(C(t)=C_base_year). So, how should I define C?

Thanks
Masoud

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.




--
PEDRO JAVIER RAMÍREZ TORREALBA
Mobile: +44-(0)75-8069-3119
London, UNITED KINGDOM

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

RE: Dependent Variable

Post by Archiver »


Hi

You could also just fix the first value:

C.FX(“1”) = C_base_year;

In this case there is no need for the constraint_ini equation.
Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Pedro Javier Ramírez Torrealba
Sent: Wednesday, March 23, 2016 5:56 PM
To: gamsworld@googlegroups.com
Subject: Re: Dependent Variable



Hi Masoud,



You need to use the conditional operator ($) for the constraints:



constraint_ini.. C('1') =e= C_base_year;

constraints(t)$(ord(t) > 1).. C(t+1) =e= C(t) + Y(t+1);





Cheers,

Pedro



On Wed, Mar 23, 2016 at 3:35 PM, Masoud wrote:

It is necessary to mention that C is not a parameter and there are some constraints on it.



On Wednesday, March 23, 2016 at 7:02:46 PM UTC+4:30, Masoud wrote:

Hi everyone,



I would like to define a dependent variable. How can I do it?

Here is a simple example:



C(t+1)=C(t)+Y(t+1)

C(1)=C_base_year



Where, t is a set (shows the year), Y is a binary variable and C is a dependent variable.

It is clear that C is fixed in the base year(t=1) and it depends on Y variable for t>1.

If I define it as a variable, it is constant for other years too(C(t)=C_base_year). So, how should I define C?



Thanks

Masoud

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.





--

PEDRO JAVIER RAMÍREZ TORREALBA

Mobile: +44-(0)75-8069-3119

London, UNITED KINGDOM

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Dependent Variable

Post by Archiver »


Hi Renger,

You are right. I forgot that option that is much simpler, and I would say elegant.


Cheers,
Pedro

On Thu, Mar 24, 2016 at 3:23 PM, Renger van Nieuwkoop wrote:

Hi

You could also just fix the first value:

C.FX(“1”) = C_base_year;

In this case there is no need for the constraint_ini equation.
Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Pedro Javier Ramírez Torrealba
Sent: Wednesday, March 23, 2016 5:56 PM
To: gamsworld@googlegroups.com
Subject: Re: Dependent Variable



Hi Masoud,



You need to use the conditional operator ($) for the constraints:



constraint_ini.. C('1') =e= C_base_year;

constraints(t)$(ord(t) > 1).. C(t+1) =e= C(t) + Y(t+1);





Cheers,

Pedro



On Wed, Mar 23, 2016 at 3:35 PM, Masoud wrote:

It is necessary to mention that C is not a parameter and there are some constraints on it.



On Wednesday, March 23, 2016 at 7:02:46 PM UTC+4:30, Masoud wrote:

Hi everyone,



I would like to define a dependent variable. How can I do it?

Here is a simple example:



C(t+1)=C(t)+Y(t+1)

C(1)=C_base_year



Where, t is a set (shows the year), Y is a binary variable and C is a dependent variable.

It is clear that C is fixed in the base year(t=1) and it depends on Y variable for t>1.

If I define it as a variable, it is constant for other years too(C(t)=C_base_year). So, how should I define C?



Thanks

Masoud

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.





--

PEDRO JAVIER RAMÍREZ TORREALBA

Mobile: +44-(0)75-8069-3119

London, UNITED KINGDOM

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.




--
PEDRO JAVIER RAMÍREZ TORREALBA
Mobile: +44-(0)75-8069-3119
London, UNITED KINGDOM

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Post Reply