Erreur d exécution Topic is solved

Problems with syntax of GAMS
Post Reply
JJcoul09
User
User
Posts: 16
Joined: 2 years ago

Erreur d exécution

Post by JJcoul09 »

Bonjour chers tous,
Je suis un nouveau utilisateur de GAMS.
Dans l'exécution d'un programme que j'ai écrire, je rencontre un problème lors de l'exécution, notamment à ce niveau:

A_s(tr)=QteO(tr)/beta_s(tr)*IMO(tr)**(-rho_s(tr))*(1-beta_s(tr))*Dde_LO(tr)**(-rho_s(tr))**(-1/rho_s(tr));

GAMS affiche: rpower: FUNC DOMAIN: x**y, x=0, y<0.

Lorsque j'utilise la commande power libellé comme ceci:

A_s(tr)=QteO(tr)/beta_s(tr)*power(IMO(tr),(-rho_s(tr)))*(1-beta_s(tr))*power(Dde_LO(tr),(-rho_s(tr))**(-1/rho_s(tr)));

Là encore GAMS affiche : pow(x,i), i n'est pas un entier.

Je vous serai reconnaissante de m'aider à un résoudre ce problème dans ma programmation.
Bien à vous

Cordialement!!!!
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: Erreur d exécution

Post by abhosekar »

The answer to this question can help you

viewtopic.php?f=9&t=12176

- Atharv
JJcoul09
User
User
Posts: 16
Joined: 2 years ago

Re: Erreur d exécution

Post by JJcoul09 »

Cher abhosekar,

Merci beaucoup pour votre aimable aide.
Je vais suivre le lien proposer et ressayer pouvoir. Je vous reviens...
JJcoul09
User
User
Posts: 16
Joined: 2 years ago

Re: Erreur d exécution

Post by JJcoul09 »

Salut ,
suit au lien transmis dans la résolution de la difficulté que je rencontre, j'ai essayer d'imposer des limites inferieures aux variables qui sont susceptibles d'être égale à zéro comme suit:
positive variable IMO(tr), Dde_LO(tr), EXO(tr);
IMO.lo(tr)=0.01;
Dde_LO.lo(tr)=0.01;
EXO.lo(tr)=0.01;

Mais GAMS affiche erreur 142 No suffix allowed here - suffix ignored.

Comment procéder maintenant?
Merci
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: Erreur d exécution

Post by abhosekar »

Are you getting the error from the same line? You get this error when you try to impose bounds on parameters for example.
If you have defined these 3 as variables, then there is no reason why you should get this error.
Please make sure that the error is because of these lines. If the error persists, please share a minimal .gms code that will help the other users to reproduce your issue.

- Atharv
JJcoul09
User
User
Posts: 16
Joined: 2 years ago

Re: Erreur d exécution

Post by JJcoul09 »

Ci-joint un code minimal de mon programme:
*Variables
Dde_LO(tr) Demande locale pour le produit tr
EXO(tr) Exportations du produit tr
IMO(tr) Importations du produit tr
*Data
IMO(tr)=DP("IMO",tr);
EXO(tr)=DP("EXO",tr);
Dde_LO(tr)=MCS("AC",tr,"PR",tr);
*Fonction à élasticité CES et CET
A_s(tr)=QteO(tr)/(beta_s(tr)*IMO(tr)**(-rho_s(tr))+(1-beta_s(tr))*Dde_LO(tr)**(-rho_s(tr)))**(-1/rho_s(tr));
A_t(tr)=XSO(tr)/(beta_t(tr)*EXO(tr)**rho_t(tr)+(1-beta_t(tr))*Dde_LO(tr)**rho_t(tr))**(1/rho_t(tr));
A ce stage GAMS affiche erreur a la line 388: rpower: func domain : x**y, x=0, y inférieure à 0
erreur a la line 394: rpower: func domain : x**y, x inferieure à 0

Dans ce cas lorsque j'essaye d'imposer une limite inférieure aux variables qui sont susceptibles d'être négative, en procédant comme ceci:
positive variable IMO(tr), Dde_LO(tr), EXO(tr);
IMO.lo(tr)=0.01;
Dde_LO.lo(tr)=0.01;
EXO.lo(tr)=0.01;

GAMS affiche erreur 142 No suffix allowed here, suffix ignored

A ce stade je ne sais plus comment procéder.
Merci de m'éclairer sur ce point.

Cordialement
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: Erreur d exécution

Post by abhosekar »

Code: Select all

*Data
IMO(tr)=DP("IMO",tr);
EXO(tr)=DP("EXO",tr);
Dde_LO(tr)=MCS("AC",tr,"PR",tr);
this somehow tells me that IMO, EXO and Dde_LO are declared as parameters and not variables. Is that right? If this is right, then you are not allowed to add suffix to a parameter (lower bound on a parameter makes no sense).
Please use code block to write pieces of codes. Also, what you provide is sort of a pseudo code. Seeing the "actual" code is important here (how you declare IMO for example).

- Atharv
Rodrigue
User
User
Posts: 33
Joined: 5 years ago

Re: Erreur d exécution

Post by Rodrigue »

Il est possible que ce que vous appelez variables ne soient que des paramètres. Vous semblez construire un modèle EGC et apparemment cette erreur apparaît à la section des données et calibration. Si c'est le cas, ça signifie que vous avez déclaré IMO(tr), etc... Comme des paramètres et logiquement un suffixe n'est pas permis sur un paramètre.

Un code plus complet aiderait à mieux comprendre votre problème.

Rodrigue
JJcoul09
User
User
Posts: 16
Joined: 2 years ago

Re: Erreur d exécution

Post by JJcoul09 »

Bonjour cher tous,
j'ai fini par résoudre le problème d'exécution d'erreur de mon code à partir des commandes signpower et cvpower comme ceci:

A_s(tr)=QteO(tr)/cvpower((beta_s(tr)*IMO(tr)**(-rho_s(tr))+(1-beta_s(tr))*Dde_LO(tr) **(-rho_s(tr))), (1/(1-1/rho_s(tr))));

A_t(tr)=XSO(tr)/signpower((beta_t(tr)*EXO(tr)**rho_t(tr)+(1-beta_t(tr))*Dde_LO(tr)**rho_t(tr)),( 1/rho_t(tr)));

Merci bien à vous.


Cordialement
JJcoul09
User
User
Posts: 16
Joined: 2 years ago

Re: Erreur d exécution

Post by JJcoul09 »

Bonjour cher tous,
j'ai fini par résoudre le problème d'exécution d'erreur de mon code à partir des commandes signpower et cvpower comme ceci:

A_s(tr)=QteO(tr)/cvpower((beta_s(tr)*IMO(tr)**(-rho_s(tr))+(1-beta_s(tr))*Dde_LO(tr) **(-rho_s(tr))), (1/(1-1/rho_s(tr))));

A_t(tr)=XSO(tr)/signpower((beta_t(tr)*EXO(tr)**rho_t(tr)+(1-beta_t(tr))*Dde_LO(tr)**rho_t(tr)),( 1/rho_t(tr)));

Merci bien à vous.


Cordialement
Post Reply