Skip to content
View Categories

Matrix Tips and Tricks

Hello, and welcome to this demonstration of LPSolve matrix tips and tricks. In this video, we’ll take a look at the ingredient matrix and walk through a few easy ways to navigate and use the program. Let’s get started.

When you start LPSolve, you’ll be taken to an ingredient matrix. This may be the default matrix or the last file you saved. The ingredient matrix appears in the center of the screen, while the lower-left panel displays metadata describing the file and the ration.

The matrix itself is organized with ingredients as rows and nutrients as columns. The first column contains the ingredient name, followed by cost, and then minimum and maximum inclusion limits for each ingredient. We’ll look more closely at those limits a bit later. After that, the nutrient columns begin, starting with dry matter, protein, fat, and so on.

The 1st 4 columns Ingredient, Cost, min and Max cannot be moved, nor can they be rearranged or reordered. They are always fixed in the first four columns of the matrix.  

Above the matrix, you’ll see two drop-down menus. The menu on the left controls the number of ingredients displayed, and the one on the right controls the number of nutrients displayed. You can formulate with up to 53 nutrients in LPSolve. As you increase the number of nutrients, additional columns appear. If the number of columns exceeds the available screen space, a horizontal scroll bar will appear, allowing you to move back and forth across the matrix. If you reduce the number of visible nutrients, that scroll bar may disappear.

Similarly, you can increase the number of ingredients in the formulation. LPSolve allows up to 30 ingredients per formula. As you add ingredients, you’ll eventually reach the maximum visible area, at which point a vertical scroll bar will appear.

You can adjust column widths by dragging the right edge of a column header. This can make column labels easier to read. Row heights, however, cannot be adjusted.

You’ll notice that columns are displayed in two colors. Columns shown in blue are protected. These include columns such as cost, minimums, maximums, or any nutrient that has a minimum or maximum specification. For example, dry matter has a minimum of 15% and a maximum of 17%, which means that column cannot be hidden. Columns shown in gray are unprotected and can be hidden if desired.

To hide an unprotected column, simply left-click on the column name. For example, clicking on the ME column will hide it from view. If you attempt to hide a protected column, the program will notify you that this is not allowed. To hide a protected column, you must first remove its minimum or maximum. For instance, if you remove the minimum requirement for chloride, the column becomes unprotected and can then be hidden.

Hiding columns does not delete them—it simply removes them from view, making it easier to focus on the nutrients of interest. For example, in a milk replacer formulation, you may not be interested in lignin, starch, NDF, or ADF, and those columns can be hidden with a simple click.

If you attempt to reduce the number of visible columns to fewer than the number of protected columns, the matrix will not hide the protected columns.  They are always visible.  Therefore, it’s important not to attempt to display fewer than the number of protected columns.

There may also be nutrients you want to view that are not currently visible. For example, you might want to see lysine or methionine. One way to make these visible is to increase the number of nutrient columns until they appear. However, this can make the matrix difficult to manage.

A more efficient approach is to right-click on any nutrient column header. This opens a list of all currently hidden nutrients. You can scroll through the list, select the nutrient you want, and it will immediately appear in the matrix. You can repeat this process to display additional nutrients as needed.

Columns can also be reordered. For example, if you’d like calcium and phosphorus to appear before ash, you can simply drag the ash column to the right. Columns can only be reordered within their group—protected columns can be reordered among protected columns, and unprotected columns among unprotected columns. You cannot move a column from one group into the other.

Rows cannot be rearranged in this version of LPSolve.  If you right click on the row header, you will be asked if you would like to delete a row.  Answering yes will delete the row from the matrix.

It’s important to note that nutrient units vary. Minerals such as magnesium, chloride, and sodium are expressed as percentages of dry matter. Micronutrients like copper are expressed in parts per million or milligrams per kilogram of dry matter. Amino acids are expressed as a percentage of total protein, not as a percentage of dry matter.

If you want to express amino acids on a dry matter basis, you can use one of the extra columns labeled C0 through C9. These columns allow you to perform custom calculations. For example, you can multiply lysine concentration by crude protein concentration to calculate lysine as a percent of dry matter. Once entered, you can rename the column by right-clicking and giving it a descriptive name.

After calculating values for all ingredients, you can set a minimum or maximum on that column. Once a specification is added, the column becomes protected and can no longer be hidden.

If you are formulating on a lysine basis, you may need to include lysine as an ingredient. To do this, add an empty ingredient row and begin typing “lysine.” The program will search the feed library and populate the ingredient automatically. Be sure to adjust the dry matter basis and price as needed.

Ingredients can also be added through the Ingredient Library menu. You can browse ingredients by category—such as energy sources—or use the keyboard shortcut Ctrl + I to bring up the ingredient selection window.

To edit any nutrient concentration, simply click on the cell and type the new value. Percentages are entered as whole numbers, while values less than one can be entered with a leading zero. Minimum and maximum values control ingredient inclusion and nutrient specifications.

Whenever you make a change, the affected cells are highlighted. If you modify an ingredient’s nutrient values, you’ll also see a Save option in the row header. This allows you to save a modified ingredient to your local feed library. For example, if you have a dried whey product with a composition different from the global library, you can save it locally and reuse it in future formulations.

Double clicking anywhere within a cell will cause a red “flash” to appear.  This indicates that all the data in the matrix has been copied to the clipboard.  It’s then possible to paste the data into another application such as Excel for another purpose.

That just about does it for this overview of the LPSolve ingredient matrix. Thanks for watching, and be sure to check out additional demos in the Knowledge Base to learn more about using the program. See you next time.

Powered by BetterDocs