A constrained maximum entropy method in polymer statistics