Essays on energy and macroeconomics