Computational study of the thermal and chemical stability of metallic nanoparticles