Vehicle To Grid Implementation And Battery Management Optimization