← All Use Cases
Box-Behnken Design

Chemical Reactor Optimization

Optimize yield, purity, and cost simultaneously using a design that avoids extreme corner conditions.

Summary

This experiment investigates chemical reactor optimization. Box-Behnken design to optimize yield and purity of a batch reactor process.

The design varies 3 factors: temperature (°C), ranging from 150 to 200, pressure (bar), ranging from 2 to 6, and catalyst (g/L), ranging from 0.5 to 2.0. The goal is to optimize 3 responses: yield (%) (maximize), purity (%) (maximize), and cost (USD) (minimize). Fixed conditions held constant across all runs include reaction time = 60, stirring speed = 300.

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 yield, the most influential factors were pressure (49.5%), catalyst (31.1%), temperature (19.4%). The best observed value was 78.52 (at temperature = 175, pressure = 6, catalyst = 0.5).

For purity, the most influential factors were temperature (52.0%), catalyst (32.9%), pressure (15.1%). The best observed value was 97.99 (at temperature = 175, pressure = 6, catalyst = 2).

For cost, the most influential factors were pressure (56.1%), catalyst (30.1%), temperature (13.8%). The best observed value was 34.05 (at temperature = 175, pressure = 4, catalyst = 1.25).

Recommended Next Steps

The Scenario

You are optimizing a batch chemical reactor. You control three continuous process parameters and want to maximize product yield and purity while minimizing production cost. Running the reactor at all extreme settings simultaneously is risky, so you need a design that avoids corner points.

Why Box-Behnken?

With 3 continuous factors, Box-Behnken gives you 15 runs (vs. 18 for CCD), and every run has at most two factors at their extremes — the third stays at center. This avoids the dangerous corner condition of max temperature + max pressure + max catalyst simultaneously.

Experimental Setup

Factors

FactorLowHighUnit
temperature150200°C
pressure26bar
catalyst0.52.0g/L

Fixed: reaction_time = 60 min, stirring_speed = 300 rpm

Responses

ResponseDirectionUnit
yield↑ maximize%
purity↑ maximize%
cost↓ minimizeUSD

Configuration

use_cases/01_reactor_optimization/config.json
{ "metadata": { "name": "Chemical Reactor Optimization", "description": "Box-Behnken design to optimize yield and purity" }, "factors": [ {"name": "temperature", "levels": ["150", "200"], "type": "continuous", "unit": "°C"}, {"name": "pressure", "levels": ["2", "6"], "type": "continuous", "unit": "bar"}, {"name": "catalyst", "levels": ["0.5", "2.0"], "type": "continuous", "unit": "g/L"} ], "fixed_factors": {"reaction_time": "60", "stirring_speed": "300"}, "responses": [ {"name": "yield", "optimize": "maximize", "unit": "%"}, {"name": "purity", "optimize": "maximize", "unit": "%"}, {"name": "cost", "optimize": "minimize", "unit": "USD"} ], "settings": { "operation": "box_behnken", "test_script": "use_cases/01_reactor_optimization/sim.sh" } }

Experimental Matrix

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

Runtemperaturepressurecatalyst
117520.5
217541.25
320042
420040.5
517541.25
617541.25
715042
820021.25
917522
1020061.25
1115040.5
1217562
1315021.25
1415061.25
1517560.5

Step-by-Step Workflow

1

Preview the design

Terminal
$ doe info --config use_cases/01_reactor_optimization/config.json Plan : Chemical Reactor Optimization Operation : box_behnken Factors : temperature, pressure, catalyst Base runs : 15 Blocks : 1 Total runs: 15 Responses : yield [maximize] (%), purity [maximize] (%), cost [minimize] (USD) Fixed : reaction_time=60, stirring_speed=300
2

Generate the runner script

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

Execute the experiments

Terminal
$ bash use_cases/01_reactor_optimization/results/run.sh
4

Analyze results

Terminal
$ doe analyze --config use_cases/01_reactor_optimization/config.json
5

Get optimization recommendations

Terminal
$ doe optimize --config use_cases/01_reactor_optimization/config.json

Multi-Objective Optimization

This experiment has conflicting objectives (yield (↑), purity (↑), cost (↓)). Use --multi to find the best compromise using desirability functions:

Terminal
$ doe optimize --config use_cases/01_reactor_optimization/config.json --multi
6

Generate the HTML report

Terminal
$ doe report --config use_cases/01_reactor_optimization/config.json \ --output use_cases/01_reactor_optimization/results/report.html

Real-World Lab Workflow

Physical Experiment? Use the Manual Workflow

The automated workflow above uses a simulation script for demonstration. In a real chemistry lab, you'd physically run each reactor experiment and record the results. The DOE Helper Tool fully supports this with record, status, and export-worksheet commands.

Here's how a research chemist would actually run this experiment over several days in the lab:

1

Design the experiment & print a lab worksheet

Generate the design and export a printable worksheet to take to the lab bench.

Terminal
$ doe generate --config use_cases/01_reactor_optimization/config.json --seed 42 $ doe export-worksheet --config use_cases/01_reactor_optimization/config.json \ --format csv --output reactor_worksheet.csv $ doe export-worksheet --config use_cases/01_reactor_optimization/config.json \ --format markdown # Experiment Worksheet: Chemical Reactor Optimization Design: Box-Behnken | 15 runs | 3 factors | 3 responses | Run | temperature (°C) | pressure (bar) | catalyst (g/L) | yield (%) | purity (%) | cost (USD) | Notes | | --- | ------------------- | -------------- | -------------- | --------- | ---------- | ---------- | ----- | | 1 | 200 | 4 | 0.5 | | | | | | 2 | 150 | 6 | 1.25 | | | | | | ... | ... | ... | ... | | | | |

Print the CSV and tape it into your lab notebook, or open it in Excel/Google Sheets. The empty response columns are where you'll record measurements.

2

Check what to run next

Before heading to the lab each day, check which runs are pending.

Terminal
$ doe status --config use_cases/01_reactor_optimization/config.json Experiment: Chemical Reactor Optimization Design: box_behnken | 15 runs | 3 factors | 3 responses Progress: 3/15 complete [####................ ] 20% Completed runs: Run 1: temperature=200, pressure=4, catalyst=0.5 Run 2: temperature=150, pressure=6, catalyst=1.25 Run 3: temperature=200, pressure=6, catalyst=1.25 Pending runs: Run 4: temperature=175, pressure=2, catalyst=0.5 Run 5: temperature=150, pressure=4, catalyst=0.5 ... Next run to complete: Run 4 temperature = 175 °C pressure = 2 bar catalyst = 0.5 g/L Record results with: doe record --config <config> --run 4
3

Run the experiment & record results

After completing a reactor run, enter the measured values. The tool validates input and saves to JSON.

Terminal
$ doe record --config use_cases/01_reactor_optimization/config.json --run 4 Run 4 / 15 (Block 1) temperature = 175 °C pressure = 2 bar catalyst = 0.5 g/L Enter value for 'yield' (%): 62.4 Enter value for 'purity' (%): 91.8 Enter value for 'cost' (USD): 38.50 Saved → use_cases/01_reactor_optimization/results/run_4.json

You can also record all remaining runs in sequence:

Terminal
$ doe record --config use_cases/01_reactor_optimization/config.json --run all
4

Peek at partial results mid-experiment

Don't wait until all 15 runs are done. Use --partial to get early insights while the experiment is still in progress.

Terminal
$ doe analyze --config use_cases/01_reactor_optimization/config.json --partial Partial mode: analyzing 8/15 completed runs (missing: 9, 10, 11, 12, 13, 14, 15) === Main Effects: yield === Factor Effect % Contribution ------------------------------------------- catalyst 12.4 45.2% temperature 9.8 35.7% pressure 5.2 19.0%

This early analysis already reveals that catalyst loading is the dominant factor for yield — valuable insight for planning the remaining runs.

5

Complete analysis & generate report

Once all 15 runs are recorded, run the full analysis pipeline.

Terminal
$ doe analyze --config use_cases/01_reactor_optimization/config.json $ doe optimize --config use_cases/01_reactor_optimization/config.json $ doe report --config use_cases/01_reactor_optimization/config.json \ --output reactor_report.html

Why This Workflow Works

The analysis pipeline doesn't care how results were produced. Whether you ran a simulation, measured products from a real reactor, or collected data from a manufacturing line — as long as the response values end up in run_N.json files, the analysis, optimization, and reporting work identically. The record command handles the JSON creation so you never have to edit files manually.

Interpreting the Results

Key Findings

Trade-offs

Multi-Objective Conflict

Higher temperature increases yield but also increases cost. Higher catalyst improves purity but adds cost. There is no single setting that maximizes yield AND purity while minimizing cost — the experimenter must decide which response matters most, or find a compromise.

Next Steps

  1. Fit a quadratic RSM model to each response
  2. Construct a desirability function that weights the three responses
  3. Run confirmation experiments at the predicted optimum
  4. Narrow the factor ranges and run another Box-Behnken for fine-tuning

Features Exercised

FeatureValue
Design typebox_behnken
Factor typescontinuous (all 3)
Arg styledouble-dash
Responses3 (yield ↑, purity ↑, cost ↓)
Total runs15
Key featureMulti-response RSM, avoids corner points

Analysis Results

Generated from actual experiment runs using the DOE Helper Tool.

Response: yield

Pressure (46.5%) and catalyst (42.8%) dominate yield, with temperature playing a minor role.

Pareto Chart

Pareto chart for yield

Main Effects Plot

Main effects plot for yield

Response: purity

Temperature (40.7%) and catalyst (32.2%) dominate purity, making them the key levers for product quality.

Pareto Chart

Pareto chart for purity

Main Effects Plot

Main effects plot for purity

Response: cost

Pressure (41.9%) and catalyst (40.9%) dominate cost, suggesting these factors must be balanced against yield gains.

Pareto Chart

Pareto chart for cost

Main Effects Plot

Main effects plot for cost

Response Surface Plots

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

📊

How to Read These Surfaces

Each plot shows predicted response (vertical axis) across two factors while other factors are held at center. Red dots are actual experimental observations.

  • Flat surface — these two factors have little effect on the response.
  • Tilted plane — strong linear effect; moving along one axis consistently changes the response.
  • Curved/domed surface — quadratic curvature; there is an optimum somewhere in the middle.
  • Saddle shape — significant interaction; the best setting of one factor depends on the other.
  • Red dots far from surface — poor model fit in that region; be cautious about predictions there.

yield (%) — R² = 0.693, Adj R² = 0.140
Moderate fit — surface shows general trends but some noise remains.
Curvature detected in catalyst, pressure — look for a peak or valley in the surface.
Strongest linear driver: temperature (decreases yield).
Notable interaction: temperature × pressure — the effect of one depends on the level of the other. Look for a twisted surface.

purity (%) — R² = 0.843, Adj R² = 0.561
Moderate fit — surface shows general trends but some noise remains.
Curvature detected in pressure, temperature — look for a peak or valley in the surface.
Strongest linear driver: pressure (increases purity).
Notable interaction: temperature × catalyst — the effect of one depends on the level of the other. Look for a twisted surface.

cost (USD) — R² = 0.642, Adj R² = -0.002
Moderate fit — surface shows general trends but some noise remains.
Curvature detected in catalyst, temperature — look for a peak or valley in the surface.
Strongest linear driver: temperature (decreases cost).
Notable interaction: pressure × catalyst — the effect of one depends on the level of the other. Look for a twisted surface.

cost: pressure vs catalyst

RSM surface: cost — pressure vs catalyst

cost: temperature vs catalyst

RSM surface: cost — temperature vs catalyst

cost: temperature vs pressure

RSM surface: cost — temperature vs pressure

purity: pressure vs catalyst

RSM surface: purity — pressure vs catalyst

purity: temperature vs catalyst

RSM surface: purity — temperature vs catalyst

purity: temperature vs pressure

RSM surface: purity — temperature vs pressure

yield: pressure vs catalyst

RSM surface: yield — pressure vs catalyst

yield: temperature vs catalyst

RSM surface: yield — temperature vs catalyst

yield: temperature vs pressure

RSM surface: yield — temperature vs pressure

Full Analysis Output

doe analyze
=== Main Effects: yield === Factor Effect Std Error % Contribution -------------------------------------------------------------- temperature 9.1475 2.0585 40.5% catalyst 7.4375 2.0585 33.0% pressure 5.9764 2.0585 26.5% === Summary Statistics: yield === temperature: Level N Mean Std Min Max ------------------------------------------------------------ 150 4 64.6450 5.1577 60.6600 71.6600 175 7 65.5600 9.3573 52.9300 78.5200 200 4 73.7925 4.7382 67.5500 77.8400 pressure: Level N Mean Std Min Max ------------------------------------------------------------ 2 4 68.4550 7.2435 60.8300 77.8400 4 7 69.3414 9.1916 52.9300 78.5200 6 4 63.3650 6.5765 55.4200 69.8300 catalyst: Level N Mean Std Min Max ------------------------------------------------------------ 0.5 4 70.9900 1.4384 69.7700 72.7000 1.25 7 67.7857 9.2044 52.9300 78.5200 2 4 63.5525 9.3752 55.4200 77.0800 === Main Effects: purity === Factor Effect Std Error % Contribution -------------------------------------------------------------- catalyst 6.3261 1.3850 43.8% pressure 4.1586 1.3850 28.8% temperature 3.9521 1.3850 27.4% === Summary Statistics: purity === temperature: Level N Mean Std Min Max ------------------------------------------------------------ 150 4 90.0375 3.3817 85.3000 92.5500 175 7 87.3429 6.2959 78.9100 97.6500 200 4 91.2950 5.3626 85.4600 97.9900 pressure: Level N Mean Std Min Max ------------------------------------------------------------ 2 4 89.5800 4.5572 83.0000 92.7400 4 7 90.4586 3.9188 85.4600 97.6500 6 4 86.3000 8.2292 78.9100 97.9900 catalyst: Level N Mean Std Min Max ------------------------------------------------------------ 0.5 4 87.1000 3.4632 83.0000 90.0300 1.25 7 92.1486 4.7238 85.3000 97.9900 2 4 85.8225 6.0253 78.9100 92.3900 === Main Effects: cost === Factor Effect Std Error % Contribution -------------------------------------------------------------- temperature 15.4050 2.8932 54.4% pressure 9.1025 2.8932 32.1% catalyst 3.8125 2.8932 13.5% === Summary Statistics: cost === temperature: Level N Mean Std Min Max ------------------------------------------------------------ 150 4 44.4625 7.4242 36.6400 53.1400 175 7 48.4843 10.9213 34.0500 65.5200 200 4 59.8675 10.8260 47.7600 73.4600 pressure: Level N Mean Std Min Max ------------------------------------------------------------ 2 4 53.1675 6.8669 45.5900 62.2200 4 7 52.5400 13.7655 34.0500 73.4600 6 4 44.0650 9.2419 36.4300 55.4300 catalyst: Level N Mean Std Min Max ------------------------------------------------------------ 0.5 4 52.7475 3.8037 47.8100 56.0300 1.25 7 49.9971 11.8208 34.0500 65.5200 2 4 48.9350 16.7759 36.4300 73.4600

Optimization Recommendations

doe optimize
=== Optimization: yield === Direction: maximize Best observed run: #3 temperature = 175 pressure = 6 catalyst = 0.5 Value: 78.52 RSM Model (linear, R² = 0.06): Coefficients: intercept: +67.5113 temperature: -0.4100 pressure: +2.1775 catalyst: +1.3750 Predicted optimum: temperature = 175 pressure = 6 catalyst = 2 Predicted value: 71.0638 Factor importance: 1. temperature (effect: 9.9, contribution: 48.8%) 2. pressure (effect: 7.6, contribution: 37.6%) 3. catalyst (effect: 2.8, contribution: 13.6%) === Optimization: purity === Direction: maximize Best observed run: #9 temperature = 175 pressure = 4 catalyst = 1.25 Value: 97.99 RSM Model (linear, R² = 0.16): Coefficients: intercept: +89.1153 temperature: +1.0962 pressure: +2.2000 catalyst: +1.3638 Predicted optimum: temperature = 175 pressure = 6 catalyst = 2 Predicted value: 92.6791 Factor importance: 1. pressure (effect: 6.9, contribution: 48.6%) 2. temperature (effect: 4.6, contribution: 32.2%) 3. catalyst (effect: 2.7, contribution: 19.2%) === Optimization: cost === Direction: minimize Best observed run: #13 temperature = 200 pressure = 2 catalyst = 1.25 Value: 34.05 RSM Model (linear, R² = 0.01): Coefficients: intercept: +50.4473 temperature: -0.4200 pressure: +1.4512 catalyst: +0.0688 Predicted optimum: temperature = 150 pressure = 6 catalyst = 1.25 Predicted value: 52.3186 Factor importance: 1. temperature (effect: 9.4, contribution: 52.0%) 2. pressure (effect: 7.4, contribution: 41.0%) 3. catalyst (effect: 1.3, contribution: 7.1%)

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

Per-Response Desirability

ResponseWeightDesirabilityPredictedDir
yield 1.5
0.5648
67.55 0.5648 67.55 %
purity 2.0
0.9545
97.99 0.9545 97.99 %
cost 1.0
0.6383
47.76 0.6383 47.76 USD

Recommended Settings

FactorValue
temperature150 °C
pressure4 bar
catalyst0.5 g/L

Source: from observed run #9

Trade-off Summary

Sacrifice = how much worse than single-objective best.

ResponsePredictedBest ObservedSacrifice
purity97.9997.99+0.00
cost47.7634.05+13.71

Top 3 Runs by Desirability

RunDFactor Settings
#30.6895temperature=175, pressure=4, catalyst=1.25
#60.6436temperature=150, pressure=4, catalyst=2

Model Quality

ResponseType
purity0.1730linear
cost0.0211linear

Full Multi-Objective Output

doe optimize --multi
============================================================ MULTI-OBJECTIVE OPTIMIZATION Method: Derringer-Suich Desirability Function ============================================================ Overall desirability: D = 0.7328 Response Weight Desirability Predicted Direction --------------------------------------------------------------------- yield 1.5 0.5648 67.55 % ↑ purity 2.0 0.9545 97.99 % ↑ cost 1.0 0.6383 47.76 USD ↓ Recommended settings: temperature = 150 °C pressure = 4 bar catalyst = 0.5 g/L (from observed run #9) Trade-off summary: yield: 67.55 (best observed: 78.52, sacrifice: +10.97) purity: 97.99 (best observed: 97.99, sacrifice: +0.00) cost: 47.76 (best observed: 34.05, sacrifice: +13.71) Model quality: yield: R² = 0.1193 (linear) purity: R² = 0.1730 (linear) cost: R² = 0.0211 (linear) Top 3 observed runs by overall desirability: 1. Run #9 (D=0.7328): temperature=150, pressure=4, catalyst=0.5 2. Run #3 (D=0.6895): temperature=175, pressure=4, catalyst=1.25 3. Run #6 (D=0.6436): temperature=150, pressure=4, catalyst=2
← All Use Cases Next: Web App A/B Testing →