A real time energy management strategy for plug-in hybrid electric vehicles based on optimal control theory