A Decision Focused Learning Framework for Operation of Energy Communities with Electric Vehicles under Uncertainty*
Abstract
This paper presents an application oriented Decision Focused Learning (DFL) framework for coordinated scheduling of photovoltaic generation, stationary batteries, and vehicle to grid (V2G) enabled electric vehicles in energy communities under uncertainty. A neural policy maps system states and short-term profiles to battery and EV charging and discharging actions and is trained directly by minimizing cumulative operational cost. LSTM and XGBoost models provide PV, load, and price forecasts as policy inputs. Uncertainty in photovoltaic generation, demand, and electricity price is represented through equally weighted training scenarios, while state dependent differentiable mappings incorporate device power limits, state of charge limits, and EV availability. The framework is evaluated for industrial, commercial, and residential energy communities against a rule based strategy under common test conditions. The learned policy reduces total realized operating cost by 12.53 percent and decreases peak grid imports by 41.1 percent, 24.4 percent, and 53.9 percent for the three communities. Self-consumption increases are limited to 0.48, 0.54, and 0.23 percentage points. The results support direct cost aware policy learning for coordinated storage dispatch without repeated online optimization.