Summary
This experiment investigates cookie texture optimization. Central composite design to control chewiness vs crispness by tuning butter ratio, sugar type blend, egg count, and baking time.
The design varies 4 factors: butter pct (%), ranging from 30 to 50, brown sugar ratio (%), ranging from 0 to 100, eggs (count), ranging from 1 to 3, and bake time (min), ranging from 8 to 14. The goal is to optimize 2 responses: chewiness score (pts) (maximize) and spread ratio (ratio) (maximize). Fixed conditions held constant across all runs include oven temp = 175, flour type = all_purpose.
A Central Composite Design (CCD) was selected to fit a full quadratic response surface model, including curvature and interaction effects. With 4 factors this produces 32 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 chewiness score, the most influential factors were butter pct (41.9%), eggs (25.1%), brown sugar ratio (20.6%). The best observed value was 9.7 (at butter pct = 40, brown sugar ratio = 50, eggs = 2).
For spread ratio, the most influential factors were butter pct (46.1%), eggs (23.3%), brown sugar ratio (20.7%). The best observed value was 5.51 (at butter pct = 40, brown sugar ratio = 159.545, eggs = 2).
Recommended Next Steps
- Run confirmation experiments at the predicted optimal settings to validate the model.
- Consider whether any fixed factors should be varied in a future study.
Experimental Setup
Factors
| Factor | Low | High | Unit |
butter_pct | 30 | 50 | % |
brown_sugar_ratio | 0 | 100 | % |
eggs | 1 | 3 | count |
bake_time | 8 | 14 | min |
Fixed: oven_temp = 175, flour_type = all_purpose
Responses
| Response | Direction | Unit |
chewiness_score | ↑ maximize | pts |
spread_ratio | ↑ maximize | ratio |
Configuration
{
"metadata": {
"name": "Cookie Texture Optimization",
"description": "Central composite design to control chewiness vs crispness by tuning butter ratio, sugar type blend, egg count, and baking time"
},
"factors": [
{
"name": "butter_pct",
"levels": [
"30",
"50"
],
"type": "continuous",
"unit": "%"
},
{
"name": "brown_sugar_ratio",
"levels": [
"0",
"100"
],
"type": "continuous",
"unit": "%"
},
{
"name": "eggs",
"levels": [
"1",
"3"
],
"type": "continuous",
"unit": "count"
},
{
"name": "bake_time",
"levels": [
"8",
"14"
],
"type": "continuous",
"unit": "min"
}
],
"fixed_factors": {
"oven_temp": "175",
"flour_type": "all_purpose"
},
"responses": [
{
"name": "chewiness_score",
"optimize": "maximize",
"unit": "pts"
},
{
"name": "spread_ratio",
"optimize": "maximize",
"unit": "ratio"
}
],
"settings": {
"operation": "central_composite",
"test_script": "use_cases/95_cookie_texture/sim.sh"
}
}
Experimental Matrix
The Central Composite Design produces 32 runs. Each row is one experiment with specific factor settings.
| Run | butter_pct | brown_sugar_ratio | eggs | bake_time |
| 1 | 40 | 50 | 2 | 4.42733 |
| 2 | 30 | 100 | 1 | 14 |
| 3 | 50 | 0 | 3 | 8 |
| 4 | 50 | 100 | 3 | 14 |
| 5 | 40 | 50 | 4.19089 | 11 |
| 6 | 50 | 0 | 3 | 14 |
| 7 | 40 | -59.5445 | 2 | 11 |
| 8 | 30 | 100 | 3 | 8 |
| 9 | 40 | 50 | 2 | 11 |
| 10 | 50 | 100 | 1 | 8 |
| 11 | 40 | 50 | 2 | 11 |
| 12 | 50 | 0 | 1 | 14 |
| 13 | 40 | 50 | 2 | 11 |
| 14 | 50 | 100 | 3 | 8 |
| 15 | 40 | 50 | -0.19089 | 11 |
| 16 | 18.0911 | 50 | 2 | 11 |
| 17 | 40 | 50 | 2 | 11 |
| 18 | 30 | 0 | 1 | 14 |
| 19 | 50 | 100 | 1 | 14 |
| 20 | 40 | 50 | 2 | 11 |
| 21 | 30 | 0 | 3 | 8 |
| 22 | 40 | 50 | 2 | 11 |
| 23 | 61.9089 | 50 | 2 | 11 |
| 24 | 30 | 0 | 3 | 14 |
| 25 | 40 | 50 | 2 | 11 |
| 26 | 30 | 100 | 1 | 8 |
| 27 | 40 | 50 | 2 | 17.5727 |
| 28 | 40 | 50 | 2 | 11 |
| 29 | 50 | 0 | 1 | 8 |
| 30 | 40 | 159.545 | 2 | 11 |
| 31 | 30 | 0 | 1 | 8 |
| 32 | 30 | 100 | 3 | 14 |
Step-by-Step Workflow
1
Preview the design
$ doe info --config use_cases/95_cookie_texture/config.json
2
Generate the runner script
$ doe generate --config use_cases/95_cookie_texture/config.json \
--output use_cases/95_cookie_texture/results/run.sh --seed 42
3
Execute the experiments
$ bash use_cases/95_cookie_texture/results/run.sh
4
Analyze results
$ doe analyze --config use_cases/95_cookie_texture/config.json
5
Get optimization recommendations
$ doe optimize --config use_cases/95_cookie_texture/config.json
6
Multi-objective optimization
With 2 competing responses, use --multi to find the best compromise via Derringer–Suich desirability.
$ doe optimize --config use_cases/95_cookie_texture/config.json --multi
7
Generate the HTML report
$ doe report --config use_cases/95_cookie_texture/config.json \
--output use_cases/95_cookie_texture/results/report.html
Features Exercised
| Feature | Value |
| Design type | central_composite |
| Factor types | continuous (all 4) |
| Arg style | double-dash |
| Responses | 2 (chewiness_score ↑, spread_ratio ↑) |
| Total runs | 32 |
Analysis Results
Generated from actual experiment runs using the DOE Helper Tool.
Response: chewiness_score
Top factors: butter_pct (41.9%), eggs (25.1%), brown_sugar_ratio (20.6%).
ANOVA
| Source | DF | SS | MS | F | p-value |
| Source | DF | SS | MS | F | p-value |
| butter_pct | 4 | 24.1364 | 6.0341 | 1.596 | 0.2267 |
| brown_sugar_ratio | 4 | 9.8464 | 2.4616 | 0.651 | 0.6350 |
| eggs | 4 | 20.2407 | 5.0602 | 1.338 | 0.3014 |
| bake_time | 4 | 10.5357 | 2.6339 | 0.697 | 0.6060 |
| Lack | of | Fit | 8 | 45.0507 | 5.6313 |
| Pure | Error | 7 | 26.4688 | | |
| Error | 15 | 71.5195 | 3.7812 | | |
| Total | 31 | 136.2787 | 4.3961 | | |
Pareto Chart
Main Effects Plot
Normal Probability Plot of Effects
Half-Normal Plot of Effects
Model Diagnostics
Response: spread_ratio
Top factors: butter_pct (46.1%), eggs (23.3%), brown_sugar_ratio (20.7%).
ANOVA
| Source | DF | SS | MS | F | p-value |
| Source | DF | SS | MS | F | p-value |
| butter_pct | 4 | 7.0439 | 1.7610 | 3.610 | 0.0298 |
| brown_sugar_ratio | 4 | 2.2256 | 0.5564 | 1.141 | 0.3751 |
| eggs | 4 | 4.3729 | 1.0932 | 2.241 | 0.1133 |
| bake_time | 4 | 1.0116 | 0.2529 | 0.518 | 0.7235 |
| Lack | of | Fit | 8 | 6.7722 | 0.8465 |
| Pure | Error | 7 | 3.4145 | | |
| Error | 15 | 10.1867 | 0.4878 | | |
| Total | 31 | 24.8407 | 0.8013 | | |
Pareto Chart
Main Effects Plot
Normal Probability Plot of Effects
Half-Normal Plot of Effects
Model Diagnostics
Response Surface Plots
3D surfaces fitted with quadratic RSM. Red dots are observed data points.
chewiness score brown sugar ratio vs bake time
chewiness score brown sugar ratio vs eggs
chewiness score butter pct vs bake time
chewiness score butter pct vs brown sugar ratio
chewiness score butter pct vs eggs
chewiness score eggs vs bake time
spread ratio brown sugar ratio vs bake time
spread ratio brown sugar ratio vs eggs
spread ratio butter pct vs bake time
spread ratio butter pct vs brown sugar ratio
spread ratio butter pct vs eggs
spread ratio eggs vs bake time
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.6570
Per-Response Desirability
| Response | Weight | Desirability | Predicted | Dir |
chewiness_score |
1.5 |
|
6.40 0.5649 6.40 pts |
↑ |
spread_ratio |
1.0 |
|
4.96 0.8240 4.96 ratio |
↑ |
Recommended Settings
| Factor | Value |
butter_pct | 40 % |
brown_sugar_ratio | 50 % |
eggs | 2 count |
bake_time | 11 min |
Source: from observed run #19
Trade-off Summary
Sacrifice = how much worse than single-objective best.
| Response | Predicted | Best Observed | Sacrifice |
spread_ratio | 4.96 | 5.51 | +0.55 |
Top 3 Runs by Desirability
| Run | D | Factor Settings |
| #10 | 0.6270 | butter_pct=40, brown_sugar_ratio=159.545, eggs=2, bake_time=11 |
| #4 | 0.5990 | butter_pct=18.0911, brown_sugar_ratio=50, eggs=2, bake_time=11 |
Model Quality
| Response | R² | Type |
spread_ratio | 0.0937 | linear |
Full Multi-Objective Output
============================================================
MULTI-OBJECTIVE OPTIMIZATION
Method: Derringer-Suich Desirability Function
============================================================
Overall desirability: D = 0.6570
Response Weight Desirability Predicted Direction
---------------------------------------------------------------------
chewiness_score 1.5 0.5649 6.40 pts ↑
spread_ratio 1.0 0.8240 4.96 ratio ↑
Recommended settings:
butter_pct = 40 %
brown_sugar_ratio = 50 %
eggs = 2 count
bake_time = 11 min
(from observed run #19)
Trade-off summary:
chewiness_score: 6.40 (best observed: 9.70, sacrifice: +3.30)
spread_ratio: 4.96 (best observed: 5.51, sacrifice: +0.55)
Model quality:
chewiness_score: R² = 0.6328 (quadratic)
spread_ratio: R² = 0.0937 (linear)
Top 3 observed runs by overall desirability:
1. Run #19 (D=0.6570): butter_pct=40, brown_sugar_ratio=50, eggs=2, bake_time=11
2. Run #10 (D=0.6270): butter_pct=40, brown_sugar_ratio=159.545, eggs=2, bake_time=11
3. Run #4 (D=0.5990): butter_pct=18.0911, brown_sugar_ratio=50, eggs=2, bake_time=11
Full Analysis Output
=== Main Effects: chewiness_score ===
Factor Effect Std Error % Contribution
--------------------------------------------------------------
butter_pct 6.5000 0.3706 41.9%
eggs 3.9000 0.3706 25.1%
brown_sugar_ratio 3.2000 0.3706 20.6%
bake_time 1.9071 0.3706 12.3%
=== ANOVA Table: chewiness_score ===
Source DF SS MS F p-value
-----------------------------------------------------------------------------
butter_pct 4 24.1364 6.0341 1.596 0.2267
brown_sugar_ratio 4 9.8464 2.4616 0.651 0.6350
eggs 4 20.2407 5.0602 1.338 0.3014
bake_time 4 10.5357 2.6339 0.697 0.6060
Lack of Fit 8 45.0507 5.6313 1.489 0.3065
Pure Error 7 26.4688 3.7812
Error 15 71.5195 3.7812
Total 31 136.2787 4.3961
=== Summary Statistics: chewiness_score ===
butter_pct:
Level N Mean Std Min Max
------------------------------------------------------------
18.0911 1 9.0000 0.0000 9.0000 9.0000
30 8 5.6625 2.4254 2.0000 9.7000
40 14 4.9714 1.8503 2.2000 7.4000
50 8 5.3750 1.9440 2.0000 7.9000
61.9089 1 2.5000 0.0000 2.5000 2.5000
brown_sugar_ratio:
Level N Mean Std Min Max
------------------------------------------------------------
-59.5445 1 2.7000 0.0000 2.7000 2.7000
0 8 5.1875 2.0195 2.0000 7.9000
100 8 5.8500 2.3195 2.0000 9.7000
159.545 1 5.9000 0.0000 5.9000 5.9000
50 14 5.1786 2.1523 2.2000 9.0000
eggs:
Level N Mean Std Min Max
------------------------------------------------------------
-0.19089 1 6.5000 0.0000 6.5000 6.5000
1 8 6.3250 2.2714 2.0000 9.7000
2 14 5.1429 2.1209 2.2000 9.0000
3 8 4.7125 1.7505 2.0000 7.3000
4.19089 1 2.6000 0.0000 2.6000 2.6000
bake_time:
Level N Mean Std Min Max
------------------------------------------------------------
11 14 4.8929 2.1967 2.2000 9.0000
14 8 4.9625 1.5390 2.0000 6.4000
17.5727 1 5.8000 0.0000 5.8000 5.8000
4.42733 1 6.8000 0.0000 6.8000 6.8000
8 8 6.0750 2.5756 2.0000 9.7000
=== Main Effects: spread_ratio ===
Factor Effect Std Error % Contribution
--------------------------------------------------------------
butter_pct 3.5100 0.1582 46.1%
eggs 1.7725 0.1582 23.3%
brown_sugar_ratio 1.5725 0.1582 20.7%
bake_time 0.7600 0.1582 10.0%
=== ANOVA Table: spread_ratio ===
Source DF SS MS F p-value
-----------------------------------------------------------------------------
butter_pct 4 7.0439 1.7610 3.610 0.0298
brown_sugar_ratio 4 2.2256 0.5564 1.141 0.3751
eggs 4 4.3729 1.0932 2.241 0.1133
bake_time 4 1.0116 0.2529 0.518 0.7235
Lack of Fit 8 6.7722 0.8465 1.735 0.2409
Pure Error 7 3.4145 0.4878
Error 15 10.1867 0.4878
Total 31 24.8407 0.8013
=== Summary Statistics: spread_ratio ===
butter_pct:
Level N Mean Std Min Max
------------------------------------------------------------
18.0911 1 2.0000 0.0000 2.0000 2.0000
30 8 3.2150 0.8827 1.6800 4.3900
40 14 3.5557 0.8069 2.2800 4.9100
50 8 3.5888 0.7444 2.5800 4.9600
61.9089 1 5.5100 0.0000 5.5100 5.5100
brown_sugar_ratio:
Level N Mean Std Min Max
------------------------------------------------------------
-59.5445 1 4.9100 0.0000 4.9100 4.9100
0 8 3.3375 0.9077 1.6800 4.3900
100 8 3.4663 0.7614 2.5900 4.9600
159.545 1 3.3600 0.0000 3.3600 3.3600
50 14 3.5014 0.9919 2.0000 5.5100
eggs:
Level N Mean Std Min Max
------------------------------------------------------------
-0.19089 1 4.1600 0.0000 4.1600 4.1600
1 8 3.0475 0.7398 1.6800 4.0200
2 14 3.4507 0.9839 2.0000 5.5100
3 8 3.7563 0.7607 2.5800 4.9600
4.19089 1 4.8200 0.0000 4.8200 4.8200
bake_time:
Level N Mean Std Min Max
------------------------------------------------------------
11 14 3.6193 1.0465 2.0000 5.5100
14 8 3.5387 0.8544 2.5800 4.9600
17.5727 1 3.6900 0.0000 3.6900 3.6900
4.42733 1 2.9300 0.0000 2.9300 2.9300
8 8 3.2650 0.8002 1.6800 4.1600
Optimization Recommendations
=== Optimization: chewiness_score ===
Direction: maximize
Best observed run: #14
butter_pct = 40
brown_sugar_ratio = 50
eggs = 2
bake_time = 11
Value: 9.7
RSM Model (linear, R² = 0.1819, Adj R² = 0.0607):
Coefficients:
intercept +5.2938
butter_pct -0.0028
brown_sugar_ratio -0.1770
eggs -0.3794
bake_time -0.8905
RSM Model (quadratic, R² = 0.5264, Adj R² = 0.1363):
Coefficients:
intercept +5.9324
butter_pct -0.0028
brown_sugar_ratio -0.1769
eggs -0.3794
bake_time -0.8905
butter_pct*brown_sugar_ratio +0.7562
butter_pct*eggs +0.0313
butter_pct*bake_time +0.4437
brown_sugar_ratio*eggs -0.1312
brown_sugar_ratio*bake_time -0.6188
eggs*bake_time +1.1312
butter_pct^2 +0.0140
brown_sugar_ratio^2 -0.3506
eggs^2 -0.2464
bake_time^2 -0.2152
Curvature analysis:
brown_sugar_ratio coef=-0.3506 concave (has a maximum)
eggs coef=-0.2464 concave (has a maximum)
bake_time coef=-0.2152 concave (has a maximum)
butter_pct coef=+0.0140 negligible curvature
Notable interactions:
eggs*bake_time coef=+1.1312 (synergistic)
butter_pct*brown_sugar_ratio coef=+0.7562 (synergistic)
brown_sugar_ratio*bake_time coef=-0.6188 (antagonistic)
butter_pct*bake_time coef=+0.4437 (synergistic)
Predicted optimum (from quadratic model, at observed points):
butter_pct = 50
brown_sugar_ratio = 100
eggs = 1
bake_time = 8
Predicted value: 8.3867
Surface optimum (via L-BFGS-B, quadratic model):
butter_pct = 30
brown_sugar_ratio = 36.9373
eggs = 1
bake_time = 8
Predicted value: 8.3875
Model quality: Moderate fit — use predictions directionally, not precisely.
Factor importance:
1. eggs (effect: 5.3, contribution: 41.3%)
2. brown_sugar_ratio (effect: 3.3, contribution: 25.7%)
3. bake_time (effect: 2.8, contribution: 21.5%)
4. butter_pct (effect: 1.5, contribution: 11.5%)
=== Optimization: spread_ratio ===
Direction: maximize
Best observed run: #12
butter_pct = 40
brown_sugar_ratio = 159.545
eggs = 2
bake_time = 11
Value: 5.51
RSM Model (linear, R² = 0.1737, Adj R² = 0.0513):
Coefficients:
intercept +3.4912
butter_pct +0.0575
brown_sugar_ratio +0.1027
eggs +0.3929
bake_time +0.0185
RSM Model (quadratic, R² = 0.4963, Adj R² = 0.0814):
Coefficients:
intercept +3.1592
butter_pct +0.0575
brown_sugar_ratio +0.1027
eggs +0.3929
bake_time +0.0185
butter_pct*brown_sugar_ratio -0.3356
butter_pct*eggs -0.3394
butter_pct*bake_time -0.0781
brown_sugar_ratio*eggs +0.2556
brown_sugar_ratio*bake_time +0.0469
eggs*bake_time -0.1144
butter_pct^2 +0.1827
brown_sugar_ratio^2 +0.2150
eggs^2 +0.0379
bake_time^2 -0.0205
Curvature analysis:
brown_sugar_ratio coef=+0.2150 convex (has a minimum)
butter_pct coef=+0.1827 convex (has a minimum)
eggs coef=+0.0379 negligible curvature
bake_time coef=-0.0205 negligible curvature
Notable interactions:
butter_pct*eggs coef=-0.3394 (antagonistic)
butter_pct*brown_sugar_ratio coef=-0.3356 (antagonistic)
Predicted optimum (from quadratic model, at observed points):
butter_pct = 30
brown_sugar_ratio = 100
eggs = 3
bake_time = 14
Predicted value: 4.9720
Surface optimum (via L-BFGS-B, quadratic model):
butter_pct = 30
brown_sugar_ratio = 100
eggs = 3
bake_time = 13.1339
Predicted value: 4.9737
Model quality: Weak fit — consider adding center points or using a different design.
Factor importance:
1. brown_sugar_ratio (effect: 2.2, contribution: 43.4%)
2. butter_pct (effect: 1.3, contribution: 26.0%)
3. eggs (effect: 1.3, contribution: 24.7%)
4. bake_time (effect: 0.3, contribution: 5.9%)