-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_DICE_general-miu.py
91 lines (52 loc) · 4.09 KB
/
run_DICE_general-miu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 12 14:53:40 2020
@author: kcaldeira
"""
from plot_utilities import *
from io_utilities import *
import cProfile
from DICE_diffeqs import DICE_instance
#%%
# starting point has learning curve of 10 k$ at 10,000 tCO2, and a learning rate of 12% per doubling.
if __name__ == "__main__":
caseName = 'testNS_100k'
# If no arg is given, run vanilla DICE
print (caseName)
resultCentral = DICE_instance(
dt = 1, # dt time step for integration
nTechs = 2, # number of technologies considered
decisionTimes =[0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,110,130,150,200,250,275,290,300], # times for miu decisions
# NOTE: <decisionTimes> are also the times assumed for specified limits on miu
#limMiuLower = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], # lower limit on miu values (= sum across all techs)
limMiuLower = 0, # can be scalar or vector of len(decisionTimes)
#limMiuUpper = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], # upper limit on miu values (= sum across all techs)
#limMiuUpper = [1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2], # upper limit on miu values (= sum across all techs)
limMiuUpper = 1.0, # can be scalar or vector of len(decisionTimes)
limmiu = 1.0, # upper limit on any individual technology
optSavings = True, # True means to optimize on savings rate, False means to use default DICE value
savingDecisionTimes =[0,20,40,60,80,100,150,200,250,275,300], # times for savings rate decisions
techLearningCurve = [False, True], # does this technology have a learning curve (True) or a specified cost function (False)
# NOTE: <learningCurveTech> must have a length of <nTechs>
techLearningSubsidy = [False, False], # whether to allow learning curve subsidies or require deploying only to highest
# marginal cost of other technologies.
techInitCost = [550, 2000], # Initial cost for learning curve. Must be same shape as nTechs.
#techInitCost = [550, 1e4], # Initial cost for learning curve. Must be same shape as nTechs.
# If no learning curve, then this value is the initial backstop cost (pback)
techInitAmount = [0, 1e4], # Initial cost for learning curve. Must be same shape as nTechs, but value if no learning curve is unimportant
techLearningRate = [0.005050763379468082, 0.18442457113742744], # 12% per doubling. Must be same shape as nTechs.
# If no learning curve, then value is fractional cost improvement per year
firstUnitFractionalCost = [0.0,0.1], # Marginal cost at miuX = 0 compared to marginal cost at miuX = 1.
utilityOption = 1, # utilityOption == 0 --> DICE utility function; 1 --> assume consumption == utility
prstp = 0.03, # pure rate of time preference (0.015 is DICE default ; for default, just comment out and don't define )
parallel = 15, # number of cores to use, 0 or 1 is single core; Serial: 0 or 1, Parallel: 2,3,4,5,6,7,8...
#parallel = 1, # number of cores to use, 0 or 1 is single core; Serial: 0 or 1, Parallel: 2,3,4,5,6,7,8...
maxeval = 10000, # maxeval maximum number of iterations for solver
#maxeval = 100, # maxeval maximum number of iterations for solver
FOCUS = 100, # FOCUS parameter for midaco solver
damageCostRatio = 1.0, # scaling on climate damage
abatementCostRatio = 1.0 # scaling on abatement costs (multiplies costs above for all techs)
)
pickle_results('../dice-diffeqs_analyze/output',caseName,filter_dic(resultCentral.out))
write_CSV_from_pickle('../dice-diffeqs_analyze/output',caseName)
# %%