Electrical discharge machining (EDM) is a thermal material removal process by means of electrical discharge. Because of the stochastic nature of the EDM process, electro-thermal energy conversion in the discharge zone is still not well understood. In this paper, an inverse optimal control problem was used foranalysis and optimization of energy conversion processes in order to improve machining efficiency. Modeling and identification of a thermal process were conducted using the inverse heat transfer problem based on the known temperature within a workpiece. In addition to the temperature field, this approach allows the determination of unknown heat flux density distribution on the workpiece surface. By using the heat flux, the inverse optimal control problem based on minimizing a Tikhonov functional allows to obtain the optimal heat sourceparameters (discharge power and discharge duration) on the discharge energy. In this context, the concept of inverse problem allows reliable determination of the optimal discharge energy to achieve the highest possible productivity with the desired quality. The performance of prediction of the heat affected zone compared to the experimental results showed a good agreement, which confirms the validity of the inverse method compared to the reported models.