In this paper, it is shown that dynamic optimization problems of first-order systems can be transformed into a static paramertic programming problem, where the state plays the role of the parameter. Thus, an optimal feedback law is obtained. This concept is applied to the die-sinking Electrical Discharge Machining, a highly time varying industrial process which necessitates adapation of machining settings during operation. It is shown that the minimum-time operation of this process is equivalent to choosing the manipulated variables that maximizes the speed of machining at every position.