Optimization Toolbox: Getting started
← Optimization Toolbox overview · Modeling guide · Solver guide · Examples · Reference
What you will learn
This guide uses the supplied workbook exactly as published. By the end you should be able to:
- identify the model-definition and result sheets;
- solve the baseline linear program;
- select another mathematical problem without changing Python;
- apply a named scenario;
- compare local and global search on the included multimodal model;
- distinguish solver termination from the Toolbox’s independent feasibility check;
- know which sheets to edit when authoring a new model.
Workbook tour
The workbook is deliberately split into definition sheets and review sheets.
Definition sheets
- Start — choose the active model and solve controls.
- Variables — define decision variables and scalar parameters.
- Linear Model — define linear objectives and ranged linear constraints.
- Quadratic & Conic — add quadratic objective terms. Conic support is planned but not active.
- Expressions — define safe nonlinear objectives, constraints, residuals, and equations.
- Scenarios — define named input/bound/coefficient overrides.
Review sheets
- Results — solution summary, variable values, and constraint activity/slack.
- Analysis — Pareto points, local/global comparisons, or model-specific analysis.
- Diagnostics — classification, feasibility, scaling, and capability evidence.
Blue cells are authored/input cells. Green cells are notebook publications populated through BF.OUTPUT formulas.
First solve: Product Mix
The default model ID is product_mix.
1. Read the decision variables
On Variables, the model has two continuous decisions:
| Variable | Meaning | Lower | Upper |
|---|---|---|---|
chairs |
Chairs to produce | 0 | 1,000 |
desks |
Desks to produce | 0 | 50 |
2. Read the objective
On Linear Model, the named objective Profit contains:
- 45 per chair;
- 80 per desk.
The Start sheet leaves Objective direction at Auto. For the supplied product_mix fixture, Auto means maximize.
3. Read the constraints
The same sheet defines two resource constraints:
- Labor:
2 * chairs + 4 * desks <= 240 - Material:
3 * chairs + 5 * desks <= 300
The desk demand cap is represented as the variable upper bound of 50 rather than as a redundant linear-constraint row.
4. Read Results
The baseline acceptance result is:
- Status:
OPTIMAL - Objective: 4,750
- Chairs: approximately 16.6667
- Desks: 50
- Maximum modeled violation: 0 within solver precision
Do not stop at the objective. Review the Constraint status table for activity, slack, binding state, and LP marginals.
5. Read Diagnostics
Diagnostics should identify the model as LP and show a passing independent feasibility check. This second check is deliberate: it recomputes the modeled constraints from the returned decision vector instead of blindly trusting a solver success flag.
Change the active problem
On Start, set Active model to another supplied model ID.
| Model ID | Demonstrates |
|---|---|
workforce |
Integer workforce scheduling / MILP |
portfolio |
Quadratic portfolio objective with linear constraints |
marketing |
Smooth constrained nonlinear objective |
parameter_fit |
Nonlinear least-squares parameter estimation |
equations |
Bounded nonlinear equation system |
goal_plan |
Two-objective epsilon-constraint Pareto frontier |
multimodal |
Local versus bounded global search |
infeasible |
Explicit infeasibility handling |
The model rows live together in the input sheets and are filtered by the active Model ID. Switching models does not swap notebooks or hard-coded business logic.
Run a named scenario
The Scenarios sheet includes three examples:
- Product Mix —
High margin desks - Portfolio —
Higher return target - Marketing —
Tight budget
To run one:
- Select the corresponding active model.
- Set Start → Scenario to the exact scenario name.
- Let the notebook rerun.
- Compare Results with the baseline you recorded.
A scenario changes the compiled model before solving. It does not overwrite the base rows.
The beta applies one named scenario at a time. It does not claim to perform an automatic batch scenario sweep. For systematic sensitivity work, create explicit scenario names and evaluate them as controlled runs.
Compare local and global search
Set Active model to multimodal. Its objective is the two-variable Himmelblau function over finite bounds.
With Solve mode = Recommended, the global workflow compares:
- local SLSQP from the authored initial point;
- seeded MultiStart;
- Differential Evolution;
- SHGO.
Open Analysis to compare objective, feasibility, runtime, evaluation count, and random seed where relevant.
Then set Solve mode = Local. The result intentionally becomes a local solve only. This is useful for demonstrating why a successful local optimum and a global-search result are different claims.
For stochastic runs, keep Random seed unchanged when you want reproducibility. Change it when you intentionally want a different stochastic search trajectory.
See Global optimization for the detailed semantics.
Generate a Pareto frontier
Set Active model to goal_plan.
This model has two named linear objectives:
CostEmissions
The Toolbox solves endpoints and then repeatedly minimizes Cost while tightening an upper bound on Emissions. Pareto points on Start controls how many epsilon values are attempted, from 3 through 31.
Open Analysis to see the frontier table. Each row reports the two objective values, the epsilon bound, solve status, solver, and maximum violation.
The current beta selects the middle feasible frontier point as the representative decision vector on Results. Use Analysis for the full tradeoff rather than interpreting that one point as uniquely preferred.
Diagnose an infeasible model
Set Active model to infeasible.
The model deliberately requires:
x + y >= 10x + y <= 5
No vector can satisfy both. The correct result is therefore INFEASIBLE.
This fixture exists because failure behavior is part of an optimization product. A workbench that only demonstrates successful solves gives reviewers no evidence about what happens when business rules conflict.
Edit a supplied model
For a safe first edit, change one coefficient rather than adding a new model.
Example: Product Mix profit scenario without using the Scenarios sheet:
- Open Linear Model.
- Find the
product_mix / Profit / desksrow. - Change its coefficient from 80 to another value.
- Return to Results and inspect the new objective and decisions.
- Restore the original value when finished.
For repeatable business use, prefer a named scenario to directly overwriting a base coefficient.
Create a new model
A new model is a coordinated set of rows sharing one new Model ID.
At minimum:
- Add the ID and label to the model catalog on Start.
- Add one or more decision variables on Variables.
- Add an objective through Linear Model, Quadratic & Conic, or Expressions.
- Add constraints where required.
- Set Objective direction explicitly to Minimize or Maximize.
- Set Active model to the new ID.
- Review Diagnostics before trusting the result.
Do not begin a production model from undocumented column guesses. Use the full Modeling guide.
Read solver statuses correctly
The Toolbox uses deliberately conservative terms:
OPTIMAL— reserved for LP/MILP solver outcomes that justify the claim.LOCAL_OPTIMUM— a successful local nonlinear/least-squares solve that passes independent feasibility.FEASIBLE_SOLUTION— a feasible point without a stronger optimum claim, including equation-solving success.BEST_FOUND— best independently feasible candidate among bounded global-search methods; not a proof of global optimality.PARETO_SET— a set of nondominated tradeoff points was produced.INFEASIBLE— solver reports no feasible solution for the modeled constraints.UNBOUNDED— LP/MILP solver reports the objective can improve without bound.FAILED— the solve or independent acceptance checks did not justify a stronger status.
The complete field definitions are in Reference → Status glossary.
Next steps
- To author or audit model rows: Modeling guide.
- To understand solver selection and MATLAB differences: Solver guide.
- To understand local/global claims: Global optimization guide.
- To study each supplied formulation: Worked examples.
- For exact columns, output schemas, and errors: Reference.