  We describe a simple Monte Carlo simulation method to calculate the
free-energy cost of localizing a single monomer of a polymer confined to a
cavity. The localization position is chosen to be on the inside surface of the
confining cavity. The method is applied to a freely-jointed hard-sphere polymer
chain confined to cavities of spherical and cubic geometries. In the latter
case we consider localization at a corner and at the center of a face of the
confining cube. We consider cases of end-monomer localization both with and
without tethering of the other end monomer to a point on the surface. We also
examine localization of monomers at arbitrary position along the contour of the
polymer. We characterize the dependence of the free energy on the cavity size
and shape, the localization position, and the polymer length. The quantitative
trends can be understood using standard scaling arguments and use of a simple
theoretical model. The results are relevant to those theories of polymer
translocation that focus on the importance of the free-energy barrier as the
translocation process requires an initial localization of a monomer to the
position of a nanopore.
