implemented the class MtlOptEnergy.