Comparative Study of Thermodynamic Properties of Metallic and Semiconducting Nanoparticles in Dielectric Matrix