  A three-step model for calculating the magnetic field generated by coils
inside cuboid-shaped shields like magnetically shielded rooms (MSRs) is
presented. The shield is modelled as two parallel plates of infinite width and
one tube of infinite height. We propose an improved mirror method which
considers the effect of the parallel plates of finite thickness. A reaction
factor is introduced to describe the influence of the vertical tube, which is
obtained from finite element method (FEM) simulations. By applying the improved
mirror method and then multiplying the result with the reaction factor, the
magnetic flux density within the shielded volume can be determined in a fast
computation. The three-step model is verified both with FEM and measurements of
the field of a Helmholtz coil inside an MSR with a superconducting quantum
interference device. The model allows a fast optimization of shield-coupled
coil spacings compared to repetitive time-consuming FEM calculations. As an
example, we optimize the distance between two parallel square coils attached to
the MSR walls. Measurements of a coil prototype of 2.75~m in side length show a
magnetic field change of 18~pT over the central 5~cm at the field strength of
2.7~\textmu T. This obtained relative field change of 6~ppm is a factor of 5.4
smaller than our previously used Helmholtz coil.
