  Trapping macromolecules is impoartant for the study of their conformations,
interactions, dynamics and kinetic processes. Here, we develop a variational
approach which self-consistently introduces a mean force that controls the
center-of-mass position and a self-adjustable harmonic potential that counters
the center-of-mass fluctuation. The effectiveness and versatility of our
approach is verified in three classical yet not fully understood problems in
polymer physics: (1) single-chain conformation in the entire solvent regimes,
(2) globule-pearl necklace-coil transition of a polyelectrolyte and (3)
inter-chain interaction by simultaneously trapping two polymers. The scaling
relationships and $\theta$ behaviors are well captured. Conformations with
large shape anisotropy appearing in charged polymers are clearly depicted. Our
theoretical predictions are in quantitative agreement with experimental results
reported in the literature.
