Feed allocation and animal response are related to the nutritive value of available feeds and the nutrient requirements of up to six animal groups making up either dairy or beef herds. Diets for each group are formulated using a cost-minimizing linear programming approach, which makes the best use of homegrown feeds and purchased supplements. Protein and energy requirements are determined for each animal group based upon the characteristics of the average animal in the group. One or two protein supplements are used to balance rations. These can include both high and low rumen degradable protein feeds. Feed characteristics can be defined to describe essentially any supplement of each type including blended feeds. Supplemental P and K fed, if needed, is the difference between the requirement of each animal group and the sum of that contained in the feeds consumed.