Guide

Optimizer

Optimization objectives, variables, grid parameters, and algorithm configuration

Optimizer is used to search automatically for a better parameter set. On this page, define optimization objectives, search variables, an optional grid pre-search (Grid Parameters), and local solver configuration (Algorithm Parameters), then execute Run Optimizer from the top toolbar.

This page defines the optimization task. It does not interpret the final outcome. After the run finishes, go to Optimization Report in the results area to inspect the best solution, evaluation history, and objective breakdown.

Prerequisites

  • Structure passes validation.
  • Optics passes validation.
  • The optimization goal and desired direction are clear (anti-reflection, transmission enhancement, spectrum matching, etc.).
  1. Define Objectives first (target quantity, incident light, scoring method).
  2. Define Variables (searchable parameters and bounds).
  3. Tune Grid Parameters (optional grid pre-search).
  4. Tune Algorithm Parameters (solver and convergence settings).
  5. Use a small-budget first run, then increase budget only after the direction is validated.

Page Structure

The Optimizer page is divided into four vertical sections:

SectionFunction
Optimization ObjectivesDefines target quantities, incident light conditions, and scoring methods
Optimization VariablesDefines searchable parameters and their bounds
Grid ParametersOptional grid pre-search (coarse grid scan before local refinement)
Algorithm ParametersLocal solver selection and convergence parameters

The upper half contains the objectives and variables sections (empty-state example):

The lower half contains the grid parameters and algorithm parameters sections:

Global Toolbar

  • Run Optimizer is available only when the entire model is valid.
  • Once the run starts, all input controls on this page are locked.
  • If this page contains errors, the footer groups them under Optimizer and keeps the run entry disabled.

Optimization Objectives

The objectives section defines what "better" means. All enabled objectives are combined into one weighted fitness score.

Toolbar

ActionDescription
Add ObjectiveCreates a new objective (default: Reflectance, Maximize, 550 nm)
EditOpens the editor dialog for the selected objective
DuplicateDuplicates the selected objective (including all settings)
Move Up / Move DownReorders objectives
DeleteRemoves the selected objective

Objective List Table

The list table shows a summary for each objective. Double-click a row or click the Edit button to open the editor dialog.

ColumnContentNotes
Reorder handleDrag iconDrag to reorder rows
Enable checkboxCheckboxDisabled objectives do not participate in fitness calculation
ModeBadge: Point / Band / Curve Fit / ColorDerived automatically from wavelength mode and goal type
TargetColor-coded tagMagenta = R, Cyan = T, Orange = A
Incident LightSummary texte.g., "550 nm · 0° · Unpolarized" or "400-700 nm / 5 nm · 45° · S"
GoalSummary texte.g., "Maximize" or "Average · Minimize" or "Curve Fit · RMSE"
WeightNumberDefault 1, minimum 0.000001
StatusStatus iconGreen check = Ready, Red X = Needs Review (hover for details)
Edit buttonButtonOpens the editor dialog
Delete buttonX buttonRemoves this objective

Below is a complete example with 3 objectives (mixed Point and Band modes) and the Wavelength Coverage Preview:

Mode Derivation Logic

The Mode badge in the objective list is derived automatically from the current configuration; no manual selection is needed:

ConditionMode
Color Match goal selected (Reflection Color / Transmission Color)Color
Curve Fit scoring method selectedCurve Fit
Single wavelength + Scalar GoalPoint
Sweep wavelength + Scalar GoalBand

Target Color Coding

The objective list table and Wavelength Coverage Preview use a unified color scheme:

TargetColorApplied to
Reflectance (R) / Reflection ColorMagenta / PinkTag + preview bar fill
Transmittance (T) / Transmission ColorCyan / TealTag + preview bar fill
Absorptance (A) / Layer AbsorptionOrangeTag + preview bar fill

Wavelength Coverage Preview

Below the objective list is a collapsible Wavelength Coverage Preview panel that visualizes each objective's wavelength range as horizontal bars.

FeatureDescription
Point objectivesShown as a dot marker
Sweep / Band objectivesShown as a horizontal bar
Color codingMatches the Target color (Magenta / Cyan / Orange)
Disabled objectivesShown at 40% opacity
Click interactionClick a bar to select the corresponding objective
Summary text"{N} overlap regions, {range}, up to {M} enabled objectives overlapping"

Below is the Wavelength Coverage Preview with a single objective (displayed as a dot marker):

With multiple objectives, the preview panel shows multiple bars with overlap annotations in summary text:

Multi-Objective Best Practices

Core strategies for multi-objective optimization:

  • Point + Band combination: Use a Point objective to lock the extremum at the design wavelength, and a Band objective to ensure broadband performance.
  • Weight allocation: Higher Weight directs the solver to invest more optimization effort on that objective.
  • Independent incident light: Each objective's incident light conditions are configured independently, allowing different angles and polarization states within the same optimization run.

Example for broadband anti-reflection coating design:

#TargetModeWavelengthGoalWeight
1RPoint550 nmMinimize2
2RBand400-700 nmAverage · Minimize1
3TBand400-700 nmAverage · Maximize0.5

This configuration sets reflectance minimization at the design wavelength as the highest priority (weight 2), broadband average reflectance minimization as the secondary objective (weight 1), and transmittance maximization (weight 0.5) as a supplementary direction.

For curve fitting scenarios, add one objective in Curve Fit mode with a target spectral shape, and another using Scalar Goal to enforce a floor value (for example, Stay in Range mode to ensure reflectance does not exceed a threshold).


Objective Editor Dialog

Click the Edit button or double-click an objective row to open the editor dialog. The dialog has three sections: Target, Incident Light, and Optimization Goal.

Target Section

Select the physical quantity to optimize:

QuantityUI LabelDescription
RReflectance (R)Reflectance
TTransmittance (T)Transmittance
AAbsorptance (A)Absorptance
layerAbsorptionLayer AbsorptionSingle layer or layer group absorption; requires selecting a specific layer or group
reflectionColorReflection ColorReflection color coordinate matching
transmissionColorTransmission ColorTransmission color coordinate matching

When Layer Absorption is selected, a secondary selector appears for choosing the target layer or layer group.

When Reflection Color or Transmission Color is selected, the system automatically switches to Sweep mode, enables incident spectrum, enables color calculation, and locks the Goal to Color Match.

Incident Light Section

Each objective has independent incident light conditions, separate from the global Optics page.

Each objective's incident light parameters are independent from the global Optics page configuration. Different objectives within the same optimization run can use different incident angles, polarization states, and wavelength ranges.

Wavelength Sampling

ModeFieldsDescription
SingleSingle Wavelength (nm)Evaluates one wavelength point, minimum 1 nm
SweepStart Wavelength / End Wavelength / Step (nm)Evaluates a wavelength range point by point; Start < End, Step > 0

Color targets are forced to use Sweep mode.

Incident Angle

Range: 0 deg to 89.9 deg. Slider and numeric input are linked.

Polarization Ratio

Range: 0 to 1. 0 = pure s-polarization, 1 = pure p-polarization, 0.5 = unpolarized.

Cone Angle (Optional Module)

Models finite numerical aperture or divergent beams. When enabled:

ParameterRangeDescription
Half-angle0 deg to 89.9 degHalf-cone angle
DistributionUniform / LambertianAngular distribution
Ring Count2 to 20Number of rings
Incident angle + half-cone angle must not exceed 89.9 deg.

Incident Spectrum (Optional Module)

Available only in Sweep mode. When enabled, the incident spectrum acts as wavelength weights for weighted averaging or weighted curve fitting.

SourceDescription
Illuminant AIncandescent standard illuminant
Illuminant D65Daylight standard illuminant
FileLoad a custom spectrum file (.txt / .pl)

For color targets, the incident spectrum is automatically enabled and requires configuring source and observer angle (2 deg / 10 deg).

Optimization Goal Section

The available goal type depends on the combination of Target and wavelength mode.

Scalar Goal

Available for all non-color targets.

ParameterDescription
AggregatorAppears only in Sweep mode. Options: Average / Minimum / Maximum / Integral; becomes Weighted Average when incident spectrum is enabled
ModeMaximize / Minimize / Hit Target / Stay in Range
Target ValueOnly for Hit Target mode, range 0 to 1
Lower Bound / Upper BoundOnly for Stay in Range mode, range 0 to 1, Upper >= Lower

In Single wavelength mode, no Aggregator is needed; the score is evaluated directly at that wavelength.

Curve Fit

Available only in Sweep mode. The goal is to match the optimized spectrum to a given target curve.

ParameterDescription
Error MetricRMSE (default); becomes Weighted RMSE when incident spectrum is enabled
Curve DataCSV/TSV text, each row wavelength, value[, weight], minimum 2 points
Import CSVImport curve data from a file
ApplyParse and validate the text; must be applied before saving

After the Apply operation, a status tag indicates the current data state:

Status TagColorMeaning
Applied · N pointsGreenData successfully parsed and applied
UnappliedYellowText was modified but not yet applied
ErrorRedParsing failed; check the error message
The curve data wavelength range must cover the current Sweep range. After editing, you must click Apply Curve Data before saving. The Save button remains disabled until the curve data is applied.

Color Match

Automatically activated when Reflection Color or Transmission Color is selected.

ParameterDescription
Color pickerNative color input with HEX display
L / a / bCIE LAB color coordinates; L range 0 to 100
Color ErrorDelta E 2000

Weight

Each objective has a Weight field (default 1, minimum 0.000001). When multiple objectives are used, weights determine each objective's share in the total fitness. Higher weight values direct the solver to invest more optimization effort on that objective.


Optimization Variables

The variable table defines which input parameters the solver is allowed to modify.

Toolbar

ActionDescription
AddCreates a new row (enabled by default, path and bounds are empty)
DuplicateDuplicates the selected row
Move Up / Move DownReorders rows
DeleteRemoves the selected row

Variable Table Fields

ColumnDescription
Enable checkboxControls whether the variable participates in the search
ParameterParameter path, selected via CascadeSelect picker
MinimumSearch lower bound
Initial ValueStarting value (disabled when grid is enabled)
MaximumSearch upper bound

Path Selection (CascadeSelect)

The CascadeSelect path picker shows two top-level categories: Structure (layers and layer groups) and Surroundings (incidence and transmission media). Expand each category to drill down to specific parameters.

The path picker uses a cascading menu that only shows currently enabled elements in the structure:

CategoryPath formatCurrent restriction
Regular layer thicknessstructure / {LayerName} / thicknessMost common
Layer refractive indexstructure / {LayerName} / {n, k, nExt, kExt}Limited by indexType
Layer Group internal layerstructure / {GroupName} / Layers / {LayerName} / ...Group must be enabled
Incidence mediumsurroundings / incidence / nOnly n is supported
Transmission mediumsurroundings / transmission / {n, k}Not available in File mode

indexType and Optimizable Properties

The refractive index mode determines which properties can be used as optimization variables:

indexTypeAllowed propertiesBlocked properties
Constantthickness, n, knExt, kExt
Const. Birefringencethickness, n, k, nExt, kExt--
FilethicknessAll refractive-index properties

Initial Value and Grid Interaction

  • When grid search is off: Initial Value serves as the starting point for the local solver and must be within the [Minimum, Maximum] range.
  • When grid search is on: The Initial Value column is disabled; starting points are replaced by grid seeds.
When grid search is enabled, the Initial Value column is disabled. An info message appears above the table: grid mode replaces starting values with grid seeds.

Validation Rules

RuleDescription
At least one enabled variableOtherwise the optimization task is invalid
Enabled variables must have a valid pathEmpty paths cause immediate errors
No duplicate paths among enabled variablesRemember to change paths after duplication
min and max cannot both be emptyAt least one bound is required
If both are present, min < maxMust be satisfied

When Paths Become Invalid

ScenarioFix
A layer or group was deletedRe-select the path
A layer or group was disabledRe-enable it or choose another path
A layer or group was renamedRe-select the path
The property no longer matches the current indexTypeChange the mode or choose another property

Multi-Variable Configuration Example

VariablePathMinMaxPurpose
ITO thicknessstructure / ITO / thickness2080Main design parameter
SiO2 thicknessstructure / SiO2 / thickness50200Spacer layer thickness
Substrate nsurroundings / transmission / n1.41.7Material selection range

When using grid search with 2 variables and 5 samples per variable, this produces 5^2 = 25 grid points. Each grid seed then gets refined by the local solver.


Grid Parameters

Grid search is an optional pre-search stage. When enabled, the optimizer first performs a coarse grid scan across the entire variable space, selects the top seeds, and then runs local optimization from each seed independently.

ParameterRangeDescription
Enable GridOn / OffEnable grid pre-search
Grid Samples Per Variable2 to 25 (slider)Sampling density per variable dimension
Top K Seeds1 to total grid pointsNumber of best grid seeds that proceed to local refinement

Behavioral Changes When Grid Is Enabled

BehaviorDescription
Initial Value disabledStarting values in the variables table are replaced by grid seeds
Label text changesMax Evaluations becomes Max Local Evaluations Per Seed
Estimated grid pointsDisplays formula: Estimated grid points = (Samples Per Variable)^(number of enabled variables)
Grid point count grows exponentially with the number of variables. 2 variables with 5 samples = 25 points; 3 variables with 5 samples = 125 points; 4 variables with 5 samples = 625 points. When many variables are involved, reduce sampling density or reduce the number of enabled variables.

Algorithm Parameters

Algorithm Selection

AlgorithmTypeSuitable for
TRFTrust-region least-squaresMulti-objective, curve fitting; the default choice
L-BFGS-BQuasi-Newton with bound constraintsSmooth gradient landscapes, many variables
Nelder-MeadDerivative-free simplexNon-smooth objective landscapes or when gradient information is not needed

Common Parameters

ParameterRangeDescription
Max Evaluations20 to 1000Total evaluation budget (per-seed local budget when grid is enabled)

TRF Parameters

ParameterRangeDefaultDescription
Step Ratio0.001 to 0.10.01Relative step size for building local perturbations
f Tol> 01e-6Objective improvement threshold
x Tol> 01e-4Parameter update threshold
g Tol> 01e-6Gradient optimality threshold

L-BFGS-B Parameters

ParameterRangeDefaultDescription
Step Ratio0.001 to 0.10.01Relative step size for building local perturbations
f Tol> 01e-8Objective improvement threshold
g Tol> 01e-5Gradient optimality threshold

Nelder-Mead Parameters

ParameterRangeDefaultDescription
Initial Simplex Ratio0.01 to 0.20.05Relative initial simplex size
x Atol> 01e-3Absolute parameter convergence tolerance
f Atol> 01e-6Absolute objective convergence tolerance

Practical Tuning Guidance

For a first optimization attempt, start with a modest budget (Max Evaluations = 50 to 150) and confirm the direction is correct before increasing. If using grid search, start with Samples Per Variable = 3 to 5 and Top K Seeds = 2 to 3.
ScenarioRecommended configuration
Initial trial runTRF, Max Evaluations = 100, Grid disabled
Coarse scan + refinementEnable Grid, Samples = 3-5, Top K = 2-3, TRF
Many variables (> 4)L-BFGS-B, reduce Grid sampling density
Non-smooth objective landscapeNelder-Mead, increase Max Evaluations accordingly

Pre-Run Validation and Common Errors

Checklist before executing Run Optimizer:

  1. At least one enabled and valid objective exists.
  2. At least one enabled and valid variable exists.
  3. No duplicate paths among enabled variables.
  4. Structure and Optics pass validation.
  5. Variable ranges are physically reasonable.
  6. Algorithm parameters are within the allowed ranges.
SymptomCommon causeFix
Run Optimizer stays disabledObjectives, variables, or algorithm controls still contain errorsCheck the footer, fix each item
A new variable immediately failsAdd created an enabled empty rowFill the path and bounds, or disable it first
Hit Target mode remains invalidTarget Value is missingEnter a value between 0 and 1
Stay in Range mode remains invalidLower/Upper Bound missing or Upper < LowerFill both and ensure Upper >= Lower
Color target validation failsSweep range produces fewer than 2 sample pointsWiden the wavelength range or reduce step
Curve Fit cannot be savedCurve data was not appliedClick Apply Curve Data
Results are poor and unstableBounds too wide, targets conflict, or budget too smallShrink bounds first, then review targets and budget

After this page is configured, continue with the next chapter: Basic Optical Results. Read ordinary result interpretation first, then return later to Optimization Report for best-solution analysis.

Copyright © 2026 Dreapex