How to model a mixed sequential/non-sequential system

This article outlines the procedure for modeling a Mixed Mode system in OpticStudio. This utilizes both sequential surfaces and non-sequential objects in the same lens file. Mixed Mode will have Non-Sequential Component (NSC) groups within a sequential design and this article will cover their creation, as well as defining Exit Port characteristics. Finally, common mistakes and considerations will be addressed.

Authored By Dan Hill


There are two distinct ray tracing modes supported by OpticStudio (Sequential and Non-Sequential), but oftentimes it is necessary to combine the two techniques. A design that uses both methods of ray tracing may be referred to as a “Mixed Mode” or “Hybrid” system.

A Mixed-Mode system is a sequential system that contains non-sequential objects (aka NSC groups). To perform a ray trace through such a system, Entry and Exit Ports must be used to define the beginning and the end of the NSC group.

Mixed Mode layout

An example of a Mixed Mode system might be a point or extended surface object which is represented by rays that follow a Sequential ray path through one or two conventional lenses, then follow a Non-Sequential path through a prism or light pipe before illuminating the image surface. Below, the progression of rays in a Mixed Mode design is presented. In this case, a collimated beam passes through the Entry Port and undergoes TIR multiple times within a 30-60-90 prism. The collimated beam eventually hits the Exit Port, where the Sequential ray trace is resumed, and the light is focused by an equiconvex lens.

This method of ray tracing requires the use of ports - the Entry and Exit Ports - for rays to enter and leave the NSC group. The Entry and Exit Ports are a vital part of constructing a Mixed Mode system and will be discussed in more detail in the following pages of this article. When using ports, rays are launched from defined field positions on the object surface. All the usual Sequential OpticStudio system data, such as field positions and pupil sizes, determine the properties of rays entering the NSC group. 

Rays enter the group through the Entry Port, and may only leave the group via the Exit Port; they may then continue through the remainder of the Sequential system.

Inserting the NSC group: The Entry Port

Rays can only enter an NSC group through the Entry Port. NSC groups are first defined by inserting a Non-Sequential Component surface at the desired location in the LDE. This is performed by simply changing the Surface Type in the Surface Properties dialog for the selected surface.

It is the Non-Sequential Component (NSC) surface in the LDE which describes the location, size and shape of the Entry Port into the NSC group. The Entry Port may be planar, spherical, or conic aspherical, if desired, as described by the Radius and Conic parameters of the NSC surface. The location of the vertex of the Entry Port (or NSC surface) is determined by the previous surfaces in the LDE in the usual sequential, local coordinate system.

The NSC surface also supports a surface aperture, and any rays which fall outside of the defined size of the aperture will be terminated. Those rays which pass through the aperture on the Entry Port will be traced non-sequentially through the objects defined within the NSC group (more on this later).

Parameters of the NSC surface: The Exit Port

The NSC surface has a total of 9 parameters, most of which are used to define the location of the Exit Port with respect to the Entry Port.

As shown above, these parameters are:

  • Draw Ports?: This flag is used solely for drawing purposes. Sometimes, it is useful to be able to display the entry and Exit Ports in the layout plots. Use 0 to draw neither the entry nor Exit Port. Use 1 to draw just the Entry Port, 2 to draw only the Exit Port, and 3 to draw both. The default value is 3.
  • Exit Loc X, Exit Loc Y, Exit Loc Z, Exit Tilt X, Exit Tilt Y, Exit Tilt Z: These parameters describe the x,y,z positions and tilts of the Exit Port surface with respect to that of the Entry Port. As an example, if only an Exit Loc Z of 10 was specified (all other location and tilt parameter = 0), then the Exit Port would be located 10 lens units along the local z-axis of the NSC surface (the Entry Port):

OpticStudio uses a default Exit Loc Z value of 1, simply to place the Exit Port some non-zero distance from the Entry Port. If the two are co-located, then rays which hit the Entry Port immediately exit via the Exit Port, and will never see the objects defined within the group.

  • Order: The order flag indicates the order in which to perform the tilts/decenters. This works identical to that of the Order flag for Coordinate Breaks. For details, see the article entitled "How to tilt and decenter a sequential optical component."
  • Reverse Rays: This flag is used to indicate the direction of propagation of rays once they leave the Exit Port. If the flag is 0, then OpticStudio assumes that the Non-Sequential group acts like a refractive lens. In other words, if the direction of propagation of the rays is the same from entry to Exit Port, then this flag should be zero. If, on the other hand, rays reverse direction relative to the incoming direction, then this flag should be 1. 

Because the positions of the Exit Port with respect to the NSC surface are defined by the parameters of the NSC surface itself, the surface following the NSC surface in the LDE becomes the location of the Exit Port. It is this surface that defines the size and shape of the Exit Port. Note the Semi-Diameter of the Exit Port must be a user-defined value, and cannot be automatically calculated.

Apertures may also be placed on the Exit Port surface, if the desired shape is non-circular. When a ray strikes the Exit Port, the coordinates and direction cosines of the ray in the coordinate system of the Exit Port are computed, and then the ray is traced sequentially through any remaining surfaces defined in the LDE. If one of the following surfaces is another Non-Sequential Components surface, then the process begins again for the components defined for that group. This means that more than one NSC group may be defined, and each group has its own entry and Exit Port!

Defining the objects within each NSC group

So far we have discussed how to define both the Entry and Exit Port for our Non-Sequential Component group. But what about the non-sequential objects themselves? Where and how are these objects defined?

Objects within each Non-Sequential Component group are defined in their own editor, called the Non-Sequential Component Editor, which may be accessed from the Editors menu of the Setup tab in OpticStudio.

The Non-Sequential Component Editor (NSCE) operates just like a pure non-sequential editor, where objects are defined by positions and object-specific parameters. Objects may be nested, GRIN media may be applied, faces may be coated, etc.

The important point to note about the NSCE is the global coordinate by which every object in a group is referenced to. The global (0,0,0) is located at the Entry Port of each group, so all of the objects defined within the NSCE are referenced to the Entry Port of that group. There is no limit to the number of objects which may be defined in the group, but as soon as any ray strikes the Exit Port, it resumes its sequential path.

The title bar of the NSCE indicates which surface in the LDE that the group corresponds to:

This means that the objects listed in the NSCE are the components in the NSC group defined by a particular surface in the LDE. Since more than one NSC group may be defined in a single Mixed Mode system, more than one NSC Editor is required. Only one editor may be displayed at a time. The active NSC editor may be toggled by using the fletch on the Object Properties bar.

For example, if two different NSC groups exist, described by surfaces 4 and 8 in the LDE, then the objects which exist in the first group will be defined by the NSC Editor for “Component Group on Surface 4” and the second group will be defined in its own NSC Editor: “Component Group on Surface 8.”

Considerations and comments

There are many sample files included with OpticStudio which use this Mixed Mode capability, many of which are located in the {Zemax}\Samples\Non-Sequential\Prisms\ directory. To familiarize yourself with Mixed Mode within OpticStudio, you may want to consider opening some of the various files within this folder and observe the definition of the objects within the NSC Editor, the Exit Port location and size, the sequential aperture definition, and so on.

Additionally, here are some key points to understand about Mixed Mode systems:

  • All of the normal OpticStudio Sequential analysis features are still available in Mixed Mode systems, such as Ray Fans, Spot Diagrams, OPD plots; etc. However, it is important to note that many sequential features are based upon calculations that depend upon paraxial equivalents (such as the location of the paraxial exit pupil to calculate the reference sphere radius necessary for OPD calculations). As a general NSC group cannot be broken down into a paraxial equivalent, many of the paraxial-based calculations will be meaningless. Perhaps the most commonly used and meaningful analysis features used in Mixed Mode systems are that of the Spot Diagram and Geometric Image Analysis since they do not require any paraxial references.
  • Note that the NSC surface in the LDE supports a Glass definition, which may be used to define the “background” material and index of refraction of the media in which NSC objects are placed. If material is defined, then both the entry and Exit Port may serve as refractive boundaries.
  • Ray defined by the Sequential System Aperture (sequential rays) cannot see the sources and detectors defined within an NSC group. Likewise, rays from NSC sources cannot leave the NSC group. As a result, rays from NSC sources cannot be used as part of the Sequential-based analysis feature.

Sequential rays cannot split within an NSC group – only the primary ray path is considered. In Sequential Mode, a deterministic ray path is required, and only the number of rays launched (no more) may reach the image plane (ray splitting could potentially increase the number of rays that eventually reach the image plane). This is especially essential for optimization, so that OpticStudio may converge to a solution.


  1. Webinar: Creating sequential systems with prisms, CAD parts, and other complex objects in OpticStudio
  2. Webinar: Comprehensive optical system design in OpticStudio


Was this article helpful?
16 out of 18 found this helpful



Please sign in to leave a comment.