Optical systems
A collection of optical elements forms an optical system. Optical systems are used together with beams for the solve_system! function. Depending on the system type, different solver implementations can be activated. Currently the following types are available:
└── BeamletOptics.AbstractSystem
├── StaticSystem
└── System
At least 2 types have been found.Refer to the Tutorials section for examples on how to define optical systems.
BeamletOptics.System — Type
System <: AbstractSystemA container storing the optical elements of, i.e. a camera lens or lab setup.
Fields
objects: vector containing the different objects that are part of the system (subtypes ofAbstractObject)
BeamletOptics.StaticSystem — Type
StaticSystem <: AbstractSystemA static container storing the optical elements of, i.e. a camera lens or lab setup. Compared to System this way defining the system is less flexible, i.e. no elements can be added or removed after construction but it allows for more performant ray-tracing.
This type uses long tuples for storing the elements. This container should not be used for very large optical systems as it puts a lot of stress onto the compiler.
Fields
objects: vector containing the different objects that are part of the system (subtypes ofAbstractObject)
Solving systems
In order to solve optical systems, this package uses a hybrid sequential and non-sequential mode. Which mode is being used is determined automatically by the solve_system! function. This is explained in more detail in the section: Tracing logic.
BeamletOptics.solve_system! — Function
solve_system!(system::System, beam::AbstractBeam; r_max=100, retrace=true, depth_max=typemax(Int))Manage the tracing of an AbstractBeam through an optical system. The function retraces the beam if possible and then proceeds to trace each leaf of the beam tree through the system. The condition to stop ray tracing is that the last beam intersection is nothing or the beam interaction is nothing. Then, the system is considered to be solved. A maximum number of rays per beam (r_max) can be specified in order to avoid infinite calculations under resonant conditions, i.e. two facing mirrors. Likewise, depth_max limits how many branching levels are explored when new sub-beams are generated (for example, by beamsplitters) so that the tree cannot grow without bound.
Arguments
system::System: The optical system in which the beam will be traced.beam::AbstractBeam: The beam object to be traced through the system.r_max::Int=100(optional): Maximum number of tracing iterations for each leaf. Default is 100.retrace::Bool=true(optional): Flag to indicate if the system should be retraced. Default is true.depth_max::Int=typemax(Int)(optional): Maximum number of branching levels explored from the root beam. Default allows unlimited depth.