gams:model_predecessor_successor_relations

This shows you the differences between two versions of the page.

Both sides previous revision Previous revision | |||

gams:model_predecessor_successor_relations [2020/05/18 12:36] Lutz Westermann some formatting |
gams:model_predecessor_successor_relations [2020/05/18 14:10] (current) Lutz Westermann |
||
---|---|---|---|

Line 26: | Line 26: | ||

Now here is what you can do: | Now here is what you can do: | ||

- | ''delta(d,h) =e= x(d,h) - x(d-(1$sameas('h1')),h--1)) ;'' | + | |

+ | <code> | ||

+ | delta(d,h) =e= x(d,h) - x(d-(1$sameas('h1')),h--1)) ; | ||

+ | </code> | ||

Not so elegant, but it will work. I prefer working with an additional | Not so elegant, but it will work. I prefer working with an additional | ||

Line 36: | Line 40: | ||

</code> | </code> | ||

- | This matching operators (''.'' and '':'') are new syntax and will work with | + | ''.'' and '':'' are called [[https://www.gams.com/latest/docs/UG_SetDefinition.html#UG_SetDefinition_Multi-dimensionalSets|matching operators]]. |

- | 22.7 and higher. You can do the maps also with older GAMS statements. | + | |

Now I would have the variable ''x'' and ''delta'' over ''t'' and then the | Now I would have the variable ''x'' and ''delta'' over ''t'' and then the | ||

- | constraint looks simple: ''delta(t) =e= x(t) - x(t-1) (or x(t--1) for steady state)'' | + | constraint looks simple: |

+ | | ||

+ | <code> | ||

+ | delta(t) =e= x(t) - x(t-1); (or x(t--1) for steady state) | ||

+ | </code> | ||

In case you have data by ''d,h'' you can use the map ''tdh'', for example: | In case you have data by ''d,h'' you can use the map ''tdh'', for example: | ||

''delta(t) =l= sum(tdh(t,d,h), maxdeviation(d,h));'' | ''delta(t) =l= sum(tdh(t,d,h), maxdeviation(d,h));'' |

IMPRESSUM / LEGAL NOTICE
PRIVACY POLICY
gams/model_predecessor_successor_relations.txt · Last modified: 2020/05/18 14:10 by Lutz Westermann