Contenido principal

OpticalTolerance

R2026b

Monte Carlo tolerance analysis results of optical system

Since R2026b

    Description

    Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

    An OpticalTolerance object stores Monte Carlo tolerance analysis results, including per-trial metric scores, perturbation values, and pre- and post-compensation merit scores.

    Creation

    Create an OpticalTolerance object using the opticalTolerance function.

    Properties

    expand all

    This property is read-only.

    Monte Carlo trial data, represented as a table with one row per trial.

    The table contains these columns.

    ColumnDescription
    Metric1-by-n vector containing the post-compensation raw metric values, where n is the number of metrics in the merit function.
    PreCompensationMetric1-by-n vector containing the pre-compensation raw metric values, where n is the number of metrics in the merit function.
    Compensation1-by-m vector containing the deviation of the target properties of the compensator from their nominal values, where m is the number of tuning parameters in the compensator.
    StatusIndicated as "Pass" if the trial is successful. Otherwise, the status displays the error details.

    This property is read-only.

    Optimized compensator values per trial, represented as a numeric matrix where each row corresponds to a trial and each column corresponds to a compensator tuning variable.

    This property is read-only.

    Residual merit scores before compensation, represented as a numeric column vector with one entry per trial. Residual merit scores are merit scores measured as a ratio with respect to a target, making them unitless values.

    This property is read-only.

    Residual merit scores after compensation, represented as a numeric column vector with one entry per trial. Residual merit scores are merit scores measured as a ratio with respect to a target, making them unitless values. Use this property to identify the worst-performing trial or to compute yield (percentage of trials below a threshold).

    Object Functions

    applyPerturbationApply perturbation from sensitivity or tolerance analysis results

    Examples

    collapse all

    Import an optical system into the workspace.

    opsys = zmximport("DoubleGaussLens.zmx");

    Create an optical tolerance set with a tolerance for the radius of curvature of surfaces.

    tolSet = opticalToleranceSet;
    tolSet = addSurfaceConicConstantTolerance(tolSet,0.07);

    Create a merit function object for evaluating system performance.

    meritFcn = opticalMeritFunction;
    meritFcn = addSpot(meritFcn);

    Run a Monte Carlo tolerance analysis with 100 trials on the optical system using the merit function, and tolerance.

    resultTolerance = opticalTolerance(opsys,meritFcn,tolSet,NumTrials=100);

    Perturb the optical system using the results from the 12th Monte Carlo trial.

    idx = 12;
    newopsys = applyPerturbation(resultTolerance,idx,CompensatorApplied=false);

    Evaluate the merit function of the perturbed optical system, and observe that the metric score and the raw metric value match the merit score and raw metric value in the results.

    [score,rawValue] = evaluate(meritFcn,newopsys)
    score = 
    0.0557
    
    rawValue = 
    0.0557
    
    resultTolerance.MeritScore(idx)
    ans = 
    0.0557
    
    resultTolerance.ResultTable.Metric(idx)
    ans = 
    0.0557
    

    Version History

    Introduced in R2026b