UN Physics the Poles of A Generator with Electromotive Force Question

The poles of a generator with electromotive force ? and negligible internal resistance are connected to an external circuit that has resistance R and inductance L.If the electromotive force of the generator drops abruptly to zero, determine:a) the evolution of the current intensity in the circuit,b) the total energy dissipated by the current due to the Joule effect until its extinction.Where does this energy come from?