Skip to content
Home » LPsolve » LPSolve – The Back Story

LPSolve – The Back Story

The feed industry has experienced fundamental changes in the past 30 years and perhaps no area of greater change than in the dairy industry. The industry has transitioned from feeding forage plus 10-20 kg/day of a commercial “complete feed” (which provided all non-forage nutrients) to highly sophisticated total mixed rations containing forages, energy and protein ingredients, by-products, additives, vitamins, minerals, and highly technical ruminally protected nutrients like fats and amino acids. Ration formulation, once limited to trained nutritionists and Pearson Squares, are now managed by advanced linear programs that can not only minimize cost but can maximize profit on the basis of feed cost and milk income. We’ve come a long way, baby.

Similar changes are happening in the calf world, albeit more slowly. Producers who once only purchased a complete calf starter and a complete milk replacer (think, “complete feed”) are now purchasing individual components of each and blending them on farm to produce unique calf starters and liquid blends that better meet the farm’s individual needs.

The changes I’ve described are happening more rapidly in the United States than in other parts of the world. Calf raisers with access to by-products like beet pulp (for calf starters) or liquid whey (for milk replacers) are increasingly using their own resources to create diets for their calves. It’s an interesting new world.

This issue came to light very clearly for me in the summer of 2025, when I consulted for a private company that manufactures calf milk replacer. The company, located in the Midwestern U.S., asked me to visit with their sales and technical teams to discuss milk replacer ingredients and other topics. We discussed topics such as dried whey quality and the merchandising of dried whey in the industry. It’s well known that dried whey may have black, scorched particles that occur during the drying process.

The industry has a quality scoring system for whey (see the ADPI Analytical method #005, Determination of scorched particles for more information) and the results of whey of different qualities are demonstrated in the picture below.

Most commercial milk replacer companies have sophisticated quality control programs to sample and test loads of incoming ingredients to determine their acceptability to be used in their formulas. Every company’s programs differ, but it is common that dried whey with too many scorched particles will be rejected and the seller (often, ingredient brokers) need to find other outlets for their products.

https://adpi.org/methodsofanalysis/analytical-method-005-determination-of-scorched-particles/

That’s where the calf raiser comes in. Often, these producers lack the experience and tools to determine whether whey (or other ingredients) are acceptable, and, therefore, these loads of whey – offered at an attractive price – are used on their operations, often with negative outcomes.

Another issue with on-farm mixing of ingredients is the need to properly balance all important nutrients to ensure calves receive required nutrients to meet needs for both maintenance and growth. Here’s the tricky part – most calf operations lack the tools needed to determine the nutrients (e.g., fat, amino acids, etc.) in ingredients used to make their feed blends, so they default to using an Excel spreadsheet to balance fat and protein. Nutrients were missing and the ability to compare costs of alternative ingredients was lacking. Producers were trying to use their own ingredients, but the results were far from optional. And… we can do better.

A productive plane ride!

Following a long conversation with my colleagues at the CMR company, I decided (on the plane ride home) that there needed to be a simple but accurate method to put a tool into the hands of producers that was simple, straightforward to use, but provided an accurate formulation and a least-cost solution.

After exploring several options, I discovered a freely availalble linear programming algorithm that could be adapted into a feed formulation system. It could be generalized so it not only formulated milk replacers, but starter formulations – or, indeed, any feed – given the proper information about nutrient composition of the ingredients and nutrient requirements for the feed to be formulated.

The project to develop LPSolve took a few months but the goal was achieved. Develop an LP program as simple to use as Excel’s Solver (which also can do linear programming) but as accurate as any program on the market. My goal, too, was to minimize the extra “bells and whistles” that most dairy producers don’t need or want. Simple. Accurate. Useful.

Once developed, it became clear that the simplicity of LPSolve readily lends itself to teaching the basics of linear programming. Of course, there are many on-line LP algorithms that provide for great instruction, but LPSolve is useful in that the feeds being developed can be applied on the farm, perhaps in real time.

I was happy with the result of that plane ride – time well spent!