A power distribution system has a plurality of reactive power resources including capacitor banks and distributed energy resources connected to branches of the power distribution system. Power loss is reduced in the distribution system by determining discrete switch states for the capacitor banks and continuous set points for the distributed energy resources, so that the reactive power provided by the reactive power resources reduces power loss while optionally correcting voltage violations in the power distribution system when the capacitor banks are set in accordance with the respective discrete switch states and the distributed energy resources are operated at the respective continuous set points. The range of values for the continuous set points is constrained based on maximum and minimum reactive power limits for each distributed energy resource under consideration.