Metadata
Title
Hands-On 5: GAMSCHK – Bruce McCarl
Category
general
UUID
8372e079097b4083a51e75c2492eb610
Source URL
https://agecoresearch.tamu.edu/mccarl/classes-i-teach/hands-on-5-gamschk/
Parent URL
https://agecoresearch.tamu.edu/mccarl/
Crawl Time
2026-03-16T03:54:44+00:00
Rendered Raw Markdown

Hands-On 5: GAMSCHK – Bruce McCarl

Source: https://agecoresearch.tamu.edu/mccarl/classes-i-teach/hands-on-5-gamschk/ Parent: https://agecoresearch.tamu.edu/mccarl/

OPTION DISPWIDTH=15

SET INGREDTS NAMES OF THE AVAILABLE FEED INGREDIENTS\ /CORN the proportion of corn used in one pound of feed\ HAY the proportion of hay used in one pound of feed\ SOYBEAN the proportion of soybeans used in one pound of feed\ WHEAT the proportion of wheat in one pound of feed\ OATS the proportion of oats in one pound of feed\ RICE the proportion of rice in one pound of feed\ /\ INGREDT(INGREDTS) SUBSET OF THE AVAILABLE FEED INGREDIENTS\ / CORN the proportion of corn used in the small model\ HAY the proportion of hay used in the small model\ SOYBEAN the proportion of soybeans used in the small model\ /

  NUTRIENTs            NUTRIENT REQUIREMENT CATEGORIES
  /Protein   each pound of feed has a minimum protien requirement
   VitaminA  each pound of feed has a minimum Vitamin A requirement
   VitaminC  each pound of feed has a minimum Vitamin C requirement
   VitaminD  each pound of feed has a minimum Vitamin D requirement
  /

  NUTRIENT(NUTRIENTs)  NUTRIENT REQUIREMENT CATEGORIES
  / Protein   protein is used in the small model
    VitaminA  vitamin A is used in the small model
  /  ;

INGREDT(INGREDTS)=YES;\ NUTRIENT(NUTRIENTs)=YES;

PARAMETER INGREDCOST(INGREDTS) FEED INGREDIENT COSTS PER POUND PURCHASED\ /CORN 3.0\ HAY 4.0\ SOYBEAN 5.0\ WHEAT 2.0\ OATS 5.4\ RICE 3.0\ /;

PARAMETER NUTREQUIRE(NUTRIENTS) NUTRIENT REQUIREMENTS\ /\ Protein 0.05\ VitaminA 0.09\ VitaminC 0.28\ VitaminD 1200 /;

*SCALAR UnitLimit /1/;

TABLE CONTENT(NUTRIENTS, INGREDTS) NUTRIENT CONTENTS PER POUND OF FEED INGREDIENT\ CORN HAY SOYBEAN WHEAT OATS RICE\ Protein 0.01 0.04 0.07 0.025 0.04 0.02\ VitaminA 0.02 0.14 0.1 0.07 0.09 0.06\ VitaminC 0.15 0.05 0.2 0.25 0.16 0.12\ VitaminD 600 1000 700 1600 1500 2000\ ;

POSITIVE VARIABLES\ FEEDUSE(INGREDTS) AMOUNT OF EACH INGREDIENT USED IN MIXING FEED;

VARIABLES\ COST PER LB COST OF THE MIXED FEED;\ EQUATIONS\ OBJT OBJECTIVE FUNCTION ( TOTAL COST OF THE FEED )\ MINLimit(NUTRIENTS) MINIMUM LIMITS ON EACH NUTRIENT IN THE BLENDED FEED\ WEIGHT REQUIREMENT THAT EXACTLY ONE LB OF FEED BE PRODUCED;

OBJT..\ COST =E= SUM(INGREDT, -INGREDCOST(INGREDT) * FEEDUSE(INGREDT));

MINLimit(NUTRIENT)..\ SUM(INGREDT, CONTENT(NUTRIENT, INGREDT) * FEEDUSE(INGREDT))\ =G= NUTREQUIRE(NUTRIENT);

WEIGHT..\ SUM(INGREDT, FEEDUSE(INGREDT)) =E= 1 ;

MODEL FEEDING /ALL/;\ SOLVE FEEDING USING LP MINIMIZING COST;