← All Use Cases
🐄
Central Composite Design

Pig Farrowing Pen Design

Central composite design to maximize piglet survival and sow comfort by tuning creep area temperature, pen floor type heating, and space allowance

Summary

This experiment investigates pig farrowing pen design. Central composite design to maximize piglet survival and sow comfort by tuning creep area temperature, pen floor type heating, and space allowance.

The design varies 3 factors: creep temp c (C), ranging from 28 to 35, heat mat pct (%), ranging from 0 to 100, and space m2 (m2), ranging from 4 to 7. The goal is to optimize 2 responses: piglet survival pct (%) (maximize) and sow comfort (pts) (maximize). Fixed conditions held constant across all runs include breed = large_white, litter size = 12.

A Central Composite Design (CCD) was selected to fit a full quadratic response surface model, including curvature and interaction effects. With 3 factors this produces 22 runs including center points and axial (star) points that extend beyond the factorial range.

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 piglet survival pct, the most influential factors were heat mat pct (40.0%), creep temp c (30.9%), space m2 (29.1%). The best observed value was 91.0 (at creep temp c = 25.1099, heat mat pct = 50, space m2 = 5.5).

For sow comfort, the most influential factors were space m2 (34.9%), creep temp c (33.6%), heat mat pct (31.5%). The best observed value was 7.3 (at creep temp c = 25.1099, heat mat pct = 50, space m2 = 5.5).

Recommended Next Steps

Experimental Setup

Factors

FactorLowHighUnit
creep_temp_c2835C
heat_mat_pct0100%
space_m247m2

Fixed: breed = large_white, litter_size = 12

Responses

ResponseDirectionUnit
piglet_survival_pct↑ maximize%
sow_comfort↑ maximizepts

Configuration

use_cases/295_pig_farrowing/config.json
{ "metadata": { "name": "Pig Farrowing Pen Design", "description": "Central composite design to maximize piglet survival and sow comfort by tuning creep area temperature, pen floor type heating, and space allowance" }, "factors": [ { "name": "creep_temp_c", "levels": [ "28", "35" ], "type": "continuous", "unit": "C" }, { "name": "heat_mat_pct", "levels": [ "0", "100" ], "type": "continuous", "unit": "%" }, { "name": "space_m2", "levels": [ "4", "7" ], "type": "continuous", "unit": "m2" } ], "fixed_factors": { "breed": "large_white", "litter_size": "12" }, "responses": [ { "name": "piglet_survival_pct", "optimize": "maximize", "unit": "%" }, { "name": "sow_comfort", "optimize": "maximize", "unit": "pts" } ], "settings": { "operation": "central_composite", "test_script": "use_cases/295_pig_farrowing/sim.sh" } }

Experimental Matrix

The Central Composite Design produces 22 runs. Each row is one experiment with specific factor settings.

Runcreep_temp_cheat_mat_pctspace_m2
131.5505.5
23507
3281004
431.5141.2875.5
531.5505.5
625.1099505.5
731.5502.76139
831.5505.5
9351004
1037.8901505.5
1131.5505.5
1231.5-41.28715.5
1331.5505.5
142807
1531.5505.5
163504
1731.5508.23861
18351007
1931.5505.5
202804
21281007
2231.5505.5

Step-by-Step Workflow

1

Preview the design

Terminal
$ doe info --config use_cases/295_pig_farrowing/config.json
2

Generate the runner script

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

Execute the experiments

Terminal
$ bash use_cases/295_pig_farrowing/results/run.sh
4

Analyze results

Terminal
$ doe analyze --config use_cases/295_pig_farrowing/config.json
5

Get optimization recommendations

Terminal
$ doe optimize --config use_cases/295_pig_farrowing/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/295_pig_farrowing/config.json --multi
7

Generate the HTML report

Terminal
$ doe report --config use_cases/295_pig_farrowing/config.json \ --output use_cases/295_pig_farrowing/results/report.html

Features Exercised

FeatureValue
Design typecentral_composite
Factor typescontinuous (all 3)
Arg styledouble-dash
Responses2 (piglet_survival_pct ↑, sow_comfort ↑)
Total runs22

Analysis Results

Generated from actual experiment runs using the DOE Helper Tool.

Response: piglet_survival_pct

Top factors: heat_mat_pct (40.0%), creep_temp_c (30.9%), space_m2 (29.1%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
creep_temp_c4115.787928.94701.3430.3264
heat_mat_pct4293.537973.38453.4050.0587
space_m24238.454559.61362.7660.0944
LackofFit20.00000.0000
PureError7150.8750
Error951.674221.5536
Total21699.454533.3074

Pareto Chart

Pareto chart for piglet_survival_pct

Main Effects Plot

Main effects plot for piglet_survival_pct

Normal Probability Plot of Effects

Normal probability plot for piglet_survival_pct

Half-Normal Plot of Effects

Half-normal plot for piglet_survival_pct

Model Diagnostics

Model diagnostics for piglet_survival_pct

Response: sow_comfort

Top factors: space_m2 (34.9%), creep_temp_c (33.6%), heat_mat_pct (31.5%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
creep_temp_c48.69332.17334.4220.0299
heat_mat_pct412.23003.05756.2220.0110
space_m2415.94583.98658.1120.0047
LackofFit20.00000.0000
PureError73.4400
Error90.00000.4914
Total2135.98001.7133

Pareto Chart

Pareto chart for sow_comfort

Main Effects Plot

Main effects plot for sow_comfort

Normal Probability Plot of Effects

Normal probability plot for sow_comfort

Half-Normal Plot of Effects

Half-normal plot for sow_comfort

Model Diagnostics

Model diagnostics for sow_comfort

Response Surface Plots

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

piglet survival pct creep temp c vs heat mat pct

RSM surface: piglet survival pct creep temp c vs heat mat pct

piglet survival pct creep temp c vs space m2

RSM surface: piglet survival pct creep temp c vs space m2

piglet survival pct heat mat pct vs space m2

RSM surface: piglet survival pct heat mat pct vs space m2

sow comfort creep temp c vs heat mat pct

RSM surface: sow comfort creep temp c vs heat mat pct

sow comfort creep temp c vs space m2

RSM surface: sow comfort creep temp c vs space m2

sow comfort heat mat pct vs space m2

RSM surface: sow comfort heat mat pct vs space m2

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.9545

Per-Response Desirability

ResponseWeightDesirabilityPredictedDir
piglet_survival_pct 2.0
0.9545
91.00 0.9545 91.00 %
sow_comfort 1.5
0.9545
7.30 0.9545 7.30 pts

Recommended Settings

FactorValue
creep_temp_c31.5 C
heat_mat_pct50 %
space_m25.5 m2

Source: from observed run #18

Trade-off Summary

Sacrifice = how much worse than single-objective best.

ResponsePredictedBest ObservedSacrifice
sow_comfort7.307.30+0.00

Top 3 Runs by Desirability

RunDFactor Settings
#170.8481creep_temp_c=31.5, heat_mat_pct=50, space_m2=5.5
#40.7876creep_temp_c=31.5, heat_mat_pct=50, space_m2=8.23861

Model Quality

ResponseType
sow_comfort0.6186quadratic

Full Multi-Objective Output

doe optimize --multi
============================================================ MULTI-OBJECTIVE OPTIMIZATION Method: Derringer-Suich Desirability Function ============================================================ Overall desirability: D = 0.9545 Response Weight Desirability Predicted Direction --------------------------------------------------------------------- piglet_survival_pct 2.0 0.9545 91.00 % ↑ sow_comfort 1.5 0.9545 7.30 pts ↑ Recommended settings: creep_temp_c = 31.5 C heat_mat_pct = 50 % space_m2 = 5.5 m2 (from observed run #18) Trade-off summary: piglet_survival_pct: 91.00 (best observed: 91.00, sacrifice: +0.00) sow_comfort: 7.30 (best observed: 7.30, sacrifice: +0.00) Model quality: piglet_survival_pct: R² = 0.6385 (quadratic) sow_comfort: R² = 0.6186 (quadratic) Top 3 observed runs by overall desirability: 1. Run #18 (D=0.9545): creep_temp_c=31.5, heat_mat_pct=50, space_m2=5.5 2. Run #17 (D=0.8481): creep_temp_c=31.5, heat_mat_pct=50, space_m2=5.5 3. Run #4 (D=0.7876): creep_temp_c=31.5, heat_mat_pct=50, space_m2=8.23861

Full Analysis Output

doe analyze
=== Main Effects: piglet_survival_pct === Factor Effect Std Error % Contribution -------------------------------------------------------------- heat_mat_pct 11.0000 1.2304 40.0% creep_temp_c 8.5000 1.2304 30.9% space_m2 8.0000 1.2304 29.1% === ANOVA Table: piglet_survival_pct === Source DF SS MS F p-value ----------------------------------------------------------------------------- creep_temp_c 4 115.7879 28.9470 1.343 0.3264 heat_mat_pct 4 293.5379 73.3845 3.405 0.0587 space_m2 4 238.4545 59.6136 2.766 0.0944 Lack of Fit 2 0.0000 0.0000 0.000 1.0000 Pure Error 7 150.8750 21.5536 Error 9 51.6742 21.5536 Total 21 699.4545 33.3074 === Summary Statistics: piglet_survival_pct === creep_temp_c: Level N Mean Std Min Max ------------------------------------------------------------ 25.1099 1 86.0000 0.0000 86.0000 86.0000 28 4 77.5000 6.6081 69.0000 85.0000 31.5 12 82.6667 5.5323 74.0000 91.0000 35 4 80.0000 6.2183 71.0000 85.0000 37.8901 1 84.0000 0.0000 84.0000 84.0000 heat_mat_pct: Level N Mean Std Min Max ------------------------------------------------------------ -41.2871 1 85.0000 0.0000 85.0000 85.0000 0 4 75.0000 6.3246 69.0000 83.0000 100 4 82.5000 3.0000 79.0000 85.0000 141.287 1 74.0000 0.0000 74.0000 74.0000 50 12 83.5833 4.8516 75.0000 91.0000 space_m2: Level N Mean Std Min Max ------------------------------------------------------------ 2.76139 1 76.0000 0.0000 76.0000 76.0000 4 4 81.5000 3.4157 77.0000 85.0000 5.5 12 84.0000 4.8804 74.0000 91.0000 7 4 76.0000 7.3937 69.0000 85.0000 8.23861 1 78.0000 0.0000 78.0000 78.0000 === Main Effects: sow_comfort === Factor Effect Std Error % Contribution -------------------------------------------------------------- space_m2 2.1333 0.2791 34.9% creep_temp_c 2.0500 0.2791 33.6% heat_mat_pct 1.9250 0.2791 31.5% === ANOVA Table: sow_comfort === Source DF SS MS F p-value ----------------------------------------------------------------------------- creep_temp_c 4 8.6933 2.1733 4.422 0.0299 heat_mat_pct 4 12.2300 3.0575 6.222 0.0110 space_m2 4 15.9458 3.9865 8.112 0.0047 Lack of Fit 2 0.0000 0.0000 0.000 1.0000 Pure Error 7 3.4400 0.4914 Error 9 0.0000 0.4914 Total 21 35.9800 1.7133 === Summary Statistics: sow_comfort === creep_temp_c: Level N Mean Std Min Max ------------------------------------------------------------ 25.1099 1 6.2000 0.0000 6.2000 6.2000 28 4 4.1500 1.4154 3.0000 6.2000 31.5 12 5.7083 1.1309 4.0000 7.3000 35 4 5.3250 1.5500 3.1000 6.7000 37.8901 1 6.2000 0.0000 6.2000 6.2000 heat_mat_pct: Level N Mean Std Min Max ------------------------------------------------------------ -41.2871 1 4.5000 0.0000 4.5000 4.5000 0 4 4.3000 1.6330 3.1000 6.7000 100 4 5.1750 1.4660 3.0000 6.2000 141.287 1 4.1000 0.0000 4.1000 4.1000 50 12 6.0250 0.9196 4.0000 7.3000 space_m2: Level N Mean Std Min Max ------------------------------------------------------------ 2.76139 1 4.0000 0.0000 4.0000 4.0000 4 4 5.6250 1.2203 3.9000 6.7000 5.5 12 5.9833 0.9703 4.1000 7.3000 7 4 3.8500 1.3178 3.0000 5.8000 8.23861 1 5.1000 0.0000 5.1000 5.1000

Optimization Recommendations

doe optimize
=== Optimization: piglet_survival_pct === Direction: maximize Best observed run: #18 creep_temp_c = 25.1099 heat_mat_pct = 50 space_m2 = 5.5 Value: 91.0 RSM Model (linear, R² = 0.1413, Adj R² = -0.0018): Coefficients: intercept +81.4545 creep_temp_c -2.3533 heat_mat_pct -0.8063 space_m2 -0.7412 RSM Model (quadratic, R² = 0.6552, Adj R² = 0.3966): Coefficients: intercept +84.0598 creep_temp_c -2.3533 heat_mat_pct -0.8063 space_m2 -0.7412 creep_temp_c*heat_mat_pct +2.7500 creep_temp_c*space_m2 -2.0000 heat_mat_pct*space_m2 -0.0000 creep_temp_c^2 -0.7026 heat_mat_pct^2 +0.3474 space_m2^2 -3.5526 Curvature analysis: space_m2 coef=-3.5526 concave (has a maximum) creep_temp_c coef=-0.7026 concave (has a maximum) heat_mat_pct coef=+0.3474 convex (has a minimum) Notable interactions: creep_temp_c*heat_mat_pct coef=+2.7500 (synergistic) creep_temp_c*space_m2 coef=-2.0000 (antagonistic) Predicted optimum (from quadratic model, at observed points): creep_temp_c = 28 heat_mat_pct = 0 space_m2 = 7 Predicted value: 87.3203 Surface optimum (via L-BFGS-B, quadratic model): creep_temp_c = 28 heat_mat_pct = 0 space_m2 = 5.76574 Predicted value: 89.7256 Model quality: Moderate fit — use predictions directionally, not precisely. Factor importance: 1. creep_temp_c (effect: 20.0, contribution: 49.9%) 2. space_m2 (effect: 14.6, contribution: 36.4%) 3. heat_mat_pct (effect: 5.5, contribution: 13.7%) === Optimization: sow_comfort === Direction: maximize Best observed run: #18 creep_temp_c = 25.1099 heat_mat_pct = 50 space_m2 = 5.5 Value: 7.3 RSM Model (linear, R² = 0.0603, Adj R² = -0.0963): Coefficients: intercept +5.4000 creep_temp_c -0.3046 heat_mat_pct -0.1957 space_m2 -0.1299 RSM Model (quadratic, R² = 0.3680, Adj R² = -0.1061): Coefficients: intercept +5.6211 creep_temp_c -0.3046 heat_mat_pct -0.1957 space_m2 -0.1299 creep_temp_c*heat_mat_pct +0.7000 creep_temp_c*space_m2 -0.4250 heat_mat_pct*space_m2 -0.1250 creep_temp_c^2 -0.0505 heat_mat_pct^2 +0.1895 space_m2^2 -0.4705 Curvature analysis: space_m2 coef=-0.4705 concave (has a maximum) heat_mat_pct coef=+0.1895 convex (has a minimum) creep_temp_c coef=-0.0505 negligible curvature Notable interactions: creep_temp_c*heat_mat_pct coef=+0.7000 (synergistic) creep_temp_c*space_m2 coef=-0.4250 (antagonistic) Predicted optimum (from linear model, at observed points): creep_temp_c = 28 heat_mat_pct = 0 space_m2 = 4 Predicted value: 6.0302 Surface optimum (via L-BFGS-B, linear model): creep_temp_c = 28 heat_mat_pct = 0 space_m2 = 4 Predicted value: 6.0302 Model quality: Weak fit — consider adding center points or using a different design. Factor importance: 1. creep_temp_c (effect: 4.2, contribution: 54.4%) 2. space_m2 (effect: 2.4, contribution: 30.7%) 3. heat_mat_pct (effect: 1.2, contribution: 14.9%)
← Previous: Rotational Grazing Pattern All Use Cases →