A method and apparatus is disclosed for intelligently inverting DC power from DC sources such as photovoltaic (PV) solar modules to single-phase or three-phase AC power to feed the power grid for electricity generation. A power inverter with multiple input channels or input ports that can connect to multiple DC sources is disclosed.