Optimization of experiment in scanning force microscopy of polymers