On the premise of known output power of wind power and photovoltaic and time-of-use electricity price implemented in the grid
electric vehicles energy storage battery is used in the battery swapping mode and the direct charging mode. The optimization objective is minimum fuel cost and power cost purchased from an external grid in the direct charging mode. For the battery swapping mode
minimum recharging cost is added as the optimization objective on the basis of the above-mentioned optimization objective in battery swapping mode. The optimization objectives are verified using CPLEX software
the results showing that the optimization program will help reduce the operating cost of the microgrid operator. The battery swapping mode is better than the direct charging mode for using battery discharging energy when energy price is high and charging when energy price is low
thus improving the operational economy of the microgrid. This work is supported by National Basic Research Program of China (973 Program) (No. 2009CB219700).