<jupyter_start><jupyter_text>CO2 Abatement Tied to Surface engineering (COATS) COATS soft links efficiency improvements due to surface engineering applied to the energy sector with integrated assessmend methods to estimate the environmental benefits achieved. For more detailed information about the methodology, you can refer to the paper:(submitted)  Input data The input data is available in the excel file (Model Input Data.xlsx) in the doc folder.  COATS class The COATS class (Coats.py) is available in the src folder.  Energy outputs The scenarios are taken from SSP database by IIASA (https://tntcat.iiasa.ac.at/SspDb/dsd?Action=htmlpage&page=40). The excel sheet retrieved contains: (1) the 5 Regions, (2) the MESSAGE-GLOBIOM baseline scenarios for SSP1, SSP2 and SSP3 and the 1.9 and 2.6 variant of it for SSP1 and SSP2 and (3) the electricity output (Energy/Secondary energy) of all technologies. The first step is to read the output excel file and do reverse engineering to predict the age-cohort of the system.  Environmental impacts The environmental impacts are calculated by multiplying the output of each technology by its impact factor retrieved from ecoinvent. This also takes into account the reduced impact due to surface engineering.<jupyter_code>#Imports
import pandas as pd
import numpy as np
import sys
from scipy.stats import norm
from scipy import linalg
#Create and solve the model
coats_baseline = Coats.from_template('Model Input Data.xlsx')
coats_baseline.solve()
#Data for first graph:
coats_baseline.energy_results
#Data for second graph:
coats_baseline.d_elec_results_total
#Data for third graph:
#From this I can get the benefits of the SE (with slight adjustment)
coats_baseline.benefits_from_se
#Data for third graph:
#get the impact from coating
coats_baseline.burdens_from_se
#sensitivity initialization and solving:
sensitivity_coal_low = Coats.from_template('iamc_db.xlsx')
sensitivity_coal_low.elec_char.at['Secondary Energy|Electricity|Coal|w/ CCS','EffieciencyImprovement'] = 0.1
sensitivity_coal_low.elec_char.at['Secondary Energy|Electricity|Coal|w/o CCS','EffieciencyImprovement'] = 0.1
sensitivity_coal_low.solve()

sensitivity_coal_high = Coats.from_template('iamc_db.xlsx')
sensitivity_coal_high.elec_char.at['Secondary Energy|Electricity|Coal|w/ CCS','EffieciencyImprovement'] = 0.3
sensitivity_coal_high.elec_char.at['Secondary Energy|Electricity|Coal|w/o CCS','EffieciencyImprovement'] = 0.3
sensitivity_coal_high.solve()

sensitivity_gas_low = Coats.from_template('iamc_db.xlsx')
sensitivity_gas_low.elec_char.at['Secondary Energy|Electricity|Gas|w/ CCS','EffieciencyImprovement'] = 0.015
sensitivity_gas_low.elec_char.at['Secondary Energy|Electricity|Gas|w/o CCS','EffieciencyImprovement'] = 0.015
sensitivity_gas_low.solve()

sensitivity_gas_high = Coats.from_template('iamc_db.xlsx')
sensitivity_gas_high.elec_char.at['Secondary Energy|Electricity|Gas|w/ CCS','EffieciencyImprovement'] = 0.04
sensitivity_gas_high.elec_char.at['Secondary Energy|Electricity|Gas|w/o CCS','EffieciencyImprovement'] = 0.04
sensitivity_gas_high.solve()

sensitivity_solar_low = Coats.from_template('iamc_db.xlsx')
sensitivity_solar_low.elec_char.at['Secondary Energy|Electricity|Solar','EffieciencyImprovement'] = 0.05
sensitivity_solar_low.solve()

sensitivity_solar_high = Coats.from_template('iamc_db.xlsx')
sensitivity_solar_high.elec_char.at['Secondary Energy|Electricity|Solar','EffieciencyImprovement'] = 0.15
sensitivity_solar_high.solve()

sensitivity_wind_low = Coats.from_template('iamc_db.xlsx')
sensitivity_wind_low.elec_char.at['Secondary Energy|Electricity|Wind','EffieciencyImprovement'] = 0.0005
sensitivity_wind_low.solve()

sensitivity_wind_high = Coats.from_template('iamc_db.xlsx')
sensitivity_wind_high.elec_char.at['Secondary Energy|Electricity|Wind','EffieciencyImprovement'] = 0.5
sensitivity_wind_high.solve()
#sensitivity coal low results (benefits of the SE)
sensitivity_coal_low.benefits_from_se
#sensitivity coal low results (impact from coating)
sensitivity_coal_low.burdens_from_se_tech
#sensitivity coal high results (benefits of the SE)
sensitivity_coal_high.benefits_from_se
#sensitivity coal high results (impact from coating)
sensitivity_coal_high.burdens_from_se_tech
#sensitivity gas low results (benefits of the SE)
sensitivity_gas_low.benefits_from_se
#sensitivity gas low results (impact from coating)
sensitivity_gas_low.burdens_from_se_tech
#sensitivity gas high results (benefits of the SE)
sensitivity_gas_high.benefits_from_se
#sensitivity gas high results (impact from coating)
sensitivity_gas_high.burdens_from_se_tech
#sensitivity solar low results (benefits of the SE)
sensitivity_solar_low.benefits_from_se
#sensitivity solar low results (impact from coating)
sensitivity_solar_low.burdens_from_se_tech
#sensitivity solar high results (benefits of the SE)
sensitivity_solar_high.benefits_from_se
#sensitivity solar high results (impact from coating)
sensitivity_solar_high.burdens_from_se_tech
#sensitivity wind low results (benefits of the SE)
sensitivity_wind_low.benefits_from_se
#sensitivity wind low results (impact from coating)
sensitivity_wind_low.burdens_from_se_tech
#sensitivity wind high results (benefits of the SE)
sensitivity_wind_high.benefits_from_se
#sensitivity wind high results (impact from coating)
sensitivity_wind_high.burdens_from_se_tech
#sensitivity 1%
sensitivity_SSP1 = Coats.from_template('iamc_db.xlsx')
sensitivity_SSP1.adop_rates.at['old','SSP1-Baseline'] = 0.49
sensitivity_SSP1.adop_rates.at['new','SSP1-Baseline'] = 0.99
sensitivity_SSP1.solve()

sensitivity_SSP2 = Coats.from_template('iamc_db.xlsx')
sensitivity_SSP2.adop_rates.at['new','SSP2-Baseline'] = 0.81
sensitivity_SSP2.solve()

sensitivity_SSP3 = Coats.from_template('iamc_db.xlsx')
sensitivity_SSP3.adop_rates.at['new','SSP3-Baseline'] = 0.11
sensitivity_SSP3.solve()

#sensitivity 1% results
sensitivity_SSP1.d_elec_results_total.loc['CC']
sensitivity_SSP2.d_elec_results_total.loc['CC']
sensitivity_SSP3.d_elec_results_total.loc['CC']<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08377395902181096, 'fraction_numerical': 0.013549239920687376, 'mean_word_length': 8.07496251874063, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '559281', 'license': 'MIT', 'n_tokens_mistral': 2266, 'n_tokens_neox': 2044, 'n_words': 480, 'path': 'doc/COATS.ipynb', 'repo_name': 'mohamadkaddoura/COATS', 'size': '6052'}