Search found 16 matches

by moatta
1 year ago
Forum: Syntax
Topic: No solution returned
Replies: 1
Views: 10455

No solution returned

Hello

I have a code that does not return a solution. I'd like to know if there is a contradiction in the equations or something else preventing the solution. How can I investigate this? The code is attached for your reference.
sizing_hub.gms
(8.52 KiB) Downloaded 63 times
by moatta
1 year ago
Forum: Syntax
Topic: Domain Errors
Replies: 4
Views: 2704

Re: Domain Errors

Hmm, GAMS has many solvers. You need to be specific. Best if you attach your log file. I have attached the log of the BARON solver. As I said before, it declares the model unbounded, but that's an okay outcome in optimization (optimal, infeasible, or unbounded are the three possible outcomes of an ...
by moatta
1 year ago
Forum: Syntax
Topic: Domain Errors
Replies: 4
Views: 2704

Re: Domain Errors

parameters.gms GAMS is very very explicit: "**** Exec Error at line 67: rPower: FUNC DOMAIN: x**y, x=0,y<0". Your line 67 looks as follows: 67 eq7 .. PH2 =e= 0.5*(RHa*PH2O)*((exp((1.635*Ifc/A)/(signpower(Tfc,1.334)))*(RHa*PH2O/Pa)**(-1))-1); There is just one term with ** in there. Lookin...
by moatta
1 year ago
Forum: Syntax
Topic: Domain Errors
Replies: 4
Views: 2704

Domain Errors

Hello
I have a code that had several errors. I fixed most of them by defining initial conditions to fix the division by zero errors and replacing some ** operators with power functions.
Now, I have domain errors that I could not fix. Please help.
parameters.gms
(3.36 KiB) Downloaded 66 times
by moatta
1 year ago
Forum: Syntax
Topic: Conditional Statement with Strings
Replies: 4
Views: 1898

Re: Conditional Statement with Strings

bussieck wrote: 1 year ago Use Set not Parameter since this expects a number to be stored with a record.

Code: Select all

 Set genType(g,f)
    /
    g1.Oil-CT
    g2.Oil-CT
    g3.Coal-Steam
    g4.Coal-Steam
  /;
-Michael
Thank you very much. That resolved the issue.
I appreciate your help and support.
by moatta
1 year ago
Forum: Syntax
Topic: Conditional Statement with Strings
Replies: 4
Views: 1898

Re: Conditional Statement with Strings

The trouble is that GAMS has no string valued symbols, everything is double valued or sets (with yes/no membership). So gendata(g,"Type")="Oil" does not work in GAMS. There a a couple of ways around this. You could make a set genType(g,f) (f for fuel) and then the algebra would ...
by moatta
1 year ago
Forum: Syntax
Topic: Conditional Statement with Strings
Replies: 4
Views: 1898

Conditional Statement with Strings

Hello Everyone, Is it possible to type a conditional statement with a string? For example, to sum the output of all generators of the same fuel type at each hour after the solve statement: units(t,"Oil") = sum(g, P.l(g,t)$(gendata(g,"Type")="Oil")); But I am getting the...
by moatta
1 year ago
Forum: Tools
Topic: Chart Settings
Replies: 0
Views: 4624

Chart Settings

Hello Everyone, I have a parameter that stores my results as follows: report(scenario, time, "result") where scenario and time are sets I need to plot result vs time for each scenario (multi-line plot), but this cannot be done. I am getting random charts. I am plotting from the output gdx ...
by moatta
2 years ago
Forum: Modeling
Topic: Infeasible Solution
Replies: 1
Views: 1300

Infeasible Solution

Hello Everyone, I have the following code: set j /L1*L6/ k /t1*t24/ j1 /L1*L3/ j2 /L4*L6/ Table OT(j,*) p s f r L1 750 17 24 2 L2 700 15 20 3 L3 600 15 24 2 L4 400 15 24 10 L5 150 1 24 24 L6 150 16 18 3; Table c(k,*) m n t d u t1 10.1 1 22 24 1 t2 10.1 2 22 1 1 t3 10.1 3 21 2 1 t4 10.1 4 21 3 1 t5 1...
by moatta
2 years ago
Forum: Modeling
Topic: Endogenous $-control operations not allowed
Replies: 2
Views: 1544

Re: Endogenous $-control operations not allowed

Fred wrote: 2 years ago Hi,

The post How do I formulate logical expressions in equations? from the FAQ may be helpful:

I hope this helps!

Fred
Thanks Fred for your reply and help.