メインコンテンツ

opticalSensitivity

R2026b

Analyze sensitivity of optical system

Since R2026b

    Description

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

    result = opticalSensitivity(opsys,meritFcn,tolSet) analyzes the sensitivity of the optical system opsys by perturbing each parameter defined in the tolerance set tolSet and evaluating the merit function meritFcn. The function returns the per-tolerance sensitivity coefficients, sorted by impact.

    result = opticalSensitivity(opsys,meritFcn,tolSet,Name=Value) specifies additional options using one or more name-value arguments. For example, UseParallel=true enables you to distribute tolerance perturbation evaluation across parallel workers.

    example

    Examples

    collapse all

    Import an optical system into the workspace.

    opsys = zmximport("PhotographicLens.zmx");

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

    tolSet = opticalToleranceSet;
    tolSet = addSurfaceRadiusTolerance(tolSet,0.05);

    Create a merit function object for evaluating system performance.

    meritFcn = opticalMeritFunction;
    meritFcn = addSpot(meritFcn);

    Run a sensitivity analysis on the optical system, using the merit function, and tolerance.

    resultSensitivity = opticalSensitivity(opsys,meritFcn,tolSet);

    Perturb the optical system by using the 16th tolerance-target combination.

    idx = 16;
    [sysMinComp,sysMaxComp] = applyPerturbation(resultSensitivity,idx,CompensatorApplied=false);

    Evaluate the merit function of the perturbed optical system at the minimum and maximum tolerance limits. Observe that these metric scores match the metric scores in the results of the original sensitivity analysis.

    evaluate(meritFcn,sysMinComp)
    ans = 
    0.0069
    
    evaluate(meritFcn,sysMaxComp)
    ans = 
    0.0085
    
    resultSensitivity.ResultTable.MetricScore{idx}
    ans = 1×2 cell array
        {[0.0069]}    {[0.0085]}
    
    

    Input Arguments

    collapse all

    Optical system to analyze, specified as an opticalSystem object.

    Merit function, specified as an opticalMeritFunction object containing the metrics to evaluate. Choose metrics and targets based on the performance characteristics you want to protect, such as spot size.

    For sensitivity analysis, use a single metric to produce an unambiguous ranking of top offenders. When you use multiple metrics, the function sorts results by the maximum difference among metrics, which can obscure which tolerance the system most exceeds.

    Tolerance set, specified as an opticalToleranceSet object containing the parameters to perturb and their tolerance values. Choose tolerances that reflect your manufacturing and assembly realities. Sensitivity analysis can identify which of the specified tolerances the system most exceeds.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: opticalSensitivity(opsys,meritFcn,tolSet,Compensator=compSet) specifies the tuning parameters to optimize after each perturbation.

    Compensator optimization set, specified as an opticalOptimizationSet object containing the tuning parameters to optimize after each perturbation. Use this argument to obtain realistic post-adjustment sensitivity results, such as when an autofocus mechanism compensates for manufacturing errors. To specify a compensator, you must have an Optimization Toolbox™ license.

    Parallel computing, specified as a logical 1(true) or 0(false). Specify UseParallel as true to distribute tolerance perturbation evaluations across parallel workers. This option requires Parallel Computing Toolbox™.

    Data Types: logical

    Output Arguments

    collapse all

    Sensitivity analysis results, returned as an OpticalSensitivity object. The result contains a table sorted in descending order by impact, with per-tolerance sensitivity coefficients and the deviations of the target properties of the compensator from their nominal values.

    Version History

    Introduced in R2026b