Design of Experiments

Central Composite Design (CCD): Generate a 2nd-order DoE in Plain English

A Central Composite Design (CCD) lets you fit a quadratic response surface from 2 to 6 factors with as few runs as possible. Lattice generates the design matrix, randomizes run order, and hands it back ready for the lab or the line.

When CCD is the right design

You have already done a screening pass — maybe a fractional factorial — and you know which 2–6 factors actually matter. Now you want the optimum. CCD is the workhorse for second-order response-surface modeling: it can estimate main effects, two-factor interactions, and pure quadratic curvature, all from a single design.

If you have more than six factors, screen first with a fractional factorial. If your factors include hard categorical levels, consider a Definitive Screening Design instead. If runs are extremely cheap, a full factorial may be simpler.

What Lattice computes

The engine calls pyDOE3's CCD generator with the variant you choose: ccc rotatable (default), cci inscribed, or ccf face-centered. It then decodes coded levels back to your real units, randomizes run order with a fixed seed (so the design is reproducible later), and emits a data frame with one row per run.

The output object includes the design matrix, the alpha value used, the number of factorial / axial / center runs, an orthogonality check, and a trace_id. The same factor configuration always yields the same run sheet — you can hand this to a colleague, they can reproduce it months later.

1 · Intent → method

An LLM picks doe_generate_ccd from a fixed catalog.

2 · Method → numbers

Deterministic Python engine runs the math. Same input → same output.

3 · Numbers → plain language

A second LLM translates the result into your domain’s vocabulary.

How to phrase your request

The planner picks doe_generate_ccd from prompts like:

If you skip the alpha or center-point count, Lattice picks rotatable + 5 center replicates and tells you so in the result, so you can override.

Reading the run sheet

Each row is one experiment. Columns include the coded levels (-1 / 0 / +1 / ±α), the decoded real units, a block column (if you asked for blocking), and a run_order column shuffled by the seed. After running the experiments and collecting responses, hand the data back to Lattice and ask for rsm_fit_quadratic to fit the surface, then optimize_constrained to find the optimum.

Common mistakes Lattice guards against

People often pick CCD when they really need screening — running a 19-run CCD on six factors when only two matter is wasteful. Lattice asks for the screening result if you skip from "I have factors" straight to "build CCD." Another common slip is interpreting axial points as physically reachable when alpha > 1 — Lattice prints the actual real-unit values for the axial runs so you can sanity-check before signing off.

  • How many runs does CCD use?

    For k factors: 2^k factorial points + 2k axial points + n center replicates. With k = 3 and 5 center reps you get 8 + 6 + 5 = 19 runs. Lattice prints the count before you commit.

  • Should I pick rotatable, face-centered, or inscribed?

    Rotatable (alpha = 4th-root of factorial points) is the default for unconstrained ranges. Face-centered (alpha = 1) suits hard physical limits. Inscribed pulls everything into the original box. Lattice surfaces the choice with one-line guidance per option.

  • Can I add blocking?

    Yes. CCD splits naturally into orthogonal blocks (factorial portion vs axial portion). Lattice exposes a 'blocks' parameter and confirms that the chosen size keeps the design orthogonal.

Tool input schema

Schema for doe_generate_ccd not exported yet (run pnpm export:registry).