%ME 362
%Lecture 3
%Energy Consumption in the USA

clc
clear all

%List of countries by electricity consumption: 
%http://en.wikipedia.org/wiki/List_of_countries_by_electricity_consumption
%According to the US DoE, the US annual electricity consumption in 2010 was
%3,886,400,000 MWh

fprintf('US Electrical Energy [MWh]:\n')
E_e_MWh=3886400000

fprintf('World Electrical Energy [MWh]:\n')
E_e_world_MWh=19320360620

fprintf('US Electrical Energy Fraction:\n')
E_e_frac_world=E_e_MWh/E_e_world_MWh

fprintf('US Electrical Energy [J]:\n')
E_e_J=E_e_MWh*10^6*3600

fprintf('US Electrical Energy [TWy]:\n')
E_e_TWy=E_e_J/(365.25*24*3600)/10^12

fprintf('US Average Electrical Power [TW]:\n')
P_e_Tw=E_e_TWy

fprintf('US Population:\n')
population_USA=317848000

fprintf('US Average Electrical Power per Capita [W]:\n')
P_e_cap_W=P_e_Tw*10^12/population_USA

%List of countries by total primary energy consumption: 
%http://en.wikipedia.org/wiki/List_of_countries_by_total_primary_energy_consumption_and_production 
%According to the US EIA, the US annual energy consumption in 2007 was
%101,553.86 Trillions of BTU (1 BTU = 0.293 W·h = 1055 J)

fprintf('US Total Energy [Trillions of BTU]:\n')
E_t_TBTU=101553.86

fprintf('US Total Energy [J]:\n')
E_t_J=E_t_TBTU*10^12*1055

fprintf('US Total Energy [TWy]:\n')
E_t_TWy=E_t_J/(365.25*24*3600)/10^12

fprintf('US Electrical Energy Fraction w.r.t. Total Energy:\n')
E_e_frac_total=E_e_TWy/E_t_TWy

