A gas turbine engine for an aircraft, comprising: a high-pressure (HP) spool comprising an HP compressor and a first electric machine driven by an HP turbine ; a low-pressure (LP) spool comprising an LP compressor and a second electric machine driven by an LP turbine ; a combustion system comprising a fuel metering unit; an energy storage system ; and an engine controller configured to, in response to a change of a throttle lever angle setting indicative of an acceleration event: increase fuel flow to the combustion system by the fuel metering unit; determine whether a state of charge of the energy storage system is greater than a minimum value and whether an aircraft power demand, P D , is less than a maximum power, P BATmax available from the energy storage system ; responsive to the state of charge of the energy storage system being greater than the minimum value and the aircraft power demand, P D , being less than the maximum power, P BATmax , available from the energy storage system , supply the aircraft power demand, P D , using the energy storage system , supply excess power, P BATmax - P D , from the energy storage system to the first electric machine and operate the first electric machine in a motor mode to increase the HP spool rotational speed and engine core mass flow. a high-pressure (HP) spool comprising an HP compressor and a first electric machine driven by an HP turbine ; a low-pressure (LP) spool comprising an LP compressor and a second electric machine driven by an LP turbine ; a combustion system comprising a fuel metering unit; an energy storage system ; and an engine controller configured to, in response to a change of a throttle lever angle setting indicative of an acceleration event: increase fuel flow to the combustion system by the fuel metering unit; determine whether a state of charge of the energy storage system is greater than a minimum value and whether an aircraft power demand, P D , is less than a maximum power, P BATmax available from the energy storage system ; responsive to the state of charge of the energy storage system being greater than the minimum value and the aircraft power demand, P D , being less than the maximum power, P BATmax , available from the energy storage system , supply the aircraft power demand, P D , using the energy storage system , supply excess power, P BATmax - P D , from the energy storage system to the first electric machine and operate the first electric machine in a motor mode to increase the HP spool rotational speed and engine core mass flow. increase fuel flow to the combustion system by the fuel metering unit; determine whether a state of charge of the energy storage system is greater than a minimum value and whether an aircraft power demand, P D , is less than a maximum power, P BATmax available from the energy storage system ; responsive to the state of charge of the energy storage system being greater than the minimum value and the aircraft power demand, P D , being less than the maximum power, P BATmax , available from the energy storage system , supply the aircraft power demand, P D , using the energy storage system , supply excess power, P BATmax - P D , from the energy storage system to the first electric machine and operate the first electric machine in a motor mode to increase the HP spool rotational speed and engine core mass flow. <EOS>