Search found 1033 matches

by bussieck
3 years ago
Forum: Modeling
Topic: VAR operands relational or boolean
Replies: 11
Views: 6584

Re: VAR operands relational or boolean

I don't think that you logic is correct also you if logic looks flawed, but I guess you mean if(DU(t)-(DIP(t)- DIN(t))-CU(t))>=0, DD(t)=DU(t)-(DIP(t)- DIN(t))-CU(t); else DD(t)=0; ) or easier DD(T) = max(0,DU(t)-(DIP(t)- DIN(t))-CU(t)). I would do it like this: set s /slack1, slack2/; SOS1 variable ...
by bussieck
3 years ago
Forum: Syntax
Topic: dollar sign ($) in macro
Replies: 2
Views: 2222

Re: dollar sign ($) in macro

Macros are expanded by the GAMS compiler. The expanded text is not scanned for compile time commands (anything that starts with a $, like $call) by the compiler, so you can't have a $ command inside a macro. You will need to use a batinclude for this: $set Filaname xxx $set Path abc/ $set SpecKey $e...
by bussieck
3 years ago
Forum: Announcements
Topic: Webinar: GAMS MIRO Engine - running GAMS in the cloud! Announcement
Replies: 0
Views: 77070

Webinar: GAMS MIRO Engine - running GAMS in the cloud! Announcement

I want to let you know about an upcoming webinar next Tuesday (5/5/20).
Please find details at https://www.gams.com/news-events/detail ... the-cloud/

-Michael
by bussieck
3 years ago
Forum: Modeling
Topic: Defining a SOS1-Variable as binary, where not all Sets must contain a non-Zero Value
Replies: 4
Views: 2931

Re: Defining a SOS1-Variable as binary, where not all Sets must contain a non-Zero Value

Just turn your x(i,l) into a binary variable and your equality constraint into a less-or-equal: defx(i).. sum(l, x(i,l)) =l= 1 ; That's it. Don't worry about x being binary instead of SOS 1. Most solvers will turn them into binary inside anyway, because nowadays modern MIP solvers prefer to work wit...
by bussieck
3 years ago
Forum: Modeling
Topic: VAR operands relational or boolean
Replies: 11
Views: 6584

Re: VAR operands relational or boolean

I did not check your logic, but a few comments: Don't use arbitrary large numbers for bigM. They mess up the numerics of your model. Find out from your understanding of model and data what's the maximum/minimum value a variable can take. If that's not possible, bigM is not possible and you need to g...
by bussieck
3 years ago
Forum: GAMS-FAQ
Topic: How do I export only rounded numbers from GAMS to Excel?
Replies: 1
Views: 2121

Re: How do I export only rounded numbers from GAMS to Excel?

There is no explicit option to round numbers when writing to an Excel file, but you can round within GAMS before writing the data to GDX. You could also use cell formatting in Excel to instruct Excel to show you a certain number of digits. The following will round the parameter abc to two decimal pl...
by bussieck
3 years ago
Forum: GAMS-FAQ
Topic: How do I export only rounded numbers from GAMS to Excel?
Replies: 1
Views: 2121

How do I export only rounded numbers from GAMS to Excel?

When unloading data from GAMS to Excel with GDX, is it possible to round numbers or choose the number of decimal to be included in the Excel files?
by bussieck
3 years ago
Forum: Modeling
Topic: VAR operands relational or boolean
Replies: 11
Views: 6584

Re: VAR operands relational or boolean

You can't model this as an LP. You can model this with some binary variables and make a MIP out of it. You need a binary variable that is 0 if DU(t)-(DIP(t)- DIN(t))-CU(t) <= 0 and 1 otherwise. Search the forum for logical constraint and HP Williams (that is an author of a book that describes such r...
by bussieck
3 years ago
Forum: Modeling
Topic: Error: Endogenous operands for * not allowed in linear models
Replies: 4
Views: 9897

Re: Error: Endogenous operands for * not allowed in linear models

Look at r1 and o1. The supply capacity from s1, s2, and s3 is 8+6+0=14. The demand is o1.r1 is 18. No way to make it, so the model is infeasible. How did I get there? Again, I removed the unhelpful and superfluous supplier variables, get an LP and solved with e.g. Cplex, now I get a infeasible solut...
by bussieck
3 years ago
Forum: GAMS-FAQ
Topic: How do I compute the Kronecker product in GAMS FAQ
Replies: 1
Views: 4895

Re: How do I compute the Kronecker product in GAMS FAQ

The Kronecker products, see https://en.wikipedia.org/wiki/Kronecker_product can easily computed with the matching operator (see https://www.gams.com/latest/docs/UG_SetDefinition.html?search=matching ). See details in the following example: $onText Kronecker product of two matrices A and B A is of di...