optimization.variable.base#

Base Variable Module

This module contains the base class for a variable in an optic system. The VariableBehavior class is an abstract class that represents the behavior of a variable in an optic system. It is used as a base class for all variables in the optimization process.

Kramer Harrison, 2024

Classes

VariableBehavior(optic, surface_number[, scaler])

Represents the behavior of a variable in an optic system.

class VariableBehavior(optic, surface_number, scaler: Scaler = None, **kwargs)[source]#

Represents the behavior of a variable in an optic system.

Parameters:
  • optic (Optic) – The optic system to which the variable belongs.

  • surface_number (int) – The surface number of the variable.

  • scaler (Scaler) – The scaler to use for the variable. Defaults to IdentityScaler().

  • **kwargs – Additional keyword arguments.

Variables:
  • optic (Optic) – The optic system to which the variable belongs.

  • _surfaces (SurfaceGroup) – The group of surfaces in the optic system.

  • surface_number (int) – The surface number of the variable.

  • scaler (Scaler) – The scaler to use for the variable.

abstractmethod get_value()[source]#

Get the value of the variable.

Returns:

The value of the variable.

inverse_scale(scaled_value)[source]#

Inverse scale the value of the variable.

Parameters:

scaled_value – The scaled value to inverse scale

scale(value)[source]#

Scale the value of the variable for improved optimization performance.

Parameters:

value – The value to scale

abstractmethod update_value(new_value)[source]#

Update the value of the variable.

Parameters:

new_value – The new value of the variable.