Skip to content
Home » LPsolve » LPSolve Demo

LPSolve Demo

Welcome to this demonstration of the LPSolve software. My name is Jim Quigley, webmaster for calfnotes.com and the author of the LPSolve software. 

Once the program is downloaded and installed, you can start the program and come to the nutrient screen. The screen is laid out like an Excel spreadsheet with the columns being the nutrients and the rows being the ingredients that will go into the formula. Along the top is the menu bar that allows us access to different commands and different processes within the software. 

We can select the number of ingredients that will be in the formula from the drop box down here. We can have up to about 30 ingredients per formula, and we can look at multiple different numbers of nutrients. There are a total of 53 nutrients that are available. We’ll keep it to a small number here for the purposes of the demonstration. 

Let’s go ahead and open a new file. We’re going to open one of the examples that is installed with the program. We’re going to go ahead and make a calf grain, and the program will load the ingredients, and you can see here the ingredients are selected. The first column is the cost per unit, in this case metric tons. We can set a minimum and maximum for each individual ingredient. So, in this case, we don’t want more than 20% wheat midds we want to have exactly 0.25% of the vitamin mineral premix. 

Okay, so the nutrients then are in the following columns. You’ll notice it’s possible for us to resize and we can move columns as well to set them up the way we want. You’ll notice the columns are in blue or in white, and the ones that are in blue will have a nutrient requirement here. At the bottom, we have the minimum and maximums for setting the program. In this case, we want a minimum of 17% crude protein, a minimum of 3% fat. We can set a maximum as well, for example, 5% fat.  Perhaps we want between 25 and 30% starch. And you’ll see that there are a number of other ingredients that are here. 

And we can, if we want to find new ingredients, we can either increase the number of nutrients that are displayed or we can right-click on the header, and you’ll notice we have a new option here. So, for example, if I’m interested in the lysine concentration, I can put that here. For those nutrients that we’re not interested in, we can hide them from view. So, I’ll just left-click on the column header here and they’ll go away. So perhaps I don’t really care about ME or NP or ADF, but I am interested in the NDF and the lysine concentrations. So, I can make those changes as appropriate. 

If there are any changes in the nutrient content, I can make those changes here. You’ll notice when I make a change, the cell that’s changed is highlighted, and I have the option of saving this ingredient as a new ingredient that I can use in the future. So those are the basics. 

Down here at the bottom, I can describe the farm, the formula that I’m formulating, who is doing it, and then a brief description of the formula itself. So that’s kind of the basic setup. 

When I’m ready and have my nutrients minimums and maximums and the ingredient minimums and maximums, I can hit the run button. And if there’s a feasible solution, then the program will open a new window and show us the actual formula. 

You’ll notice here on the right; we see the percentages of the ingredients that are included in the formula. So, in this… In this case, we’re using about 31% soy hulls, 20% wheat middlings, which is the maximum, and 35% steam rolled grain, steam rolled barley, and a number of other smaller inclusion rates. 

You’ll notice that there are lower prices and higher prices. These are the shadow prices that tell us the prices at which their inclusion in the formula will change. So, for example, in this case, corn gluten feed will come into the formula if the price goes down to $174.05 or less. So, it kind of tells us that an idea of when these particular ingredients will become attractive. 

At the bottom, we see the actual nutrient composition. In this case, the nutrient composition is 90% Dry matter, 17% protein, 3% fat, et cetera. You’ll notice the ones that have red numbers below them are at their minimums or their maximums. In this case, we’re exactly 25% starch, which is our minimum. 

And these numbers tell us the price at which or the cost of that minimum nutrient specification. The overall cost based on our input costs is $140.82 per ton. And this is the least cost possible for this particular formulation. When we’re finished, we can close the results, or we can choose to print them out as well. 

So, I can print the solution. and we can take a look at what this looks like. We see the description of the farm. On the left-hand side, we see the ingredients and their inclusion rates in descending order, the kilograms per day of dry matter, and the kilograms per day as fed. We also have the nutrients minimums, the actual value, and the maximums are shown here. We can then choose to print this, or we can close and we can close and also look at the batch sheets. 

Here again, there is a report that tells us the amount that needs to be included either on a kilogram per dry matter basis or a percent as fed to kilograms per day as fed. 

To make changes to the formula, we can simply close and then go back to our input screens. We might change the price. For example, we know that there is a minimum price for including the corn gluten feed. So, if I change that to below that break-even price, suddenly corn gluten feed becomes attractive and will be used by the program. Now, we may decide that 25, 26% barley is too much. So, we might set a maximum here at 20% barley and perhaps also a maximum for the corn gluten feed. And now we see we’re going to hit those maximums, and the price is actually a little different now because we have made some changes to the pricing for the formula. 

This brief introduction shows you the basics of the program. There are many other options available, but the basics are based around the simplex algorithm for the linear program that the program can do. Hope this gives you a nice introduction to LPSolve, and more information is available in the knowledge base. Thanks for watching, and we’ll hope you enjoy the program.