← All Use Cases
🐄
Box-Behnken Design

Dairy Cow Feed Ration

Box-Behnken design to maximize milk yield and minimize feed cost by tuning forage-to-concentrate ratio, protein supplement, and energy density

Summary

This experiment investigates dairy cow feed ration. Box-Behnken design to maximize milk yield and minimize feed cost by tuning forage-to-concentrate ratio, protein supplement, and energy density.

The design varies 3 factors: forage pct (%), ranging from 40 to 70, protein pct (%CP), ranging from 14 to 20, and energy mcal (Mcal/kg), ranging from 1.5 to 1.8. The goal is to optimize 2 responses: milk kg day (kg/day) (maximize) and feed cost day (USD/day) (minimize). Fixed conditions held constant across all runs include breed = holstein, lactation stage = mid.

A Box-Behnken design was chosen because it efficiently fits quadratic models with 3 continuous factors while avoiding extreme corner combinations — requiring only 15 runs instead of the 8 needed for a full factorial at two levels.

Quadratic response surface models were fitted to capture potential curvature and factor interactions. The RSM contour plots below visualize how pairs of factors jointly affect each response.

Key Findings

For milk kg day, the most influential factors were protein pct (44.2%), energy mcal (28.8%), forage pct (27.0%). The best observed value was 35.2 (at forage pct = 40, protein pct = 17, energy mcal = 1.8).

For feed cost day, the most influential factors were protein pct (47.4%), energy mcal (29.3%), forage pct (23.3%). The best observed value was 5.03 (at forage pct = 55, protein pct = 20, energy mcal = 1.5).

Recommended Next Steps

Experimental Setup

Factors

FactorLowHighUnit
forage_pct4070%
protein_pct1420%CP
energy_mcal1.51.8Mcal/kg

Fixed: breed = holstein, lactation_stage = mid

Responses

ResponseDirectionUnit
milk_kg_day↑ maximizekg/day
feed_cost_day↓ minimizeUSD/day

Configuration

use_cases/291_dairy_cow_nutrition/config.json
{ "metadata": { "name": "Dairy Cow Feed Ration", "description": "Box-Behnken design to maximize milk yield and minimize feed cost by tuning forage-to-concentrate ratio, protein supplement, and energy density" }, "factors": [ { "name": "forage_pct", "levels": [ "40", "70" ], "type": "continuous", "unit": "%" }, { "name": "protein_pct", "levels": [ "14", "20" ], "type": "continuous", "unit": "%CP" }, { "name": "energy_mcal", "levels": [ "1.5", "1.8" ], "type": "continuous", "unit": "Mcal/kg" } ], "fixed_factors": { "breed": "holstein", "lactation_stage": "mid" }, "responses": [ { "name": "milk_kg_day", "optimize": "maximize", "unit": "kg/day" }, { "name": "feed_cost_day", "optimize": "minimize", "unit": "USD/day" } ], "settings": { "operation": "box_behnken", "test_script": "use_cases/291_dairy_cow_nutrition/sim.sh" } }

Experimental Matrix

The Box-Behnken Design produces 15 runs. Each row is one experiment with specific factor settings.

Runforage_pctprotein_pctenergy_mcal
155141.5
255171.65
370171.8
470171.5
555171.65
655171.65
740171.8
870141.65
955141.8
1070201.65
1140171.5
1255201.8
1340141.65
1440201.65
1555201.5

Step-by-Step Workflow

1

Preview the design

Terminal
$ doe info --config use_cases/291_dairy_cow_nutrition/config.json
2

Generate the runner script

Terminal
$ doe generate --config use_cases/291_dairy_cow_nutrition/config.json \ --output use_cases/291_dairy_cow_nutrition/results/run.sh --seed 42
3

Execute the experiments

Terminal
$ bash use_cases/291_dairy_cow_nutrition/results/run.sh
4

Analyze results

Terminal
$ doe analyze --config use_cases/291_dairy_cow_nutrition/config.json
5

Get optimization recommendations

Terminal
$ doe optimize --config use_cases/291_dairy_cow_nutrition/config.json
6

Multi-objective optimization

With 2 competing responses, use --multi to find the best compromise via Derringer–Suich desirability.

Terminal
$ doe optimize --config use_cases/291_dairy_cow_nutrition/config.json --multi
7

Generate the HTML report

Terminal
$ doe report --config use_cases/291_dairy_cow_nutrition/config.json \ --output use_cases/291_dairy_cow_nutrition/results/report.html

Features Exercised

FeatureValue
Design typebox_behnken
Factor typescontinuous (all 3)
Arg styledouble-dash
Responses2 (milk_kg_day ↑, feed_cost_day ↓)
Total runs15

Analysis Results

Generated from actual experiment runs using the DOE Helper Tool.

Response: milk_kg_day

Top factors: protein_pct (44.2%), energy_mcal (28.8%), forage_pct (27.0%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
forage_pct232.427516.21381.3780.3059
protein_pct287.247543.62383.7080.0725
energy_mcal249.250824.62542.0930.1857
LackofFit6126.956821.1595
PureError223.5267
Error8150.483511.7633
Total14319.409322.8150

Pareto Chart

Pareto chart for milk_kg_day

Main Effects Plot

Main effects plot for milk_kg_day

Normal Probability Plot of Effects

Normal probability plot for milk_kg_day

Half-Normal Plot of Effects

Half-normal plot for milk_kg_day

Model Diagnostics

Model diagnostics for milk_kg_day

Response: feed_cost_day

Top factors: protein_pct (47.4%), energy_mcal (29.3%), forage_pct (23.3%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
forage_pct24.15222.07610.8350.4684
protein_pct214.86477.43242.9900.1072
energy_mcal27.29103.64551.4670.2867
LackofFit619.91353.3189
PureError24.9717
Error824.88522.4858
Total1451.19323.6567

Pareto Chart

Pareto chart for feed_cost_day

Main Effects Plot

Main effects plot for feed_cost_day

Normal Probability Plot of Effects

Normal probability plot for feed_cost_day

Half-Normal Plot of Effects

Half-normal plot for feed_cost_day

Model Diagnostics

Model diagnostics for feed_cost_day

Response Surface Plots

3D surfaces fitted with quadratic RSM. Red dots are observed data points.

feed cost day forage pct vs energy mcal

RSM surface: feed cost day forage pct vs energy mcal

feed cost day forage pct vs protein pct

RSM surface: feed cost day forage pct vs protein pct

feed cost day protein pct vs energy mcal

RSM surface: feed cost day protein pct vs energy mcal

milk kg day forage pct vs energy mcal

RSM surface: milk kg day forage pct vs energy mcal

milk kg day forage pct vs protein pct

RSM surface: milk kg day forage pct vs protein pct

milk kg day protein pct vs energy mcal

RSM surface: milk kg day protein pct vs energy mcal

Multi-Objective Optimization

When responses compete, Derringer–Suich desirability finds the best compromise. Each response is scaled to a 0–1 desirability, then combined via a weighted geometric mean.

Overall Desirability
D = 0.6190

Per-Response Desirability

ResponseWeightDesirabilityPredictedDir
milk_kg_day 1.5
0.7056
30.60 0.7056 30.60 kg/day
feed_cost_day 1.0
0.5085
8.16 0.5085 8.16 USD/day

Recommended Settings

FactorValue
forage_pct55 %
protein_pct20 %CP
energy_mcal1.8 Mcal/kg

Source: from observed run #2

Trade-off Summary

Sacrifice = how much worse than single-objective best.

ResponsePredictedBest ObservedSacrifice
feed_cost_day8.165.03+3.13

Top 3 Runs by Desirability

RunDFactor Settings
#130.5936forage_pct=70, protein_pct=17, energy_mcal=1.5
#50.5690forage_pct=55, protein_pct=17, energy_mcal=1.65

Model Quality

ResponseType
feed_cost_day0.0444linear

Full Multi-Objective Output

doe optimize --multi
============================================================ MULTI-OBJECTIVE OPTIMIZATION Method: Derringer-Suich Desirability Function ============================================================ Overall desirability: D = 0.6190 Response Weight Desirability Predicted Direction --------------------------------------------------------------------- milk_kg_day 1.5 0.7056 30.60 kg/day ↑ feed_cost_day 1.0 0.5085 8.16 USD/day ↓ Recommended settings: forage_pct = 55 % protein_pct = 20 %CP energy_mcal = 1.8 Mcal/kg (from observed run #2) Trade-off summary: milk_kg_day: 30.60 (best observed: 35.20, sacrifice: +4.60) feed_cost_day: 8.16 (best observed: 5.03, sacrifice: +3.13) Model quality: milk_kg_day: R² = 0.0776 (linear) feed_cost_day: R² = 0.0444 (linear) Top 3 observed runs by overall desirability: 1. Run #2 (D=0.6190): forage_pct=55, protein_pct=20, energy_mcal=1.8 2. Run #13 (D=0.5936): forage_pct=70, protein_pct=17, energy_mcal=1.5 3. Run #5 (D=0.5690): forage_pct=55, protein_pct=17, energy_mcal=1.65

Full Analysis Output

doe analyze
=== Main Effects: milk_kg_day === Factor Effect Std Error % Contribution -------------------------------------------------------------- protein_pct 6.5750 1.2333 44.2% energy_mcal 4.2857 1.2333 28.8% forage_pct 4.0250 1.2333 27.0% === ANOVA Table: milk_kg_day === Source DF SS MS F p-value ----------------------------------------------------------------------------- forage_pct 2 32.4275 16.2138 1.378 0.3059 protein_pct 2 87.2475 43.6238 3.708 0.0725 energy_mcal 2 49.2508 24.6254 2.093 0.1857 Lack of Fit 6 126.9568 21.1595 1.799 0.3995 Pure Error 2 23.5267 11.7633 Error 8 150.4835 11.7633 Total 14 319.4093 22.8150 === Summary Statistics: milk_kg_day === forage_pct: Level N Mean Std Min Max ------------------------------------------------------------ 40 4 25.9750 5.4993 18.4000 30.6000 55 7 28.0714 4.0323 22.9000 34.8000 70 4 30.0000 5.7359 22.3000 35.2000 protein_pct: Level N Mean Std Min Max ------------------------------------------------------------ 14 4 31.1000 5.2928 23.8000 35.2000 17 7 28.2714 3.3084 22.9000 33.4000 20 4 24.5250 5.2424 18.4000 30.3000 energy_mcal: Level N Mean Std Min Max ------------------------------------------------------------ 1.5 4 31.0000 4.1207 25.5000 34.8000 1.65 7 26.7143 5.7632 18.4000 35.2000 1.8 4 27.3500 2.5775 23.8000 29.4000 === Main Effects: feed_cost_day === Factor Effect Std Error % Contribution -------------------------------------------------------------- protein_pct 2.7050 0.4937 47.4% energy_mcal 1.6721 0.4937 29.3% forage_pct 1.3325 0.4937 23.3% === ANOVA Table: feed_cost_day === Source DF SS MS F p-value ----------------------------------------------------------------------------- forage_pct 2 4.1522 2.0761 0.835 0.4684 protein_pct 2 14.8647 7.4324 2.990 0.1072 energy_mcal 2 7.2910 3.6455 1.467 0.2867 Lack of Fit 6 19.9135 3.3189 1.335 0.4876 Pure Error 2 4.9717 2.4858 Error 8 24.8852 2.4858 Total 14 51.1932 3.6567 === Summary Statistics: feed_cost_day === forage_pct: Level N Mean Std Min Max ------------------------------------------------------------ 40 4 7.3425 1.5628 5.1200 8.6500 55 7 8.4100 1.6910 6.2500 11.4100 70 4 8.6750 2.7421 5.0300 11.3600 protein_pct: Level N Mean Std Min Max ------------------------------------------------------------ 14 4 9.4325 2.3220 6.8000 11.4100 17 7 8.3286 1.2400 6.2500 10.0500 20 4 6.7275 1.9086 5.0300 8.4000 energy_mcal: Level N Mean Std Min Max ------------------------------------------------------------ 1.5 4 9.3250 1.7589 7.4400 11.4100 1.65 7 7.6529 2.3296 5.0300 11.3600 1.8 4 8.0175 0.8283 6.8000 8.6500

Optimization Recommendations

doe optimize
=== Optimization: milk_kg_day === Direction: maximize Best observed run: #12 forage_pct = 40 protein_pct = 17 energy_mcal = 1.8 Value: 35.2 RSM Model (linear, R² = 0.3932, Adj R² = 0.2277): Coefficients: intercept +28.0267 forage_pct -3.2125 protein_pct +1.8000 energy_mcal +1.4625 RSM Model (quadratic, R² = 0.7818, Adj R² = 0.3890): Coefficients: intercept +28.4667 forage_pct -3.2125 protein_pct +1.8000 energy_mcal +1.4625 forage_pct*protein_pct +0.2250 forage_pct*energy_mcal -2.7000 protein_pct*energy_mcal +1.4250 forage_pct^2 +2.3167 protein_pct^2 -3.9583 energy_mcal^2 +0.8167 Curvature analysis: protein_pct coef=-3.9583 concave (has a maximum) forage_pct coef=+2.3167 convex (has a minimum) energy_mcal coef=+0.8167 convex (has a minimum) Notable interactions: forage_pct*energy_mcal coef=-2.7000 (antagonistic) protein_pct*energy_mcal coef=+1.4250 (synergistic) Predicted optimum (from quadratic model, at observed points): forage_pct = 40 protein_pct = 17 energy_mcal = 1.8 Predicted value: 38.9750 Surface optimum (via L-BFGS-B, quadratic model): forage_pct = 40 protein_pct = 18.1368 energy_mcal = 1.8 Predicted value: 39.5434 Model quality: Good fit — general trends are captured, some noise remains. Factor importance: 1. forage_pct (effect: 6.4, contribution: 41.9%) 2. protein_pct (effect: 6.0, contribution: 39.0%) 3. energy_mcal (effect: 2.9, contribution: 19.1%) === Optimization: feed_cost_day === Direction: minimize Best observed run: #1 forage_pct = 55 protein_pct = 20 energy_mcal = 1.5 Value: 5.03 RSM Model (linear, R² = 0.3171, Adj R² = 0.1309): Coefficients: intercept +8.1960 forage_pct -1.0625 protein_pct +0.5237 energy_mcal +0.7913 RSM Model (quadratic, R² = 0.7917, Adj R² = 0.4167): Coefficients: intercept +8.3067 forage_pct -1.0625 protein_pct +0.5237 energy_mcal +0.7913 forage_pct*protein_pct -0.3325 forage_pct*energy_mcal -0.8525 protein_pct*energy_mcal +0.4850 forage_pct^2 +1.3792 protein_pct^2 -1.7533 energy_mcal^2 +0.1667 Curvature analysis: protein_pct coef=-1.7533 concave (has a maximum) forage_pct coef=+1.3792 convex (has a minimum) energy_mcal coef=+0.1667 convex (has a minimum) Notable interactions: forage_pct*energy_mcal coef=-0.8525 (antagonistic) protein_pct*energy_mcal coef=+0.4850 (synergistic) forage_pct*protein_pct coef=-0.3325 (antagonistic) Predicted optimum (from quadratic model, at observed points): forage_pct = 40 protein_pct = 17 energy_mcal = 1.8 Predicted value: 12.5588 Surface optimum (via L-BFGS-B, quadratic model): forage_pct = 54.3338 protein_pct = 14 energy_mcal = 1.5 Predicted value: 5.8873 Model quality: Good fit — general trends are captured, some noise remains. Factor importance: 1. forage_pct (effect: 2.6, contribution: 39.2%) 2. protein_pct (effect: 2.4, contribution: 36.6%) 3. energy_mcal (effect: 1.6, contribution: 24.3%)
← All Use Cases Next: Sheep Shearing Technique →