Central Composite Design¶
This tutorial illustrates the use of a face-centred central composite design to investigate and optimize the operating conditions of a coal mill.
Two continuous process factors are considered:
Coal load, :math:`X_1`: ranging from \(5\) to \(15\ \mathrm{tons\,h^{-1}}\);
Classifier position, :math:`X_2`: ranging from \(1\) to \(3\).
The classifier is a curtain that partially closes the mill. Its experimental levels correspond to:
\(1\): classifier closed;
\(2\): classifier open at \(50\%\);
\(3\): classifier fully open.
Previous process knowledge suggested that both factors could exhibit nonlinear behaviour. A two-level factorial design would therefore be insufficient because it cannot estimate quadratic effects. A central composite design is used to estimate a complete second-order model.
Experimental design¶
A face-centred central composite design combines:
four factorial points;
four axial points with \(\alpha=1\);
one centre point.
For two factors, the complete design contains:
experiments.
The investigated factor levels are:
Factor |
Low level, \(-1\) |
Centre, \(0\) |
High level, \(+1\) |
|---|---|---|---|
Coal load |
\(5\) |
\(10\) |
\(15\) |
Classifier position |
\(1\) |
\(2\) |
\(3\) |
Because \(\alpha=1\), the axial points lie at the centres of the edges of the factorial domain. The complete design therefore explores a square experimental region using its four vertices, four edge midpoints, and centre.
Response variables¶
Two responses are measured for each experiment:
:math:`Y_1`: percentage of small particles with diameter below 200 mesh;
:math:`Y_2`: percentage of large particles with diameter above 50 mesh.
The objective is not simply to maximize or minimize a single response, but to identify operating conditions producing a material of acceptable quality:
and
Within the region satisfying both requirements, the most profitable operating condition is the one corresponding to the highest feasible coal load.
Model specification¶
For each response, a complete second-order polynomial model is considered:
where:
\(\beta_0\) is the intercept;
\(\beta_1\) and \(\beta_2\) describe the linear effects;
\(\beta_{12}\) describes the interaction between coal load and classifier position;
\(\beta_{11}\) and \(\beta_{22}\) describe the quadratic effects;
\(\varepsilon\) represents the experimental error.
The model contains six coefficients. Since nine experiments are performed, three residual degrees of freedom are available for estimating the model error and evaluating coefficient significance.
In this notebook, doetools is used to:
define the two continuous factors;
generate the nine-run face-centred central composite design;
inspect and visualize the experimental region;
specify the complete second-order model;
fit separate models for the two responses;
identify the region satisfying both quality requirements.
This example is adapted from Leardi (2009), Experimental design in chemistry: A tutorial, published in Analytica Chimica Acta, DOI: https://doi.org/10.1016/j.aca.2009.06.015.
[1]:
# This is needed to display plotly figures in the Jupyter notebook, not for the library itself
import plotly.io as pio
pio.renderers.default = "notebook"
# Fundamental imports
from doetools import CentralCompositeDesign as CCD
from doetools import ContinuousFactor as CF
from doetools import ModelTerms, suggest_design
2. Design Initialization and Exploration¶
2.1 Factor Definition and Design Creation¶
Define the experimental factors and create the CCD object. For this tutorial, we use a face-centered design (CCF) where axial points are located at the face of the factor space cube (α = 1). This is a great design when we want to fit a quadratic model and we cannot extend the factors bound.
[2]:
factors = {
"Load" : CF(n_levels = 3, lower_bound=5, upper_bound=15),
"Classifier" : CF(n_levels = 3, lower_bound=1, upper_bound=3)
}
[3]:
# Obtain design suggestions for the optimization phase of the experiment
suggested_design = suggest_design(factors,
phase="optimization",
model_order="quadratic",
max_experiments=None,
constraints=False,
performed_exp=False
)
####################################################################################################
# DoE Advisor Recommendations
# Phase: OPTIMIZATION
# Process Factors: 2 (Continuous: 2, Categorical: 0)
# Mixture Factors: 0
# Model Order: Quadratic
# Performed Experiments: No
# Non-rectangular Constraints: No
####################################################################################################
====================================================================================================
Design: Full Factorial Design (3-level)
Number of runs: 9
Pros:
• Simple, structured design with good coverage of the factor space
• Includes center and mid-level points to capture curvature
• Fits within budget (9 ≤ None runs)
Cons:
• Run count grows quickly with the number of factors (3^k)
• Can consume a large fraction of the budget, leaving limited room for replication or follow-up
Use case:
• Optimization when a full 3-level factorial is feasible and you want comprehensive coverage of
the factor space to fit a quadratic model without relying on a specific RSM structure
====================================================================================================
====================================================================================================
Design: Central Composite Design (CCD)
Number of runs: 11
Pros:
• Efficient for fitting second-order (quadratic) response surface models
• Standard, widely adopted design with a clear analysis workflow
Cons:
• May require axial (star) points outside the original factor ranges unless face-centered
• Extremes can be impractical or infeasible under tight operating constraints
Use case:
• Optimization when a quadratic response surface is expected and you want a well-established
design to locate and characterize an optimum
Note:
• If factor bounds are tight, consider a face-centered CCD or switch to a constrained
(e.g., D-optimal) design.
====================================================================================================
[4]:
# Define the design and print design and factor summary to inspect the design
design = CCD(factors=factors, center_points=1, design="ccf")
design.get_design_summary()
[4]:
| Design | Runs | Replicates | Center Points | Continuous | Categorical | Mixture Components | |
|---|---|---|---|---|---|---|---|
| Central Composite | 9 | 0 | 1 | 2 | 0 | 0 |
[5]:
# Get factor summary to inspect the design
design.get_factor_summary()
[5]:
| Factor | Type | Levels Count | Levels | Coded Levels | Reference Level | Lower Bound | Upper Bound | |
|---|---|---|---|---|---|---|---|---|
| 0 | Load | cont | 3 | [5.0, 10.0, 15.0] | [-1.0, 0.0, 1.0] | <NA> | 5 | 15 |
| 1 | Classifier | cont | 3 | [1.0, 2.0, 3.0] | [-1.0, 0.0, 1.0] | <NA> | 1 | 3 |
[6]:
# View the design matrix
design_matrix = design.get_design_matrix()
design_matrix
[6]:
| Load | Classifier | |
|---|---|---|
| 0 | 5.0 | 1.0 |
| 1 | 5.0 | 3.0 |
| 2 | 15.0 | 1.0 |
| 3 | 15.0 | 3.0 |
| 4 | 15.0 | 2.0 |
| 5 | 5.0 | 2.0 |
| 6 | 10.0 | 3.0 |
| 7 | 10.0 | 1.0 |
| 8 | 10.0 | 2.0 |
[7]:
# The design can be easily visualized in 3D with "plot_design" method
fig00 = design.plot_design(ax1="Load", ax2="Classifier", coded=True)
fig00
2.2 Export Design for Experimentation¶
Export the design matrix to Excel in natural units for laboratory use. The exported file:
Contains all experimental runs with factor settings
Includes empty columns (Y1, Y2) for recording measured responses
Uses natural units for ease of experimental execution
Is not randomized (set
randomize=Trueto prevent systematic bias in practice)
Next step: Conduct experiments following the design matrix and record observed responses in the Excel file.
[8]:
design.export_experiments(responses = ["Y1", "Y2"],
randomize=False,
destination = "01_ccd_design.xlsx",
coded=False)
3. Model Specification¶
Define the regression model structure for response surface analysis. A full quadratic model includes:
Where:
β₀ (Intercept): Baseline response at the center point
βᵢ (Main effects): Linear effect of each factor
βᵢⱼ (Two-factor interactions): Combined effect of factor pairs
βᵢᵢ (Quadratic terms): Curvature in the response surface
This model structure enables detection of optimal conditions (maxima, minima, saddle points) within the experimental region.
[9]:
# Set the model terms for the design
model_terms = ModelTerms(intercept=True,
pro_main = "all",
pro_int2 = "all",
pro_quadratic = "all")
design.set_model_terms(model_terms)
4. Leverage Analysis¶
4.1 Leverage Values¶
Leverage (hᵢᵢ) quantifies how much each experimental point influences the fitted model. It represents the diagonal elements of the hat matrix: H = X(X’X)⁻¹X’.
[10]:
leverages = design.get_leverages()
leverages
[10]:
| Leverage | |
|---|---|
| 0 | 0.805556 |
| 1 | 0.805556 |
| 2 | 0.805556 |
| 3 | 0.805556 |
| 4 | 0.555556 |
| 5 | 0.555556 |
| 6 | 0.555556 |
| 7 | 0.555556 |
| 8 | 0.555556 |
4.2 Leverage Visualization¶
Visualize how leverage varies across the factor space.
[11]:
fig0, fig1 = design.plot_leverage(ax1 = "Load",
ax2 = "Classifier")
2D Leverage Plot¶
[12]:
fig0