In this paper, we propose a new economic dispatch model with random wind power, demand response and carbon tax. The specific feature of the demand response model is that the consumer's electricity demand is divided into two parts: necessary part and non-essential part. The part of the consumer's participation in the demand response is the non-essential part of the electricity consumption. The optimal dispatch objective is to obtain the minimum total cost (fuel cost, random wind power cost and emission cost) and the maximum consumer's non-essential demand response benefit while satisfying some given constraints. In order to solve the optimal dispatch objective, a multi-subpopulation bat optimization algorithm (MSPBA) is proposed by using different search strategies. Finally, a case of an economic dispatch model is given to verify the feasibility and effectiveness of the established mathematical model and proposed algorithm. The economic dispatch model includes three thermal generators, two wind turbines and two consumers. The simulation results show that the proposed model can reduce the consumer's electricity demand, reduce fuel cost and reduce the impact on the environment while considering random wind energy, non-essential demand response and carbon tax. In addition, the superiority of the proposed algorithm is verified by comparing with the optimization results of CPLEX+YALMIP toolbox for MATLAB, BA, DBA and ILSSIWBA.