Overview
This application calculates the most inexpensive mix of available foods which satisfy infant (0 – 24 months) nutritional needs. The application uses the “Simplex Algorithm” to calculate the food mix and is written in FoxPro
As illustrated below, a master “Constraints” file controls the loading of the simplex table. This file assures that all the “Available foods”, with their nutritional components (Amino Acids, Minerals, Vitamins, etc) are processes correctly and in accordance with the selected “Objective” record from the Objective file.
The user selects an Available foods group, which could contain hundreds of different foods (i.e. bananas, shrimp, mother’s milk, etc.). The user must also select an Objective record which contains the established limits for each nutrient. Utility programs compare these two files and present the data in a variety of formats with necessary calculations so that the user can quickly verify and modify the data.
After execution of the Simplex Algorithm the results are store, manipulated and presented to the user.
Available Food
Available Foods is a list of all the foods and their nutritional make-up.
An Objective is a record (within the Objectives file) containing all the nutrients and their established minimum and/or maximum values.Constraints is a file containing a list of nutrients with preset or established values for each nutrient. This file contains the instructions for processing each nutrient.
An Available Food’s nutritional content are grouped into 5 categories :
1) General Composition – Product name, Dry matter, Energy content, Coefficient of digestibility for proteins, Crude proteins, Digestible proteins, Fiber, Lipids, Linoleic acid, Linolenic acid,
General Composition | Amino Acids |
Minerals |
Vitamins |
Crude protein (g) |
Calcium (mg) |
Vitamin A (µg eq. retinol) | |
Fiber (g) |
Phosphor (mg) |
Vitamin D (UI) | |
Sodium (mg) |
|||
Potassium (mg) |
|||
Chloride (mg) |
2) Amino Acids – Histidine, Isoleucine, Leucine, Mysine, Methionine+cystine, Phenylalanine+Tyrosine, Threonine, Tryptophan and Valine.3)
3) Minerals – Sodium, Potassium, Chloride, Calcium, Phosphorus, Magnesium, Iron, Iodine, Copper, Zinc, Manganese and Selenium.4)
() Vitamins – Vitamins A, D, C, B6, B12, K1, E Thiamin, Riboflavin, Nicotinamide, Folic acid, Pantothenic acid, Biotin.5)
() Data Sources – References, Descriptions, Data entry date and responsible, etc.
Constraints
Contains a record with all the nutrients having two different names, one name for the maximum and the minimum. For example Sodium would be labeled max_sodium and min_sodium. Maximum is the roof, not to be exceeded, while the minimum is the floor, do not go below. The constraint file performs the link of Sodium within an Available Food and the Maximum and Minimum in the Objective file.
The Constraints file directs the Nutrition program because it contains information necessary for comparing the nutrients of an Available Foods to those fixed in the Objectives.
Storing information in the Constraints file permits the manipulation (adding, modifying, deleting) of the data before executing the Simplex Algorithm. For example, a record could be added which establishes a percentage of an Available Food (i.e. >10 % sugar) to be included. This causes a food to become an Objective.
Nutrients could be excluded from the calculation if the amount of the nutrient in a food is unknown. A negative value for a nutrient (either in the Available foods or Objective files) indicates that the value is unknown and that the nutrient can not be considered in the calculation.
General Composition | Amino Acids | Minerals |
Vitamins |
Digestible protein(g) | Histidine (mg) | Sodium (mg) | Linoleic acid (mg) |
Lipids (g) | Isoleucine (mg) | Potassium (mg) | Vitamin A (µg eq. retinol) |
Leucine (mg) | Chloride (mg) | Vitamin B6 (µg) | |
Lysine (mg) | Calcium (mg) | Vitamin B12 (µg) | |
Methionine + Cystine (mg) |
Phosphorus (mg) | Ascorbic acid (mg) | |
Phenylalanine + Tyrosine(mg) |
Magnesium (mg) | Vitamin D (UI) | |
Threonine (mg) | Iron (mg) | Vitamin E (UI) | |
Tryptophan (mg) | Iodine (µg) | Vitamin K1 (µg) | |
Valine (mg) | Copper (µg | Thiamin (µg) | |
Zinc (µg) | Riboflavin (µg) | ||
Manganese (µg) | Nicotinamide (µg) | ||
Selenium (µg) |
Folic acid (µg) |
||
Pantothenic acid (µg) | |||
Linolenic acid (mg) | |||
Biotin (µg) |
The Constraints file directs the Nutrition program. It contains information necessary for comparing the nutrients of Available foods to those fixed by the Objectives.
For example, one record contains :
CODE_CONS |
|
NOM_CONS |
|
TEXT_CONS |
|
VAR_OBJET |
|
VAR_DISPON |
|
INF_EQ_SUP |
|
ACTIVE |
|
LIST_OPT |
|
VALUE_CONS |
|
INIT_LEG |
|
CONV_CALC |
|
DIVIDE_100 |
|
TAUX_PERT |
|
TENEUR_EST |
|
PER_SATIS |
|
RPT_TEXT |
|
TEXT_CONSE |
|
RPT_TEXTE |
|
Storing information in the Constraints file permits the manipulation (adding, modifying, deleting) of the data before executing the Simplex Algorithm. For example, a record could be added which establishes a percentage of a food (i.e. >10 % sugar) to be included. This causes a food to become an objective.
Nutrients could be excluded from the calculation if the amount of the nutrient in a food is unknown. A negative value for a nutrient (either in the Available foods or Objective files) indicates that the value is unknown and that the nutrient can not be considered in the calculation.
Objectives
Control
The user selects the Objective record. Once select all the operation performed on the file will only apply to the selected Objectives.
___________________________________
Maximums
One Objective records contains the Maximums
General Composition | Amino Acids |
Minerals |
Vitamins |
Crude protein (g) |
Calcium (mg) |
Vitamin A (µg eq. retinol) | |
Fiber (g) |
Phosphor (mg) |
Vitamin D (UI) | |
Sodium (mg) |
|||
Potassium (mg) |
|||
Chloride (mg) |
___________________________________
Minimums
General Composition |
Amino Acids |
Minerals |
Vitamins |
Digestible protein(g) | Histidine (mg) | Sodium (mg) | Linoleic acid (mg) |
Lipids (g) | Isoleucine (mg) | Potassium (mg) | Vitamin A (µg eq. retinol) |
Leucine (mg) | Chloride (mg) | Vitamin B6 (µg) | |
Lysine (mg) | Calcium (mg) | Vitamin B12 (µg) | |
Methionine + Cystine (mg) |
Phosphorus (mg) | Ascorbic acid (mg) | |
Phenylalanine + Tyrosine(mg) |
Magnesium (mg) | Vitamin D (UI) | |
Threonine (mg) | Iron (mg) | Vitamin E (UI) | |
Tryptophan (mg) | Iodine (µg) | Vitamin K1 (µg) | |
Valine (mg) | Copper (µg | Thiamin (µg) | |
Zinc (µg) | Riboflavin (µg) | ||
Manganese (µg) | Nicotinamide (µg) | ||
Selenium (µg) |
Folic acid (µg) |
||
Pantothenic acid (µg) | |||
Linolenic acid (mg) | |||
Biotin (µg) |
Conclusion
Operational research is a very good technique when searching for an optimal solution for exploiting resources, under constrains, in a non-linear environment. There are several important considerations when trying to adapt and apply the Simplex Algorithm. The field of Operational Research is a passionate science with amazing and stupefying results.
Execute the Simplex Algorithm
Let her rip. The tables is rotated and each line and column calculated and the table sorted. This could take several hundred reiterations.
Compares fixed objectives with calculated results
Composition, what foods and their percentage in the mix and the state of the product (ie. natural or dried)
Totals
Dynamic Self-Coding
The Constraints file directs the Nutrition program because it contains information necessary for comparing the nutrients of an Available Foods to those fixed by the Objectives.
Storing information in the Constraints file permits the manipulation (adding, modifying, deleting) of the data before executing the Simplex Algorithm. For example, a record could be added which establishes a percentage of a food (i.e. >10 % sugar) to be included. This causes a food to become an objective.
Nutrients could be excluded from the calculation if the amount of the nutrient in a food is unknown. A negative value for a nutrient (either in the Available foods or Objective files) indicates that the value is unknown and that the nutrient can not be considered in the calculation.
For example, one record contains :
CODE_CONS |
|
NOM_CONS |
|
TEXT_CONS |
|
VAR_OBJET |
|
VAR_DISPON |
|
INF_EQ_SUP |
|
ACTIVE |
|
LIST_OPT |
|
VALUE_CONS |
|
INIT_LEG |
|
CONV_CALC |
|
DIVIDE_100 |
|
TAUX_PERT |
|
TENEUR_EST |
|
PER_SATIS |
|
RPT_TEXT |
|
TEXT_CONSE |
|
RPT_TEXTE |
|
image to place