During LHC operation, an energy of up to 360 MJ will be stored in each proton beam. A magnet failure can lead to important equipment damage if the beam is not extracted in time. The machine protection systems should detect such failures and trigger the beam extraction system. In order to characterize the beam response after magnet failures, tracking simulations have been performed with MAD-X. The magnetic field was set to change with time according to realistic current changes in the electrical circuits with the magnets after a powering failure. The effect on the beam of powering failures in the normal conducting quadrupoles has been studied. For fast failures (beam lost in less than 100 ms) the linear changes in the optics define the losses and the nonlinear effects are negligible. For slower failures, higher order resonances may lead to beam losses of up to 8% of the beam.