Linear optimization methods for vehicle energy and communication networks