Optimization
Optimization opens a native decision report beside its declared assumptions. Use it to inspect production quantities, resource use, feasibility, marginal values or a bounded nonlinear…
Optimization
Optimization opens a native decision report beside its declared assumptions. Use it to inspect production quantities, resource use, feasibility, marginal values or a bounded nonlinear candidate; retain a solution and compare a later capture without changing the historical baseline.
Start with the canonical production and design example.
Open Production decisions and choose Find solution. The native
model resolves ProductionReport; its summary shows the objective,
Solution choices and Resources and requirements. See each quantity and
its native objective contribution, with whole-unit choices marked. Resource
rows show usage, the original capacity or requirement, native slack and the
native binding flag. Only binding constraints focuses on rows explicitly
reported as binding; unavailable flags are excluded, never inferred from slack.
Capacity rows label their slack Unused capacity; minimum-requirement rows label it Above requirement. Bars show native usage against positive limits; negative/signed or unavailable values keep their numbers without a bar. Objective contribution bars compare magnitudes within the current page, retaining signed numbers. Bars do not establish feasibility or an optimum. Tables show eight rows per page; use Next choices or Next resources to inspect more. Open a row's Exact values for its original numeric precision, coefficient, integer flag or native column bounds. Additional bounds remain model-defined; the starter's encoded quantity bounds appear as constraint rows.
Infeasible, unbounded, budget-limited and unavailable-solver outcomes explain the native status on the main result face. A budget-limited report may retain its candidate; no missing quantities, binding flags or margins are synthesized. Open Feasibility, sensitivity and solver details for available marginal values, conditional sensitivity scope and advanced solver diagnostics. Choose Edit on Labor hours to adjust the declared input through a guarded native write. Save and update solution confirms the input and refreshes the result. If refreshing fails after confirmation, the surface states that the assumption saved and keeps an explicit Refresh solution action. Bounded design and stopping budget demonstrates editable objective target, box bounds and iteration budget using the same native formula owner.
Configuration names one report and up to 64 numeric controls:
version = 1
kind = "optimization"
title = "Production decisions"
[report]
symbol = "ProductionReport"
[[controls]]
symbol = "LaborHours"
label = "Labor hours"
role = "constraint"
minimum = 0
Supported reports use the native grid.optimization.report.v1 contract from
LINEAR_PROGRAM.REPORT, MIXED_INTEGER_PROGRAM.REPORT,
BOUNDED_MINIMIZE_N.REPORT, PORTFOLIO_QP_WEIGHTS.REPORT, or CS_MAX_FLOW.REPORT.
Only declared numeric inputs authorized by the host are editable. Roles
objective, variable, constraint and budget describe the control; the
native formula determines its meaning. minimum, maximum and integer
validate this control’s edits; they do not add constraints to the solver.
Problem setup → Choose source connects a model report through an acknowledged
configuration write. Suggestions come from resident model values; you can also
enter a report symbol that has not been loaded yet. Editable assumptions
offers declared numeric inputs, preserving existing labels and bounds.
A new unbound Optimization surface opens Create a simple resource plan first;
you can also choose an existing report. Code stays under Advanced setup.
The starter chooses an unused ProductionReport, ProductionReport_2, and so on.
Create a simple resource plan authors a native report
formula for 1–6 nonnegative quantities and 1–6 resources or requirements.
Enter contribution per unit, resource use per unit and capacity; Create native
report maximizes contribution through the existing native source/formula owner.
It refuses existing report names. After that formula is acknowledged, source
setup opens with its new report name; Connect source is a separate confirmed
write. A connection failure keeps the created report available for binding
without creating another.
After an acknowledged creation, Create another problem starts a separate reviewed workflow while preserving the completed report. Previously created names remain protected while the model view refreshes. Create and connect are still explicit actions; an unconfirmed write must be observed before continuing.
Open Advanced formulation to choose Minimize cost, then set a resource rule to At least for demand or Exactly for a balance requirement. This avoids describing only capacity limits when production is required. Set each decision's minimum and optional maximum quantity; Whole units selects native mixed-integer solving. For binary choices, use whole units with minimum zero and maximum one. Closing the advanced controls keeps the selected goal, resource rules, quantity settings and MIP capability notice visible.
Minimum requirements and lower quantity bounds emit native unary-negation
expressions; equality emits two opposite labeled inequalities. Reports retain
the original row senses and expose quantity bounds as named constraint rows.
They do not change the native nonnegative column default. Whole-unit plans call
MIXED_INTEGER_PROGRAM.REPORT; a missing MIP capability is a native refusal,
never a silent continuous relaxation. The canonical example includes
Minimum-cost supply and Whole-unit exact packing for these workflows.
Choose Set up nonlinear design for a native numeric objective expression
and one–six continuous decisions. Give each decision a unique name, a starting
value and finite minimum/maximum; use those names directly in the expression,
for example (Price - TargetPrice)^2 + (Quantity - 8)^2. Existing model values
such as TargetPrice retain their native meaning. Starts must lie inside ordered
bounds; negative decisions and fixed bounds are allowed. Names identify local
decisions, so they shadow equally named model values inside the objective.
Grid owns objective parsing/evaluation and the existing bounded Nelder–Mead
solver when no requirements are added. Choose Minimize (the default) or
Maximize. Box-only search supplies no general-constraint certificate, integer
decisions or global search.
Expand Requirements (optional) to add up to six labeled smooth expressions
with At most, At least or Exactly a finite numeric limit. This selects
CONSTRAINED_MINIMIZE_N.REPORT; the native callback returns the objective and
signed expression-minus-limit residuals together. No browser evaluation or
objective penalty result substitutes for constraint feasibility.
Native SQP uses normalized finite-box coordinates, bounded finite differences, positive-definite BFGS quadratic subproblems with the maintained Clarabel backend, elastic feasibility restoration and a merit line search. A starting point may violate general requirements, but must lie inside its finite box. Singular or failed restoration, invalid expression domains and stalled searches retain an explicit candidate outcome; failed restoration is not proof of infeasibility.
Solver controls folds positive feasibility and stationarity tolerances; defaults are 1e-7 and 1e-6. Feasibility uses authored residual units. Stationarity is the projected Lagrangian gradient in normalized box coordinates; its tolerance also bounds the native complementarity residual. This operation admits at most 1000 iterations and 200000 native callback evaluations. Native convergence requires all measured feasibility, stationarity and complementarity checks to pass, with Local first-order stopping assurance. This assumes smooth expressions and is neither a global optimum nor a decision-error certificate. Review residual scaling and the start; the folded details retain every signed requirement residual, measured checks, budgets and restoration steps.
Complete captures retain the native report and authored requirements. Name-based comparisons preserve decision alignment; CSV includes exact native constraint residuals, feasibility and stopping fields. Changed requirements/tolerances are called out explicitly. The constrained circle example starts inside the box but off its equality manifold, then asks for native restoration and first-order stopping. Selected cost is bounded native QPs, finite-difference evaluations and line search; unrelated cells select none of this numerical work, and no worker, timer or alternate evaluator is introduced.
For box-only search, Solver controls folds the positive objective-spread tolerance and whole-number
iteration budget (1–10000, default 200). Tolerance concerns simplex objective
spread, not coordinate error. Review scaling, starting values and possible local
minima when interpreting results. The main result shows Local convergence or
Budget reached · candidate only, native box violation, iterations and the
absence of general-feasibility/stationarity guarantees. Decision names and bounds
remain visible; Authored objective and starting values retains the exact
problem choices for inspection, capture and print. Solver status, parameters,
objective and all completion fields stay native and unchanged inside the complete
optimization_report record. Authored labels, expression and starts accompany that
record without replacing its fields. Maximize compiles the negated expression
into the same native minimizer; the headline, retained comparison and CSV show
the native-authored maximize objective. Objective transformation exposes the
raw minimized value and original solver direction. Native outcome, assurance and
stopping conditions retain their meaning; maximizing adds no global certificate.
Older guided formulas using MERGE(native_report, metadata) may expose only
metadata because native persistent records are not legacy merge objects. Use Previous nonlinear report missing its result? → Restore previous design
in the empty result view, or Restore previous nonlinear design in setup.
An exact prior generated formula restores its decision names, objective, starts,
bounds, tolerance and iteration budget into an editable draft with a new unused
report name. Review Native formula, then Create native report and explicitly
connect its source. The original remains in Code; restoration writes nothing
until creation. Changed or unrecognized formulas receive actionable Code guidance
and do not silently load default settings. Existing plain native reports remain supported.
Creation chooses an unused DesignReport, then uses the same explicit formula
write and separate Connect source acknowledgement as resource plans. Local
field errors remain editable. Failed/ambiguous writes keep the draft, disable
blind retries and offer download/cancel; Stop waiting for report fences late
responses without claiming the write was cancelled. An existing created report
can be connected without creating another. The canonical example includes
Guided nonlinear design using this exact authoring shape.
Objective expressions must fit one line of at most 2048 characters without comments, and generated formulas retain the 16 KiB limit. The guided form does not evaluate expressions in the browser. Resource-plan coefficients can use existing model values under Advanced formulation; general formulations and larger problems remain in Edit problem in Code.
Opening the surface starts no solve, timer, background request or saved-file scan. Inspection is explicit and captures the report with all declared effective inputs, source identity and package versions. Source/input/package changes during capture refuse it. Solver budget and problem setup controls stay collapsed until needed. Source identity is available in Source and capture details. Control edits require a fresh revision and a unique, matching, advancing native receipt. Failed or ambiguous writes retain the draft; copy it, discard it and inspect native values before deciding whether to retry. Hosts without receipts expose assumptions read-only. Run offers explicit Find solution / Refresh solution without input or configuration mutation commands; print uses already-ready values and never requests a solve. After a capture, selected input notifications and the host working revision mark changed-input results visibly historical and prevent editing their old assumptions. Refresh before using a historical solution for current decisions.
Open Save and compare solutions, give the solution a name and choose Save current solution to save exactly the solution displayed above into Files, with its original input, source and package identity. Saving never re-solves it. Export solution opens format choices. Complete JSON downloads the complete displayed capture, including report rows outside the current page. Decisions CSV, Resources CSV and supported Parameters CSV export every admitted row, including off-page and nonbinding rows. Native numeric cells use exact numeric strings; missing, blank and error cells retain explicit value kinds. Every row repeats native outcome/assurance and available capture identity; CSV adds no solver certification. Formula-like text receives an apostrophe prefix for spreadsheet safety, while numbers remain unchanged. Tables above 2,000 rows or 8 MiB refuse without trimming; Complete JSON remains available. Export errors belong to the displayed capture and provenance; switching captures clears an earlier refusal. For an already-ready resident result without a study capture, export identifies that narrower provenance explicitly. Save the Grid document to carry those Files in its archive. Browse saved solutions reads the saved scenario list only on request. An interrupted or unacknowledged save blocks another write. Open the saved solution with the attempted name: if its complete stored capture exactly matches the attempted capture, Grid confirms that existing copy without writing again. A different or missing capture does not clear the ambiguity. Open saved solution displays its historical report without re-solving. Saved results retain their original report symbol even after a fresh copied design is connected under another name. When the current name is absent, a capture containing one Optimization report can still open; ambiguous multi-report captures require the matching original name. Its folded export options download the complete historical JSON or admitted CSV rows with original capture identity. Print saved solution opens a local document with every admitted native row, original report identity and an exact original-capture appendix. It uses the reopened result without resolving or writing; the fresh Print Studio view continues to show resident results. Comparing against a differently named current report is refused with guidance to reconnect the original report. Compare with current solution compares two immutable captures and refuses different source or package identities. The comparison shows each native outcome and objective beside its original capture time, then the numeric objective change. Decision changes show quantities and contributions; Resource and requirement changes show usage, limits, native slack and binding flags. Changed assumptions use your configured labels. Differences mean current capture minus saved capture in the model’s units, never a new solve, an improvement certificate or an inferred feasibility claim. Candidate, infeasible and unbounded outcomes stay visible, and unavailable numbers do not become zero.
Only changed decisions and resources keeps the everyday view compact; clear it to include unchanged rows. Tables show eight rows per page. Matching uses unique native labels, so reordered rows compare correctly. Duplicate or missing labels and tables over 2000 rows decline the friendly row match with a visible notice; Exact captured changes and the complete export remain available. A changed requirement direction keeps both original directions and values but does not interpret the difference between their slacks.
Sensitivity and capture identity contains original-bound marginal values, conditional local predictions and native solver notes. Missing duals and allowable sensitivity ranges remain unavailable; the browser does not calculate them. Nonlinear captures also show Nonlinear decision changes when each report supplies one–six exact unique authored decision names matching its native parameter vector. Names join across reordered vectors; added or removed names remain separate. Only changed decisions filters unchanged values/settings. Each row shows saved/current native values and descriptive change; Exact captured values retains original precision, native bounds and authored starts. Missing, duplicate or mismatched names refuse this detailed table without guessing positions; objective/outcome and complete captured changes remain available. Returned candidates retain their native status. Numeric differences add no improvement, feasibility, stationarity or global optimality assurance.
Export comparison downloads both complete original captures, their identities and exact field changes as JSON, including rows beyond the current page.
Print comparison opens a local, script-free document and the browser’s print dialog. Its main tables include all admitted decisions, resources and assumptions, including unchanged rows; sensitivity, exact changes and both complete original captures follow as appendices. Native text is escaped and the document permits no network resources. This explicit action carries session comparison data that a fresh PrintStudio view cannot inherit. Browser popup restrictions are reported without losing the comparison. Documents over 8 MiB refuse print and retain the complete JSON export. Neither export nor print resolves a historical baseline. Available local marginal predictions remain conditional on their native report’s sensitivity scope.
A pending inspection or setup write offers Stop waiting. Late responses cannot replace the local view; stopping a write keeps its uncertain draft and prevents blind retry. Download a setup/plan draft before cancelling it; observe saved configuration or the native target in Code before another write.
Feasibility, convergence and optimality are distinct. An infeasible report has no fabricated decisions; a budget-exhausted nonlinear candidate does not certify convergence or global optimality. Missing marginal values, stationarity residuals, counters and IIS witnesses stay unavailable. Mixed-integer problems require the native MIP capability and never silently relax integrality.
Study captures admit at most 500 declared inputs and 1 MiB of portable values; scenario files admit 2 MiB and the model retains at most 100 scenarios. Large or native-resource input models can refuse capture; use their supported resource capture rather than weakening these limits. Captures do not freeze the runtime executable or external data bytes. Scenario Files can be edited by authorized users and are not authenticated solver certificates. Exact table values remain in the complete report and each row's Exact values; primary displayed values use up to ten significant digits. Print opens exact row values and solver details, and includes all admitted LP/MIP solution choices and resource rows, unfiltered. Advanced diagnostic tables retain their own bounded pages; Export solution retains the complete displayed report.
Local presentation and receipt tests pass. Live native/UI review, example execution, full-app latency/RSS and paired default-path cost measurements remain pending; the delivery record tracks them.
In Advanced formulation, enable Use existing model values to enter
named numeric values or single-cell references in objective coefficients,
resource coefficients and resource limits. For example, UnitMargin and
Inputs!B2 remain native references in the authored LP/MIP formula. Grid solves
against their current values, so changing an admitted input updates the model's
plan; refresh the surface to capture its current solution. Quantity bounds stay
numeric. Formula expressions and ranges stay in Code. This option creates no
new inputs or controls and does not silently coerce invalid model values.
For a current guided nonlinear report, Copy current design opens a new draft with its original objective, starting values, bounds, goal and solver controls. Constrained designs also retain every authored requirement and tolerance. Review and edit the draft, then create its fresh report and explicitly connect it. The original report remains available. Reports without complete guided settings and stale reports do not offer copying. Detailed solver explanations stay under Solver controls.
New guided resource plans retain their complete authored setup with the native report. Copy current resource plan opens a fresh editable draft with the original contribution or cost coefficients, model references, resource rules, quantity bounds, and whole-unit settings. References remain references and use current model values when the new plan is solved. Review the draft, explicitly create its new report, then choose that source to connect it. The original report stays in Code. Advanced quantity and formulation controls remain folded.
Copying requires a current report with complete guided metadata matching its native decision and resource declarations. Older or manual reports without these settings, malformed declarations, and stale captures cannot be copied through this action; inspect their original formulas in Code. Saved captures and complete JSON exports retain the authored setup alongside the original native result; resource-plan copying does not reuse solved quantities or grant a stronger solver certificate.
Copying current settings also requires the displayed capture's retained source to match the available editor source, even on hosts without revision metadata. A changed source disables copying and asks for a refresh while preserving the historical result for inspection and export. Copy admission requires the explicit guided wrapper; attaching setup annotations directly to a manual/raw native report does not enable this action.
In a copied nonlinear draft, folded Starting values offers Original authored starts (the unchanged default) or Displayed solution. The latter copies the retained native decision numbers, in their exact authored order, into the draft; it does not solve, create a report, or connect a source. Review the visible starts and formula before the existing explicit creation and connection steps. Minimize or Maximize, bounds, requirements and stopping controls remain as copied.
Solution reuse requires a current captured result, a source assignment that exactly matches guided output, complete unique decision labels, and one finite native coordinate per decision inside the original box. Manual formulas, resident-only reports, stale or changed captures, missing/error coordinates and out-of-box results cannot initialize this way. Edited draft bounds must also admit the chosen starts; changed decision names/order refuse reuse. Source, revision, owner and capture changes retain the draft and refuse creation. A reused local solution provides no global-optimum guarantee and does not establish feasibility for changed requirements. Native outcomes and assurances remain unchanged.
Captured Optimization JSON, structured CSV fields and complete print appendices preserve negative zero as a JSON number. Exact comparisons and uncertain-save recovery distinguish -0 from 0. Named scenario Files, restore previews and the explicit bulk input transition retain the same sign; nonfinite historical input/result values are refused before serialization rather than converted to null. Existing capture and scenario byte limits remain.
Saved scenario downloads enforce the existing 2 MiB limit while reading, before buffering the complete file. Unsupported content types or invalid UTF-8 are refused. Scenario and study-record saves confirm the requested native Files path and byte size before reporting success; an inconsistent receipt remains unconfirmed and never triggers another upload automatically.
Stopping solution inspection or save preparation cancels subsequent read/preparation phases. A stopped preflight does not start an upload and keeps the displayed solution and name available. Once upload dispatch has begun, stopping retains the exact recovery tracking and requires observation before another save.
New scenario and solution captures retain the originally requested partition selector: a number for an explicit partition, or null for the default selector. Legacy captures leave it unrecorded. Reopening and printing a saved solution show that original context; saving it later never relabels the capture with the destination partition. Comparison rows show changed coefficients, whole-unit settings, bounds and nonlinear starting values directly, even when quantities remain unchanged.
The input-scenario panel offers Open saved scenario to inspect and download the original capture without applying inputs, resolving current results, or requiring compatibility with the current source. Original inputs, results and source remain behind a folded detail view. Restore and comparison continue to perform their own compatibility checks.
Run and print only display a resident solution whose native snapshot identifies the connected report. Explicit historical study capture also checks each returned result symbol before retaining its value, accepting equivalent native cell-address spellings. A foreign result cannot be exported under the connected report’s identity.
Scenario saving defaults to assumptions only. Optional result symbols and study-record export live under Capture results and export; selected symbols remain visible in the folded summary and change the save action to Save scenario with results. A confirmed save selects its new file for immediate reopening.
The scenario panel retains the exact file path and capture bytes immediately before dispatch. If the reply is lost or the receipt is inconsistent, another scenario save is disabled until Observe saved scenario confirms those original bytes. Observation never uploads or resolves results; Download pending scenario preserves the same capture locally. Preflight failures keep the name editable and do not create uncertain-write recovery.
Opened scenarios show recorded input values directly: study captures use their original effective inputs, while inputs-only captures show saved overrides. Longer lists provide name search and bounded paging. Retained results can be selected without recalculation; native Optimization reports use their existing result overview, while other values preserve exact scalars and folded native metadata.
Long comparison tables provide bounded search across exact decision/resource names, recorded settings and reviewed input labels. Advanced marginal and exact-change searches remain inside their disclosures. Search combines with changed-only filtering; complete print and JSON export preserve all admitted rows.