This paper presents a novel objective function in order to design elec
tromagnetic devices. The finite element method taking the open boundar
y condition into account is used for magnetic field computation. Compa
rison of the results obtained with the novel objective function and th
e least squares shows that the former is superior to the latter.