Repurposing second-life EV batteries for grid resiliency and energy storage