The principal economic sector devoted to the breeding, raising, and production of farm animals is known as the livestock industry. There are precise standards for making high-quality feed in animal husbandry. Precision livestock feeding is a crucial component, with the potential to significantly impact the profitability of livestock; it permits the provision of diets to animals that are precisely tailored to their specific daily nutritional needs. Through simulation modeling, a single model can be created for automated systems to determine daily rations for farm animals. For the purposes of this document, precision livestock feeding refers to the practice of tailoring feed to individual animals or groups of animals, taking into account their changing nutritional needs over time and individual differences in terms of nutritional requirements. The practice aims to optimize animal health and performance while reducing feed waste. This paper presents a formal model for determining the quantities of components needed to achieve a minimum cost mixture that satisfies compositional and quantitative criteria. The present research calculates the amount of hay and silage required to feed an animal per day at the most economical cost by applying an optimization approach that involves defining and solving an optimization problem. The problem is solved using a well-known software package, which is necessary for the practical application of the resulting model. Real data from livestock production in Bulgaria are used to numerically test the model.