Skip to content

Commit

Permalink
changed calculation of capex from investment -> project development c…
Browse files Browse the repository at this point in the history
…osts were lower than needed be
  • Loading branch information
smartie2076 committed Jun 12, 2019
1 parent 58ed992 commit bb75e1f
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 81 deletions.
4 changes: 3 additions & 1 deletion D_process_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def economic_values(experiment):
'project']

for item in component_list:
print(item)
# --------------------------------------------------#
# CAPEX without opex/a #
# --------------------------------------------------#
Expand All @@ -85,7 +86,8 @@ def economic_values(experiment):
# costs. Includes project_cost_annuity, distribution_grid_cost_annuity, maingrid_extension_cost_annuity for
# consistency eventhough these are not used in optimization.
experiment.update({item + '_cost_annuity': experiment[item + '_cost_annuity'] / 365*experiment['evaluated_days']})

if item == 'project':
print(experiment[item + '_cost_investment'], experiment[item + '_cost_capex'], experiment[item + '_cost_annuity']*365/experiment['evaluated_days'])
return experiment

def add_timeseries(experiment_s):
Expand Down
8 changes: 6 additions & 2 deletions Z_economic_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ def crf(project_life, wacc):

def capex_from_investment(investment_t0, lifetime, project_life, wacc, tax):
# [quantity, investment, installation, weight, lifetime, om, first_investment]
number_of_investments = int(round(project_life / lifetime+0.5))

if project_life == lifetime:
number_of_investments = 1
else:
number_of_investments = int(round(project_life / lifetime + 0.5))
# costs with quantity and import tax at t=0
first_time_investment = investment_t0 * (1+tax)

Expand All @@ -28,6 +30,8 @@ def capex_from_investment(investment_t0, lifetime, project_life, wacc, tax):

# Substraction of component value at end of life with last replacement (= number_of_investments - 1)
if number_of_investments * lifetime > project_life:
print(number_of_investments * lifetime)
print(investment_t0)
last_investment = first_time_investment / ((1 + wacc) ** ((number_of_investments - 1) * lifetime))
linear_depreciation_last_investment = last_investment / lifetime
capex = capex - linear_depreciation_last_investment * (number_of_investments * lifetime - project_life)
Expand Down
4 changes: 3 additions & 1 deletion Z_output_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ def overall_results_title(settings, number_of_project_sites, sensitivity_array_d

title_overall_results = pd.concat([title_overall_results, pd.DataFrame(columns=[
'capacity_pv_kWp',
'capacity_wind_kW',
'capacity_storage_kWh',
'power_storage_kW',
'capacity_rectifier_ac_dc_kW',
'capacity_inverter_kW',
'capacity_wind_kW',
'capacity_genset_kW',
'capacity_pcoupling_kW',
'consumption_fuel_annual_l',
Expand Down
Loading

0 comments on commit bb75e1f

Please sign in to comment.