Thermodynamic reversible transformations in micro-electro-mechanical systems