Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ dmypy.json
.idea/*

# Datafiles
*.xlsx
*.csv
#*.xlsx
#*.csv



Expand Down
Binary file added onsset/Bolivia/CNPV2012.xlsx
Binary file not shown.
19,280 changes: 19,280 additions & 0 deletions onsset/Bolivia/Database_new.csv

Large diffs are not rendered by default.

19,280 changes: 19,280 additions & 0 deletions onsset/Bolivia/Database_new_1.csv

Large diffs are not rendered by default.

19,280 changes: 19,280 additions & 0 deletions onsset/Bolivia/Database_new_2.csv

Large diffs are not rendered by default.

19,280 changes: 19,280 additions & 0 deletions onsset/Bolivia/Database_new_3.csv

Large diffs are not rendered by default.

19,280 changes: 19,280 additions & 0 deletions onsset/Bolivia/Multy_Tech_Test_4.csv

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions onsset/Bolivia/Multy_Test_Summary_4.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
,2020,2030
1.Population_Grid,10873419.386803921,12040181.937042283
1.Population_MG_Hydro1,0.0,0.0
1.Population_MG_Hydro2,14700.875516196937,16612.361765558475
1.Population_MG_Wind1,329.55628010769254,0.0
1.Population_MG_Wind2,0.0,0.0
1.Population_MG_PV1,0.0,0.0
1.Population_MG_PV2,0.0,0.0
1.Population_SA_PV1,400017.79516723735,131797.52736547653
1.Population_SA_PV2,730.582596953845,3820.981998784616
1.Population_MG_Diesel1,492.34914141538417,0.0
1.Population_MG_Diesel2,0.0,0.0
1.Population_SA_Diesel1,0.0,0.0
1.Population_SA_Diesel2,356391.35833779996,889316.0640977832
2.New_Connections_Grid,2508713.531102265,1165940.6448167344
2.New_Connections_MG_Hydro1,0.0,0.0
2.New_Connections_MG_Hydro2,4414.586983146937,1911.4862493615403
2.New_Connections_MG_Wind1,319.16547873369257,0.0
2.New_Connections_MG_Wind2,0.0,0.0
2.New_Connections_MG_PV1,0.0,0.0
2.New_Connections_MG_PV2,0.0,0.0
2.New_Connections_SA_PV1,313357.3197380889,118454.46479130704
2.New_Connections_SA_PV2,174.629546133845,366.59689376923143
2.New_Connections_MG_Diesel1,467.9394461543842,0.0
2.New_Connections_MG_Diesel2,0.0,0.0
2.New_Connections_SA_Diesel1,0.0,0.0
2.New_Connections_SA_Diesel2,219749.54344482892,148959.87493735057
3.Capacity_Grid,204202.3369525752,117212.51928818687
3.Capacity_MG_Hydro1,0.0,0.0
3.Capacity_MG_Hydro2,172.17616799207877,80.07368634934491
3.Capacity_MG_Wind1,30.202994797678063,0.0
3.Capacity_MG_Wind2,0.0,0.0
3.Capacity_MG_PV1,0.0,0.0
3.Capacity_MG_PV2,0.0,0.0
3.Capacity_SA_PV1,22769.890199777998,8563.479209823397
3.Capacity_SA_PV2,11.201942468465617,25.281899372004457
3.Capacity_MG_Diesel1,27.68207804420122,0.0
3.Capacity_MG_Diesel2,0.0,0.0
3.Capacity_SA_Diesel1,0.0,0.0
3.Capacity_SA_Diesel2,6294.1595727453705,4427.380106057222
4.Investment_Grid,846532512.7115273,136231125.2591667
4.Investment_MG_Hydro1,0.0,0.0
4.Investment_MG_Hydro2,1239002.0893283295,205691.97088117694
4.Investment_MG_Wind1,186995.93758444744,0.0
4.Investment_MG_Wind2,0.0,0.0
4.Investment_MG_PV1,0.0,0.0
4.Investment_MG_PV2,0.0,0.0
4.Investment_SA_PV1,123171250.3568173,18364608.536213037
4.Investment_SA_PV2,119412.7067138435,128365.16345514636
4.Investment_MG_Diesel1,161914.11353509844,0.0
4.Investment_MG_Diesel2,0.0,0.0
4.Investment_SA_Diesel1,0.0,0.0
4.Investment_SA_Diesel2,7552991.487294461,2145773.482471249
19,280 changes: 19,280 additions & 0 deletions onsset/Bolivia/bo-1-0_0_0_0_0_0.csv

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions onsset/Bolivia/bo-1-0_0_0_0_0_0_summary.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
,2020,2030
1.Population_Grid,10873419.386803921,12040181.937042283
1.Population_MG_Hydro1,0.0,0.0
1.Population_MG_Hydro2,14700.875516196937,16612.361765558475
1.Population_MG_Wind1,329.55628010769254,0.0
1.Population_MG_Wind2,0.0,0.0
1.Population_MG_PV1,0.0,0.0
1.Population_MG_PV2,0.0,0.0
1.Population_SA_PV1,400017.79516723735,131797.52736547653
1.Population_SA_PV2,730.582596953845,3820.981998784616
1.Population_MG_Diesel1,492.34914141538417,0.0
1.Population_MG_Diesel2,0.0,0.0
1.Population_SA_Diesel1,0.0,0.0
1.Population_SA_Diesel2,356391.35833779996,889316.0640977832
2.New_Connections_Grid,2508713.531102265,1165940.6448167344
2.New_Connections_MG_Hydro1,0.0,0.0
2.New_Connections_MG_Hydro2,4414.586983146937,1911.4862493615403
2.New_Connections_MG_Wind1,319.16547873369257,0.0
2.New_Connections_MG_Wind2,0.0,0.0
2.New_Connections_MG_PV1,0.0,0.0
2.New_Connections_MG_PV2,0.0,0.0
2.New_Connections_SA_PV1,313357.3197380889,118454.46479130704
2.New_Connections_SA_PV2,174.629546133845,366.59689376923143
2.New_Connections_MG_Diesel1,467.9394461543842,0.0
2.New_Connections_MG_Diesel2,0.0,0.0
2.New_Connections_SA_Diesel1,0.0,0.0
2.New_Connections_SA_Diesel2,219749.54344482892,148959.87493735057
3.Capacity_Grid,204202.3369525752,117212.51928818687
3.Capacity_MG_Hydro1,0.0,0.0
3.Capacity_MG_Hydro2,172.17616799207877,80.07368634934491
3.Capacity_MG_Wind1,30.202994797678063,0.0
3.Capacity_MG_Wind2,0.0,0.0
3.Capacity_MG_PV1,0.0,0.0
3.Capacity_MG_PV2,0.0,0.0
3.Capacity_SA_PV1,22769.890199777998,8563.479209823397
3.Capacity_SA_PV2,11.201942468465617,25.281899372004457
3.Capacity_MG_Diesel1,27.68207804420122,0.0
3.Capacity_MG_Diesel2,0.0,0.0
3.Capacity_SA_Diesel1,0.0,0.0
3.Capacity_SA_Diesel2,6294.1595727453705,4427.380106057222
4.Investment_Grid,846532512.7115273,136231125.2591667
4.Investment_MG_Hydro1,0.0,0.0
4.Investment_MG_Hydro2,1239002.0893283295,205691.97088117694
4.Investment_MG_Wind1,186995.93758444744,0.0
4.Investment_MG_Wind2,0.0,0.0
4.Investment_MG_PV1,0.0,0.0
4.Investment_MG_PV2,0.0,0.0
4.Investment_SA_PV1,123171250.3568173,18364608.536213037
4.Investment_SA_PV2,119412.7067138435,128365.16345514636
4.Investment_MG_Diesel1,161914.11353509844,0.0
4.Investment_MG_Diesel2,0.0,0.0
4.Investment_SA_Diesel1,0.0,0.0
4.Investment_SA_Diesel2,7552991.487294461,2145773.482471249
Binary file added onsset/Bolivia/specs_paper_new.xlsx
Binary file not shown.
14 changes: 14 additions & 0 deletions onsset/Bolivia_runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os
from runner import scenario



# 'Database_lower_ElecPopCalib.csv'
# 'Database_new_1.csv'
specs_path = os.path.join('Bolivia', 'specs_paper_new.xlsx')
calibrated_csv_path = os.path.join('Bolivia', 'Database_new_3.csv')
results_folder = os.path.join('Bolivia')
summary_folder = os.path.join('Bolivia')

scenario(specs_path, calibrated_csv_path, results_folder, summary_folder)

124 changes: 124 additions & 0 deletions onsset/Data_Base_manipulation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 14 21:34:50 2020

@author: balderrama
"""

import pandas as pd
from random import shuffle
import numpy as np

#%%
data = pd.read_csv('Bolivia/Database_new.csv')

## creation of population for the years 2020 and 2030
test = pd.DataFrame()
test['Slopes'] = data['Pop2025High']/data['Pop']
b = (data['Pop2025High'] - data['Pop'])/(2025 - 2012)
test['Interceptors'] = data['Pop2025High'] - b*2025
test['Pop2025High'] = data['Pop2025High']
test['Pop2025Test'] = test['Interceptors'] + b*2025
test['Pop'] = data['Pop']
test['PopTest'] = test['Interceptors'] + b*2012
test['Pop2020'] = test['Interceptors'] + b*2020
test['Pop2030'] = test['Interceptors'] + b*2030

#print(test['Pop'].sum())
#print(test['Pop2020'].sum())
#print(test['Pop2025High'].sum())
#print(test['Pop2030'].sum())
#print(test['Pop2025High'].sum() - test['Pop2020'].sum())
#print(test['Pop2030'].sum() - test['Pop2025High'].sum())

data['Pop2020High'] = test['Pop2020']
data['Pop2030High'] = test['Pop2030']


# Change the name of column Elecpop to ElecPopCalib
data['ElecPopCalib'] = data['ElecPop']

data = data.drop('ElecPop',axis=1)

## change the wind
#data['WindVel'] = 5
#data['WindCF'] = 0.3

# Change small mistakes in elecstart 2012

data.loc[7797, 'ElecStart'] = 0
data.loc[9620, 'ElecStart'] = 0
data.loc[13070, 'ElecStart'] = 0

data.to_csv('Bolivia/Database_new_2.csv')
# Change FinalElecCode2012

codes = {7: 'MG_Hydro2012',
6: 'MG_Wind2012',
5: 'MG_PV2012',
4: 'MG_Diesel2012',
3: 'SA_PV2012',
2: 'SA_Diesel2012',
1: 'Grid2012',
99: 'Non'}

for i in data.index:
tech = codes[data.loc[i, 'FinalElecCode2012']]
data.loc[i, 'FinalElecCode2012'] = tech

#data['FinalElecCode2012'] = np.where(data['FinalElecCode2012'] == 1, 1, 99)





data.to_csv('Bolivia/Database_new_3.csv')

#%%

# analize the ElecStart/ not done yet

data = pd.read_csv('Bolivia/Database_new_1.csv')


test = pd.DataFrame()

test['Pop'] = data['Pop']
test['ElecPopCalib'] = data['ElecPopCalib']
test['ElecStart'] = data['ElecStart']
test['FinalElecCode2012'] = data['FinalElecCode2012']







#%%
# Create a new data set with lower electricity penetration

data = pd.read_csv('Bolivia/Database_new_1.csv')

size = len(data)
zeros = int(round(size*0.3,0))
ones = int(round(size*0.7,0))

Modificator = [0] * zeros + [1] * ones

shuffle(Modificator)

data['ElecPopCalib'] = data['ElecPopCalib']*Modificator

data.to_csv('Bolivia/Database_lower_ElecPopCalib.csv')











Loading