A method of defining a magnetic field for a target volume in a Magnetic Resonance Imaging machine, the method comprising: generating an initial model of: a magnet assembly (1; 19) comprising a first axisymmetrically shaped magnet (2; 20) and a second axisymetrically shaped magnet (3; 21) maintained in a fixed spaced relationship by a yoke assembly (10; 28), said first and second magnets being provided for generating said magnetic field in the target volume, the magnet assembly having an axis extending from a center of the first magnet (2; 20) to a center of the second magnet (3; 21); wherein each of the magnets (2; 3) is a permanent magnet (6; 7) and has an inward-facing surface (4; 5; 22; 23) opposing the other inward-facing surface (4; 5; 22; 23); and one or more fixed objects, including the yoke assembly (10; 28), disturbing the magnetic field in the target volume in a non-axisymmetric manner that would cause the magnetic field in the target volume to be inhomogeneous; estimating the magnetic field for the target volume based on the model; calculating deviation between the estimated magnetic field and a target magnetic field for the target volume; and updating the model to reduce the deviation by non-axisymmetrically modifying one or more parameters representing a surface geometry of one or both of the inward-facing surfaces (4; 5; 22; 23) to produce a variety of magnetic field strengths across one or both of the first or second magnets (2; 20; 3; 21) that, in combination, produce the target magnetic field in the target volume. generating an initial model of: a magnet assembly (1; 19) comprising a first axisymmetrically shaped magnet (2; 20) and a second axisymetrically shaped magnet (3; 21) maintained in a fixed spaced relationship by a yoke assembly (10; 28), said first and second magnets being provided for generating said magnetic field in the target volume, the magnet assembly having an axis extending from a center of the first magnet (2; 20) to a center of the second magnet (3; 21); wherein each of the magnets (2; 3) is a permanent magnet (6; 7) and has an inward-facing surface (4; 5; 22; 23) opposing the other inward-facing surface (4; 5; 22; 23); and one or more fixed objects, including the yoke assembly (10; 28), disturbing the magnetic field in the target volume in a non-axisymmetric manner that would cause the magnetic field in the target volume to be inhomogeneous; estimating the magnetic field for the target volume based on the model; a magnet assembly (1; 19) comprising a first axisymmetrically shaped magnet (2; 20) and a second axisymetrically shaped magnet (3; 21) maintained in a fixed spaced relationship by a yoke assembly (10; 28), said first and second magnets being provided for generating said magnetic field in the target volume, the magnet assembly having an axis extending from a center of the first magnet (2; 20) to a center of the second magnet (3; 21); wherein each of the magnets (2; 3) is a permanent magnet (6; 7) and has an inward-facing surface (4; 5; 22; 23) opposing the other inward-facing surface (4; 5; 22; 23); and one or more fixed objects, including the yoke assembly (10; 28), disturbing the magnetic field in the target volume in a non-axisymmetric manner that would cause the magnetic field in the target volume to be inhomogeneous; estimating the magnetic field for the target volume based on the model; calculating deviation between the estimated magnetic field and a target magnetic field for the target volume; and updating the model to reduce the deviation by non-axisymmetrically modifying one or more parameters representing a surface geometry of one or both of the inward-facing surfaces (4; 5; 22; 23) to produce a variety of magnetic field strengths across one or both of the first or second magnets (2; 20; 3; 21) that, in combination, produce the target magnetic field in the target volume.