メインコンテンツ

opticalToleranceSet

R2026b

Optical tolerances for sensitivity and Monte Carlo analysis

Since R2026b

    Description

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

    An opticalToleranceSet object contains a set of manufacturing and assembly optical tolerances to use for sensitivity or Monte Carlo tolerance analysis.

    Creation

    Description

    tolSet = opticalToleranceSet creates an empty tolerance set with no tolerances. Add tolerances using the object functions.

    example

    Properties

    expand all

    Tolerance objects, specified as a 1-by-n array of Tolerance objects.

    This property is read-only.

    Summary table of tolerances, represented as a table with these columns: TargetProperty, ToleranceRange, ToleranceType, and TargetIndex. The columns correspond to the properties of the tolerance objects added to the tolerance set, with each row representing those properties for a single tolerance object.

    Object Functions

    addSurfaceRadiusToleranceAdd tolerance for surface radius of curvature
    addSurfaceConicConstantToleranceAdd tolerance for surface conic constant
    addSurfacePositionToleranceAdd tolerance for surface position
    addSurfaceTiltToleranceAdd tolerance for surface tilt
    addSurfaceAsphericToleranceAdd tolerance for surface aspheric coefficients
    addComponentPositionToleranceAdd tolerance for component position
    addComponentTiltToleranceAdd tolerance for component tilt
    addComponentMaterialToleranceAdd tolerance for component material property
    addCustomToleranceAdd custom tolerance

    Examples

    collapse all

    Import an optical system into the workspace.

    opsys = zmximport("PhotographicLens.zmx");

    Create an empty optical tolerance set.

    tolSet = opticalToleranceSet;

    Add tolerances to the tolerance set.

    tolSet = addSurfaceRadiusTolerance(tolSet,0.05);
    tolSet = addSurfaceConicConstantTolerance(tolSet,[-0.01 0.01],TargetIndex=2);
    tolSet = addSurfacePositionTolerance(tolSet,PositionX=0.1);
    tolSet = addSurfaceTiltTolerance(tolSet,TiltX=[-0.5 0.5],TargetIndex=3);
    tolSet = addSurfaceAsphericTolerance(tolSet,0.05,4);
    tolSet = addComponentPositionTolerance(tolSet,PositionX=0.1);
    tolSet = addComponentTiltTolerance(tolSet,TiltY=[-0.2 0.2],TargetIndex=2:8);
    tolSet = addComponentMaterialTolerance(tolSet,Nd=0.05,TargetIndex=2:8);

    Inspect the tolerance set.

    tolSet
    tolSet = 
      opticalToleranceSet with properties:
    
            Tolerances: [1×8 optics.tolerance.Tolerance]
        ToleranceTable: [8×4 table]
    
    
    tolSet.Tolerances
    ans = 1×8 heterogeneous Tolerance (SurfaceRadiusTolerance, SurfaceConicConstantTolerance, SurfacePositionTolerance, ...) array with properties:
        ToleranceRange
        ToleranceType
    
    
    tolSet.ToleranceTable
    ans = 8×4 table
             TargetProperty     ToleranceRange    ToleranceType       TargetIndex   
             _______________    ______________    _____________    _________________
    
        1    "Radius"           -0.05     0.05    "Percentage"     {0×0 double     }
        2    "ConicConstant"    -0.01     0.01    "Absolute"       {[            2]}
        3    "PositionX"         -0.1      0.1    "Percentage"     {0×0 double     }
        4    "TiltX"             -0.5      0.5    "Absolute"       {[            3]}
        5    "Aspheric"         -0.05     0.05    "Percentage"     {0×0 double     }
        6    "PositionX"         -0.1      0.1    "Percentage"     {0×0 double     }
        7    "TiltY"             -0.2      0.2    "Absolute"       {[2 3 4 5 6 7 8]}
        8    "Nd"               -0.05     0.05    "Percentage"     {[2 3 4 5 6 7 8]}
    
    	Get insights using Copilot
    
    

    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 tolerances.

    resultSensitivity = opticalSensitivity(opsys,meritFcn,tolSet);

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

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

    Version History

    Introduced in R2026b