Domain Errors

Problems with syntax of GAMS
Post Reply
moatta
User
User
Posts: 16
Joined: 4 years ago

Domain Errors

Post by moatta »

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 47 times
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Domain Errors

Post by bussieck »

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. Looking at the initial value of RHA, PH2O, and Pa only Pa is set to 0, so we have 0**-1 which GAMS does not like. Set values for Pha and PH2O and continue in the manner to eliminate all function and gradient evaluation errors. You can also try to run with a solver that does not need a starting point, e.g. BARON (https://www.gams.com/latest/docs/S_BARO ... S_REQUIRED). You need to set "option sys12=1;" to let GAMS pass the model on to the solver that can't be evaluated at the input point. BTW, BARON declares the model unbounded.

-Michael
moatta
User
User
Posts: 16
Joined: 4 years ago

Re: Domain Errors

Post by moatta »

parameters.gms
(3.43 KiB) Downloaded 42 times
bussieck wrote: 1 year ago 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. Looking at the initial value of RHA, PH2O, and Pa only Pa is set to 0, so we have 0**-1 which GAMS does not like. Set values for Pha and PH2O and continue in the manner to eliminate all function and gradient evaluation errors. You can also try to run with a solver that does not need a starting point, e.g. BARON (https://www.gams.com/latest/docs/S_BARO ... S_REQUIRED). You need to set "option sys12=1;" to let GAMS pass the model on to the solver that can't be evaluated at the input point. BTW, BARON declares the model unbounded.

-Michael
Thank you ver much Michael for your help. I did what you suggested but now I have fatal errors with the solver. Please see the attached file.
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Domain Errors

Post by bussieck »

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 optimization problem). Not every solver will be happy with a model where the expressions can be in a way that they can't be evaluated. Perhaps, you read up on the challenges of NLP solving: https://www.gams.com/latest/docs/S_CONO ... ION_ERRORS

-Michael
parameters.log
(3.88 KiB) Downloaded 50 times
moatta
User
User
Posts: 16
Joined: 4 years ago

Re: Domain Errors

Post by moatta »

bussieck wrote: 1 year ago 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 optimization problem). Not every solver will be happy with a model where the expressions can be in a way that they can't be evaluated. Perhaps, you read up on the challenges of NLP solving: https://www.gams.com/latest/docs/S_CONO ... ION_ERRORS

-Michael

parameters.log
Thank you very much bussieck for your help. I used the BARON solver and the problem was solved.
Post Reply