CLOSE WINDOW
DELETEMFO ALL
W = 5
K= 20
sample = 80
SYSP 11, W*6
SYSP 12, 1
apod_factor =1/POWER((1/3),1)
SYSP 13, apod_factor
FOR I, 1, sample+1, 1
INSERTMFO I
SETOPERAND I, 11, “REAY”
SETOPERAND I, 9, 1
norm_pupil_coord = I/sample
X= norm_ pupil_coord*W*3
# Un-normilized pupil coordinate
S= K*SQRT(1-EXPE(-2*POWER(X,2)/POWER(W,2)))
#same as the final equation in the article
SETOPERAND I, 8, -S
# set target. Positive input #coordinatehas negative
# output coordinate (positive lens) thusthe negative sign
SETOPERAND I, 7, norm_pupil_coord
# Set Py column of the operand
SETOPERAND I, 2, NSUR()
# specify the image surface for the REAYvalue calculation
NEXT
OPTIMIZE
UPDATE ALL # Update all windows
END