Driven by conditions set by smaller solutes, proteins fold and unfold. Experimentally, these conditions are stated as intensive variables - pH and other chemical potentials - as though small solutes were infinite resources that come at an externally varied free energy cost. Computationally; the finite spaces of simulation allow only used numbers of these solutes. By combining the analytic Gibbs adsorption isotherm with the computational Monte Carlo sampling of polymer configurations, we have been able to overcome an inherent limitation of computer simulation. The idea is to compute analytically the free energy changes wrought by solutes on each particular configuration. Then numerical computation is needed only to sample the set of configurations as efficiently as when no bathing solute is present. For illustration, the procedure is applied to an idealized two-dimensional heteropolymer to yield lessons about the effect of cosolutes on protein stability.