Find how many grams of beef, bread and cheese you must take in order to
obtain 100g protein, 380g starch and 38g fat and find the total number of
calories.
/* Nutrients problem */
VAR a "Beef [g]" ..
,b "Bread [g]" ..
,c "Cheese [g]" ..
,K "Calorie [cal]"
0.21*a + 0.09*b + 0.23*c = 100 /* Protein (g) */
0.58*b + 0.01*c = 380 /* Starch (g) */
0.06*a + 0.02*b + 0.26*c = 38 /* Fat (g) */
1.5 *a + 2.7 *b + 3.6 *c = K
Explanation
- The VAR statement defines variables. The double quotation mark (
" ) is used for descriptions such as the output of calculation
results.
- .. means the continuation of a statement, and multiple statements or
equations can be written.
- Without the OUTPUT statement, all the variable values will be output.
Enter equations and click on the [Solve] button.
The following sample problems will help you understand how EQUATRAN-G works.