  Magnetic shields that use both active and passive components to enable the
generation of a tailored low-field environment are required for many
applications in science, engineering, and medical imaging. Until now, accurate
field nulling, or field generation, has only been possible over a small
fraction of the overall volume of the shield. This is due to the interaction
between the active field-generating components and the surrounding
high-permeability passive shielding material. In this paper, we formulate the
interaction between an arbitrary static current flow on a cylinder and an
exterior closed high-permeability cylinder. We modify the Green's function for
the magnetic vector potential and match boundary conditions on the shield's
interior surface to calculate the total magnetic field generated by the system.
We cast this formulation into an inverse optimization problem to design
active--passive magnetic field shaping systems that accurately generate any
physical static magnetic field in the interior of a closed cylindrical passive
shield. We illustrate this method by designing hybrid systems that generate a
range of magnetic field profiles to high accuracy over large interior volumes,
and simulate them in real-world shields whose passive components have finite
permeability, thickness, and axial entry holes. Our optimization procedure can
be adapted to design active--passive magnetic field shaping systems that
accurately generate any physical user-specified static magnetic field in the
interior of a closed cylindrical shield of any length, enabling the development
and miniaturization of systems that require accurate magnetic shielding and
control.
