Which apparatus changes a direct current to alternating current?

An inverter or a motor-generator set.