Optimization Toolbox: Getting started

Solve the first model, change scenarios, compare solvers, and learn the Optimization Toolbox workbook workflow.

← 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:

  1. Select the corresponding active model.
  2. Set Start → Scenario to the exact scenario name.
  3. Let the notebook rerun.
  4. 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.

Generate a Pareto frontier

Set Active model to goal_plan.

This model has two named linear objectives:

  • Cost
  • Emissions

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 >= 10
  • x + 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:

  1. Open Linear Model.
  2. Find the product_mix / Profit / desks row.
  3. Change its coefficient from 80 to another value.
  4. Return to Results and inspect the new objective and decisions.
  5. 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:

  1. Add the ID and label to the model catalog on Start.
  2. Add one or more decision variables on Variables.
  3. Add an objective through Linear Model, Quadratic & Conic, or Expressions.
  4. Add constraints where required.
  5. Set Objective direction explicitly to Minimize or Maximize.
  6. Set Active model to the new ID.
  7. 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