def _compile_newton(self):
        """Newton power flow execution
                1. evaluate g and f;
                1.1. handle islanded buses by Bus.gisland()
                2. factorize when needed;
                3. evaluate Gy and Fx.
                3.1. take care of islanded buses by Bus.gyisland()
        """
        string = '"""\n'

        # evaluate algebraic equations g and differential equations f
        string += 'system.dae.init_fg()\n'
        for pflow, gcall, call in zip(self.pflow, self.gcall, self.gcalls):
            if pflow and gcall:
                string += call
        string += 'system.dae.reset_small_g()\n'
        string += '\n'
        for pflow, fcall, call in zip(self.pflow, self.fcall, self.fcalls):
            if pflow and fcall:
                string += call
        string += 'system.dae.reset_small_f()\n'

        # handle islanded buses in algebraic equations
        string += self.gisland
        string += '\n'

        # rebuild constant Jacobian elements if factorization needed
        string += 'if system.dae.factorize:\n'
        string += '    system.dae.init_jac0()\n'
        for pflow, jac0, call in zip(self.pflow, self.jac0, self.jac0s):
            if pflow and jac0:
                string += '    ' + call
        string += '    system.dae.temp_to_spmatrix(\'jac0\')\n'

        # evaluate Jacobians Gy and Fx
        string += 'system.dae.setup_FxGy()\n'
        for pflow, gycall, call in zip(self.pflow, self.gycall, self.gycalls):
            if pflow and gycall:
                string += call
        for pflow, fxcall, call in zip(self.pflow, self.fxcall, self.fxcalls):
            if pflow and fxcall:
                string += call

        # handle islanded buses in the Jacobian
        string += self.gyisland
        string += 'system.dae.temp_to_spmatrix(\'jac\')\n'

        string += '"""'
        if SHOW_PF_CALL:
            logger.debug(string)
        self.newton = compile(eval(string), '', 'exec')
Newton power flow execution
                1. evaluate g and f;
                1.1. handle islanded buses by Bus.gisland()
                2. factorize when needed;
                3. evaluate Gy and Fx.
                3.1. take care of islanded buses by Bus.gyisland()