Molecular dynamics calculation of thermodynamic properties of nanostructures