OPTIMAL POWER DISPATCHING FOR A GRID CONNECTED ELECTRIC VEHICLE