62
Optimization
GemRay can automatically choose the angles to optimize the optical performance of a
gemstone. GemRay uses an algorithm called the Downhill Simplex Method to find the
“
best
”
angles. This method also called Nelder-Mead method, after its discoverers. Sometimes it
’
s
called the Amoeba method. The Siplex method searches for a minimum of a function of
several variables. We want a maximum instead of a minimum, but the problem is
mathematically equivalent, since you can just take the reciprocal of the objective function.
Let
’
s call the function to be maximized the merit function and the function to be minimized
the objective function. Our merit function is just a weighted average of the brightness
percentages from the different lighting models at different tilt angles.
Our problem has two dimensions: the pavilion and crown scale factors. For our two-
dimensional problem, the simplex of the Downhill Simplex Method is just a triangle. The
method starts off with a small right triangle with the right angle vertex on the pavilion and
crown scale factors you have entered. For the other two vertices, it just offsets a small
amount in pavilion and crown scale factors. GemRay calculates the relative merits of the
three vertices. Using the relative heights of the three vertices it uses a simple set of rules
to transform or move the triangle to find a new triangle that is nearer the minimum. It
might move one or all of the vertices. For each new point, the method calculates the
objective function. From the relative heights of the objective function, it decides how to
transform the triangle for the next step. The process repeats until, at the final stage, the
triangle shrinks to a single point at the minimum.
When you press the Optimize
button, GemRay will
pop up the Optimization dialog so you can select the
values that control the optimization. The Tilt Angle
maximum and increment set the maximum tilt for the
optimization. At the default setting of 30 for the
maximum and 10 for the increment, GemRay will tilt the
stone
–30°,
–20°,
–10°,
0,
10°,
20°,
and
30°
and
calculate a small 100 pixel image for each tilt angle. The
brightness values are then multiplied by the weight
factors in the upper portion of the dialog.
With the default settings, the optimization gives a great
deal of weight to tilt performance since there are six
tilted images and only one face-up image. For this
reason, you might want to increase the weight value for
one or more of the face-up brightnesses. When you
make changes in the weights, make big changes, say a
factor of 5 or 10. A 10% change in one of the weights is
unlikely to change the outcome. Another trick is to
change one of the weights to 1000 to optimize for just that parameter. This is quicker than
zeroing out the other weights. The weights are relative weights, so if you double all of the
weights, the optimizer will converge on exactly the same answer, and the same merit value
will be displayed.
It is important to note that the tilt angle in the optimization is separate from the tilt
amount in the main GemRay Options dialog. The tilt direction however is the same and is