This project introduces a modeling software that manages the power flow of a grid-connected distributed energy system on a daily basis. The system uses a control strategy that prioritizes the use of renewable energy sources over storage devices and conventional sources. Wind turbines and PV arrays are the primary sources of energy. Battery bank is used as the permanent storage device and small natural gas generators and the grid are the conventional sources. The software can manage the power flow of electric vehicles as mobile storage units. The power optimization algorithm monitors the power available from each energy source, analyzes and combines their outputs to meet the load demand. Output of the energy sources are analyzed using 15-minute time series simulations. The computer model was developed using MATLAB with a graphical user interface for easy setup, operation and analysis of the results.