I am developing a model (my firts one out of class) related to farm management. One of its modules involves 5 different crops and 6 different patches where they are grown, some overlapping patches. They will further integrate with soil quality module, herd structure and development, feed production, etc. and finally with effects of Conservation Agriculture practices (that are different per crop) in all these variables.
I have created some subscripts to deal with their equations, but I am having a difficulty with one of them. I am attaching that part of the model.
I want to have a variable "Cop Area" that summarizes the sum of each individual crop allocated area, and then put that together with the production variables of yields to have each one total production, and not dealing with each individual area and then each individual production as it does now.
I am not being able to create that summarized area matrix . I have tried inumerous equations, always with some errors in the result. I present two of them in the attached model.
Thanks for any help,
Lellis
Subscripts matrix addition
Subscripts matrix addition
- Attachments
-
- Test CropArea.mdl
- (15.46 KiB) Downloaded 546 times
I think what you're after may be:
Patch Grows Crop[Crops,PatchNumber]=
IF THEN ELSE(Crop per Patch[Crops,PatchNumber]=Crops,1,0)
Units: Dmnl
Total Crop Area[Crops]=
SUM(Patch Grows Crop[Crops,PatchNumber!]*Patch Size[PatchNumber!])
Units: ha
If the patch cropping pattern doesn't change, these could be made INITIALs to improve performance. Also, for big matrices, VECTOR SELECT would probably be a good idea.
I notice that your crop per patch implies multiple crops on some patches. Presumably this is seasonal rotation or something?
One other hint: for things like your Crop per Patch[Crops,PatchNumber] matrix, it's often easier to enter the data in Excel, then use GET XLS CONSTANTS to retrieve it. That way it's easy to see the #s. Alternatively, use <control><enter> (or is it <shift><enter>?) to format your matrix like this:
1,0,0,0,0,0;
0,2,2,0,0,0;
0,0,0,3,0,0;
0,0,0,0,4,4;
0,5,5,5,0,0;
Tom
Patch Grows Crop[Crops,PatchNumber]=
IF THEN ELSE(Crop per Patch[Crops,PatchNumber]=Crops,1,0)
Units: Dmnl
Total Crop Area[Crops]=
SUM(Patch Grows Crop[Crops,PatchNumber!]*Patch Size[PatchNumber!])
Units: ha
If the patch cropping pattern doesn't change, these could be made INITIALs to improve performance. Also, for big matrices, VECTOR SELECT would probably be a good idea.
I notice that your crop per patch implies multiple crops on some patches. Presumably this is seasonal rotation or something?
One other hint: for things like your Crop per Patch[Crops,PatchNumber] matrix, it's often easier to enter the data in Excel, then use GET XLS CONSTANTS to retrieve it. That way it's easy to see the #s. Alternatively, use <control><enter> (or is it <shift><enter>?) to format your matrix like this:
1,0,0,0,0,0;
0,2,2,0,0,0;
0,0,0,3,0,0;
0,0,0,0,4,4;
0,5,5,5,0,0;
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/