# Patent

## Title
Magnets with varying magnetization direction and method of making such magnets

## Abstract

A permanent magnet in which the magnetization direction varies with location to optimize or restrict a magnetic field property in a selected direction at a selected point. The magnetic field property may be, for example, the transverse magnetic field, axial magnetic field, axial gradient of the transverse magnetic field, transverse gradient of the transverse magnetic field, axis gradient of the axial magnetic field, transverse gradient of the axial magnetic field, the product of the transverse magnetic field and the transverse gradient of the transverse magnetic field, the product of the transverse magnetic field and the axial gradient of the transverse magnetic field, the product of the axial magnetic field and the transverse gradient of the axial magnetic field, or the product of the axial magnetic field and the axial gradient of the axial magnetic field. The magnet may be formed of one or more segments in which the magnetization direction varies smoothly and continuously, or the magnet may be formed of a plurality of segments in which the magnetization direction is constant. A method of making and using such magnets is also disclosed.

## Background
This application is a continuation of application Ser. No. 09/546,840, field Apr. 11, 2000, now abandoned.


FIELD OF THE INVENTION
This invention relates to permanent magnets, and in particular to a permanent magnet in which the magnetization direction varies to maximize a selected magnetic property of the magnet, and to methods of making such magnets.
BACKGROUND OF THE INVENTION
There are a number of applications, such as magnetic surgical applications, where it necessary to apply strong magnetic forces (i.e., magnetic fields and/or gradients). With recent advances in permanent materials, permanent magnets can provide strong magnetic forces for many of these applications. However, the size of a conventional permanent magnetic that is needed to provide these strong magnetic forces limits their usefulness. The structures needed to support massive conventional magnets are expensive and cumbersome. Moreover because magnetic forces fall off rapidly (with the third power of the distance for magnetic fields and with the fourth power of the distance for magnetic gradients), the magnet must be very close to the point where the magnetic force is to be applied, making the rotations and translations of the magnet to change the direction of the applied magnetic force difficult. In the special case of magnetic surgery applications, the movement of the magnet is also limited by imaging and life support equipment in the procedure room.
SUMMARY OF THE INVENTION
The present invention is a permanent magnet in which the magnetization direction varies to maximize the selected magnetic property of the magnet (e.g. field strength or gradient), and to a method of making such magnets. Generally, the magnet of the present invention comprises permanent magnets in which the magnetization direction at each point is selected to optimize the particular magnetic property. Thus in contrast to conventional permanent magnets in which the magnetization direction is uniform throughout, in the magnets of the present invention, the material at each point provides the optimum contribution to the desired magnetic property. This optimization means that a magnet of the present invention can be smaller and lighter than a conventional magnet, and yet sill provide equivalent magnetic force. This magnet is particularly useful in magnetic surgical procedures. The magnet allows smaller less cumbersome equipment to be used in to support and manipulate the magnet, and reduces the opportunity of interference with people and equipment in the procedure room.
According to the method of this invention, the magnet shape is first determined, given the physical constraints, e.g. set off distance, accommodating other structures and equipment in the vicinity of the where the magnetic will be operated; and likely manipulations required of the magnet. A permanent magnet in the selected shape is then made, in which the magnetization direction at each point is generally optimized for the selected property. This can be accomplished by providing a monolithic permanent magnet piece with a continuously varying magnetization direction, or by providing a plurality of magnetic segments, which can either have a single magnetization direction throughout, or which can themselves have continuously varying magnetization direction. In the former case, the magnetization direction is optimized for a particular point, for example the center of mass, thereby substantially approximating the optimum magnetization direction.
Thus magnets of the present invention provide improved magnetic properties for a given weight and size over conventional permanent magnet. The magnets can be manipulated by smaller and less cumbersome equipment, and due to their smaller size are less likely to interfere with, or be interfered with by persons and equipment. The method of the present invention provides magnets of the present invention.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a diagram showing the relationship between a local magnetic moment m, the magnetization angle α, and the location of the moment m as given by r and θ from the origin at the application point;
FIG. 2 is a top plan view of a first embodiment of a magnet, constructed according to the principles of this invention, optimized to provide a strong, transverse field at a selected application point spaced from the magnet face;
FIG. 3 is a top plan view of a second embodiment of a magnet constructed according to the principles of this invention, in which the magnet field was restricted during design to provide a transverse field at a selected application point spaced from the magnet face;
FIG. 4 is a top plan view of a third embodiment of a magnet, constructed according to the principles of this invention, optimized to provide a strong, forward field at a selected pointed spaced from the magnet face;
FIG. 5 is a top plan view of a fourth embodiment of a magnet constructed according to the principles of this invention, illustrating how the restriction of field direction permits asymmetry in magnet construction;
FIG. 6 is a graph of magnetization angle α versus position angle θ for restricted bx (i.e., by=0) (the magnet shown in FIG. 3), and for the optimized of bx (the magnet shown in FIG. 2);
FIG. 7 is a graph of the scaled magnetic field component in the x direction (b′x) versus position angle θ of the element for a restricted field magnetization case (by=0), the scaled magnet field component in the y direction (b′y) being zero;
FIG. 8 is a constant contribution curve, i.e., the curve representing the positions where a properly aligned magnetic moment would contribute equally to the field in the x direction at the origin, (i.e., an angular distribution curve r vs. θ as a polar plot) for the restricted field magnetization curve (by=0));
FIG. 9 is a graph of magnetization angle α versus position angle θ for the restricted gradient (∂bx/∂x=0) and for the restricted gradient (∂bx/∂y=0);
FIG. 10 is a graph of the scaled magnetic field components in the x direction (b′x) and in the y direction (b′y) of the contributing element versus position angle θ of the element for the restricted transverse field gradient in the axial direction case (∂bx/∂x=0);
FIG. 11 is a graph of the scaled magnetic field components in the x direction (b′x) and in the y direction (b′y) of the contributing element versus position angle θ of the element for the restricted transverse field gradient in the transverse direction case (∂bx/∂y=0);
FIG. 12 is a constant contribution curve, i.e., the curve representing the positions where a properly aligned magnetic moment would contribute equally to the axial gradient component of the transverse field (i.e., the field in the x direction) at the origin, (i.e., an angular distribution curve r vs. θ as a polar plot) for the restricted gradient magnetization case (∂bx/∂x=0);
FIG. 13 is a constant contribution curve, i.e., the curve representing the positions where a properly aligned magnetic moment would contribute equally to the transverse gradient component of the transverse field (i.e., the field in the x direction) at the origin, (i.e., an angular distribution curve r vs. θ as a polar plot) for the restricted gradient magnetization case (∂bx/∂y=0);
FIG. 14 is a graph of the scaled magnetic field component in the x direction (b′x) and in the y direction (b′y) of the contributing element versus position angle θ of the element for the optimized field magnetization case (bx maximized)(e.g. for the magnet shown in FIG. 2);
FIG. 15 is a constant contribution curve, i.e., the curve representing the positions where a properly aligned magnetic moment would contribute equally to the field in the x direction at the origin, (i.e., an angular distribution curve r vs. θ as polar plot) for the optimized field magnetization case (bx maximized);
FIG. 16 is graph of magnetization angle α versus position angle θ for optimized gradient component (∂bx/∂x optimized with respect to α), and for optimized gradient component (∂bx/∂y optimized with respect to α);
FIG. 17 is a graph of the scaled magnetic field components in the x direction (b′x) and in the y direction (b′y) of the contributing element versus position angle θ of the element for the optimized transverse gradient of the transverse field (∂bx/∂x optimized with respect to α);
FIG. 18 is a graph of the scaled magnetic field components in the x direction (b′x) and in the y direction (b′y) versus position angle θ for the optimized axial gradient of the transverse field (∂bx/∂y optimized with respect to α);
FIG. 19 is a constant contribution curve, i.e., the curve representing the positions where a properly aligned magnetic moment would contribute equally to the optimized transverse gradient of the transverse field (i.e., the field in the x direction) at the origin, (i.e., an angular distribution curve r vs. θ as polar plot) for the optimized gradient magnetization case (∂bx/∂x optimized);
FIG. 20 is a constant contribution curve, i.e., the curve representing the positions where a properly aligned magnetic moment would contribute equally to the optimized axial gradient of the transverse field (i.e., the field in the x direction) at the origin, (i.e., an angular distribution curve r vs. θ as a polar plot) for the optimized gradient magnetization case (∂x/∂y optimized);
FIG. 21 is graph of magnetization angle α versus position angle θ for optimized field-gradient product components (bx(∂bx/∂x) optimized) and (bx(∂bx/∂y) optimized);
FIG. 22 is a graph of the scaled magnetic field components in the x direction (b′x) and in the y direction (b′y) of the contributing element versus position angle θ for the element for optimized field-gradient product magnetization case (bx(∂bx/∂x) optimized);
FIG. 23 is a graph of the scaled magnetic field components in the x direction (b′x) and in the y direction (b′y) of the contributing element versus position angle θ for optimized field-gradient product magnetization case (bx(∂bx/∂y) maximized);
FIG. 24 is a constant contribution curve, i.e., the curve representing the positions where a properly aligned magnetic moment would contribute equally to the optimized field gradient product at the origin, (i.e., an angular distribution curve r vs. θ as a polar plot) for the optimized gradient magnetization case (bx(∂bx/∂x) optimized);
FIG. 25 is a constant contribution curve, i.e., the curve representing the positions where a properly aligned magnetic moment would contribute equally to the optimized field gradient product at the origin, (i.e., an angular distribution curve r vs. θ as a polar plot) for the optimized gradient magnetization case [bx(∂bx/∂y) maximized];
FIG. 26A is a perspective view of a magnet constructed from a plurality of permanent magnetic segments, according to the principles of this invention;
FIG. 26B is top plan view of the magnet shown in FIG. 26A;
FIG. 26C is a side elevation view of the magnet shown in FIG. 26A;
FIG. 26D is a front elevation view of the magnet shown in FIG. 26A;
FIG. 27A is a front perspective view of an alternate construction of a magnet constructed from a plurality of permanent magnet segments, according to the principles of this invention; and
FIG. 27B is a rear perspective view of the magnet shown in FIG. 27A.
Corresponding reference numerals indicate corresponding parts throughout the several views of the drawings.



DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
The magnets of the preferred embodiments of the present invention are permanent magnets in which the magnetization direction varies by location to provide magnets that optimize a selected magnetic field property at a selected location external to the magnet. These magnets may comprise a monolithic magnet in which the magnetization direction varies smoothly and continuously so that at each location, the magnetization direction is substantially in the direction that optimizes the selected magnetic property. Alternatively, these magnets may comprise a plurality of magnet segments, each with a magnetization that is substantially in the direction that optimizes the selected magnetic field property. These magnets can be used in any application, but are particularly useful for magnetic surgical applications.
The methods of making magnets of the preferred embodiments of the present invention provide for the simple construction of optimized magnets. The methods involve the arrangement of individual magnetic dipole elements. These dipole elements may be actual microscopic magnetic domains in a material, or they may be macroscopic magnetic segments assembled to form the magnet. Using the dipole approximation, it is possible to derive formulas for the magnetization direction as a function of the position. Based upon these formulas the appropriate magnetization direction at any location can be determined. This magnetization can then be achieved by variably magnetizing a monolithic magnet, or by assembling a plurality of magnetic segments of different uniform magnetization directions.
A magnetic dipole is approximated by the formula: 



  
    
      
        b
        =
        
          
            
              μ
              0
            
            
              4
              ⁢
              π
            
          
          ⁡
          
            [
            
              
                -
                
                  m
                  
                    r
                    3
                  
                
              
              +
              
                
                  3
                  ⁢
                  
                    (
                    
                      m
                      ·
                      r
                    
                    )
                  
                  ⁢
                  r
                
                
                  r
                  5
                
              
            
            ]
          
        
      
    
    
      
        (
        1
        )
      
    
  




where b is the magnetic field due to the elemental magnetic moment m, r is the location of the moment, and μo is the permeability of free space. The orientation of m for each location in the magnet is determined to maximize a selected magnetic field property at the selected operating point. The collection of N magnetic moments comprising the magnet create a source field B, that is the sum of the source fields created by each of the magnetic moments: 



  
    
      
        B
        =
        
          
            ∑
            
              i
              =
              1
            
            N
          
          ⁢
          
             
          
          ⁢
          
            b
            i
          
        
      
    
    
      
        (
        2
        )
      
    
  




In this preferred embodiment, the collection of magnetic moments that form the magnet are treated in two dimensions, i.e., in a plane. The optimization of the magnet moments which represent the local magnetization direction, will be two-dimensional, and the important elemental magnetizations will therefore lie in this chosen plane. While a full three-dimensional optimization has been carried out, the two-dimensional case is described as the preferred embodiment because magnets with constant magnetization in one direction are simpler to construct, and three-dimensional optimization yields only an incremental gain in efficiency. It is apparent to one of ordinary skill in the art that the optimization could be a three-dimensional, which although in some cases might be important, in most cases does not yield important increases in efficiency.

As discussed herein, the coordinates are chosen so that the active plane in which the moment orientations are restricted is designated the x-y plane. Then, in principle, the z-axis contains no variation in magnetization within the magnet boundaries, although it can be appreciated that boundary conditions may render this assumption slightly inaccurate depending on the restrictions or parameter optimization. Therefore, the optimal magnetization directions are easily analyzed in the plane defined by the magnetic field b and the magnetic moment m.
FIG. 1 shows the coordinate system in which the microscopic moment m, is at a magnetization angle α, and a location given by r and θ. The direction of the vector r is reversed from its usual textbook usage. This is permissible since r appears quadratically in the moment equation. It is useful in the present application, since it leads intuitively to the usage of its two-dimensional magnitude as an angular distribution of magnetized moments needed to provide required fields and/or gradients. Using the coordinate system in FIG. 1, b of equation (1) can be expressed in terms of the angles α and θ. 



  
    
      
        b
        =
        
          
            {
            
              
                
                  
                    b
                    x
                  
                
              
              
                
                  
                    b
                    y
                  
                
              
            
            }
          
          =
          
            
              
                
                  μ
                  o
                
                ⁢
                m
              
              
                8
                ⁢
                π
                ⁢
                
                   
                
                ⁢
                
                  r
                  3
                
              
            
            ⁢
            
              {
              
                
                  
                    
                      
                        A
                        ⁢
                        
                           
                        
                        ⁢
                        cos
                        ⁢
                        
                           
                        
                        ⁢
                        α
                      
                      +
                      
                        B
                        ⁢
                        
                           
                        
                        ⁢
                        sin
                        ⁢
                        
                           
                        
                        ⁢
                        α
                      
                    
                  
                
                
                  
                    
                      
                        B
                        ⁢
                        
                           
                        
                        ⁢
                        cos
                        ⁢
                        
                           
                        
                        ⁢
                        α
                      
                      +
                      
                        
                          (
                          
                            2
                            -
                            A
                          
                          )
                        
                        ⁢
                        sin
                        ⁢
                        
                           
                        
                        ⁢
                        α
                      
                    
                  
                
              
              }
            
          
        
      
    
    
      
        (
        3
        )
      
    
  
  
    
      
        
          ∂
          
             
          
          ⁢
          
            b
            x
          
        
        =
        
          
            {
            
              
                
                  
                    
                      ∂
                      
                        b
                        x
                      
                    
                    /
                    
                      ∂
                      x
                    
                  
                
              
              
                
                  
                    
                      ∂
                      
                        b
                        x
                      
                    
                    /
                    
                      ∂
                      y
                    
                  
                
              
            
            }
          
          =
          
            
              
                3
                ⁢
                
                  μ
                  o
                
                ⁢
                m
              
              
                
                  8
                  ⁢
                  π
                  ⁢
                  
                     
                  
                  ⁢
                  
                    r
                    4
                  
                
                ⁢
                
                   
                
              
            
            ⁢
            
              {
              
                
                  
                    
                      
                        C
                        ⁢
                        
                           
                        
                        ⁢
                        cos
                        ⁢
                        
                           
                        
                        ⁢
                        α
                      
                      +
                      
                        D
                        ⁢
                        
                           
                        
                        ⁢
                        sin
                        ⁢
                        
                           
                        
                        ⁢
                        α
                      
                    
                  
                
                
                  
                    
                      
                        E
                        ⁢
                        
                           
                        
                        ⁢
                        cos
                        ⁢
                        
                           
                        
                        ⁢
                        α
                      
                      +
                      
                        F
                        ⁢
                        
                           
                        
                        ⁢
                        sin
                        ⁢
                        
                           
                        
                        ⁢
                        α
                      
                    
                  
                
              
              }
            
          
        
      
    
    
      
        (
        4
        )
      
    
  




where 



  
    
      
        
          
            
              
                
                  A
                  ≡
                  
                    A
                    ⁡
                    
                      (
                      θ
                      )
                    
                  
                
                =
                
                  1
                  +
                  
                    3
                    ⁢
                    cos
                    ⁢
                    
                       
                    
                    ⁢
                    2
                    ⁢
                    θ
                  
                
              
            
          
          
            
              
                
                ⁢
                
                  
                    B
                    ≡
                    
                      B
                      ⁡
                      
                        (
                        θ
                        )
                      
                    
                  
                  =
                  
                    3
                    ⁢
                    sin
                    ⁢
                    
                       
                    
                    ⁢
                    2
                    ⁢
                    θ
                  
                
              
            
          
        
        }
      
    
    
      
        (
        5
        )
      
    
  
  
    
      
        
          
            
              
                
                ⁢
                
                  
                    C
                    ≡
                    
                      C
                      ⁡
                      
                        (
                        θ
                        )
                      
                    
                  
                  =
                  
                    
                      2
                      ⁢
                      
                         
                      
                      ⁢
                      sin
                      ⁢
                      
                         
                      
                      ⁢
                      θsin
                      ⁢
                      
                         
                      
                      ⁢
                      2
                      ⁢
                      θ
                    
                    -
                    
                      cos
                      ⁢
                      
                         
                      
                      ⁢
                      θ
                    
                    -
                    
                      3
                      ⁢
                      
                         
                      
                      ⁢
                      cos
                      ⁢
                      
                         
                      
                      ⁢
                      θcos
                      ⁢
                      
                         
                      
                      ⁢
                      2
                      ⁢
                      θ
                    
                  
                
              
            
          
          
            
              
                
                ⁢
                
                  
                    D
                    ≡
                    
                      D
                      ⁡
                      
                        (
                        θ
                        )
                      
                    
                  
                  =
                  
                    
                      3
                      ⁢
                      
                         
                      
                      ⁢
                      cos
                      ⁢
                      
                         
                      
                      ⁢
                      θ
                      ⁢
                      
                         
                      
                      ⁢
                      sin
                      ⁢
                      
                         
                      
                      ⁢
                      2
                      ⁢
                      θ
                    
                    +
                    
                      2
                      ⁢
                      
                         
                      
                      ⁢
                      sin
                      ⁢
                      
                         
                      
                      ⁢
                      θcos
                      ⁢
                      
                         
                      
                      ⁢
                      θ
                    
                  
                
              
            
          
          
            
              
                
                ⁢
                
                  
                    E
                    ≡
                    
                      E
                      ⁡
                      
                        (
                        θ
                        )
                      
                    
                  
                  =
                  
                    
                      
                        -
                        2
                      
                      ⁢
                      
                         
                      
                      ⁢
                      cos
                      ⁢
                      
                         
                      
                      ⁢
                      θsin
                      ⁢
                      
                         
                      
                      ⁢
                      2
                      ⁢
                      θ
                    
                    -
                    
                      sin
                      ⁢
                      
                         
                      
                      ⁢
                      θ
                    
                    -
                    
                      3
                      ⁢
                      
                         
                      
                      ⁢
                      sin
                      ⁢
                      
                         
                      
                      ⁢
                      θcos
                      ⁢
                      
                         
                      
                      ⁢
                      2
                      ⁢
                      θ
                    
                  
                
              
            
          
          
            
              
                
                ⁢
                
                  
                    F
                    ≡
                    
                      F
                      ⁡
                      
                        (
                        θ
                        )
                      
                    
                  
                  =
                  
                    
                      2
                      ⁢
                      cos
                      ⁢
                      
                         
                      
                      ⁢
                      θ
                      ⁢
                      
                         
                      
                      ⁢
                      cos
                      ⁢
                      
                         
                      
                      ⁢
                      2
                      ⁢
                      θ
                    
                    -
                    
                      3
                      ⁢
                      
                         
                      
                      ⁢
                      sin
                      ⁢
                      
                         
                      
                      ⁢
                      θsin2
                      ⁢
                      
                         
                      
                      ⁢
                      θ
                    
                  
                
              
            
          
        
        }
      
    
    
      
        (
        6
        )
      
    
  




Thus the quantities A, B, C, D, E and F are functions only of the element position angle θ relative to a coordinate system in which the elemental field b and complete field B are described. Furthermore, the quantities given by equations (3) and (4) represent the complete reduced set given that ∇·b=0 and ∇×b=0, thereby establishing that there are only four unique quantities bx, the field in the x direction, by, the field in the y direction, ∂bx/∂x, the gradient in the x direction, and ∂bx/∂y, the gradient in the y direction, (assuming, as stated above, that the z components are ignored).

Co-pending U.S. patent application Ser. No. 09/497,467, filed Feb. 3, 2000, entitled An Efficient Magnet System for Magnetically-Assisted Surgery, incorporated herein by reference, details one embodiment in which the completed magnet is operated so that the procedure point in a patient is on the central x-y plane.
The essence of the methods described herein is to select the desired magnetic field properties of the completed magnet, and apply the requisite implied conditions to the individual elemental moments. For example, if a strong, flat, transverse, central field region is needed for the operating region of a magnet, the individual elemental moments (at angle α) can be aligned relative to their locations (i.e., as specified by angle θ in the plane) so as to produce optimal contributions to that type of field. This is a unique vector type of “focusing” to accomplish a desired field projection for each element of the magnet, adding up to an optimum for the complete magnet. As described in more detail below, the first step in development of a magnet is to calculate the relationship between α and θ for the selected magnetic field property and selected location, for the magnet. In the case of a predominantly transverse field over the operating center region of the magnet, one requisite implied condition would be to set by equal to zero in equation (3) above. FIGS. 2 and 4 show alternative magnet constructions for optimizing the magnetic field along the x-direction. In FIG. 2 the field is parallel to the magnet face. In FIG. 4, the field is perpendicular to the magnet face. In the case of the restricted field magnets (shown in FIGS. 3 and 5) the magnets provide strong fields in a given direction by setting perpendicular components to zero at the outset. In the case of optimized field magnets (shown in FIGS. 2 and 4) the magnets provide the mathematical optimum filed strength. The restricted field magnets, automatically achieves the desired field direction, irrespective of magnet shape or symmetry (as illustrated by FIG. 5). The optimal field magnet provides the optimal field strength in the desired direction, for a given size, but requires symmetric retention of elements to preserve field direction.
In another application, the requirement may be for a gradient that is zero except in a selected direction in a selected region spaced from the magnet. The magnetic field gradient is a tensor, so in two-dimensions, two such cases can exist mathematically, for ∂bx/∂x=0 or for ∂bx/∂y=0, by the use of equation (4) above. (∂by/∂x=∂bx/∂y from ∇×b=0.) Clearly, a number of magnet shapes could be used with this restricted case.
In still another application, the requirement may be for the optimization of the magnetic field gradients in some region. And still another application, the requirement may be for the field-gradient products to be optimized. This last case would be useful for the pulling of permeable materials or objects in some particular direction, while orienting them in the same or a different direction. Five major categories of these restrictions and optimizations are discussed below. One of ordinary skill in the art could use similar methods for other cases.
Once the optimal magnet shape and the magnetization direction for a given position are determined, a permanent magnet can be fabricated from a permanent magnetic material, such as a neodymium-boron-iron (Nd—B—Fe) material, of the appropriate shape can be magnetized in the appropriate directions, or a magnet can be assembled from a plurality if magnetic segments, with the proper shape and magnetization direction.
Specifically, the five major categories of cases employ two different procedures: restriction and optimization, although similar results can sometimes be achieved by either procedure. The two procedures differ, organizationally, in the use either of restriction of an undesired property, or the optimization of a desired property. The details of element selection at the end to achieve a final complete magnet will be motivated somewhat differently in the two procedures.
Cases A and B first restrict components of certain magnetic field properties so as to a priori provide the directions needed for the desired properties. The case will then, at the end, use material removal to make the magnet as small and light as possible while achieving required strengths of the desired quantities at the desired location.
Alternatively, cases C, D and E will first optimize (maximize) the desired quantities, and at the end remove material to simultaneously make the magnet smaller and to rid the field of undesired “off-direction” components of the desired quantity, since the procedure will not have automatically removed them. Clearly, attention to symmetry is important.
A. Restricted Field Case
This case first restricts a magnetic field property, uses equations to arrive at a prototype magnet shape, and then uses judicious material removal to optimize the desired quantity in conjunction with achieving the smallest and lightest magnet, typically using an iterative or trial and error method. This case does not use a formal optimization procedure.
In this case, one component of the magnetic field of the element is zeroed at a distance from the magnet. This restricted case is useful in that the magnet may be composed of segments that do not need to be balanced (i.e., symmetry need not be reflected in the magnet's material removal, or design) to ensure that one component of the field remains zeroed.
The procedure here will be first to develop equations which relate the magnetization angle α to the position angle θ for a particular element so that it will contribute a magnetic field only in the x direction, i.e. so by/=0, for some point of interest in the operating region. This can be thought of as a conditional requirement on each particular element, to be used later in the assembly of elements for the magnet. This might, for example, be a case where a transverse field was needed in the patient procedure volume. FIGS. 6, 7, and 8 will be used to depict, respectively and as described above, the consequences of this restriction on 1) the magnetization angle-position angle relationship, 2) the relative magnetic field component contributions vs. position angle θ at an implicit but correctly scaled distance r, and 3) a polar plot of the distance r at which the given reference field strength is reached in the x-y plane.
Setting by=0, we find that 



  
    
      
        
          tan
          ⁢
          
             
          
          ⁢
          α
        
        =
        
          B
          
            A
            -
            2
          
        
      
    
    
      
        (
        7
        )
      
    
  




relates the magnetization angle α to the element position angle θ (implicitly through A and B). This is depicted as the solid line in FIG. 3. From symmetry, the case bx=0 can be seen by extrapolation. FIG. 6 contains the information which is needed to keep track of (in the computer) the magnetization directions α in the “shape” plot or “angular distribution” plot, FIG. 8 below, which is used to determine the final magnet shape. FIG. 7 portrays the change in the magnetic field contributions of the elements due to their varying magnetization directions (as a consequence of varying θ) where the plotted field is scaled so that 



  
    b
    ′
  
  =
  
    
      (
      
        
          8
          ⁢
          π
          ⁢
          
             
          
          ⁢
          
            r
            3
          
        
        
          
            μ
            o
          
          ⁢
          m
        
      
      )
    
    ⁢
    
      b
      .
    
  




It also follows that for constant contributions of bx, the desired shape of the magnet is given by solving the x-component of equation (3) for r: 



  
    
      
        r
        =
        
          
            
              (
              
                
                  
                    μ
                    o
                  
                  ⁢
                  m
                
                
                  8
                  ⁢
                  π
                  ⁢
                  
                     
                  
                  ⁢
                  
                    b
                    x
                  
                
              
              )
            
            
              1
              /
              3
            
          
          ⁢
          
            
              (
              
                
                  A
                  ⁢
                  
                     
                  
                  ⁢
                  cos
                  ⁢
                  
                     
                  
                  ⁢
                  α
                
                +
                
                  B
                  ⁢
                  
                     
                  
                  ⁢
                  sin
                  ⁢
                  
                     
                  
                  ⁢
                  α
                
              
              )
            
            
              1
              /
              3
            
          
        
      
    
    
      
        (
        8
        )
      
    
  




for which θ, again, is implicit in A and B. This is shown by the polar plot of FIG. 5 (i.e., r versus θ) where the radial component is scaled by the quantity 



  
    
      (
      
        
          8
          ⁢
          π
          ⁢
          
             
          
          ⁢
          
            b
            x
          
        
        
          
            μ
            o
          
          ⁢
          m
        
      
      )
    
    
      1
      /
      3
    
  
  .




A few of the directions α (implicit in r(θ) are shown by the arrows around the r(θ) curve. The magnet shown in FIG. 3 is derived from this restricted field case.

In summary, the magnet shape and ideal magnetization distribution is determined in the x-y plane from FIG. 8, which represents a locus of the planar value of r at which a reference value of bx is achieved.
B. Restricted Gradient Case
Similar in overall method to the restricted field case, this case, in addition to practically restricting a different quantity, is useful in that the magnet may then be composed of segments that do not require symmetry in their design to remove the influence of undesirable gradient terms at the point r. For the choice of gradient direction null ∂bx/∂x=0 we find that 



  
    
      
        
          tan
          ⁢
          
             
          
          ⁢
          α
        
        =
        
          -
          
            C
            D
          
        
      
    
    
      
        (
        9
        )
      
    
  




and for ∂bx/∂y=0 it follows that 



  
    
      
        
          tan
          ⁢
          
             
          
          ⁢
          α
        
        =
        
          -
          
            E
            F
          
        
      
    
    
      
        (
        10
        )
      
    
  




FIG. 9 depicts the results of equations (9) and (10), showing α versus θ explicitly in the two sub-cases. FIGS. 10 and 11 plot the relationship of the scaled magnetic field contributions to θ for the two cases ∂bx/∂x=0 and ∂bx/∂y=0, respectively. In FIG. 9 there are now two α-θ relationships, corresponding to the two directions of gradient restriction. It is notable, and relevant to final magnet design, that while θ was double-valued in α for the restricted field condition, it is now triple-valued in α in each of the gradients not restricted to zero. The two curves in FIG. 10 for the scaled field component ( bx′ and by′) contributions, both of which now survive, oscillate with θ but are 90 degrees out of phase. In FIG. 11 the scaled magnetic field components contributions again oscillate out of phase, but with only a single cycle in 360 degrees of θ.

Given a constant gradient component a ∂bx/∂y, the polar plots for the radial component r for which ∂bx/∂x=0 are shown in FIG. 12 where 



  
    
      
        r
        =
        
          
            
              (
              
                [
                
                  
                    3
                    ⁢
                    
                      μ
                      o
                    
                    ⁢
                    m
                  
                  
                    8
                    ⁢
                    
                      π
                      ⁡
                      
                        (
                        
                          
                            ∂
                            
                              b
                              x
                            
                          
                          /
                          
                            ∂
                            y
                          
                        
                        )
                      
                    
                  
                
                ]
              
              )
            
            
              1
              /
              4
            
          
          ⁢
          
            
              (
              
                
                  E
                  ⁢
                  
                     
                  
                  ⁢
                  cos
                  ⁢
                  
                     
                  
                  ⁢
                  α
                
                +
                
                  F
                  ⁢
                  
                     
                  
                  ⁢
                  sin
                  ⁢
                  
                     
                  
                  ⁢
                  α
                
              
              )
            
            
              1
              /
              4
            
          
        
      
    
    
      
        (
        11
        )
      
    
  




Likewise, a constant ∂bx/∂x for which ∂bx/∂y=0 yields FIG. 13 where now 



  
    
      
        r
        =
        
          
            
              (
              
                [
                
                  
                    3
                    ⁢
                    
                      μ
                      o
                    
                    ⁢
                    m
                  
                  
                    8
                    ⁢
                    
                      π
                      ⁡
                      
                        (
                        
                          
                            ∂
                            
                              b
                              x
                            
                          
                          /
                          
                            ∂
                            x
                          
                        
                        )
                      
                    
                  
                
                ]
              
              )
            
            
              1
              /
              4
            
          
          ⁢
          
            
              (
              
                
                  C
                  ⁢
                  
                     
                  
                  ⁢
                  cos
                  ⁢
                  
                     
                  
                  ⁢
                  α
                
                +
                
                  D
                  ⁢
                  
                     
                  
                  ⁢
                  sin
                  ⁢
                  
                     
                  
                  ⁢
                  α
                
              
              )
            
            
              1
              /
              4
            
          
        
      
    
    
      
        (
        12
        )
      
    
  




In these restricted cases, the correct 1/r4 dependence of the gradient is retained so that the appropriate magnitudes are preserved. The multi-lobed shape curves (angular distribution curves) require more care in the use of symmetries, etc. in the design of the complete magnet, e.g. the choice of where to remove material.

C. Maximized Field Cases

Instead of restricting a field or gradient component at some selected focal point (operating region), it may be more useful to use an alternative, formal optimization method to achieve a similar but better result. Here the distributions are calculated for element orientations which are formally optimized to maximize a field component. For example, it will optimize (maximize) a field component to replace the a priori restricting of an undesired component as was the case in case A. The resulting optimized magnet shapes can be seen by comparing the magnet in FIG. 2 (optimized) and FIG. 3 (restricted). In this new case, we wish to relate α to θ for the magnetic moments to be oriented in such a manner as to contribute maximally to either bx or by, depending on the desired direction of the field relative to the magnet face. Given that the field components are analogous if θ sweeps from 0 to 2π, ∂bx/∂α=0 yields: 



  
    
      
        
          tan
          ⁢
          
             
          
          ⁢
          α
        
        =
        
          
            B
            A
          
          .
        
      
    
    
      
        (
        13
        )
      
    
  




The relationship between α and θ for this optimized field case is shown in dashed lines in FIG. 6. FIG. 14 details the relationship of the magnetic field component contributions to θ. Obviously, care must be taken in the design of the complete magnet by judicious choice of symmetry to ensure the removal of the y-component of the field which now is not automatically excluded at the start. The nature of r is identical in form to that expressed in equation (8). However, since the relationship between α and θ is now given by equation (13) rather than by equation (7), we see that r versus θ now takes the simple form of FIG. 15, which is different from the form resulting from the restricted field case shown in FIG. 8. It should also be noted that for a maximum to exist, ∂2bx/∂α2<0 which results in the requirement that bx>0, an obvious condition.

Thus, the new result yields the magnet shape shown in FIG. 2, as opposed to the shape shown in FIG. 3 for the restricted field case, to arrive at a particular field strength for a strictly transverse field parallel to the magnet face at some given distance. It is apparent that the new method yields a smaller optimal magnet cross section, and a lighter magnet in this particular type of design problem.
D. Optimized Gradient Case
Here the overall procedure parallels that of case C. But now the gradient components, not the field components, are formally maximized, and the material removal is used (with symmetry considerations) at the end to achieve the desired gradient directions.
As in the procedures above, we relate α to θ so that the moment of the element is oriented in a manner to contribute maximally to the required quantity, except that here that quantity is either 



  
    
      
        ∂
        
          b
          x
        
      
      /
      
        ∂
        x
      
    
    ⁢
    
       
    
    ⁢
    or
    ⁢
    
       
    
    ⁢
    
      
        ∂
        
          b
          x
        
      
      /
      
        
          ∂
          y
        
        .
        
           
        
        ⁢
        For
      
    
    ⁢
    
       
    
    ⁢
    
      ∂
      
        ∂
        α
      
    
    ⁢
    
      (
      
        
          ∂
          
            b
            x
          
        
        
          ∂
          x
        
      
      )
    
  
  =
  0




we calculate 



  
    
      
        
          tan
          ⁢
          
             
          
          ⁢
          α
        
        =
        
          D
          C
        
      
    
    
      
        (
        14
        )
      
    
  




which yields the α-θ relationship shown in solid lines in FIG. 16. The magnetic field component contribution is depicted in FIG. 17 and the variable r takes the form of equation (12), but with the new implicit α-θ relationship changing the result. That is plotted in FIG. 19. 



  
    
      
        
          For
          ⁢
          
             
          
          ⁢
          
            ∂
            
              ∂
              α
            
          
          ⁢
          
            (
            
              
                ∂
                
                  b
                  x
                
              
              
                ∂
                y
              
            
            )
          
        
        =
        
          
            0
            :
            
              

            
            ⁢
            
              tan
              ⁢
              
                 
              
              ⁢
              α
            
          
          =
          
            F
            E
          
        
      
    
    
      
        (
        15
        )
      
    
  




which yields the α-θ relationship shown in dashed lines in FIG. 16. Now FIG. 18 plots the magnetic fields and the behavior of r is in the form of equation (11) and depicted in FIG. 20. As discussed above, the ignored gradients and field components must be examined in determining less important material removal in the magnet's design, depending on the application of the magnet.

E. Maximized Field-Gradient Product Case

Again, as in cases C and D, the overall procedure is to formally maximize a desired quantity and finally to use symmetry conditions on material removal to achieve the desired magnetic field property of interest.
It is often of interest to provide a pulling force on a permeable material or medium. A good quantity in most cases for evaluating such a force is the field-gradient product. Therefore in this final major case, it is desired to maximize the quantities 



  
    b
    x
  
  ⁢
  
    
      ∂
      
        b
        x
      
    
    
      ∂
      y
    
  
  ⁢
  
     
  
  ⁢
  and
  ⁢
  
     
  
  ⁢
  
    b
    x
  
  ⁢
  
    
      ∂
      
        b
        x
      
    
    
      ∂
      x
    
  




which represent the only unique components of the field-gradient product. All other cases for the field-gradient product follow from ∇·b=0 and ∇×b=0. From equations (3) and (4) we rewrite the field-gradient product in the form of 



  
    
      
        
          
            b
            x
          
          ⁢
          
            
              ∂
              
                b
                x
              
            
            
              ∂
              y
            
          
        
        =
        
          
            3
            
              2
              ⁢
              
                r
                7
              
            
          
          ⁢
          
            
              
                (
                
                  
                    
                      μ
                      o
                    
                    ⁢
                    m
                  
                  
                    8
                    ⁢
                    π
                  
                
                )
              
              2
            
            ⁡
            
              [
              
                
                  (
                  
                    AE
                    +
                    BF
                  
                  )
                
                +
                
                  
                    (
                    
                      AE
                      -
                      BF
                    
                    )
                  
                  ⁢
                  cos
                  ⁢
                  
                     
                  
                  ⁢
                  2
                  ⁢
                  α
                
                +
                
                  
                    (
                    
                      BE
                      +
                      AF
                    
                    )
                  
                  ⁢
                  sin
                  ⁢
                  
                     
                  
                  ⁢
                  2
                  ⁢
                  α
                
              
              ]
            
          
        
      
    
    
      
        (
        16
        )
      
    
  
  
    
      
        
          
            b
            x
          
          ⁢
          
            
              ∂
              
                b
                x
              
            
            
              ∂
              x
            
          
        
        =
        
          
            3
            
              2
              ⁢
              
                r
                7
              
            
          
          ⁢
          
            
              
                (
                
                  
                    
                      μ
                      o
                    
                    ⁢
                    m
                  
                  
                    8
                    ⁢
                    π
                  
                
                )
              
              2
            
            ⁡
            
              [
              
                
                  (
                  
                    
                      A
                      ⁢
                      
                         
                      
                      ⁢
                      C
                    
                    +
                    BD
                  
                  )
                
                +
                
                  
                    (
                    
                      
                        A
                        ⁢
                        
                           
                        
                        ⁢
                        C
                      
                      -
                      BD
                    
                    )
                  
                  ⁢
                  cos
                  ⁢
                  
                     
                  
                  ⁢
                  2
                  ⁢
                  α
                
                +
                
                  
                    (
                    
                      BC
                      +
                      AD
                    
                    )
                  
                  ⁢
                  sin
                  ⁢
                  
                     
                  
                  ⁢
                  2
                  ⁢
                  α
                
              
              ]
            
          
        
      
    
    
      
        (
        17
        )
      
    
  




Thus for 



  
    
      
        ∂
        
          ∂
          α
        
      
      ⁢
      
        (
        
          
            b
            x
          
          ⁢
          
            
              ∂
              
                b
                x
              
            
            
              ∂
              y
            
          
        
        )
      
    
    =
    0
  
  ,




we find that 



  
    
      
        
          tan
          ⁢
          
             
          
          ⁢
          2
          ⁢
          α
        
        =
        
          
            BE
            +
            AF
          
          
            AE
            -
            BF
          
        
      
    
    
      
        (
        18
        )
      
    
  




and for 



  
    
      
        ∂
        
          ∂
          α
        
      
      ⁢
      
        (
        
          
            b
            x
          
          ⁢
          
            
              ∂
              
                b
                x
              
            
            
              ∂
              x
            
          
        
        )
      
    
    =
    0
  
  ,




the relationship between α and θ becomes 



  
    
      
        
          tan
          ⁢
          
             
          
          ⁢
          2
          ⁢
          α
        
        =
        
          
            BC
            +
            AD
          
          
            AC
            -
            BD
          
        
      
    
    
      
        (
        19
        )
      
    
  




where the condition for a maximum to exists for both equations (16) and (17) is that tan2 2α≧−1.

The relationship between α and θ, from equations (18) and (19), is shown in FIG. 21 in solid liens for bxdbx/dy and in dashed lines for bxdbxdx, and the field distribution plots for the two sub-cases are in FIGS. 22 (bxdbx/dy) and 23 (bxdbx/dx). The two-dimensional r(θ) curves detailed in equations (20) and (21) follow from (16) and (17), respectively: 



  
    
      
        r
        =
        
          
            
              
                [
                
                  
                    3
                    
                      2
                      ⁢
                      
                        
                          b
                          x
                        
                        ⁡
                        
                          (
                          
                            
                              ∂
                              
                                b
                                x
                              
                            
                            /
                            
                              ∂
                              y
                            
                          
                          )
                        
                      
                    
                  
                  ⁢
                  
                    
                      (
                      
                        
                          
                            μ
                            o
                          
                          ⁢
                          m
                        
                        
                          8
                          ⁢
                          π
                        
                      
                      )
                    
                    2
                  
                
                ]
              
              
                1
                /
                7
              
            
            ⁡
            
              [
              
                
                  (
                  
                    AE
                    +
                    BF
                  
                  )
                
                +
                
                  
                    (
                    
                      AE
                      -
                      BF
                    
                    )
                  
                  ⁢
                  cos
                  ⁢
                  
                     
                  
                  ⁢
                  2
                  ⁢
                  α
                
                +
                
                  
                    (
                    
                      BE
                      +
                      AF
                    
                    )
                  
                  ⁢
                  sin
                  ⁢
                  
                     
                  
                  ⁢
                  2
                  ⁢
                  α
                
              
              ]
            
          
          
            1
            /
            7
          
        
      
    
    
      
        (
        20
        )
      
    
  
  
    
      
        r
        =
        
          
            
              
                [
                
                  
                    3
                    
                      2
                      ⁢
                      
                        
                          b
                          x
                        
                        ⁡
                        
                          (
                          
                            
                              ∂
                              
                                b
                                x
                              
                            
                            /
                            
                              ∂
                              x
                            
                          
                          )
                        
                      
                    
                  
                  ⁢
                  
                    
                      (
                      
                        
                          
                            μ
                            o
                          
                          ⁢
                          m
                        
                        
                          8
                          ⁢
                          π
                        
                      
                      )
                    
                    2
                  
                
                ]
              
              
                1
                /
                7
              
            
            ⁡
            
              [
              
                
                  (
                  
                    
                      A
                      ⁢
                      
                         
                      
                      ⁢
                      C
                    
                    +
                    BD
                  
                  )
                
                +
                
                  
                    (
                    
                      
                        A
                        ⁢
                        
                           
                        
                        ⁢
                        C
                      
                      -
                      BD
                    
                    )
                  
                  ⁢
                  cos
                  ⁢
                  
                     
                  
                  ⁢
                  2
                  ⁢
                  α
                
                +
                
                  
                    (
                    
                      BC
                      +
                      AD
                    
                    )
                  
                  ⁢
                  sin
                  ⁢
                  
                     
                  
                  ⁢
                  2
                  ⁢
                  α
                
              
              ]
            
          
          
            1
            /
            7
          
        
      
    
    
      
        (
        21
        )
      
    
  




These are shown as polar plots in FIGS. 24 and 25, respectively. Care must be paid to the symmetry of the magnetic field components and gradients in the magnet's design if pure field-gradient terms are to be generated (e.g., for bx(∂bx/∂y) maximized with by=0 and ∂bx/∂x=0).

Operation

In designing a magnet in accordance with the principles of this invention, one would first generally select the desired shape of the magnet. This is most conveniently done with two dimensional optimization by using the curves of constant contribution for the magnetic field property that is to be optimized or restricted, to give the shape in two dimensions, i.e., in the x-y plane. The height in the z-axis can then be selected based on the available space, desired weight, and required field strength. Once the shape of the magnet is generally determined, the magnetization direction at each location is then determined. For optimization in two dimensions, the relations between the magnetization direction angle α verses the position angle θ, discussed above can be use to determine the proper magnetization angle at each location.
In the case of a monolithic magnetic, a blank of permanent magnetic material can be made in the desired shape and magnetized so that the magnetization direction varies smoothly and continuously in the x-y plane in accordance with the proper magnetization direction determined by the appropriate relation between the magnetization direction angle α verses the position angle. As noted above, in most cases the magnetization need not vary in three dimensions, and thus the direction of magnetizations vary only in the x-y plane. This means that the magnet can be made of a single monolithic block or a plurality of similar permanent magnet slabs stacked in the non-critical (i.e., the z direction).
In the case of a multi-segmented magnet, a plurality of permanent magnet segments are assembled to conform substantially to the desired shape. The magnetization direction of each segment is selected so that the magnetization direction within the segment conforms substantially to the proper magnetization direction. Ideally the magnetization would vary within the segment to conform to the proper magnetization direction that satisfied the optimization/restriction criteria for the desired magnetic field property. However, achieving the ideal is technically difficult and expensive, and with judicious selection of the sizes and shapes of the permanent magnet segments makes this unnecessary. A single uniform magnetization direction can usually be selected for each segment that satisfactorily approximates the ideal magnetization direction distribution. For example, the magnetization direction for a segment could be selected to be the ideal direction at the location of the center of mass of the segment. The magnetization direction for the segment could alternatively be selected to be the ideal direction at the location of the magnetic center of the segment, (i.e. the location of at which a single magnet dipole of equivalent strength could replace the segment), or the material in the segment could be otherwise weighted (for example, inversely to the cube of the distance between each point in the segment and the selected point), to provide the appropriate point for in the segment to determine the proper magnetization direction to apply to the entire segment.
The monolithic magnets in accordance with this invention ideally would have cross-sectional shapes in the x-y plane corresponding to the shape of the constant contribution for the particular magnetic field property being optimized or restricted. This provides the most efficient magnet for the volume and weight. Thus, at least some of the surfaces of the magnets of this invention, and in particular the surfaces that face away from the selected point of application of the optimized restricted magnetic field property, conform to the surface of constant contribution. However, as a practical matter it can be difficult to form magnetic material into this shapes, and in many cases where volume and weight are not critical, it is not necessary that the magnet have this shape. As long as the magnetization direction is properly oriented throughout the magnet, the additional material does not impair the optimized/restricted magnetic field property, it merely makes the magnet larger and heavier than necessary.
Where size and/or weight of the magnet is critical, then the constant contribution curves provide guidance of where to remove material with the least impact on the magnet field properties. More specifically for a given constant contribution surface, it is always more efficient to remove material outside the surface before removing material inside the surface, even if the material outside the surface is closer to the selected point than other material inside the surface. Thus, for convenience magnets can be made in square or rectangular blocks that either approximate the optimal curved surfaces, or that are machined to approximate the optimal curved surfaces.
For example, in making a magnet that maximizes the transverse field, an appropriate curve of constant contribution for the magnet size and strength is used. See FIG. 8. The setoff distance between the magnet and the selected operating point is selected, and the cross section of the magnet in the x-y plane is then determined. The properties of the magnet field that would be created by such a magnet can be calculated to determine if the magnet is the appropriate size. If the properties are larger than required, a smaller magnet can be selected. if the properties are smaller than required, a larger magnet can be selected. The magnet can then be completed by providing a monolithic block or permanent magnet material of the selected cross section, or a plurality of slabs of the selected cross-section, and magnetizing the block or the slabs in the direction α in the x-y plane determined by the position angle θ, given by relation between α and θ for the desired optimization or restriction of the magnetic field properties. Of course, rather than using a monolithic block, or a plurality of slabs stacked in the z direction, the magnets can be assembled from a plurality of segments. The segments can be shaped to form the magnetic of the desired shape (see FIGS. 26A-D), or where the size and weight are not important, they can simply be rectangular prisms, which as easier to work with (see FIGS. 27A and B). Each segment has the appropriate magnetization direction α in the x-y plane for the location of the segment θ. Of course, for ease of manufacture, the magnet can be made with rectangular segments as shown in FIG. 27, and machined or otherwise shaped to the optimal shape, such as that shown in FIG. 26.

## Claims

1. A method of performing a medical procedure using magnet to project a magnetic field into a patient to control a magnetic medical element inside the patient, where the magnet comprises a plurality of permanent magnet segments, the magnetization direction of each permanent magnet segment varying in three dimensions with respect to each segment's assembled location so that the magnetization direction of each permanent magnet segment is in the direction that substantially optimizes the strength of the externally projected magnetic field at a selected point.

2. A permanent magnet in which the magnetization direction varies with location to optimize the magnetic field at an externally selected point in a selected direction, the magnet comprising a plurality of permanent magnet segments, the magnetization direction of each permanent magnet segment varying in three dimensions with respect to each segment's assembled location so that the magnetization direction of each permanent magnet segment is in the direction that substantially optimizes the magnetic field strength of the externally projecting at the selected point in the selected direction.

3. The permanent magnet according to claim 2 wherein at least a portion of the surface of the magnet conforms to a surface of constant contribution to the desired magnetic field at the selected location point.

4. The permanent magnet according to claim 3 wherein the direction of magnetization throughout each permanent magnet segment is constant.

5. The permanent magnet according to claim 4 wherein the direction of magnetization throughout each permanent magnet segment is the direction which, at the center of mass of the segment, provides the maximum contribution to the desired property optimizing the field.

6. The permanent magnet according to claim 4 direction of magnetization throughout each permanent magnet segment is the direction which, at the effective magnet center, provides the maximum contribution to the desired property optimizing the field.

7. The permanent magnet according to claim 4 wherein the size and position of the permanent magnet segments is selected so that the difference in the direction of magnetization direction between adjacent magnet segments is less than about 45°.

8. The permanent magnet according to claim 7 wherein the size and position of the permanent magnet segments is selected so that the difference in the direction of magnetization direction between adjacent magnet segments is less than about 30°.

9. The permanent magnet according to claim 3 wherein the magnetization direction throughout each permanent magnet segment is not constant.

10. A permanent magnet in which the magnetization direction varies with location to optimize a the magnetic field at an externally selected point in a selected direction, the magnet comprising: a plurality of permanent magnet segments, the magnetization direction of each permanent magnet segment varying in two dimensions with respect to each segment's assembled location so that the magnetization direction of each permanent magnet segment is in the direction that substantially optimizes the strength of the externally projecting magnetic field at the selected point in the selected direction.

11. The permanent magnet according to claim 10 wherein at least a portion of the surface of the magnet conforms to a surface of constant contribution to the desired magnetic field at the selected location point.

12. The permanent magnet according to claim 10 wherein the direction of magnetization throughout each permanent magnet segment is constant.

13. The permanent magnet according to claim 12 wherein the direction of magnetization throughout each permanent magnet segment is the direction which, at the center of mass of the segment, provides the maximum contribution to the desired property optimizing the field.

14. The permanent magnet according to claim 12 wherein the direction of magnetization throughout each permanent magnet segment is the direction which, at the effective magnet center, provides the maximum contribution to the desired property optimizing the field.

15. The permanent magnet according to claim 12 wherein the size and position of the permanent magnet segments is selected so that the difference in the direction of magnetization direction between adjacent magnet segments is less than about 45°.

16. The permanent magnet according to claim 15 wherein the size and position of the permanent magnet segments is selected so that the difference in the direction of magnetization direction between adjacent magnet segments is less than about 30°.

17. The permanent magnet according to claim 10 wherein the magnetization direction throughout each permanent magnet segment is not constant.