Domain violation for set Topic is solved

Problems with syntax of GAMS
Post Reply
吴可盈
User
User
Posts: 5
Joined: 2 years ago

Domain violation for set

Post by 吴可盈 »

Dear all ;) ,
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
first
first
second
second
Error
error.png

Here is the excel files and gams code.
shixing.gms
IOM
(109.03 KiB) Downloaded 195 times
demand.xlsx
(9.25 MiB) Downloaded 203 times
domain
image.png
image.png
image.png
Attachments
image.png
image.png
image.png
image.png
aileen
User
User
Posts: 136
Joined: 3 years ago

Re: Domain violation for set

Post by aileen »

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
吴可盈
User
User
Posts: 5
Joined: 2 years ago

Re: Domain violation for set

Post by 吴可盈 »

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.72 KiB) Downloaded 219 times
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.06 KiB) Downloaded 212 times
This is the exact position of the parameter in the table.
The exact position of the parameter in the table.png
吴可盈
User
User
Posts: 5
Joined: 2 years ago

Re: Domain violation for set

Post by 吴可盈 »

Thank you for your help. I have solved this problem :D
Post Reply