Armando A. Domingos

View Original

Optimal Sizing and Operation of a Microgrid with Electric Vehicle Charging

This was a group project for one of the best classes I have ever taken, not only at Berkeley, but in my entire career as a student. This class is taught by Professor Scott Moura, and is titled Energy Systems and Control. The goal of this project was to correctly size and operate a small microgrid, such as would be found in a commercial or industrial facility, along with determining the ideal number of chargers for the parking structure.

A quote from the final report:

Since Electric vehicles (EVs) are increasing in popularity and access to charging infrastructure will play an important role in their widespread adoption, additional investment in existing commercial facilities will be required and pairing vehicle charging infrastructure with microgrids (MGs) may help to mitigate energy consumption requirements from EVs. This project developed a model for the economic optimization of a grid-connected commercial MG that includes renewable energy generation, on-site energy storage, and EV charging with Level 2 and Level 3 capabilities. A robust optimization method that considers the stochastic nature of energy demanded and supplied was developed while satisfying constraints imposed by the facility. Results from a Mixed-Integer Linear Program (MILP) and Mixed-Integer Second-Order Cone Program (MISOCP) were evaluated to determine primary drivers for infrastructure sizing and to evaluate the robustness of the optimization model for various uncertainty levels of input data. The MISOCP was able to identify infeasible scenarios and was able to plan the optimal scenario while being robust to all stochastic variables, making it the preferred choice for planning purposes over the MILP.

Translation: this problem requires us to minimize capital cost of the system, energy cost from importing energy from the grid, demand charges, with the ability to consider export revenue, while attempting to determine the number of Level 2 and a Level 3 chargers required. This is a hard problem because mixed-integer second order cone problems (MISOCP) require a discrete integer value and are non-convex, additional integer values require an exponential increase in the number of combinations to solve the problem (even when some combinations are infeasible), and off-the-shelf programs such as CVX software cannot reach a solution.

* A quick side note: the graphs and images were made with Excel and PowerPoint… so please excuse their simplicity.

objective function

The objective function is subject to linear constraints such as storage system dynamics and non-linear SOCP constraints such as renewable system dynamics, EV energy dynamics, and grid import/export limitations. While expanded constraints are not included here, there are about 40 different equations for all the constraint categories. The SOCP constraints include the reliability of grid import/export dynamics (which rely on stochastic load and renewable energy generation), and the stochastic demand of EV charging. The first step was to consider methods to reduce the complexity of this model so that it could be easily solved without paying high computational or temporal penalties.

Our objective function: minimize capital cost, energy cost, demand charge, while subtracting revenue.

Reducing complexity

The first step was to reduce complexity from the original MISOCP. Several variables in the objective function are affected by this change, including x, and the number of chargers, n. This reduction in complexity required an assumption about the number of chargers: for a 30 unit complex, a building manager might be interested in installing a combination of up to 4 each of level 2 and level 3 charging spaces (or roughly 25 percent of parking if each unit has one spot). The difficulty lies in determining how many of each charger should be installed to allow for a high level of service for the residents while minimizing cost. To reduce complexity from a MISOCP to SOCP, combinations of level 2 and level 3 chargers were evaluated over many iterations to find the optimal solution.

Results

After many iterations, the optimal solution was 3 level 2 chargers and 1 level 3 charger. Other feasible solutions found with the iterative method were higher cost or infeasible. Inside the red circle at the bottom of the graph are the sets of infeasible solutions, which means that those solutions were not able to satisfy all of the constraints within those scenarios, for example, the number of chargers were not able to meet the EV demand at some time step. After the optimal number of chargers was determined, the values were implemented into the data sets to determine the robustness of the solution.

The optimal number of EV chargers minimized cost while meeting the greatest demand at any given time step.

modeling and corner cases

The first challenge that arose was an interesting corner case that resulted in battery charging and discharging at the same time. This occurred when energy demand was quite small compared to solar generation, and grid export had reached the maximum limit. When faced with over generation, the model attempted to expend that excess energy through the battery’s internal resistance. As you can imagine, this has a severe negative impact on battery life. This error was traced to a simple error in the data set, but it helped to show how important it is for the model to be reviewed closely and critically for any irregularities.

boundary condition: battery sizing

The difference in required battery size is the blue arrow between the red and blue horizontal lines from time step 14 to 20.

The next challenge was to consider the model’s feasibility through all time steps. With a finite time horizon, the model would attempt to maximize profit (and therefore minimize cost) when it could. The result was two boundary conditions: the first of which is that the battery completely discharged for grid export at the final step regardless of the battery state after the time horizon. This resulted in additional batteries being purchased (which increase cost) simply to satisfy the final time step.

The solution to the final state problem was to impose a minimum battery SOC at the final step. For this model it means that the energy level in the battery at the final time step must be greater than 10% of the maximum energy level of the battery multiplied by the number of battery modules required to meet peak demand. As you can see from the figure, while the model previously had battery energy at higher levels, and therefore higher cost, the constrained battery size still satisfies demand while reducing cost.

boundary condition: EV Charging demand

The mean demand is the blue line below, and the 99th percentile of demand is the yellow line above. The model relied on the 99th percentile of EV demand to maximize profitability.

The second boundary condition: high levels of EV charging regardless of EV demand. To satisfy EV demand without selling more energy than demanded, a limit on the uncertainty in the upper bound of demand needs to be set.

With the existing chance constraints, the model attempted to sell as much EV charging as possible, at the 99th percentile of EV charging demand, to maximize revenue because of the high profitability in that slim feasible region, so a constraint was implemented to limit the uncertainty. In other words, the model is able to satisfy EV charging for residents 95% of the time, but not overestimate the potential revenue from EV charging as a whole which allows the model to remain robust, while satisfying demand, without being overly optimistic about potential revenue.

conclusion

To conclude: in this project, an optimization model was developed for installing EV chargers while identifying possible drawbacks. The cost of the project was minimized by the objective function by iterating over several SOCPs, maintaining the stochastic elements of the original model, and corner cases were addressed along with boundary conditions to ensure the model is robust to EV charging, renewable generation, and building load.

This was a really fun project with a great group that really helped me learn a lot about optimization generally and how to think about and solve complex control and modeling problems. It was also helpful to have this experience within a group dynamic where everyone brought something different to the table. Everyone that I worked with has moved onto successful careers or advanced degrees, and I hope they find these experiences as helpful as I did!