Hi
It looks like you have assigned the values before running the model which doesn't make sense as you don't have a solution for Q available.
If you run the same model again using Q.L you should assign flag2 after the solve of the first instance.
Renger
Search found 639 matches
- 3 years ago
- Forum: Modeling
- Topic: 2 models using the variable of the first as the set of the second
- Replies: 8
- Views: 6652
- 3 years ago
- Forum: Modeling
- Topic: 2 models using the variable of the first as the set of the second
- Replies: 8
- Views: 6652
- 3 years ago
- Forum: Syntax
- Topic: csv2gdx creates <empty> rows when trying to read in set
- Replies: 6
- Views: 4764
Re: csv2gdx creates <empty> rows when trying to read in set
Hi You are correct. My example has the same problem: set1 has a comma and then an empty as set element. Here is what happens when I assign values: ---- 12 PARAMETER test set_1_1 0.172, set_1_2 0.843, 0.550 I think this is not possible as long as csv2gdx is not corrected for this problem. Sorry Renger
- 3 years ago
- Forum: Syntax
- Topic: csv2gdx creates <empty> rows when trying to read in set
- Replies: 6
- Views: 4764
Re: csv2gdx creates <empty> rows when trying to read in set
Hi OK, I tried to get the same problem, but when I run my code, there are <empty> in my gdx file, but there is no problem when reading the sets: set set1, set2; $call csv2gdx sets.csv output=dummy1.gdx id=text1 index=1,2 colCount=2 useheader=yes $gdxin "dummy1.gdx" $load Set1 <=text1.Dim1 ...
- 3 years ago
- Forum: Modeling
- Topic: Tactical investment model
- Replies: 7
- Views: 4162
Re: Tactical investment model
Hi A few remarks: - You have to remove the assignment to d(t,i) I made, because you inserted the table. - Your equations FO and restrict1 do not comply with the description: - x is not always positive, you should treat it not as a positive variable- Equation restrict1: This one is defined over t and...
- 3 years ago
- Forum: Modeling
- Topic: Tactical investment model
- Replies: 7
- Views: 4162
Re: Tactical investment model
Without code, there is no way to answer that...
- 3 years ago
- Forum: Modeling
- Topic: Variable sequence as a set
- Replies: 2
- Views: 2115
Re: Variable sequence as a set
Hi
You could define an overall set with the maximum of x as the number of elements:
Then you define a dynamic subset and use the value from excel to define it:
Renger
You could define an overall set with the maximum of x as the number of elements:
Code: Select all
set k /1*10000/;
Code: Select all
set i(k);
i(k)$(val.k < x+1) = YES;
- 3 years ago
- Forum: Syntax
- Topic: csv2gdx creates <empty> rows when trying to read in set
- Replies: 6
- Views: 4764
Re: csv2gdx creates <empty> rows when trying to read in set
Hi
It is not clear what you want to do: text1 seems to be defined over all sets, but then the csv file should have all combinations of the five sets and if it is a parameter values for those combinations.
Renger
It is not clear what you want to do: text1 seems to be defined over all sets, but then the csv file should have all combinations of the five sets and if it is a parameter values for those combinations.
Renger
- 3 years ago
- Forum: Modeling
- Topic: Tactical investment model
- Replies: 7
- Views: 4162
Re: Tactical investment model
Hi I added some random numbers to get the parameter d in your model. After that, there are no errors. Perhaps you could start from this code, add your table d correctly and continue. SETS i categorias /RD, AKZ, KLM, PHI, UN/; SETS t tiempo /1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ...
- 3 years ago
- Forum: Modeling
- Topic: 2 models using the variable of the first as the set of the second
- Replies: 8
- Views: 6652
Re: 2 models using the variable of the first as the set of the second
Hi qr is a variable, so one should use qr.L in the parameter and you should stage it like this (don't repeat the line with the definition of the parameter). If you still have a division by zero, this can be caused by another parameter or variable. Make sure that your other variables are not equal to...