Search found 8 matches

1 year ago
Forum: Syntax
Topic: condition on two dependent variables
Replies: 1
Views: 461

condition on two dependent variables

I have an NLP model in which I am trying to optimize a lot of interdependent variables. I need to put a condition in the model to force on a variable to be positive whenever another variable is positive. I am wondering someone could help me with the syntax.
Thanks
2 years ago
Forum: Syntax
Topic: conditional statement
Replies: 2
Views: 1113

Re: conditional statement

ok, thank you so much
2 years ago
Forum: Modeling
Topic: Modeling
Replies: 2
Views: 978

Re: Modeling

Thank you so much
2 years ago
Forum: Syntax
Topic: conditional statement
Replies: 2
Views: 1113

conditional statement

Hello, I want to create a parameter as below: Parameter di(b) dummy for BMPs; if(l.x2(rt,of,b)GT 0); di(b)=1; else di(b)=0; )); x2(rt,of,b) is one of my variables. But, I get errors as below: Parameter 528 529 di(b) dummy variable for BMPs; 530 if(l.x2(rt,of,b)GT 0); **** \$142\$149,149,149,148,135,10...
2 years ago
Forum: Modeling
Topic: Modeling
Replies: 2
Views: 978

Modeling

Hello, I have a farm multi-objective maximization problem, in which I am maximizing the profit and the nitrogen reduction using farm best practice management. I have variable x2(rt,of,b) the hectares of each crop, which is dimensioned on three sets, rt( crop rotation), of(the type of the crop, for e...
2 years ago
Forum: Syntax
Topic: summation
Replies: 2
Views: 1248

Re: summation

Thank you so much. I figured it out. But I have another question!

sum((k),(sum((i),x(i,"c",k)* t(ibmp)\$ibmp(i))* N(k)) =L= 1420

ibmp(i) is a subset of i

3 years ago
Forum: Syntax
Topic: summation
Replies: 2
Views: 1248

summation

Hello I defined 3sets for my model. Now I need to add a term to my OBJ function which is the sum of a sum . these are my sets: sets i "option" /p,b,s,d,f,1,2,3,4,5,6,7,8,9,10,11,12/ j "products" /c,l,m/ k "type of product" /1,2,3,4,5,6,7,8,9,10,11,12,13,14/; this is my parameter: C(i) cost per ha of...
3 years ago
Forum: Syntax
Topic: Syntax error
Replies: 1
Views: 640

Syntax error

Hello I m writing a simple farm profit maximization model. I wrote the simple form and I got the answer which means that the model works, but when I used set notation to define variables I got many Syntax errors. Below is the model. would you please help me? I cannot understand where is the problem....