The influence of the quality of the solvent on the properties of a polymer A thermodynamic model and molecular dynamics calculations