This has been extensively studied by many groups who have published detail models of how electrification could replace hydrocarbons.
Here's one of the latest.
Want To Limit Global Warming? Electrify Everything, Finds Study | CleanTechnica <======
Solar dominated renewable energy world possible by 2050, and cheaper
A
4-year study from Finnish-based LUT University and the German-based Energy Watch Grouplooked at how to meet the 1.5°C target of the Paris climate treaty, and found that the most effective, quickest and cheapest means was to switch just about everything to electricity, and power it with solar and other renewable energy technologies.
“A global transition to 100% renewable energy across all sectors – power, heat, transport, and desalination before 2050 is feasible,” the study concludes. In fact, the authors say, it could be done quicker than that.
“Existing renewable energy potential and technologies, including storage, is capable of generating a secure energy supply at every hour throughout the year.
“The sustainable energy system is more efficient and cost-effective than the existing system, which is based primarily on fossil fuels and nuclear. A global renewable transition is the only sustainable option for the energy sector, and is compatible with the internationally adopted Paris Agreement.