Search found 5 matches

by nasim
1 week ago
Forum: Syntax
Topic: conditional statement
Replies: 1
Views: 46

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
1 week ago
Forum: Modeling
Topic: Modeling
Replies: 0
Views: 40

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
8 months ago
Forum: Syntax
Topic: summation
Replies: 2
Views: 299

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
8 months ago
Forum: Syntax
Topic: summation
Replies: 2
Views: 299

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...
by nasim
8 months ago
Forum: Syntax
Topic: Syntax error
Replies: 1
Views: 162

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