← All Use Cases
🍳
Central Composite Design

Cookie Texture Optimization

Central composite design to control chewiness vs crispness by tuning butter ratio, sugar type blend, egg count, and baking time

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

Experimental Setup

Factors

FactorLowHighUnit
butter_pct3050%
brown_sugar_ratio0100%
eggs13count
bake_time814min

Fixed: oven_temp = 175, flour_type = all_purpose

Responses

ResponseDirectionUnit
chewiness_score↑ maximizepts
spread_ratio↑ maximizeratio

Configuration

use_cases/95_cookie_texture/config.json
{ "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.

Runbutter_pctbrown_sugar_ratioeggsbake_time
1405024.42733
230100114
350038
450100314
540504.1908911
6500314
740-59.5445211
83010038
94050211
105010018
114050211
12500114
134050211
145010038
154050-0.1908911
1618.091150211
174050211
18300114
1950100114
204050211
2130038
224050211
2361.908950211
24300314
254050211
263010018
274050217.5727
284050211
2950018
3040159.545211
3130018
3230100314

Step-by-Step Workflow

1

Preview the design

Terminal
$ doe info --config use_cases/95_cookie_texture/config.json
2

Generate the runner script

Terminal
$ 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

Terminal
$ bash use_cases/95_cookie_texture/results/run.sh
4

Analyze results

Terminal
$ doe analyze --config use_cases/95_cookie_texture/config.json
5

Get optimization recommendations

Terminal
$ 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.

Terminal
$ doe optimize --config use_cases/95_cookie_texture/config.json --multi
7

Generate the HTML report

Terminal
$ doe report --config use_cases/95_cookie_texture/config.json \ --output use_cases/95_cookie_texture/results/report.html

Features Exercised

FeatureValue
Design typecentral_composite
Factor typescontinuous (all 4)
Arg styledouble-dash
Responses2 (chewiness_score ↑, spread_ratio ↑)
Total runs32

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

SourceDFSSMSFp-value
SourceDFSSMSFp-value
butter_pct424.13646.03411.5960.2267
brown_sugar_ratio49.84642.46160.6510.6350
eggs420.24075.06021.3380.3014
bake_time410.53572.63390.6970.6060
LackofFit845.05075.6313
PureError726.4688
Error1571.51953.7812
Total31136.27874.3961

Pareto Chart

Pareto chart for chewiness_score

Main Effects Plot

Main effects plot for chewiness_score

Normal Probability Plot of Effects

Normal probability plot for chewiness_score

Half-Normal Plot of Effects

Half-normal plot for chewiness_score

Model Diagnostics

Model diagnostics for chewiness_score

Response: spread_ratio

Top factors: butter_pct (46.1%), eggs (23.3%), brown_sugar_ratio (20.7%).

ANOVA

SourceDFSSMSFp-value
SourceDFSSMSFp-value
butter_pct47.04391.76103.6100.0298
brown_sugar_ratio42.22560.55641.1410.3751
eggs44.37291.09322.2410.1133
bake_time41.01160.25290.5180.7235
LackofFit86.77220.8465
PureError73.4145
Error1510.18670.4878
Total3124.84070.8013

Pareto Chart

Pareto chart for spread_ratio

Main Effects Plot

Main effects plot for spread_ratio

Normal Probability Plot of Effects

Normal probability plot for spread_ratio

Half-Normal Plot of Effects

Half-normal plot for spread_ratio

Model Diagnostics

Model diagnostics for spread_ratio

Response Surface Plots

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

chewiness score brown sugar ratio vs bake time

RSM surface: chewiness score brown sugar ratio vs bake time

chewiness score brown sugar ratio vs eggs

RSM surface: chewiness score brown sugar ratio vs eggs

chewiness score butter pct vs bake time

RSM surface: chewiness score butter pct vs bake time

chewiness score butter pct vs brown sugar ratio

RSM surface: chewiness score butter pct vs brown sugar ratio

chewiness score butter pct vs eggs

RSM surface: chewiness score butter pct vs eggs

chewiness score eggs vs bake time

RSM surface: chewiness score eggs vs bake time

spread ratio brown sugar ratio vs bake time

RSM surface: spread ratio brown sugar ratio vs bake time

spread ratio brown sugar ratio vs eggs

RSM surface: spread ratio brown sugar ratio vs eggs

spread ratio butter pct vs bake time

RSM surface: spread ratio butter pct vs bake time

spread ratio butter pct vs brown sugar ratio

RSM surface: spread ratio butter pct vs brown sugar ratio

spread ratio butter pct vs eggs

RSM surface: spread ratio butter pct vs eggs

spread ratio eggs vs bake time

RSM surface: 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

ResponseWeightDesirabilityPredictedDir
chewiness_score 1.5
0.5649
6.40 0.5649 6.40 pts
spread_ratio 1.0
0.8240
4.96 0.8240 4.96 ratio

Recommended Settings

FactorValue
butter_pct40 %
brown_sugar_ratio50 %
eggs2 count
bake_time11 min

Source: from observed run #19

Trade-off Summary

Sacrifice = how much worse than single-objective best.

ResponsePredictedBest ObservedSacrifice
spread_ratio4.965.51+0.55

Top 3 Runs by Desirability

RunDFactor Settings
#100.6270butter_pct=40, brown_sugar_ratio=159.545, eggs=2, bake_time=11
#40.5990butter_pct=18.0911, brown_sugar_ratio=50, eggs=2, bake_time=11

Model Quality

ResponseType
spread_ratio0.0937linear

Full Multi-Objective Output

doe optimize --multi
============================================================ 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

doe analyze
=== 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

doe optimize
=== 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%)
← All Use Cases Next: Fermented Hot Sauce Formulation →