In this paper the results obtained in the realization of an automatic
procedure for magnet design in 2D, plane and axysimmetric, will be pre
sented. The proposed procedure combines mesh adaption, based on an ''a
-posteriori'' error estimate, and deterministic optimization technique
s. The use of an analysis module with mesh adaption capabilities gives
the automatic design procedure a more stable behaviour in the evaluat
ion of the objective function, In particular, one of the most importan
t features of this strategy is to allow wide variations dimensional pa
rameters, with high accuracy. The procedure has been realized with mod
ified version of the VF/OPERA 2d code, realized by the authors, and an
optimization technique, based either on the ''Response Surface'' or o
n the ''Pattern Search'' algorithm, interacting with the analysis code
using parametric commands.