Modeling

Problems with modeling
Post Reply
nasim
User
User
Posts: 8
Joined: 6 years ago

Modeling

Post by nasim »

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 example, corn,...) and b( (BMP) or best practice management for nitrogen reduction). Each BMP has a different effective rate on the farm which model can choose to produce crops under several rotations and several BMPs at the same time. If this happens (several BMPs for one crop type), the model needs to multiply the BMPs' effective rates for to get the total nitrogen reduction. But my problem is that I don`t know how to model that.

Here is the summary of important parts:

b BMPs /
CT Conservation Tillage
NT No-till
NONE No BMPS
BUFCROP Stream Buffers
BUFPAST Off-stream watering without fencing
BUFNONE No buffers
CCX No Cover
CCN Normal deadline planted cover
NM1HTMANU Tier 1 Nutrient management-high and low till with manured
NM1LTMANU Tier 1 Nutrient management-low and low till with manured
NM1NOMANU Tier 1 Nutrient management-high till without manure hay with nutrients
NM2HTMANU Tier 2 N nutrient management-high till with manured
NM2LTMANU Tier 2 N nutrient management-low till with manured
NM2HAY Tier 2 N nutrient management-hay with nutrients
NM3HTMANU Tier 3 Nutrient management-high till with manured
NM3LTMANU Tier 3 Nutrient management-low till with manured
NMNO No nutrient management
/

nitrogen reduction table:

table bmpdata(b,ef)

Nr Pr TAC
CT 0.105 0.108 -111
*CT 0.105 0.108 0
*CT 0.105 0.108 -1100
NT 0 0 0
NONE 0 0 0
BUFCROP 0.32 0.39 471
BUFPAST 0.05 0.08 73
BUFNONE 0 0 0
*b4 0.266 0.1 82
*b6 0.173 0 82
CCX 0 0 0
CCN 0.24 0.05 82
NM1HTMANU 0.0925 0.1 31.32
NM1LTMANU 0.0925 0.1 31.32
NM1NOMANU 0.05 0.08 31.32
NM2HTMANU 0.044 0 50.30
NM2LTMANU 0.044 0 182.20
NM2HAY 0.028 0 21.43
NM3HTMANU 0.028 0 2.68
NM3LTMANU 0.028 0 2.68
*NM3LTMANU 0.105 0.108 -111
NMNO 0 0 0

I used this code but I get the wrong answer:

parameter
NRFRAC(TILL,BUF,CC,NM) Nitrogen reduction fraction by BMP;
loop(b,loop(ef,
if(bmpdata(b,'Nr') LT 1,
NRFRAC(TILL,BUF,CC,NM)$allow3(TILL,BUF,CC,NM) = bmpdata(CC,'Nr')*bmpdata(TILL,'Nr')*bmpdata(NM,'Nr')*bmpdata(BUF,'Nr');
else NRFRAC(TILL,BUF,CC,NM)= bmpdata(b,'Nr'));
));


and the objective function is(maximizing nitrogen reduction:
OBJ3.. Z3=E= sum((TILL,BUF,CC,NM),sum((rt,of,b),x2(rt,of,b)$allow2(rt,of,b)*fdat(of,'NO3'))*NRFRAC(TILL,BUF,CC,NM)$(allow3(TILL,BUF,CC,NM)));

in which allow3(TILL,BUF,CC,NM) is the set of allowable combination of BMPs.

Sorry for the long explanation.
I am wondering if someone could help me. Thank you in advance. :)
I. Huck
User
User
Posts: 3
Joined: 6 years ago

Re: Modeling

Post by I. Huck »

Hi Nasim,
I guess the best option would be to define not only the single BMPs, but also the combinations.
For example, in the moment you have
set BMP
/
OptimalStorage
OptimalApplication
/
but what you want to have is another set element:
set BMP
/
OptimalStorage
OptimalApplication
OptimalStorageAndApplication
/
Now you calculate the emissions also for OptimalStorageAndApplication:
bmpdata("OptimalStorageAndApplication",ef) = bmpdata("OptimalStorage",ef) * bmpdata("OptimalApplication",ef);
Then you are done.
Best wishes
Ingo Huck
nasim
User
User
Posts: 8
Joined: 6 years ago

Re: Modeling

Post by nasim »

Thank you so much
Post Reply