An optical apparatus which includes an image forming optical system having
a movable optical element, and a driving mechanism configured to move the
optical element. The apparatus includes a first block which measures a
wavefront aberration of the optical system. A second block obtains a
linear evaluation value of an aberration expressed by a linear function
of a position of the movable optical element out of aberrations of the
optical system, and a quadratic evaluation value of a square of a root
mean square of the wavefront aberration measured by the first block
expressed by a quadratic function of the position. A third block uses a
dummy variable as an upper limit value of the linear evaluation value and
obtains a minimum value of the dummy variable by a linear programming. A
fourth block determines a position of the optical element to be moved by
the driving mechanism.