You are on page 1of 10

Animal, page 1 of 10 © The Author(s), 2020.

Published by Cambridge University Press on behalf of The Animal Consortium animal


doi:10.1017/S1751731120001433

An improved algorithm for solving profit-maximizing cattle


diet problems
J. G. O. Marques1† , R. de O. Silva1 , L. G. Barioni2 , J. A. J. Hall3 , L. O. Tedeschi4 and
D. Moran1
1
Global Academy of Agriculture and Food Security, The University of Edinburgh, Edinburgh EH25 9RG, UK; 2Embrapa Agricultural Informatics, Campinas 13083-886,
Brazil; 3School of Mathematics, The University of Edinburgh, Edinburgh EH9 3FD, UK; 4Department of Animal Science, Texas A&M University, College Station, TX 77843-
2371, USA

(Received 30 July 2019; Accepted 22 May 2020)

Feeding cattle with on-pasture supplementation or feedlot diets can increase animal efficiency and system profitability while
minimizing environmental impacts. However, cattle system profit margins are relatively small and nutrient supply accounts for
most of the costs. This paper introduces a nonlinear profit-maximizing diet formulation problem for beef cattle based on well-
established predictive equations. Nonlinearity in predictive equations for nutrient requirements poses methodological challenges
in the application of optimization techniques. In contrast to other widely used diet formulation methods, we develop a
mathematical model that guarantees an exact solution for maximum profit diet formulations. Our method can efficiently solve an
often-impractical nonlinear problem by solving a finite number of linear problems, that is, linear time complexity is achieved
through parametric linear programming. Results show the impacts of choosing different objective functions (minimizing cost,
maximizing profit and maximizing profit per daily weight gain) and how this may lead to different optimal solutions. In targeting
improved ration formulation on feedlot systems, this paper demonstrates how profitability and nutritional constraints can be met
as an important part of a sustainable intensification production strategy.

Keywords: linear programming, nonlinear programming, ration formulation, optimization, feedlot

Implications (Sartorello et al., 2018). Feeding cattle with on-pasture


supplementation or feedlot diets intensifies production by
This paper introduces a nonlinear profit-maximizing diet for- increasing animal efficiency and profitability, compared to
mulation problem for beef cattle based on well-established extensive pasture-based systems (Kaimowitz and Angelsen,
predictive equations. We develop a mathematical model that 2008). By shortening the animal production cycle and there-
can guarantee an exact solution for maximum profit diet
fore reducing methane (CH4) from ruminant enteric fermen-
formulations. This contrasts with widely used but less robust tation (Cortez-Arriola et al., 2016), feedlots may also
least-cost diet formulation approaches. Our method can decrease the greenhouse gas emissions intensity per unit
efficiently solve an often-impractical nonlinear problem by product by around 25% compared to extensive systems in
solving a finite number of linear problems. By optimizing Brazil (de Gouvello Filho and Hissa, 2011). Increasing the
ration formulation on feedlot systems, this work contributes
adoption of these measures is, therefore, desirable from
to the sustainable intensification of livestock production.
different sustainability perspectives.
Ration formulation is a complex problem typically
analyzed using mathematical optimization (Hertzler et al.,
Introduction 1988; Nicholson et al., 1994; Tedeschi et al., 2000; Soto
and Reinoso, 2012; Garcia-Launay et al., 2018). Ration
Cattle system profit margins can be small compared to other formulation requires empirical and mechanistic equations
land uses (Pashaei Kamali et al., 2016) and nutrient supply is to predict growth and nutrient requirements as functions
the largest production cost element, for example, for feedlot of animal characteristics and the diet composition
finishing systems in Brazil, feeding can represent as much (Tedeschi et al., 2005; NASEM, 2016). The nonlinear and
as 88% of variable costs, disregarding animal purchase dynamic nature of biological responses and lack of data

E-mail: j.g.o.marques@sms.ed.ac.uk restrict the construction of completely mechanistic models.

1
Marques, de O. Silva, Barioni, Hall, Tedeschi and Moran

Thus, animal nutrition models rely on a statistical fit of based on NASEM (2016) assume a fixed daily shrunk weight
available data, and a mix of mechanistic and empirical equa- gain (SWG) rather than a variable to be determined. Since
tions to predict physiological functions (Tedeschi et al., SWG depends on the concentration of net energy for
2005). This nonlinear characteristic of biological systems is maintenance (CNEm) and net energy for gain (CNEg) in
a complicating factor in diet optimization models. the diet, the least-cost modeling approach works under
The objective of this paper is to derive a method to the assumption that these are fixed parameters. Unlike cost
optimize maximum profit diets. We introduce and analyze minimization, profit maximization varies with growth rate
a nonlinear profit-maximizing diet model based on the latest and the animal selling price. Then, unless we know optimal
version of the ‘Nutrient Requirements for Beef Cattle’ by CNEm and CNEg beforehand, fixing these parameters hinders
NASEM (2016). However, any cattle growth predictive model the possibility of finding profit-maximizing diets.
that can be parametrically linearized can be solved using this
approach. We propose a new methodology to solve a non-
linear profit-maximizing cattle diet efficiently. We further Cattle growth model
explore how performance may be improved between linear This work is based on the NASEM (2016) model to predict
and logarithmic time complexity. This paper is structured nutrient requirements and growth in beef cattle, which is
in four sections. Firstly, the ‘Material and methods’ section frequently reviewed and updated to increase accuracy.
provides background on diet formulation problems, describes Their model includes the Cornell Net Carbohydrate and
the mathematical model for the nonlinear programming Protein System mechanistic equations (Fox et al., 1992;
(NLP) problem of a profit-maximizing diet and explores Russell et al., 1992; Sniffen et al., 1992; O’Connor et al.,
how to obtain an exact solution solving a finite amount of 1993), recommendations on possible fit adjustments and
linear programming (LP) problems. The ‘Results’ section variable parameters for a broad range of biophysical condi-
shows the solutions using the proposed algorithms, sensitiv- tions, including hormones, lactation, sex, breed, climate,
ity analysis on key parameters and convergence. We then heat loss, growing and finishing. Their predictive model for
discuss in more detail the implications of using the model nutrient requirements is especially helpful in pinpointing
and uncertainties to be considered. Finally, the ‘Conclusion’ possible shortfalls that compromise growth and metabolic
section summarizes our outcomes in terms of its applications efficiency. The process of defining the diet composition starts
and identifies future research. Preliminary results of this work with empirical equations to predict approximate energy,
were already published in an abstract form (Marques protein and DM intake (DMI) requirements. After determin-
et al., 2019). ing the diet, nutrient utilization is refined using more
sophisticated equations.
Based on animal weight, NASEM (2016) estimates the net
energy for maintenance (NEm (Mcal/day)) and metabolizable
Material and methods protein for maintenance (MPm (g/day)) requirements as a
Background to diet formulation problems function of shrunk BW (SBW), sex (SEX), breed (BE),
Previous work with a nonlinear diet problem based on the lactation (L) and acclimatization factor (a2) as:
nutrient requirements of beef cattle (NRC, 1984) explored
the trade-offs between profit and cost when dealing with diet NEm ¼ SBW0:75 ð0:077 BE L ða2 þ 0:05 ðBCS  1ÞSEX þ 0:8ÞÞ
optimization problems (Hertzler et al., 1988). However, (1)
recent work on these equations (NASEM, 2016) hindered
the viability of solving a nonlinear problem directly. MPm ¼ 3:8 SBW0:75 (2)
Detailed descriptions of the evolution of nutrition models
for cattle, sheep and goats have been published recently For a given NEm, the DMI (kg/day) required can be predicted
(Tedeschi and Fox, 2020; Cannas et al., 2019; Tedeschi, by:
2019). Tedeschi (2019) recently advanced the development
of the Cornell Net Carbohydrate and Protein System achieved  
DMI ¼ SBW 1:2425 þ 1:9218 NEm  0:7259 NEm2
in the 1990s (Fox et al., 1992; Russell et al., 1992; Sniffen
et al., 1992), allowing researchers to apply heuristic (3)
approaches with LP models for least-cost diets (Tedeschi
et al., 2000; Soto and Reinoso, 2012). Dry matter intake required for growing/finishing cattle must
Deriving a profit-maximizing beef cattle diet implies the also hold:
need to address nonlinear animal weight gain associated
with the simultaneous change in diet energy concentration DMI ¼ NEm=CNEm þ NEg=CNEg (4)
and the gain composition of the animal. Many cattle ration
formulation studies are based on linear cost-minimizing diets where CNEm (Mcal/kg) is the concentration of net energy for
(Oishi et al., 2011 and 2013; Moraes et al., 2012 and 2015; maintenance, NEg (Mcal/day) is the net energy available for
Cortez-Arriola et al., 2016; Mackenzie et al., 2016; Garcia- gain and CNEg (Mcal/kg) is the concentration of net energy
Launay et al., 2018). Linear cost-minimizing diet models for gain (Anele et al., 2014).

2
Diet optimization for beef cattle

The daily SWG (kg/day) for the given diet is given by: peNDFj (physically effective NDF), FATj (fat content), RDPj
(ruminally degradable protein) and CPj (crude protein) are
SWG ¼ 13:91 NEg0:9116 SBW0:6837 (5) usually fixed and available for over 200 feedstuff in
NASEM (2016)’s feed library. The parameters varying in dif-
ferent applications are T (feeding time), S (animal selling
price), cj ∀ j ∈ J (the cost of each ingredient j ) and the major
Beef cattle profit-maximizing diet
nutritional requirements based on the animal’s characteris-
Given animal attributes, for example, SBW, breed, sex and a
tics: DMI, NEm and NEg.
set J of possible ingredients, we formulate a diet by defining
The objective function (6) is derived from the profit as a
its composition in terms of the proportion of each ingredient
function of SWG:
xj ∈ [0, 1] and the respective cost cj (US$/kg of DM) ∀ j ∈ J.
Cost per kilogram of DM is readily obtained from cost per " #
X
kilogram as feed (US$/kg AF) divided by the DM ratio of Z ¼ T S  SWG  DMI cj xj  SBW0  p0 (14)
the ingredient (kg of DM/kg AF) (NASEM, 2016). In T days, j2J
total profit Z (US$) can be maximized by the NLP model
consisting of equations (6) to (13). where s is the animal sale’s price in US$/kg of SBW. Once we
consider the initial SBW0 and purchase price p0 of the animal
Max : Z ¼ T  13:91  S
" !#0:9116 are fixed in our model, they can be ignored in the objective
X 
 SBW0:6837 cnegj xj DMI  P
NEm function for solving the problem. Note that SWG is a function
j2J
j 2J cnemj xj of NEg (5), which can be written in terms of CNEm and CNEg
X
 T  DMI cx by:
j 2J j j

(6) NEg ¼ CNEg ðDMI  NEm=CNEmÞ (15)


X
s:t: : mpj xj X
j2J
8 CNEm ¼ j2J
cnemj xj (16)
>
>
>
<
1
X
 DMI 3:8 SBW0:75 þ 3727:88 CNEg ¼ cnegj xj (17)
>
> j2J
>
:
" !#0:9116
X  NEm thus, combining equations (16) and (17) with (15), we can
j2J
cnegj xj DMI  P rewrite profit as (6), adding the equation (15) in the model
j 2J cnemj xj
9 as the binding constraint (11).
" !# >
>
> The objective function (6) must be constrained by nutri-
X  NEm =
SBW0:6837  29:4 cnegj xj DMI  P tional requirements (equations (7) to (10)) and feasibility con-
j2J
j2J cnemj xj >
>
>
; straints (equations (11) to (13)). The key nutritional
requirements are the metabolizable protein for maintenance
(7) (MPm) and gain (MPg), forming the protein requirement con-
X straint (7). Protein for maintenance and gain (g/day) are
j2J
peNDFj xj  peNDF (8) straightforwardly obtained by:
X
FATj xj  0:06 (9) MPm ¼ 3:8 SBW0:75 (18)
j2J
X MPg ¼ 268 SWG  29:4 NEg (19)
j2J
RDPj CPj xj  0:125 (10)
But the metabolizable protein contribution of each feed j ∈ J
NEg NEm (mpj) is a function of ruminal microbial growth, which
P þP ¼ DMI (11)
j2J cneg x
j j j2J cnemj xj depends on the total digestible nutrients (TDNs) and fat com-
X position (FAT), rumen-undegradable protein (RUP), CP and
x
j2J j
¼1 (12) forage content. We adopted the equation developed by
Galyean and Tedeschi (2014) to estimate microbial growth
xj 2 ½0; 1 8j 2 J (13) without adjustment for dietary fat (20) rather than the pre-
viously adopted fixed coefficient of 13% of TDN.
The parameters of each feed j ∈ J: cnegj (concentration of net
energy for gain), cnemj (concentration of net energy for gain), mpj ¼ 0:64 αj þ RUPj CPj βj (20)

3
Marques, de O. Silva, Barioni, Hall, Tedeschi and Moran

where the suggested linear approximation, we can solve the NLP


(  
model via parametric LP (Dantzig, 1998). The profit function
42:73 þ 0:087 TDNj xj =1000 FAT < 3:9% Z in (10) can be rewritten as the nonlinear animal weight
αj ¼    
53:33 þ 0:096 TDNj  2:55FATj xj =1000 FAT  3:9% gain function SWG(CNEm, x) multiplied by the selling price S
 (US$/kg), with the diet costs C(CNEm, x) subtracted:
0:8 Forage < 100%
βj ¼
0:6 Forage ¼ 100%
ZðCNEm; x Þ ¼ s:SWGðCNEm; x Þ  CðCNEm; x Þ (23)
(21)

The presence of non-detergent fiber in the diet is a require- where CNEm : Rn ! CNEm ¼ f½lb; ub; lb; ub 2 Rþ 0 g is
ment in the model (8) to prevent acidosis on the animal. We the net energy for maintenance available in the diet, lb
can calculate physically effective non-detergent fiber and ub represent the lower and upper bounds of CNEm
(peNDF) (%DMI) requirement based on expected pH in and x ∈ is a vector variable representing the daily DMI proportion
the rumen (rearranging NASEM (2016)’s equation to predict of each diet ingredient. Profit Z is subject to a set of nonlinear
pH based on peNDF content): nutritional constraints Φ(CNEm, x), that is, (7), and linear
constraints F(CNEm, x), that is, (8) to (12). For a given animal
 and a fixed CNEmi ∈ CNEm*, the nonlinear function SWG
0:01ðpH  5:46Þ=0:038 pH < 6:46
peNDF ¼ (22) and constraints Φ become linear. Thus, maximizing the NPL
26:3% pH  6:46
{Z(CNEm, x): Φ(CNEm, x), F(CNEm, x)} is equivalent to solving
Thus, it is possible either to constrain peNDF content to be the LP {Z(CNEmi, x): Φ(CNEmi, x), F(CNEmi, x)} for CNEmi
higher than 26.3% or to constrain it based on a threshold ∈ [lb, ub]. Thus, the optimal solution for Z(CNEm, x) is given by:
pH below 6.46. 
Further constraints to guarantee rumen microorganism Z  ¼ max Zi ¼ maxfs:SWGðCNEmi ; xÞ  C ðCNEmi ; xÞ :;
efficiency in fiber digestion include the fat content (9), which
should be lower than 6% of DMI, and the presence of rumen-  n
degradable protein (RDP) (10) to sustain bacterial yield, ΦðCNEmi ; xÞ ¼ 0; FðCNEmi ; xÞ ¼ 0; x 2 Rþ
0 g; 8CNEmi
which should be greater than 12.5% of DMI (NASEM, 2 ½lb; ub g
2016). We assume supplementation of vitamins and minerals
to the diet; thus, constraints with requirements for those (24)
nutrients were not included.
For a fixed value of CNEmi, the NLP model composed of equa-
Furthermore, the constraint for minimum and maximum
tions (6) to (13) is equivalent to the LP represented by equa-
values of specific ingredients on a diet can be easily added
tions (25) to (33). Note that equation (30) binds the diet
without changing the complexity of the model. Such con-
composition to sum the defined CNEmi.
straints simply change the domain of xj from xj ∈ [0, 1] in
(13) to xj ∈ [lbj, ubj], where lbj and ubj are the minimum X
Max : Z ¼ x
j2J j
and maximum concentration of the feed j. Constraint (12)  
holds that feeds must sum to 100% of the diet. NEm
13:91  s  SBW0:6837 0:86 DMI  cnegj  DMI:cj
CNEmi
(25)
The parametric linear programming model for profit-
maximizing diets X 
NEm
The proposed model contains nonlinearities in the objective s:t : : ðmpj  DMI  ð3205:97 SWB 0:6837
CNEm i
function (6) and the metabolizable protein constraint (7). We j
can remove the complicating factor NEg0.9116 via a linear 29:4Þcnegj xj  DMI 1 3:8 SBW 0:75
function. NASEM (2016) uses the exponential term only
for fine adjustments based on the R2 value. (26)
We use the linear function SWG = 13.91 (0.86 NEg) X
SBW−0.6837 as an alternative to NASEM (2016)’s j2J
peNDFj xj  peNDF (27)
SWG = 13.91 NEg0.9116 SBW−0.6837. This approximation X
presents, with the original equation, an R2 = 0.999 for FATj xj  0:06 (28)
j2J
NEg values between 0 and 8 Mcal/day, which is the practical,
viable range of NEg. Moreover, in equation (15) we have NEg X
indirectly dependent on xj from equations (16) and (17). j2J
RDPj CPj xj  0:125 (29)
However, NEg can be written as a parametric function X
of CNEm. j2J
cnemj xj ¼ CNEmi (30)
In general, NLP models cannot be solved exactly. Thus, we
aim to find a point in the solution space that is guaranteed to X
x ¼1 (31)
be within a tolerance ζ of the exact solution Z*. Considering j2J j

4
Diet optimization for beef cattle

Figure 1 Parametric linear programming algorithm for solving the nonlinear programming model of profit-maximizing diet for beef cattle. The concentration of
net energy for maintenance (CNEmi (Mcal/kg)) varies inside the feasible range (lb – lower bound to ub – upper bound) with a step ε. Each solution is stored, and
the one with maximum objective function (zi) is retrieved at the end.

(26) to (33). However, the energy concentration (CNEmi) is


xj 2 ½0; 1 8 j 2 J (32) chosen arbitrarily, and an optimal solution is found for that
specific value, which may or may not be optimal for the
Figure 1 shows a ‘brute force’ algorithm for parametric LP. whole range of CNEm. Thus, the model is subject to known
For a step ε in the domain, this approach solves (ub-lb)/ε animal growth. This decision is equivalent to changing the
LP models. It compares the obtained solutions for each objective function (25) in the model for min{z = T DMI
CNEmi. Estimating the relationship between the domain step (∑j∈J cj xj)} and setting the right-hand side value of the
ε and the precision ζ of the objective function depends on metabolizable protein requirement to the corresponding
each dataset. However, we notice a posteriori that those val- value for that growth. Similar to the profit-maximizing
ues are similar in the context of diet optimization problems. approach, we solve the least-cost model for the whole range
For the precision of ε, the proposed method will need to solve of CNEm and have the best solution extracted from it. An
O(ε−1) LP models. The values lb and ub can be calculated by alternative approach is to change the objective function in
solving: NEg = CNEg (DMI − NEm/CNEm) ≥ 0, thus (1.2425 the LP (25) to (33) model to maximize the marginal profit
CNEm þ 1.9218 CNEm2 to 0.7259 CNEm3) (SBW/NEm) ≥ 0; per {z = T [s SWG − DMI (∑j∈J cj xj)]/SWG}. We implement
constrained to CNEm = ∑j∈J cnemj xj. the traditional least-cost formulation and the maximum
The well-behaved characteristic of the problem suggests profit per SWG formulation for comparison purposes using
that we can obtain a faster solution with numerical optimi- the brute force algorithm. Additionally, we run numeric sen-
zation methods. We use the golden-section search (GSS) sitivity analysis on three parameters of the model: body con-
method (Press et al., 2007), which breaks dition score (BCS), animal weight (SBW) and animal selling
p the interval using price (S ).
the golden-ratio proportion ϕ = (1þ 5)/2. This method
requires solving O(log ε−1) LPs, a considerable reduction in The model developed in Python 3 (Marques, 2020) uses
comparison with the brute force approach. the HiGHS solver (Huangfu and Hall, 2018) to optimize LP
We chose a precision of ε = 10−2 for CNEm since, in real- models in the algorithm. All results from this work can be
ity, it is unlikely that beef producers can achieve a higher obtained by replicating the execution with the same input
precision when mixing feedstuff to prepare the ration. data. The models were executed in a computer with 8 GB
Furthermore, one can easily incorporate other predictive of RAM with a quad-core CPU at 1.7 GHz.
equations or constraints in the proposed model, provided
they are linear within each feedstuff xj. In the ‘Discussion’ Bioeconomic data
section, we comment on the possibility of implementing We use bioeconomic data based on a representative feedlot
predictive equations for CH4 emission suggested by finishing system in Brazil (ANUALPEC, 2017) consisting of
NASEM (2016). Nellore steers with average BCS 5 and the initial SBW of
In the traditional least-cost formulation approach, the 300 kg under a finishing time of 60 days. Table 1 shows
model has the same constraints presented in equations the used ingredients and costs (CEPEA, 2018). Nellore selling

5
Marques, de O. Silva, Barioni, Hall, Tedeschi and Moran

Table 1 Common Brazilian ingredients used in ration formulation CNEm. The black line indicates the maximum profit solution,
(CEPEA, 2018) for Nellore beef cattle and the white lines divide regions where a change in inflec-
Ingredient Cost (US$/kg)
tion occurs. We identify those occurrences by the dual values,
that is, indicators of activity of each constraint, and reduced
Citrus pulp, dry 0.14 costs, that is, an indicator of minimal change in each variable
Corn grain 0.18 coefficient to change optimal solution.
Corn silage 0.19 Figure 2 also shows that diet cost decreases in direction to
Cottonseed meal 0.33 CNEm = 1.62 (Mcal/kg). For CNEm < 1.29 (Mcal/kg), this is
Cottonseed whole 0.14 mostly because of the reduction in urea concentration in
Distillers grain plus soluble, dry 0.08 the diet, as we see in Figure 3. Urea is used as a protein
Grain sorghum grain 0.14 source and is one of the most expensive ingredients avail-
Soybean hulls 0.16 able. But the limited allowance of energetic concentration
Soybean meal high CP 0.20
promotes the use of urea as a protein source. As CNEm
Sugarcane silage 0.09
increases, cheaper feedstuff replacements increase contribu-
Wheat middlings 0.15
Urea 0.40 tion to protein requirements. For 1.29 ≤ CNEm ≤ 1.62, the
increased allowance permits the inclusion of distillery grains,
which are rich in fat.
For CNEm = 1.28 (Mcal/kg), we observe a jump in SWG
price S was assumed 1.44 (US$/kg) (CEPEA, 2018). We and cost in Figure 2. This subtle change coincides with the
obtained the ingredient’s properties from the NASEM white line in Figure 3. Once the shift in inflection comes from
(2016) feed library, presented in Supplementary Table S1. the change in the constraints activity, it is expected that such
bumps in the function may happen in the parameters. For
CNEm ≥ 1.64 (Mcal/kg), the increase in profit derives mainly
from an increase in SWG as the diet cost keeps increasing
Results
steadily after this point. Figure 3 shows that as CNEm
Figure 2 shows the profit, diet cost and SWG as a function of increases in this range, the diet changes the ratio of sugar-
CNEm for the maximum profit model. Figure 2 shows that the cane silage to sorghum grain and whole cottonseed. This
optimal solution for CNEm (1.88 Mcal/kg) does not coincide shift is a response to the increase in required protein to
with maximum SWG nor with minimum diet cost. The plotted achieve higher SWG since those ingredients have more than
range CNEm = [0.8, 1.95] is defined by the NLP feasibility, twice the amount of proteins of sugarcane silage.
that is, for all values outside this range, the problem is In the analysis, all diets formulated for CNEm ≤ 1.56
unfeasible. Note that there are slight changes in the curve (Mcal/kg) have a negative profit. However, all diets formu-
inflection ( ∂f/ ∂CNEm) in similar positions for all three curves. lated for 1.85 ≤ CNEm ≤ 1.94 have very similar profit mar-
Figure 3 shows how diet profiles vary for different values of gins and the same five ingredients in their composition: urea,

Figure 2 (colour online) Results from the parametric linear programming algorithm for the profit-maximizing diet model for beef cattle. The green dots re-
present maximum daily profit (US$/day) for that concentration of net energy for maintenance (CNEm (Mcal/kg)), calculated as shrunk-weight gain (kg/day)
(SWG – blue triangle) times animal’s sale price, minus daily costs (US$/day) (daily cost – yellow rhombus). The white markers represent the optimal solution,
that is, maximum daily profit.

6
Diet optimization for beef cattle

Figure 3 (colour online) Diet profiles for the concentration of net energy for maintenance (CNEm) (Mcal/kg) range (0.8, 1.95) for the profit-maximizing diet
model for beef cattle. The black line highlights the diet profile of the nonlinear programming model optimal solution. The white lines mark a change in the
constraints activity.

sugarcane silage, cottonseed whole soybean meal high CP 39.62% of sorghum grain, 22.26% of soybean meal high
and sorghum grain. In that interval, RDP and peNDF require- CP, 14.24% of sugarcane silage and 3.67% of urea. The
ments are the only active constraints, suggesting that the daily profit of US$0.41/day is associated with a SWG of
presence of sugarcane silage in the diet is only used to control 1.21 kg/day and a diet cost of US$1.33/day.
ruminal pH. Figure 4a shows the normalized solution for three differ-
For CNEm ≥ 1.94, dual values are 0 for metabolized pro- ent objective functions: minimum cost, maximum profit and
tein constraint and ∑j∈J cnemj xj = CNEmi, so at this point, maximum profit/SWG. Figure 4b shows the optimal diet com-
protein requirements are easily met but the increase in SWG position for the different objective functions. Figure 4a indi-
per CNEm no longer increases daily profit, which starts to cates that using the up-to-date NASEM (2016) the different
decrease faster from this point. Beyond this point, there objective functions are not equivalent, once the optimal sol-
are no combinations of ingredients that can satisfy ∑j∈J cnemj utions highlighted are at different CNEm values. Analyzing
xj = CNEmi, particularly because only four ingredients con- daily profit for those optimal solutions indicates that it is
tain cnemj > 1.94, and none of those contain forage to satisfy 9.1% lower for the maximum profit/SWG and 52.3% lower
the peNDF constraint. for the minimum cost, compared to the maximum profit
The optimal diet is at CNEm = 1.88 Mcal/kg and DMI of objective function. Figure 4b also shows that the optimal diet
6.85 kg/day containing 20.21% of cottonseed whole, composition for each objective differs significantly.

Figure 4 (colour online) Results of different objective function of the profit-maximizing diet model for beef cattle. (a) Comparison of different normalized
objective functions: maximum daily profit, maximum profit per shrunk weight gain (SWG) and minimum cost for the range of concentration of net energy for
maintenance (CNEm). For each objective function, the optimal solution is highlighted in white. The normalization converts the optimal value to 1 and −1 for
maximization and minimization problems, respectively. (b) Diet profile of the optimal solutions for the different objective functions in (a).

7
Marques, de O. Silva, Barioni, Hall, Tedeschi and Moran

Sensitivity analysis of the optimal solution shows that, for Discussion


unused ingredients, the decrease in price (US$/kg) necessary
Transforming the NLP problem into a parametric LP equiva-
to change the diet composition is US$0.10 for citrus pulp, US
lent has practical and computational advantages. Since LPs
$0.10 for corn grain, US$2.17 for corn silage, US$1.20 for
can be solved in pseudo-polynomial time, we have a good
cottonseed meal, US$0.18 for distillers grain, US$0.70 for
estimation of computational time based solely on a few
soybean hull and US$0.41 for wheat middlings. High values
characteristics of the data and model. The brute force search
in some of these ingredients indicate that they are not
algorithm is the slowest possible approach, having to solve
competitive enough to be a viable replacement.
O(ε−1) LPs to find the ε-solution for the NLP model. However,
Sensitivity analysis on the BCS, SBW and S indicates that
it is unrealistic to work with precisions greater than 10−2 in
profit can increase with lower BCS or SBW, as well as with
diet formulation, which means a solution can usually be
higher S (see Supplementary Table S2). Once the increase
found with no more than 200 LPs resolutions, depending
in SBW and BCS influences the energy and protein require-
on the feasible range of CNEm. Once this diet optimization
ments while reducing SWG, it is expected that larger profit
model is small, that is, 7 constraints and no more than
margins come from fattening smaller animals. From the sell-
300 feed ingredients in NASEM (2016)’s library, it can be
ing price sensitivity, we see that higher prices correlate with
further developed for more complex scenarios, for example,
more energetically concentrated diets. This behavior possibly
environmental constraints, where the GSS approach can be
indicates the existence of a trade-off point where the extra
more relevant in terms of execution time.
profit margin is larger than the cost of feeding and attending
The proposed approach has advantages compared to the
minimum nutritional requirements. Moreover, in every sensi-
traditional least-cost diet alternative. An arbitrary choice of
tivity scenario all optimal diets contain the same five ingre-
CNEm may lead to suboptimal solutions, including no profit
dients in different proportions: cottonseed whole (18.74% to
scenarios. Thus, using parametric LP to solve the least-cost
22.28%), sorghum grain (12.88% to 58.67%) of soybean
model for the whole feasible CNEm interval can improve
meal high CP (0.00% to 53.49%), sugarcane silage
the solution compared to the traditional approach.
(11.35% to 16.299%) and urea (0.00% to 6.29%).
However, it can also lead to a suboptimal solution in terms
We show in Figure 5 the convergence results using
of profit, that is, revenue minus costs. We also show that the
numerical optimization with precision ε = 10−2. The GSS
assumption that maximum profit per SWG is equivalent to
takes O(log ε−1) iterations to complete. Daily profit and
maximum profit is invalid when using the most updated
CNEm converged for the same optimal values found using
predictive equations (NASEM, 2016).
the brute force search: US$0.41/day and 1.88 Mcal/kg.
The GSS showed a significant increase in performance
While the brute force algorithm took 114 iterations to find
compared with the brute force search. For ε = 10−2, it took
the optimal solution with ε = 10−2, the GSS took 10 for
10 iterations to complete, roughly 1/10 of the initial
the same ε. Since the number of iterations to find a solution
approach. Since the GSS has to solve only O(log ε−1) LPs,
through brute force in a range D is n = ⌈D2/ε⌉, for ε = 10−6
it can be useful for more complex diet optimization models.
and D = 1.15, it would require 1 322 500 iterations. On the
Empirical evidence shows that the function Z(CNEm, x) on
other hand, for the same range D, the GSS would need
Equation (23) is unimodular; thus, both brute force and
n = ⌈(log ε − log D)/ log ϕ⌉, that is, 29 iterations for
GSS are guaranteed to obtain a minimizer within ε of that
ε = 10−6. In terms of computational time, the brute force
exact minimizer.
algorithm took 2.120 s, while the GSS algorithm took
Further model limitations are related to the assumed
1.150 s, both for the precision of ε = 10−2. We estimate that
linear growth of SBW over time. Since the predicted require-
most of this time was spent in overhead.
ments change with cattle bodyweight, ideally, the model
should revaluate diet periodically. Thus, the results will accu-
mulate greater inaccuracy from the dynamic weight of the
animal, proportionally to the feeding time. This inaccuracy
is reflected in the difference in the animal weight curve in
time, between the linear approximation of SWG and nonlin-
ear SWG. This measurement can be obtained by solving the
differential equation system for growth. To overcome this,
the feeding time T can be discretized by a micro-period
p to maximize profit along the whole feeding time. Thus,
a new index t ∈ {1, : : : , T/p} can be introduced into the
model, with T and p arbitrarily chosen according to the
desired precision and computational power. This approach
is equivalent to approximate nonlinear growth by multiple
Figure 5 (colour online) Golden-section search algorithm of the linear segments.
profit-maximizing diet model for beef cattle. Results show convergence
for daily profit (blue dot) and concentration of net energy for maintenance Mathematical models to optimize diet are always
(CNEm – red rhombus). bounded to limitations on the accuracy of predictive

8
Diet optimization for beef cattle

equations for nutrient requirements and absorption. It is unlikely that in the future, the NASEM (2016)’s equa-
Nevertheless, under the infinite set of possible diets, numeri- tions will evolve in a way that compromises our model
cal optimization techniques deliver a ‘close to optimal’ solu- (Tedeschi, 2019) since it would concurrently jeopardize the
tion facing variation proportional to the uncertainty in the process by which the nutritionist formulates the baseline diet.
process. Some suggest adjustments on predictive equations Thus, as their system continues to evolve, our model should
based on each particular application (NASEM, 2016), which be able to accommodate changes in the equations for the
may also correct the assertiveness of our model’s solution. nutrient requirement prediction either by linearization, sub-
Still, it is key to have a proper understanding of the premises ject to an increase in inaccuracy, or through parametrization
and scope of both the predictive equations and the math- of nonlinear factors.
ematical optimization models when applying them to cattle The parametric LP approach makes it easier to implement
feeding operations. In this sense, the dataset and respective further developments to the model to asses a more complex
sensitivity analysis on price, SBW and BCS show that the diets situation. Furthermore, the possibility of solving the profit-
for different sale prices (þ15% to −15%) contain the same maximizing diet problem with the GSS suggests that our
ingredients in different proportions. This sensitivity analysis model could be extended or integrated with others, and still
approach can deliver a local assessment of how much uncer- be solved efficiently.
tainty in price and SBW can be absorbed, while indicating a
range for possible diet formulation. This result indicates that
the maximum profit model may contain a degree of robust- Acknowledgements
ness for uncertainty, which could be enhanced with the This work was supported by The University of Edinburgh’s
development of a stochastic optimization model for maxi- Data-Driven Innovation Chancellors fellowship. We also
mum profit. acknowledge the Economic and Social Research Council
Furthermore, in response to concerns over livestock emis- (ESRC) under grant number ES/N013255/1 and CAPES
sions, researchers have been focusing on the environmental Foundation for the scholarship no. 10180/13-3.
impacts of rations. Optimization models to evaluate eco- J. G. O. Marques 0000-0002-4099-085X
nomic and environmental (impact) trade-offs usually modify R. de O. Silva 0000-0003-3440-580X
the traditional least-cost algorithm objective function (Wang L. G. Barioni 0000-0003-1716-1428
et al., 2000a and 2000b; Tedeschi et al., 2000; Pomar et al., J. A. J. Hall 0000-0002-0030-013X
2007; Oishi et al., 2011; Moraes et al., 2012), use multi- L. O. Tedeschi 0000-0003-1883-4911
criteria analysis (Hadrich et al., 2005; Moraes and Fadel, D. Moran 0000-0001-8147-5742
2013; Moraes et al., 2015), develop multi-objective models
(Garcia-Launay et al., 2018) or integrate lifecycle assessment Declaration of interest
analysis exogenously (Oishi et al., 2013; Mackenzie et al.,
None.
2016). As our results show, the choice of the objective func-
tion will impact the optimal solution and hence, the related
economic analysis. Thus, results from studies using least-cost Ethics statement
models should be reevaluated, at least considering the whole Not applicable.
range of CNEm. Moreover, the NASEM (2016) model sug-
gests a variety of equations to predict CH4 emissions. Such Software and data repository resources
equations (e.g. those based on the International Panel on
The mathematical model programmed in Python 3, including
Climate Change guidelines; Eggleston et al., 2006) can also
the dataset used in this work, is available in the GitHub reposi-
be introduced into our model either in the constraints or in
tory at Marques (2020) under GNU General Public License v3.0.
the objective function.
Supplementary material
Conclusion To view supplementary material for this article, please visit
Our model permits optimal diet formulation by considering https://doi.org/10.1017/S1751731120001433
the interaction between CNEm, CNEg and diet profit. As
the choice of maximum profit, profit/SWG or minimum diet
cost leads to different solutions, the objective function must References
be carefully chosen prior to any economic or policy analysis. Anele UY, Domby EM and Galyean ML 2014. Predicting dry matter intake by
From a nutritional perspective, our model presents a growing and finishing beef cattle: evaluation of current methods and equation
straightforward approach to define a baseline diet solely development. Journal of Animal Science 92, 2660–2667.
based on animal characteristics. Since it does not require ANUALPEC 2017. Anuário da pecuária brasileira. FNP Consultoria/Agros
Comunicação, São Paulo, SP, Brasil.
net energy concentration beforehand, it has a broader solu-
Cannas A, Tedeschi LO, Atzori AS and Lunesu MF 2019. How can nutrition mod-
tion space than a traditional least-cost diet. Furthermore, the els increase the production efficiency of sheep and goat operations? Animal
relation with the NASEM (2016)’s prediction system allows Frontiers 9, 33–44.
the same approximations to be made in our model. CEPEA 2018. PIB do Agronegócio Brasileiro. Piracicaba, SP, Brasil.

9
Marques, de O. Silva, Barioni, Hall, Tedeschi and Moran

Cortez-Arriola J, Groot JCJ, Rossing WAH, Scholberg JMS, Améndola Massiotti NRC 1984. Nutrient requirements of beef cattle. National Academies Press,
RD and Tittonell P 2016. Alternative options for sustainable intensification of Washington, D.C., USA.
smallholder dairy farms in North-West Michoacán, Mexico. Agricultural O’Connor JD, Sniffen CJ, Fox DG and Chalupa W 1993. A net carbohydrate and
Systems 144, 22–32. protein system for evaluating cattle diets: IV. Predicting amino acid adequacy.
Dantzig GB 1998. Linear programming and extensions. Princeton University Journal of Animal Science 71, 1298–1311.
Press, Princeton, NJ, USA. Oishi K, Kato Y, Ogino A and Hirooka H 2013. Economic and environmental
Eggleston HS, Buendia L, Miwa K, Ngara T and Tanabe K 2006. 2006 IPCC guide- impacts of changes in culling parity of cows and diet composition in
lines for national greenhouse gas inventories. Institute for Global Environmental Japanese beef cow-calf production systems. Agricultural Systems 115, 95–103.
Strategies, Hayama, Japan. Oishi K, Kumagai H and Hirooka H 2011. Application of the modified feed
Fox DG, Sniffen CJ, O’Connor JD, Russell JB and Van Soest PJ 1992. A net carbo- formulation to optimize economic and environmental criteria in beef cattle
hydrate and protein system for evaluating cattle diets: III. Cattle requirements fattening systems with food by-products. Animal Feed Science and
and diet adequacy. Journal of Animal Science 70, 3578–3596. Technology 165, 38–50.
Galyean ML and Tedeschi LO 2014. Predicting microbial protein synthesis in beef Pashaei Kamali F, van der Linden A, Meuwissen MPM, Malafaia GC, Oude
cattle: relationship to intakes of total digestible nutrients and crude protein. Lansink AGJM and de Boer IJM 2016. Environmental and economic performance
Journal of Animal Science 92, 5099–5111. of beef farming systems with different feeding strategies in southern Brazil.
Garcia-Launay F, Dusart L, Espagnol S, Laisse-Redoux S, Gaudré D, Méda B and Agricultural Systems 146, 70–79.
Wilfart A 2018. Multiobjective formulation is an effective method to reduce Pomar C, Dubeau F, Létourneau-Montminy M-P, Boucher C and Julien P-O 2007.
environmental impacts of livestock feeds. British Journal of Nutrition 120, Reducing phosphorus concentration in pig diets by adding an environmental
1298–1309. objective to the traditional feed formulation algorithm. Livestock Science 111,
de Gouvello Filho C and Hissa B 2011. Brazil low carbon case study: technical 16–27.
synthesis report. The World Bank Group, Washington, DC, USA. Press WH, Teukolsky SA, Vetterling WT and Flannery BP 2007. Numerical recipes:
Hadrich JC, Wolf CA and Harsh SB 2005. Optimal livestock diet formulation with the art of scientific computing. Cambridge University Press, New York, NY, USA.
farm environmental compliance consequences. In American Agricultural Russell JB, O’Connor JD, Fox DG, Van Soest PJ and Sniffen CJ 1992. A net carbo-
Economics Association Annual Meeting, Providence, RI, USA, p. 15. hydrate and protein system for evaluating cattle diets: I. Ruminal fermentation.
Hertzler G, Wilson DE, Loy DD and Rouse GH 1988. Optimal beef cattle diets Journal of Animal Science 70, 3551–3561.
formulated by nonlinear programming. Journal of Animal Science 66, 1115. Sartorello GL, Bastos JPST and Gameiro AH 2018. Development of a calculation
Huangfu Q and Hall JAJ 2018. Parallelizing the dual revised simplex method. model and production cost index for feedlot beef cattle. Revista Brasileira de
Mathematical Programming Computation 10, 119–142. Zootecnia 47.
Kaimowitz D and Angelsen A 2008. Will livestock intensification help save Latin Sniffen CJ, O’Connor JD, Van Soest PJ, Fox DG and Russell JB 1992. A net carbo-
America’s tropical forests? Journal of Sustainable Forestry 27, 6–24. hydrate and protein system for evaluating cattle diets: II. Carbohydrate and pro-
tein availability. Journal of Animal Science 70, 3562–3577.
Mackenzie SG, Leinonen I, Ferguson N and Kyriazakis I 2016. Towards a
methodology to formulate sustainable diets for livestock: accounting for Soto C and Reinoso V 2012. Modelo de formulación de raciones al mínimo costo
environmental impact in diet formulation. British Journal of Nutrition 115, para ganado de carne basado en el sistema NRC 2000. Archivos de Zootecnia 61,
1860–1874. 255–266.
Marques JGO 2020. MaxProfitFeeding/README.md at master BlackNellore/ Tedeschi LO 2019. ASN-ASAS symposium: future of data analytics in nutrition:
MaxProfitFeeding. Retrieved on 1 December 2019 from https://github.com/ mathematical modeling in ruminant nutrition: approaches and paradigms,
BlackNellore/MaxProfitFeeding/blob/master/README.md extant models, and thoughts for upcoming predictive analytics. Journal of
Animal Science 97, 1921–1944.
Marques JGO, Silva RdO, Barioni LG, Hall JAJ and Moran D 2019. An improved
algorithm for solving nonlinear profit maximizing animal diet problems. Tedeschi LO and Fox DG 2020. The Ruminant Nutrition System: Volume I - An
Advances in Animal Biosciences 10, 290. Applied Model for Predicting Nutrient Requirements and Feed Utilization in
Ruminants. (3rd ed.). XanEdu, Ann Arbor, MI, USA.
Moraes LE and Fadel JG 2013. Minimizing environmental impacts of livestock
production using diet optimization models. In Sustainable animal agriculture Tedeschi LO, Fox DG, Chase LE and Wang SJ 2000. Whole-herd optimization with
(ed. E. Kebreab), pp. 67–82. CABI, Boston, MA, USA. the Cornell net carbohydrate and protein system. I. Predicting Feed Biological
Values for Diet Optimization with Linear Programming. Journal of Dairy
Moraes LE, Fadel JG, Castillo AR, Casper DP, Tricarico JM and Kebreab E 2015. Science 83, 2139–2148.
Modeling the trade-off between diet costs and methane emissions: A goal pro-
gramming approach. Journal of Dairy Science 98, 5557–5571. Tedeschi LO, Fox DG, Sainz RD, Barioni LG, de Medeiros SR and Boin C 2005.
Mathematical models in ruminant nutrition. Scientia Agricola 62, 76–91.
Moraes LE, Wilen JE, Robinson PH and Fadel JG 2012. A linear programming
model to optimize diets in environmental policy scenarios. Journal of Dairy Wang SJ, Fox DG, Cherney DJR, Chase LE and Tedeschi LO 2000a. Whole-herd
Science 95, 1267–1282. optimization with the Cornell net carbohydrate and protein system. III.
Application of an optimization model to evaluate alternatives to reduce nitrogen
NASEM 2016. Nutrient requirements of beef cattle, 8th revised edition. National and phosphorus mass balance. Journal of Dairy Science 83, 2160–2169.
Academies Press, Washington, D.C.
Wang SJ, Fox DG, Cherney DJR, Chase LE and Tedeschi LO 2000b. Whole-herd
Nicholson CF, Lee DR, Boisvert RN, Blake RW and Urbina CI 1994. An optimization with the Cornell net carbohydrate and protein system. II. Allocating
optimization model of the dual-purpose cattle production system in the humid homegrown feeds across the herd for optimum nutrient use. Journal of Dairy
lowlands of Venezuela. Agricultural Systems 46, 311–334. Science 83, 2149–2159.

10

You might also like