Domain violation for set

Dear all :wink: ,
I’m fairly new at GAMS. I use a series of input-output models(IOM) for my calculations. But two syntax errors occurred when I wrote the collection field. May I ask how I need to modify it?

I wrote the following Parameters, but the runtime "xx(PS,PS1)= IOT30(PS,PS1); " and “VI(FI,PS1) = IOT30(FI,PS1); ” show Domain violation for set, may I ask what I need to change?

I wrote
Parameters
2.png
1.png
Error
error.png
Here is the excel files and gams code.
shixing.gms (109 KB)
demand.xlsx (9.25 MB)
domain
image.png
image.png
image.png
image.png
image.png
image.png
image.png

Looking at your .gms file I see that you declared IOT30 over the domains (RIOT,CIOT). PS1 is an alias to PS which is a subset of RIOT not CIOT, therefore the domain violation occurs for xx(PS,PS1) = IOT30(PS,PS1); and VI(FI,PS1) = IOT30(FI,PS1); (PS1 is the wrong domain here given how you declared IOT30). However, just changing PS1 to a set from the domain CIOT will get you another error since this set is then uncontrolled. Its not very clear to me what you are trying to calculate here. Hope my hints are helping.

  • Aileen

Hi,
We want PS1 to be a subset of CIOT. PS1 has the same arrangement of elements as PS. However, after I declared PS1 as a subset of CIOT, the original two errors were resolved correctly, but five more errors(Domain violation for set) were added.
This IOM is the original model we did not modify before, because we did not change the original output of the equations, so the output of the following paragraphs are still the table form of the original equations, you should be able to deduce the meaning of the syntax from this.
The difference between our modified model and the original IOM is that there are more than 2,000 data in our model, while the original model only has seven data.
IOM.zip (15.7 KB)
One of the final results we want to get is an Excel spreadsheet of WIOT2014_Nov16_ROW. May I ask how I need to modify it?We would like your help as soon as possible. Thank you

Five new Domain violation for set errors.
errors.png
Below is our modified file, you can have a look.
shixing.gms (109 KB)
This is the exact position of the parameter in the table.
The exact position of the parameter in the table.png

Thank you for your help. I have solved this problem :smiley: