Hey guys,

I'm a beginner, when it comes to GAMS.

I have a question about a variable. I'm right now trying to model a model of a thermal energy storage.

For this I need to use ordered sets to calculate the temperature with respect to the temperature of the time step before.

For this I implemented the set:

set i time steps / 0*720 /;

as the number of time steps.

I declared the temperature:

variable T_ti(i) input temperature of the thermal energy storage;

as a subset of i. Now I want to assign an initial value to the first value of T_ti.

How do I do this? Do I need to implement an equation for it?

Thanks a lot!

Cheers,

Max

## Assign Values to variables

### Re: Assign Values to variables

Hi Max

If you want to fix the starting point, you just write
If you want to give it a starting point for the solver (GAMS assumes 0 if you don't do that):

Cheers

Renger

If you want to fix the starting point, you just write

Code: Select all

`T_ti.FX("0") = 27; `

Code: Select all

`T_ti.L("0") = 27; `

Renger

____________________________________

Enjoy modeling even more: Read my blog on modeling at The lazy economist

Enjoy modeling even more: Read my blog on modeling at The lazy economist

### Re: Assign Values to variables

Thank you for your fast reply!

Your explanation helped me a lot.

Your explanation helped me a lot.

### Re: Assign Values to variables

Hey,

I have a similar problem. I also want to assign starting values to my MIP in order to speed up the solution. I tried assigning the values using the ".l" suffix to the respective values and using the mipstart=1 option of CPLEX. However, this solution was not recognozed since the log file contains the following message : "MIP start 'm1' defined no solution".

The weird thing about it is, that I just used the solution I got from a presolve of the exact same model in order to play around with the syntax.

Any suggestions how to fix this ?

Kind regards

I have a similar problem. I also want to assign starting values to my MIP in order to speed up the solution. I tried assigning the values using the ".l" suffix to the respective values and using the mipstart=1 option of CPLEX. However, this solution was not recognozed since the log file contains the following message : "MIP start 'm1' defined no solution".

The weird thing about it is, that I just used the solution I got from a presolve of the exact same model in order to play around with the syntax.

Any suggestions how to fix this ?

Kind regards