Search found 8 matches

by nasim
4 years ago
Forum: Syntax
Topic: condition on two dependent variables
Replies: 1
Views: 2066

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
by nasim
5 years ago
Forum: Syntax
Topic: conditional statement
Replies: 2
Views: 3057

Re: conditional statement

ok, thank you so much
by nasim
5 years ago
Forum: Modeling
Topic: Modeling
Replies: 2
Views: 2951

Re: Modeling

Thank you so much
by nasim
6 years ago
Forum: Syntax
Topic: conditional statement
Replies: 2
Views: 3057

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...
by nasim
6 years ago
Forum: Modeling
Topic: Modeling
Replies: 2
Views: 2951

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...
by nasim
6 years ago
Forum: Syntax
Topic: summation
Replies: 2
Views: 3217

Re: summation

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

I wrote the following sum but I got $140 error. would you please help me!

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

ibmp(i) is a subset of i

Thanks in advance
by nasim
6 years ago
Forum: Syntax
Topic: summation
Replies: 2
Views: 3217

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 ...
by nasim
6 years ago
Forum: Syntax
Topic: Syntax error
Replies: 1
Views: 2335

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....