optimization.variable.forbes_coeff

Specialized variable handlers for Forbes polynomial coefficients.

This module provides handlers for Forbes polynomial coefficients, distinguishing between rotationally symmetric (slope-orthogonal Q) and freeform (Q-2D) surfaces.

Manuel Fragata Mendes, August 2025

Classes

ForbesQ2dCoeffVariable(optic, ...[, scaler])

Represents a variable for a Forbes Q-2D (freeform) coefficient.

ForbesQNormalSlopeCoeffVariable(optic, ...)

Represents a variable for a Forbes Q (slope-orthogonal) coefficient.

ForbesQbfsCoeffVariable(optic, ...[, scaler])

Deprecated alias for ForbesQNormalSlopeCoeffVariable.

class ForbesQ2dCoeffVariable(optic, surface_number, coeff_tuple, scaler=None, **kwargs)[source]

Represents a variable for a Forbes Q-2D (freeform) coefficient.

This variable targets the coefficient c corresponding to a specific (type, m, n) term, following the Zemax convention.

attribute

The name of the attribute holding the coefficients.

Type:

str

m

The azimuthal frequency m.

Type:

int

n

The radial order n.

Type:

int

term_type

The type of term (‘cos’ or ‘sin’).

Type:

str

coeff_tuple

The identifier for the coefficient.

Type:

tuple

get_value()[source]

Gets the value of the coefficient for the specified term.

Returns:

The value of the coefficient.

Return type:

float

Raises:

TypeError – If the geometry is not a ForbesQ2dGeometry.

inverse_scale(scaled_value)

Inverse scale the value of the variable.

Parameters:

scaled_value – The scaled value to inverse scale

scale(value)

Scale the value of the variable for improved optimization performance.

Parameters:

value – The value to scale

update_value(new_value)[source]

Updates the value of the coefficient for the specified term.

Parameters:

new_value (float) – The new value for the coefficient.

class ForbesQNormalSlopeCoeffVariable(optic, surface_number, coeff_number, scaler=None, **kwargs)[source]

Represents a variable for a Forbes Q (slope-orthogonal) coefficient.

This variable targets a coefficient for a specific radial order n.

coeff_number

The radial order ‘n’ of the coefficient.

Type:

int

get_value()[source]

Gets the value of the nth Q (slope-orthogonal) coefficient.

Returns:

The value of the coefficient.

Return type:

float

Raises:

TypeError – If the geometry is not a ForbesQNormalSlopeGeometry.

inverse_scale(scaled_value)

Inverse scale the value of the variable.

Parameters:

scaled_value – The scaled value to inverse scale

scale(value)

Scale the value of the variable for improved optimization performance.

Parameters:

value – The value to scale

update_value(new_value)[source]

Updates the value of the nth Q (slope-orthogonal) coefficient.

Parameters:

new_value (float) – The new value for the coefficient.

class ForbesQbfsCoeffVariable(optic, surface_number, coeff_number, scaler=None, **kwargs)[source]

Deprecated alias for ForbesQNormalSlopeCoeffVariable.

Deprecated since version Use: ForbesQNormalSlopeCoeffVariable instead.

get_value()

Gets the value of the nth Q (slope-orthogonal) coefficient.

Returns:

The value of the coefficient.

Return type:

float

Raises:

TypeError – If the geometry is not a ForbesQNormalSlopeGeometry.

inverse_scale(scaled_value)

Inverse scale the value of the variable.

Parameters:

scaled_value – The scaled value to inverse scale

scale(value)

Scale the value of the variable for improved optimization performance.

Parameters:

value – The value to scale

update_value(new_value)

Updates the value of the nth Q (slope-orthogonal) coefficient.

Parameters:

new_value (float) – The new value for the coefficient.