energy-efficient technology investments using a decision support system framework
TRANSCRIPT
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Energy-efficient technology investments using a decisionsupport system framework
Emilio L. Cano1 Javier M. Moguerza1
Tatiana Ermolieva2 Yurii Yermoliev2
1Rey Juan Carlos University2International Institute for Applied Systems Analysis (IIASA)
Salamanca, May 31 - June 2 2016
Computational Management Science 2016 1/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Outline
1 An Integrated Framework
2 Stochastic Models
3 Conclusions
Computational Management Science 2016 2/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Outline
1 An Integrated Framework
2 Stochastic Models
3 Conclusions
Computational Management Science 2016 3/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Decision Support Systems
Algorithms
ModelSymbolic modelVariables, relations
Underlying theoryMethodology, technique
Uncertainty modelling
DataDeterministic dataUncertain data -Stochastic processes
Data analysis
SolutionData treatmentAnalysisVisualization
DSS
Interpretation
Computational Management Science 2016 4/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Decision Support Systems
Algorithms
ModelSymbolic modelVariables, relations
Underlying theoryMethodology, technique
Uncertainty modelling
DataDeterministic dataUncertain data -Stochastic processes
Data analysis
SolutionData treatmentAnalysisVisualization
DSS
Stakeholders Dialog
Interpretation
Computational Management Science 2016 4/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Decision Support Systems
Computational Management Science 2016 4/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
DSS Framework
Requirements
Statistical softwareData visualizationMathematical modelingSolver input generationCall to the solverOutput documentation
Framework
Reproducible Research & Literate Programming
omptimr R package & Algebraic Modeling Languages (AMLs)
“The goal of RR is to tie specific instructions to data analysis andexperimental data [and modeling] so that results can be recreated,
better understood and verified”“LP: a document that is a combination of content and data analysis
code [and models]”
Computational Management Science 2016 5/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
DSS Framework
Requirements
Statistical softwareData visualizationMathematical modelingSolver input generationCall to the solverOutput documentation
Framework
Reproducible Research & Literate Programming
omptimr R package & Algebraic Modeling Languages (AMLs)
“The goal of RR is to tie specific instructions to data analysis andexperimental data [and modeling] so that results can be recreated,
better understood and verified”“LP: a document that is a combination of content and data analysis
code [and models]”
Computational Management Science 2016 5/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
DSS Framework
Requirements
Statistical softwareData visualizationMathematical modelingSolver input generationCall to the solverOutput documentation
Copy-paste
Inconsistencies
Errors
Out-of-date
non-reproducible
Painful changes
Framework
Reproducible Research & Literate Programming
omptimr R package & Algebraic Modeling Languages (AMLs)
“The goal of RR is to tie specific instructions to data analysis andexperimental data [and modeling] so that results can be recreated,
better understood and verified”“LP: a document that is a combination of content and data analysis
code [and models]”
Computational Management Science 2016 5/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
DSS Framework
Requirements
Statistical softwareData visualizationMathematical modelingSolver input generationCall to the solverOutput documentation
Black box
Compiled software for specificsolutions
Changes require re-programming
Not reproducible
Framework
Reproducible Research & Literate Programming
omptimr R package & Algebraic Modeling Languages (AMLs)
“The goal of RR is to tie specific instructions to data analysis andexperimental data [and modeling] so that results can be recreated,
better understood and verified”“LP: a document that is a combination of content and data analysis
code [and models]”
Computational Management Science 2016 5/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
DSS Framework
Requirements
Statistical softwareData visualizationMathematical modelingSolver input generationCall to the solverOutput documentation
Framework
Reproducible Research & Literate Programming
omptimr R package & Algebraic Modeling Languages (AMLs)
“The goal of RR is to tie specific instructions to data analysis andexperimental data [and modeling] so that results can be recreated,
better understood and verified”“LP: a document that is a combination of content and data analysis
code [and models]”
Computational Management Science 2016 5/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
R as an Integrated Environment
Advantages
Open Source
Reproducible Research and Literate Programming capabilities.
Integrated framework for SMS, data, equations and solvers.
Data Analysis (pre- and post-), graphics and reporting.
Computational Management Science 2016 6/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
optimr Package
getEq(model1SMS, 4, format = "gams")
## [1] "eqDemand(j,t) ..\n\t Sum((i), y(i,j,t)) =e= D(j,t) \n;\n"
Computational Management Science 2016 7/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
optimr Package
getEq(model1SMS, 4, format = "gams")
## [1] "eqDemand(j,t) ..\n\t Sum((i), y(i,j,t)) =e= D(j,t) \n;\n"
Computational Management Science 2016 7/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
optimr Package
getEq(model1SMS, 4, format = "gams")
## [1] "eqDemand(j,t) ..\n\t Sum((i), y(i,j,t)) =e= D(j,t) \n;\n"
Computational Management Science 2016 7/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Solution and Analysis
wProblem(mod1Instance, "mod1.gms", "gams", "lp")
library(gdxrrw)
igdx(" /Programs/gams")
gams("mod1.gms")
importGams(mod1Instance) <- "outSolDeterministic1.gdx"
0
50
100
150
200
0
50
100
150
200
scenario 1scenario 2
1 2Period
Uni
ts
a
0
1
Available units
profile1 profile2 profile3 profile4
0
50
100
150
200
0
50
100
150
200
0
50
100
150
200
Node 3
Node 4
Node 5
time2
time3
time4
time5
time2
time3
time4
time5
time2
time3
time4
time5
time2
time3
time4
time5
t
Sup
ply
(kW
h)
i
PV
Electricity generation
Computational Management Science 2016 8/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Integration
Sweave("comprehensiveExample.Rnw")
library(tools)
texi2pdf("comprehensiveExample.tex")
Comprehensive Example for “An Integrated
Framework for the Representation and Solution
of Stochastic Energy Optimization Problems”
Emilio L. Cano
January 6, 2014
1 Introduction
This document is an example on how to use R as an integrated environment foroptimization. It is assumed that the optimr package is installed.
Here we can include any statistical analysis, for example a time series analysisto forecast the future energy prices, saving the values as parameters. We canalso show graphical representations of the parameter values, as in Figure 1, ortables with data, e.g. Table 1.
100 scenarios simulation
20
40
60
80
2013 2014 2015 2016
Dem
and
leve
l (kW
)
Energy demand
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
CH
PP
VR
TE
2013 2014 2015 2016 2017
EU
R/k
W
Investment cost
0.1
0.2
0.3
0.1
0.2
0.3
CH
PR
TE
2013 2014 2015 2016
EU
R/k
Wh
25
50
75
100Scenario
Energy price
Figure 1: Parameter values for the stochastic parameters.
The equations or any item of the model can be printed automatically fromthe model2SMS object. For example, the following command fetches the objec-tive function:
> cat("$$", getEq(model2SMS, 6, "tex", only = "rExpr"), "$$")
∑
n∈NPn ·
∑
t∈T
∑
i∈ICI ti,n · x t
i +∑
i∈I,j∈JCO t
i,j,n ·DT tj · yt
i,j,n
1
j n t value1 winter 1 2013 17.062 spring 1 2013 21.933 summer 1 2013 34.124 autumn 1 2013 24.375 winter 1 2014 19.896 spring 1 2014 25.58
Table 1: Example D parameter values (first 6 values).
2 Solving the problem
Once we have the instance in an optimInstance object, it can be solved andthe solution imported (see source code). Results checking is also possible as thisinformation is also stored:
We can embed calculations within the text, for example the value of theobjective function (68595), or we can print pretty LATEX tables with the optimalvalues, as the ones in Tables 2 and 3, or any other analysis and representation(see Figure 2). See the .Rnw source file to see the code.
i t valueRTE 2013 45.65PV 2013 57.65PV 2014 1.78
Table 2: Optimal values for x
i j n t valueRTE winter 1 2014 2.31RTE winter 1 2015 4.27RTE winter 1 2016 8.96RTE winter 1 2017 7.92RTE winter 2 2014 1.76RTE winter 2 2015 5.21
Table 3: Optimal values for y (first 6 values)
3 Conclusion
This document can be compiled at any time, by any researcher. Note that ifany value is changed, for example in the script that contain the parameters("../data/model2Instance2.R"), the whole report is updated automatically(including tables, equations and charts). If we use simulation during the re-search, we can simply fix the seed to allow the verification of the results bythird parties. Different reports for different stakeholders can be produced usinga common structure and tailoring the outputs.
2
0
10
20
30
2013 2014 2015 2016 2017Year
kW
Technology
RTE
PV
Optimal production plans (Autumn)
Figure 2: Output data representation.
3
Gold Standard
Computational Management Science 2016 9/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Integration
Sweave("comprehensiveExample.Rnw")
library(tools)
texi2pdf("comprehensiveExample.tex")
Comprehensive Example for “An Integrated
Framework for the Representation and Solution
of Stochastic Energy Optimization Problems”
Emilio L. Cano
January 6, 2014
1 Introduction
This document is an example on how to use R as an integrated environment foroptimization. It is assumed that the optimr package is installed.
Here we can include any statistical analysis, for example a time series analysisto forecast the future energy prices, saving the values as parameters. We canalso show graphical representations of the parameter values, as in Figure 1, ortables with data, e.g. Table 1.
100 scenarios simulation
20
40
60
80
2013 2014 2015 2016
Dem
and
leve
l (kW
)
Energy demand
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
CH
PP
VR
TE
2013 2014 2015 2016 2017
EU
R/k
W
Investment cost
0.1
0.2
0.3
0.1
0.2
0.3
CH
PR
TE
2013 2014 2015 2016
EU
R/k
Wh
25
50
75
100Scenario
Energy price
Figure 1: Parameter values for the stochastic parameters.
The equations or any item of the model can be printed automatically fromthe model2SMS object. For example, the following command fetches the objec-tive function:
> cat("$$", getEq(model2SMS, 6, "tex", only = "rExpr"), "$$")
∑
n∈NPn ·
∑
t∈T
∑
i∈ICI ti,n · x t
i +∑
i∈I,j∈JCO t
i,j,n ·DT tj · yt
i,j,n
1
j n t value1 winter 1 2013 17.062 spring 1 2013 21.933 summer 1 2013 34.124 autumn 1 2013 24.375 winter 1 2014 19.896 spring 1 2014 25.58
Table 1: Example D parameter values (first 6 values).
2 Solving the problem
Once we have the instance in an optimInstance object, it can be solved andthe solution imported (see source code). Results checking is also possible as thisinformation is also stored:
We can embed calculations within the text, for example the value of theobjective function (68595), or we can print pretty LATEX tables with the optimalvalues, as the ones in Tables 2 and 3, or any other analysis and representation(see Figure 2). See the .Rnw source file to see the code.
i t valueRTE 2013 45.65PV 2013 57.65PV 2014 1.78
Table 2: Optimal values for x
i j n t valueRTE winter 1 2014 2.31RTE winter 1 2015 4.27RTE winter 1 2016 8.96RTE winter 1 2017 7.92RTE winter 2 2014 1.76RTE winter 2 2015 5.21
Table 3: Optimal values for y (first 6 values)
3 Conclusion
This document can be compiled at any time, by any researcher. Note that ifany value is changed, for example in the script that contain the parameters("../data/model2Instance2.R"), the whole report is updated automatically(including tables, equations and charts). If we use simulation during the re-search, we can simply fix the seed to allow the verification of the results bythird parties. Different reports for different stakeholders can be produced usinga common structure and tailoring the outputs.
2
0
10
20
30
2013 2014 2015 2016 2017Year
kW
Technology
RTE
PV
Optimal production plans (Autumn)
Figure 2: Output data representation.
3
Gold Standard
Computational Management Science 2016 9/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
comprehensiveExample.Rnw
\ documentc l a s s [ a4paper ]{ a r t i c l e }\ usepackage {Sweave}
\ t i t l e {Comprehens ive Example f o r``An I n t e g r a t e d Framework f o r theRep r e s e n t a t i o n and So l u t i o n o f S t o c h a s t i cEnergy Opt im i z a t i on Problems ' '}\ autho r { Em i l i o L . Cano}
<< i n t r o , echo=FALSE , r e s u l t s=hide>>=## System r equ i r emen t s## − The R so f twa r e and the packages l oaded below## − A l i c e n c e d GAMS i n s t a l l a t i o n . I f GAMS d i r e c t o r y## i s o th e r than ”˜/ app/gams23 . 9 ” , change the l i n e## ' i g d x ( ”˜/ app/gams23 . 9 ”) '## − A LaTeX d i s t r i b u t i o n f o r the c u r r e n t system
## Load needed packagesl i b r a r y ( k n i t r )l i b r a r y ( opt imr )l i b r a r y ( gdxrrw )l i b r a r y ( x t a b l e )l i b r a r y ( ggp l o t2 )l i b r a r y ( g r i d )
## Te l l gdxrrw where GAMS i s i n s t a l l e di gdx ( ”˜/ app/gams23 . 9 ”)
## Run s c r i p t s w i th data## De t e rm i n i s t i c model
Computational Management Science 2016 10/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
comprehensiveExample.Rnw (cont.)
s ou r c e ( ”. / data /model1SMS .R”)## S t o c h a s t i c e x t e n s i o nsou r c e ( ”. / data /model2SMS .R”)## In s t a n c e wi th 100 s c e n a r i o ss ou r c e ( ”. / data /mode l2 In s t ance2 .R”)@
\ beg in {document}\SweaveOpts{ concordance=TRUE}
\mak e t i t l e
\ s e c t i o n { I n t r o d u c t i o n }This document i s an example on how to use \ t e x t s f {R} as an i n t e g r a t e denv i ronment f o r o p t im i z a t i o n . I t i s assumed tha t the \ t e x t s f { opt imr } package i s i n s t a l l e d .
Here we can i n c l u d e any s t a t i s t i c a l a n a l y s i s , f o r example a t ime s e r i e s a n a l y s i sto f o r e c a s t the f u t u r e ene rgy p r i c e s , s a v i n g the v a l u e s as pa ramete r s . We cana l s o show g r a p h i c a l r e p r e s e n t a t i o n s o f the paramete r va l u e s , as i n F i gu r e ˜\ r e f { f i g : examplepar } , o r t a b l e s w i th data , e . g . Table ˜\ r e f { tab : e xamp l e t ab l e } .
\ beg in { f i g u r e } [ htp ]\ beg in { c e n t e r }<<examplepar , f i g=TRUE, echo=FALSE , width=10>>=## Demandd toP l o t <− i n s t a n c ePa r s ( mode l2 Ins tance2 , ”D”)d t oP l o t $ i d <− 1 :20pD <− ggp l o t ( data = dtoPlot , ae s ( x = id , y = va lue , group=n , c o l=n ) )pD <− pD + geom path ( )pD <− pD + s c a l e x d i s c r e t e ( name = ”” , b r eak s = seq (1 ,21 , by=5) , l a b e l s = 2013 :2017)pD <− pD + g g t i t l e ( ”Energy demand ”)
Computational Management Science 2016 11/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
comprehensiveExample.Rnw (cont.)
pD <− pD + s c a l e y c o n t i n u o u s (name =”Demand l e v e l (kW) ”)pD <− pD + theme ( l eg end . p o s i t i o n = ”none ”)pD <− pD + stat summary ( fun . y=mean , c o l o u r =”da rk r ed ” , geom=”l i n e ” , aes ( group=1) , s i z e =1)
## Inve s tment c o s td toP l o t <− i n s t a n c ePa r s ( mode l2 Ins tance2 , ”CI ”)pCI <− ggp l o t ( data = dtoPlot , ae s ( x = t , y = va lue , group=n , c o l=n ) )pCI <− pCI + geom path ( )pCI <− pCI + f a c e t g r i d ( i ˜ . )pCI <− pCI + s c a l e x c o n t i n u o u s (name = ””)pCI <− pCI + g g t i t l e ( ” Inve s tment c o s t ”)pCI <− pCI + s c a l e y c o n t i n u o u s (name =”EUR/kW”)pCI <− pCI + theme ( l egend . p o s i t i o n = ”none ”)pCI <− pCI + stat summary ( fun . y=mean , c o l o u r =”da rk r ed ” , geom=”l i n e ” , aes ( group=1) , s i z e =1)
## Opera t i on co s td toP l o t <− i n s t a n c ePa r s ( mode l2 Ins tance2 , ”CO”)d t oP l o t $ i d <− 1 :20pCO <− ggp l o t ( data = dtoPlot , ae s ( x = id , y = va lue , group=n , c o l=n ) )pCO <− pCO + geom path ( )pCO <− pCO + f a c e t g r i d ( i ˜ . )pCO <− pCO + s c a l e x d i s c r e t e ( name = ”” , b r eak s = seq (1 ,21 , by=5) , l a b e l s = 2013 :2017)pCO <− pCO + g g t i t l e ( ”Energy p r i c e ”)pCO <− pCO + s c a l e y c o n t i n u o u s (name =”EUR/kWh”)pCO <− pCO + gu i d e s ( c o l o r = gu i d e c o l o u r b a r ( t i t l e = ”Sc ena r i o ”) )pCO <− pCO + stat summary ( fun . y=mean , c o l o u r =”da rk r ed ” , geom=”l i n e ” , aes ( group=1) , s i z e =1)
g r i d . newpage ( )v pA l l <− v i ewpo r t ( l a y o u t = g r i d . l a y o u t (2 , 3 ,
w id th s = c (1/3 , 1/3 , 1/3) ,
Computational Management Science 2016 12/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
comprehensiveExample.Rnw (cont.)
h e i g h t s = c ( 0 . 1 , 0 . 9 ) ) )vpT <− v i ewpo r t ( l a y o u t . pos . c o l = 1 : 3 , l a y o u t . pos . row = 1 , name = ” t i t l e ”)vpD <− v i ewpo r t ( l a y o u t . pos . c o l = 1 , l a y o u t . pos . row = 2 , name = ”D”)vpCI <− v i ewpo r t ( l a y o u t . pos . c o l = 2 , l a y o u t . pos . row = 2 , name = ”CI ”)vpCO <− v i ewpo r t ( l a y o u t . pos . c o l = 3 , l a y o u t . pos . row = 2 , name = ”CO”)s p l o t <− vpTree ( vpA l l , v p L i s t ( vpT , vpD , vpCI , vpCO) )pushViewport ( s p l o t )s e ekV i ewpo r t ( ” t i t l e ”)g r i d . t e x t (”100 s c e n a r i o s s imu l a t i o n ” , gp = gpar ( cex=2))s eekV i ewpo r t ( ”D”)p r i n t (pD , newpage = FALSE)seekV i ewpo r t ( ”CI ”)p r i n t ( pCI , newpage = FALSE)seekV i ewpo r t ( ”CO”)p r i n t (pCO, newpage = FALSE)@
\ c ap t i o n {Parameter v a l u e s f o r the s t o c h a s t i c pa ramete r s .}\ l a b e l { f i g : examplepar }
\end{ c e n t e r }\end{ f i g u r e }
<<echo=FALSE , r e s u l t s=tex>>=x t a b l e ( head ( i n s t a n c ePa r s ( mode l2 Ins tance2 , ”D”) ) ,
l a b e l = ”tab : e xamp l e t ab l e ” ,c ap t i o n = ”Example $D$ paramete r v a l u e s ( f i r s t 6 v a l u e s ) . ”)
@
The equa t i o n s or any i tem o f the model can be p r i n t e d a u t oma t i c a l l y from the
Computational Management Science 2016 13/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
comprehensiveExample.Rnw (cont.)
\ t e x t s f {model2SMS} o b j e c t . For example , the f o l l o w i n g command f e t c h e s theo b j e c t i v e f u n c t i o n :
<< r e s u l t s=tex>>=cat ( ”$$ ” , getEq (model2SMS , 6 , ”t e x ” , on l y = ”rExpr ”) , ”$$ ”)@
\ s e c t i o n { So l v i n g the problem }
Once we have the i n s t a n c e i n an \ t e x t t t { op t im In s t an c e } ob j e c t , i t can be s o l v e d and the s o l u t i o n impor ted ( s e e s ou r c e code ) . R e s u l t s check i ng i s a l s o p o s s i b l e as t h i s i n f o rma t i o n i s a l s o s t o r e d :
<<s o l , echo=FALSE , r e s u l t s=hide>>=wProblem ( mode l2 Ins tance2 ,
f i l e n ame = ”. / data /mode l2 In s t ance2 . gms ”,fo rmat = ”gams ”,s o l v e r = ”LP ”)
r e s <− gams ( ”. / data /mode l2 In s t ance2 . gms −−o u t f i l e =./ data /mode l2 In s t ance2 . gdx ”)data ( gamsOut )i f ( r e s == 0){
importGams ( mode l 2 In s t ance2 ) <− ”. / data /mode l2 In s t ance2 . gdx ”message ( ”Opt im i z a t i on ok\n ”,
”\ tModel S ta tu s : ” ,as . c h a r a c t e r ( s ub s e t ( gamsModelStatusCode ,
i d == mode l2 In s t ance2@re su l t $mode l , desc , drop = TRUE) ) ,”\ n\ t S o l v e r S ta tu s : ” ,as . c h a r a c t e r ( s ub s e t ( gamsSo lverStatusCode ,
i d == mode l 2 I n s t a n c e 2@ r e s u l t $ s o l v e , desc , drop = TRUE) ) )} e l s e {
warn ing ( ”Check the l i s t i n g f i l e , someth ing was wrong : ” ,s ub s e t ( gamsOutCode , i d == res , desc , drop = TRUE) )
Computational Management Science 2016 14/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
comprehensiveExample.Rnw (cont.)
}@
We can embed c a l c u l a t i o n s w i t h i n the t ex t , f o r example the v a l u e o f theo b j e c t i v e f u n c t i o n (\ Sexpr { round ( mode l 2 I n s t a n c e 2@ r e s u l t $ ob j )} ) , o r we can p r i n t p r e t t y\LaTeX˜ t a b l e s w i th the op t ima l va l u e s , as the ones i n Tab le s \ r e f { tab : x} and \ r e f { tab : y } , o r anyo th e r a n a l y s i s and r e p r e s e n t a t i o n ( s e e F i gu r e ˜\ r e f { f i g : r e s } ) . See the \ t e x t t t { .Rnw} s ou r c e f i l e to s e e the code .
<< r e s u l t s=tex , echo=FALSE>>=p r i n t ( x t a b l e ( i n s t a n c eVa r s ( mode l2 Ins tance2 , ”x ”) ,
”Optimal v a l u e s f o r $x$ ” ,”tab : x ”) , i n c l u d e . rownames = FALSE)
p r i n t ( x t a b l e ( head ( i n s t a n c eVa r s ( mode l2 Ins tance2 , ”y ”) ) ,”Optimal v a l u e s f o r $y$ ( f i r s t 6 v a l u e s ) ” ,”tab : y ”) , i n c l u d e . rownames = FALSE)
@
\ beg in { f i g u r e } [ htp ]\ beg in { c e n t e r }<<bar , echo=FALSE , f i g=TRUE>>=d f 2 p l o t <− s ub s e t ( i n s t a n c eVa r s ( mode l2 Ins tance2 , ”y ”) , j == ”autumn ”)d f 2 p l o t <− agg r ega t e ( v a l u e ˜ i + t , data = d f2p l o t , FUN = mean)d f 2 p l o t $ t <− as . i n t e g e r ( as . c h a r a c t e r ( d f 2 p l o t $ t ) )p <− ggp l o t ( d f 2p l o t , ae s ( x=t ) )p <− p + geom area ( aes ( y=va lue , f i l l =i ) )p <− p + l a b s ( t i t l e = ”Optimal p r oduc t i o n p l a n s (Autumn ) ” , x = ”Year ” , y = ”kW”)p <− p + s c a l e f i l l d i s c r e t e ( ”Technology ”)p r i n t ( p )@
Computational Management Science 2016 15/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
comprehensiveExample.Rnw (cont.)
\end{ c e n t e r }\ c ap t i o n {Output data r e p r e s e n t a t i o n .\ l a b e l { f i g : r e s }}\end{ f i g u r e }
\ s e c t i o n {Conc l u s i on }This document can be comp i l ed at any time , by any r e s e a r c h e r . Note tha t i f anyv a l u e i s changed , f o r example i n the s c r i p t t ha t c on t a i n the pa ramete r s(\ t e x t t t { ”. . / data /mode l2 In s t ance2 .R”} ) , the whole r e p o r t i s updated a u t oma t i c a l l y( i n c l u d i n g t a b l e s , e qua t i o n s and c h a r t s ) .I f we use s imu l a t i o n du r i ng the r e s e a r ch , we can s imp l y f i x the seed to a l l owthe v e r i f i c a t i o n o f the r e s u l t s by t h i r d p a r t i e s . D i f f e r e n t r e p o r t s f o r d i f f e r e n t s t a k e h o l d e r s can be produced u s i n g a common s t r u c t u r e and t a i l o r i n g the ou tpu t s .
\end{document}
Computational Management Science 2016 16/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Workflow
Computational Management Science 2016 17/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Outline
1 An Integrated Framework
2 Stochastic Models
3 Conclusions
Computational Management Science 2016 18/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage models
Rolling horizon
In Cano EL, Moguerza JM, Ermolieva T and Ermoliev Y(2014). “Energy efficiency and risk management in publicbuildings: Strategic model for robust planning.”Computational Management Science, 11, pp. 25-44
Moving random time horizons
In Cano EL, Moguerza JM, Ermolieva T and Ermoliev Y (underreview). “A strategic decision support system framework forenergy-efficient technology investments.” TOP.
Computational Management Science 2016 19/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage instance
Five periods, two technologies (CHP, PV), only electricity.
100 scenarios simulation
20
40
60
80
2013 2014 2015 2016
Dem
and
leve
l (kW
)
Energy demand
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
CH
PP
VR
TE
2013 2014 2015 2016 2017
EU
R/k
W
Investment cost
0.1
0.2
0.3
0.1
0.2
0.3
CH
PR
TE
2013 2014 2015 2016
EU
R/k
Wh
25
50
75
100Scenario
Energy price
Fdet(x∗det) = 66, 920 EUR.
Infeasible 56/100
Fsto(x∗sto) = 68, 595 EUR.
Robust, optimal against all
VSS = Fsto(x∗det)− Fsto(x
∗sto) =∞
Computational Management Science 2016 20/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage instance
Five periods, two technologies (CHP, PV), only electricity.
100 scenarios simulation
20
40
60
80
2013 2014 2015 2016
Dem
and
leve
l (kW
)
Energy demand
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
CH
PP
VR
TE
2013 2014 2015 2016 2017
EU
R/k
W
Investment cost
0.1
0.2
0.3
0.1
0.2
0.3
CH
PR
TE
2013 2014 2015 2016
EU
R/k
Wh
25
50
75
100Scenario
Energy price
Fdet(x∗det) = 66, 920 EUR.
Infeasible 56/100Fsto(x
∗sto) = 68, 595 EUR.
Robust, optimal against all
VSS = Fsto(x∗det)− Fsto(x
∗sto) =∞
Computational Management Science 2016 20/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage instance
Five periods, two technologies (CHP, PV), only electricity.
100 scenarios simulation
20
40
60
80
2013 2014 2015 2016
Dem
and
leve
l (kW
)
Energy demand
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
CH
PP
VR
TE
2013 2014 2015 2016 2017
EU
R/k
W
Investment cost
0.1
0.2
0.3
0.1
0.2
0.3
CH
PR
TE
2013 2014 2015 2016
EU
R/k
Wh
25
50
75
100Scenario
Energy price
Fdet(x∗det) = 66, 920 EUR.
Infeasible 56/100
Fsto(x∗sto) = 68, 595 EUR.
Robust, optimal against all
VSS = Fsto(x∗det)− Fsto(x
∗sto) =∞
Computational Management Science 2016 20/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage instance
Five periods, two technologies (CHP, PV), only electricity.
100 scenarios simulation
20
40
60
80
2013 2014 2015 2016
Dem
and
leve
l (kW
)
Energy demand
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
CH
PP
VR
TE
2013 2014 2015 2016 2017
EU
R/k
W
Investment cost
0.1
0.2
0.3
0.1
0.2
0.3
CH
PR
TE
2013 2014 2015 2016
EU
R/k
Wh
25
50
75
100Scenario
Energy price
Fdet(x∗det) = 66, 920 EUR.
Infeasible 56/100
Fsto(x∗sto) = 68, 595 EUR.
Robust, optimal against all
VSS = Fsto(x∗det)− Fsto(x
∗sto) =∞
Computational Management Science 2016 20/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage instance
Five periods, two technologies (CHP, PV), only electricity.
100 scenarios simulation
20
40
60
80
2013 2014 2015 2016
Dem
and
leve
l (kW
)
Energy demand
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
CH
PP
VR
TE
2013 2014 2015 2016 2017
EU
R/k
W
Investment cost
0.1
0.2
0.3
0.1
0.2
0.3
CH
PR
TE
2013 2014 2015 2016
EU
R/k
Wh
25
50
75
100Scenario
Energy price
Fdet(x∗det) = 66, 920 EUR. Infeasible 56/100
Fsto(x∗sto) = 68, 595 EUR.
Robust, optimal against all
VSS = Fsto(x∗det)− Fsto(x
∗sto) =∞
Computational Management Science 2016 20/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage instance
Five periods, two technologies (CHP, PV), only electricity.
100 scenarios simulation
20
40
60
80
2013 2014 2015 2016
Dem
and
leve
l (kW
)
Energy demand
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
0
500
1000
1500
2000
2500
CH
PP
VR
TE
2013 2014 2015 2016 2017
EU
R/k
W
Investment cost
0.1
0.2
0.3
0.1
0.2
0.3
CH
PR
TE
2013 2014 2015 2016
EU
R/k
Wh
25
50
75
100Scenario
Energy price
Fdet(x∗det) = 66, 920 EUR. Infeasible 56/100
Fsto(x∗sto) = 68, 595 EUR. Robust, optimal against all
VSS = Fsto(x∗det)− Fsto(x
∗sto) =∞
Computational Management Science 2016 20/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Multi-stage model
Complete model with risk
In Cano EL, Moguerza JM and Alonso-Ayuso A (2016). “Amulti-stage stochastic optimization model for energy systemsplanning and risk management.” Energy and Buildings, 110,pp. 49–56.
Reproducible data and code
In Cano EL, Moguerza JM and Alonso-Ayuso A (2015).“Optimization instances for deterministic and stochasticproblems on energy efficient investments planning at thebuilding level.” Data in Brief, 5, pp. 805–809.
Computational Management Science 2016 21/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Multi-stage model with risk management
Different objectives: min cost, emissions, or energy use
Risk measure CVaR [Rockafellar and Uryasev (2000)]
Weighted objective function
Computational Management Science 2016 22/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage vs. Multi-stage
Dynamic two-stage
First-stage decisions: strategic
Second-stage decisions: operational
Solution: trajectory, recalculated at each step
Multi-stage
First-stage decisions: before branching
2nd -, . . . , nth -stage decisions: after branching
Solution: strategy, recalculated at each step
Computational Management Science 2016 23/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage vs. Multi-stage
Dynamic two-stage
First-stage decisions: strategic
Second-stage decisions: operational
Solution: trajectory, recalculated at each step
Multi-stage
First-stage decisions: before branching
2nd -, . . . , nth -stage decisions: after branching
Solution: strategy, recalculated at each step
Computational Management Science 2016 23/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage vs. Multi-stage
Dynamic two-stage
First-stage decisions: strategic
Second-stage decisions: operational
Solution: trajectory, recalculated at each step
Multi-stage
First-stage decisions: before branching
2nd -, . . . , nth -stage decisions: after branching
Solution: strategy, recalculated at each step
Computational Management Science 2016 23/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage vs. Multi-stage
Dynamic two-stage
First-stage decisions: strategic
Second-stage decisions: operational
Solution: trajectory, recalculated at each step
Multi-stage
First-stage decisions: before branching
2nd -, . . . , nth -stage decisions: after branching
Solution: strategy, recalculated at each step
Computational Management Science 2016 23/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Two-stage vs. Multi-stage
Dynamic two-stage
First-stage decisions: strategic
Second-stage decisions: operational
Solution: trajectory, recalculated at each step
Multi-stage
First-stage decisions: before branching
2nd -, . . . , nth -stage decisions: after branching
Solution: strategy, recalculated at each step
Computational Management Science 2016 23/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Outline
1 An Integrated Framework
2 Stochastic Models
3 Conclusions
Computational Management Science 2016 24/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Conclusions
Results
Reproducible Research methods in OptimizationThe stakeholders dialog viewpoint for DSSsThe optimr libraryComprehensive example demonstrating the framework
Further Research
Two-stage vs Multi-stage applicabilityNew models for energy storage systemsProductize package. Extend to further formatsExplore new reproducible research paths (R Markdown,interactive visualisation, . . . )
Links
Publications: http://emilio.lcano.com/content/en/
publicaciones.html
optimr package:https://github.com/emilopezcano/optimr
Computational Management Science 2016 25/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Conclusions
Results
Reproducible Research methods in OptimizationThe stakeholders dialog viewpoint for DSSsThe optimr libraryComprehensive example demonstrating the framework
Further Research
Two-stage vs Multi-stage applicabilityNew models for energy storage systemsProductize package. Extend to further formatsExplore new reproducible research paths (R Markdown,interactive visualisation, . . . )
Links
Publications: http://emilio.lcano.com/content/en/
publicaciones.html
optimr package:https://github.com/emilopezcano/optimr
Computational Management Science 2016 25/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Conclusions
Results
Reproducible Research methods in OptimizationThe stakeholders dialog viewpoint for DSSsThe optimr libraryComprehensive example demonstrating the framework
Further Research
Two-stage vs Multi-stage applicabilityNew models for energy storage systemsProductize package. Extend to further formatsExplore new reproducible research paths (R Markdown,interactive visualisation, . . . )
Links
Publications: http://emilio.lcano.com/content/en/
publicaciones.html
optimr package:https://github.com/emilopezcano/optimr
Computational Management Science 2016 25/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
DSS Mission
Joseph Kallrath (2012). Algebraic ModelingSystems, Springer. Chapter 12: A Practioner’sWish List Towards Algebraic Modeling Systems
“The automatic generation of a model’s documentation inLATEX would be very helpful for mathematicians, physicists,astronomers, and other communities publishing in LATEX.”
Computational Management Science 2016 26/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Acknowledgements
We acknowledge projects:
OPTIMOS3 (MTM2012-36163-C06-06)GROMA (MTM2015-63710-P)PPI (RTC-2015-3580-7)UNIKO (RTC-2015-3521-7)
and the Young Scientists Summer Program (YSSP) at the International Instituteof Applied Systems Analysis (IIASA).
Computational Management Science 2016 27/28
DSS framework
CMS 2016
Emilio L. Cano
An IntegratedFramework
StochasticModels
Conclusions
Discussion
Thanks !
@emilopezcanohttp://emilio.lcano.com
Computational Management Science 2016 28/28