capacity_total_plan = PDP7A_annex1.groupby("fuel").capacity_MW.sum() show(""" Summary of 2016-2030 new capacity listed in PDP7A annex 1, MW """) show(capacity_total_plan) show(""" *: Backup coal units in case all the renewable sources do not meet the set target (27GW by 2030). Small hydro not specified, included in Renewable4 Wind, Solar, Biomass not specifed after 2020 """) #%% Capacity objectives (Installed GW by fuel type) capacities_PDP7A = pd.read_csv("data/PDP7A/Objectives.csv", header=13, nrows=4, index_col=0) capacities_PDP7A = capacities_PDP7A.drop(2015) capacities_PDP7A["Hydro"] = capacities_PDP7A[ "Hydro+Storage"] - capacities_PDP7A["PumpedStorage"] capacities_PDP7A["BigHydro"] = (capacities_PDP7A["BigHydro+Storage"] - capacities_PDP7A["PumpedStorage"]) capacities_PDP7A["Oil"] = 0 capacities_PDP7A["CoalCCS"] = 0 capacities_PDP7A["GasCCS"] = 0 capacities_PDP7A["BioCCS"] = 0 show(""" PDP7A capacity objectives by fuel type (GW)
http://en.openei.org/apps/TCDB/#blank """ import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm from init import pd, show, VERBOSE, start_year, end_year, n_year, years, sources # %% Functions to build series from OpenEI data file OpenEI = pd.read_csv("data/OpenEI/generation.lcoe.20170510_650.csv", skiprows=[0, 2], header=0, index_col=0, usecols=[ "EntityId", "TechIndex", "Technology", "TechnologySubtype", "Year", "PublicationYear", "OnghtCptlCostDolPerKw", "FixedOMDolPerKw", "VariableOMDolPerMwh", "HeatRate" ]) view = dict() q = 'Technology == "Coal" and ' q += 'TechnologySubtype in ["Conventional PC", "Advanced PC", "IGCC"]' view["Coal"] = OpenEI.query(q) q = 'Technology == "Coal" and ' q += 'TechnologySubtype in ["Advanced PC CCS", "IGCC CCS"]' view["CoalCCS"] = OpenEI.query(q)
""") show(capacity_past[["Coal", "Gas", "Oil", "BigHydro", "Renewable4"]].cumsum()) show() show(""" Vietnam historical generation capacity by fuel type (MW) Small hydro included in Hydro """) show(capacity_past[["Coal", "Gas", "Oil", "Hydro", "Renewable"]].cumsum()) show() # %% read data from International Energy Agency production_past = pd.read_csv("data/IEA/ElectricityProduction.csv", header=5, index_col=0) production_past["Solar"] = 0 addcol_Renewable(production_past) production_past["SmallHydro"] = (production_past.Hydro * capacity_past.SmallHydro / capacity_past.Hydro) production_past["SmallHydro"] = production_past["SmallHydro"].astype(int) production_past[ "BigHydro"] = production_past.Hydro - production_past.SmallHydro production_past["Import"] = production_past.Imports + production_past.Exports production_past["CoalCCS"] = 0 production_past["GasCCS"] = 0 production_past["BioCCS"] = 0
# FROM BP #international_past_data["path_data"] = "data/Oil_Gas_prices/data_prices_international_past_BP.csv" #international_past_data["ini_year_Gas"] = 1977 #international_past_data["ini_year_Coal"] = 1970 # FROM EIA #international_past_data["path_data"] = "data/Oil_Gas_prices/data_\ #prices_international_past_EIA.csv" #international_past_data["ini_year_Gas"] = 1970 #international_past_data["ini_year_Coal"] = 1960 #%%Monte Carlo characteristics : 35 forcasted prices from 2016 to 2050 for_values = END_YEAR - START_YEAR + 1 #Collect of data import_prices_data = pd.read_csv(international_past_data["path_data"], index_col=0) import_prices_data.columns = ["Gas", "Coal"] x = np.array(import_prices_data.index) y_coal = np.array( import_prices_data.Coal) / (CALORIFIC_POWER["Coal_international"] * t) y_gas = np.array(import_prices_data.Gas) / MBtu price_gas = pd.DataFrame({ 'Price_Gas': import_prices_data['Gas'] }).loc[international_past_data["ini_year_Gas"]:2016] / (MBtu) price_coal = pd.DataFrame({ 'Price_Coal': import_prices_data['Coal'] }).loc[international_past_data["ini_year_Coal"]:2016] / (
# -*- coding: utf-8 -*- """Initialize local coal and gas production time series. Created on Mon Jan 8 11:31:01 2018 @author: Alice Duval Productions are in 1000t for Coal and in Million M3 for Gas. """ import numpy as np from scipy.interpolate import lagrange from init import pd, START_YEAR, END_YEAR, CALORIFIC_POWER, kt, MM3 #Collect of data local_production_data = pd.read_csv( "data/Oil_Gas_prices/data_production_local.csv", index_col=0) local_production_data.columns = ["Coal", "Gas"] x = np.array(local_production_data.index) y_coal = np.array( local_production_data.Coal) * kt * CALORIFIC_POWER["Coal_local"] y_gas = np.array( local_production_data.Gas) * MM3 * CALORIFIC_POWER["Gas_local"] #interpolation of data with a langrangian polynom function_production_coal = lagrange(x, y_coal) function_production_gas = lagrange(x, y_gas) interpol_coal_production = [] interpol_gas_production = []