A new magnetic design method, which optimizes the position of the conductors in the cross-section of a racetrack-shaped magnet, has been set up. This method is based on analytical formulas of field, harmonics and forces. The conductors are modeled with rectangles, which is particularly well adapted to a block design. A first equation is used to calculate the contribution of the rectangles, as a function of their four spatial coordinates. All the block contributions are then added up to give the entire equation as a function of all the rectangles coordinates. Finally a non-linear optimization, using the analytic formulas, computes these coordinates to fulfill the magnet specifications. The objective can be either to maximize the central field, or to minimize a criterion, for instance the conductor volume, the harmonics, the electromagnetic forces. Various kinds of constraints can also be imposed: zeroed harmonics, blocks position and number, central field... Two magnets designs are proposed as examples: a 13 T Nb3Sn magnet and a 20 T graded magnet. |