A Technique for the Optimal Control and Operation of Grid-Connected Photovoltaic Production Units