Discussion Forum » AMPL Language »

The Herd Feeding Problem

When using AMPL to model the Herd Feeding Problem you can "copy-and-paste" much of the model from the Whiskas Cat Food Problem. However, there are both "absolute" constraints (the upper bound on the amount of Pasture) and "relative" constraints (the lower bound on the percent of protein) that need to be modelled. What is the best way to do this?

-- TWikiAdminGroup - 17 Mar 2008

There are two ways to do this:

1) Do some algebra to incorporate the percentage requirements into the coefficients from an absolute requirements, e.g.,

$\frac{\sum_p c_{r p} x_p}{\sum_p x_p} \geq P_r$


$\sum_p (c_{r p} - P_r) x_p \geq 0$

2) Model the absolute requirements and the percentage requirements separately, e.g.,

$\sum_p c_{r p} x_p \leq A_r$

$\sum_p c_{r p} x_p \leq P_r \sum_p x_p$

AMPL will take care of the simplification.

-- TWikiGuest - 17 Mar 2008

Title The Herd Feeding Problem
Forum ForumAMPL
Edit | Attach | Watch | Print version | History: r1530 < r1529 < r1528 < r1527 < r1526 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r1530 - 2024-06-09 - TWikiGuest
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback