Implementation of a genetic algorithm for optimization within the Cornell Net Carbohydrate and Protein System framework

  • T. P. Tylutki
  • V. Durbal
  • C. N. Rasmussen
  • M. E. Van Amburgh


Models such as the Cornell Net Carbohydrate and Protein System include many non-linear functions. As such, non-linear optimization techniques that converge quickly and efficiently for field application are required. The objective of this paper is to introduce a genetic algorithm for optimization within the CNCPS ver. 6.1 framework. Genetic algorithms are generally categorized as global search heuristics. The genetic algorithm initially seeds the optimization with binary (0,1) representations of potential solutions (chromosomes). It then introduces crossover and mutation rates (set by the user) that automatically force changes in the chromosome combinations by changing the binary coding. Each solution is evaluated against fitness tests (e.g. nutrient and feed constraints). Two types of nutrient constraints have been utilized: soft and hard. A hard constraint forces the solution to be within set ranges. Soft constraints are set to be either equal, or within the range of the hard constraints. As solutions are evaluated, they are compared with soft constraints first. If a solution falls between a soft and hard constraint, a penalty function is applied. Solutions not meeting hard constraints are removed from the solution set. The penalty adds a ‘cost’ to the solution. If the resulting ‘cost’ adjusted solution is favorable over other solutions, it is kept within the solution set. This allows for solutions to be evaluated that may be nutritionally acceptable but slightly less then desirable. As an example, given variation in parameter measurements and model variation, it is nearly impossible to say that a 20.9% peNDF solution is different then a 21% peNDF solution; however, the cost of such a solution may be 1–10% different. Genetic algorithms also allow multiple objective functions. In this implementation, least cost or maximum income over feed costs were selected. Evaluations have shown that marginal incomes can be increased 5–10% by simply changing the objective function.


nonlinear objective function models 

Abbreviations used:


Cornell Net Carbohydrate and Protein System


Cornell- Penn-Miner Dairy Formulation Software version 3

ME =

metabolizable energy

MP =

metabolizable protein

peNDF =

physically effective neutral detergent fibre

GA =

genetic algorithm


income over (minus) feed cost

EO =

evolutionary optimization.


  1. Boston, R.C., Fox, D.G., Sniffen, C.J., Janczewski, R., Munsen, R. and Chalupa, W., 2000. The conversion of a scientific model describing dairy cow nutrition and production to an industry tool: the CPM Dairy project. In: McNamara, J.P., France, J. and Beever, D. (eds.) Modelling Nutrient Utilization in Farm Animals, Oxford: CABI Publishing. pp.361–377.CrossRefGoogle Scholar
  2. Michalewicz, Z. and Schmidt, M., 2002. Evolutionary Algorithms and Constrained Optimization. In: Sarker, R., Mohammadian, M. and Yao, X. (eds.) Evolutionary Optimization. Kluwer Academic Publishers, pp.57–86.Google Scholar
  3. Palisade Corporation, 1998. Guide to Evolver. Palisade Corporation, Ithaca, NY, USA, 203 pp.Google Scholar
  4. Tylutki, T.P., 2002. Improving herd nutrient management on dairy farms: (1) Daily milk production variance in high producing cows as an indicator of diet nutrient balance. (2) On-farm six sigma quality management of diet nutrient variance. (3) Feedstuff variance on a commercial dairy and the predicted associated milk production variance. (4) A model to predict cattle nitrogen and phosphorus excretion with alternative herd feed programs. (5) Accounting for uncertainty in ration formulation. Ph.D. Dissertation, Cornell University. Ithaca, NY, USA.Google Scholar
  5. Tylutki, T.P., Fox, D.G., Durbal, V.M., Tedeschi, L.O., Russell, J.B., Van Amburgh, M.E., Overton, T.R., Chase, L.E. and Pell, A.N., 2008. Cornell Net Carbohydrate and Protein System: A model for precision feeding of dairy cattle. Animal Feed Science and Technology 143:174–202.CrossRefGoogle Scholar

Copyright information

© Wageningen Academic Publishers 2011

Authors and Affiliations

  • T. P. Tylutki
    • 1
  • V. Durbal
    • 1
  • C. N. Rasmussen
    • 1
  • M. E. Van Amburgh
    • 2
  1. 1.Agricultural Modeling and Training Systems LLCCortlandUSA
  2. 2.Department of Animal ScienceCornell UniversityIthacaUSA

Personalised recommendations