ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymb...
Upcoming SlideShare
Loading in...5
×

Reproducible Operations Research. An Application to Energy Systems Optimization

225

Published on

Presentación en las IV Jornadas de usuarios de R, Barcelona 15-16 noviembre 2012

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
225
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Reproducible Operations Research. An Application to Energy Systems Optimization"

  1. 1. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyReproducible Operations Research.An Application to Energy SystemsOptimizationInvestigaci´on Operativa Reproducible. Aplicaci´on a laoptimizaci´on de sistemas energ´eticosEmilio L. Cano1Javier M. Moguerza11DEIO, Universidad Rey Juan Carlos, MadridIV Jornadas de Usuarios de R, Barcelona15 y 16 de noviembre de 2012IV Jornadas de Usuarios de R, 2012 1/35
  2. 2. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyOutline1 IntroductionReproducible Research2 Integrated FrameworkSymbolic Model Specification3 ApplicationThe EnRima ProjectDSS DescriptionSolver ManagerReportingIV Jornadas de Usuarios de R, 2012 2/35
  3. 3. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyOutline1 IntroductionReproducible Research2 Integrated FrameworkSymbolic Model Specification3 ApplicationThe EnRima ProjectDSS DescriptionSolver ManagerReportingIV Jornadas de Usuarios de R, 2012 3/35
  4. 4. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyReproducible OResearchThe goal of reproducible research is to tiespecific instructions to data analysis andexperimental data so that results can berecreated, better understood and verifiedIV Jornadas de Usuarios de R, 2012 4/35
  5. 5. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyWorkflowNeedsStatistical SoftwareData VisualizationData AnalysisMathematicalRepresentationSolver Input GenerationOutput DocumentationIV Jornadas de Usuarios de R, 2012 5/35
  6. 6. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyApproachesCopy-pasteInconsistenciesErrorsOut-of-datenon-reproduciblePainful changesBlack boxCompiled software for specific solutionsIV Jornadas de Usuarios de R, 2012 6/35
  7. 7. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyOutline1 IntroductionReproducible Research2 Integrated FrameworkSymbolic Model Specification3 ApplicationThe EnRima ProjectDSS DescriptionSolver ManagerReportingIV Jornadas de Usuarios de R, 2012 7/35
  8. 8. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyR as an Integrated EnvironmentAdvantagesOpen SourceReproducible Research and Literate Programmingcapabilities.Integrated framework for SMS, data, equationsand solvers.Data Analysis (pre- and post-), graphics andreporting.IV Jornadas de Usuarios de R, 2012 8/35
  9. 9. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographySymbolic Model SpecificationThe SMS contains the mathematicalrepresentation of optimization models forall relevant energy subsystems and theirinteractions.This mathematical representation iscomposed of variables, parameters, andrelations between them. Individualentities (variables and parameters) areidentified through the indices representingthe elements in different set.IV Jornadas de Usuarios de R, 2012 9/35
  10. 10. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyData-driven ModellingIV Jornadas de Usuarios de R, 2012 10/35
  11. 11. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographySets and Indices> head(SMSsets(model1SMS)[,c(1,3,4,6,7,8,9)])id tag sDes loc inSet aux subSet1 1 NA Energy-creating technology sub NA NA FALSE2 2 NA Energy-storing technology sub NA NA FALSE3 3 NA Type of energy sub NA NA FALSE4 4 NA Type of pollutant sub NA NA FALSE5 5 NA Energy market sub NA NA FALSE6 6 NA Long-term period sup NA NA FALSE> cat(getSets(model1SMS, format = "tex", compact = FALSE))begin{description}item[$i$] Energy-creating technology.item[$j$] Energy-storing technology.item[$k$] Type of energy.item[$l$] Type of pollutant.item[$n$] Energy market.item[$p$] Long-term period.item[$m$] Mid-term period.item[$t$] Short-term period.item[$a$] Technology age. a = 0,...,P-1end{description}IV Jornadas de Usuarios de R, 2012 11/35
  12. 12. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyDecision Variables> head(SMSvars(model1SMS)[,c(1,2,4, 7,9)])id symbol sDes units ind1 1 si Generators to be installed Devices 1, 62 2 sd Generators to be decommissioned Devices 1, 6, 93 3 s Available generation capacity kW 1, 64 4 xi Storing devices to be installed Devices 2, 65 5 xd Storing devices to be decommissioned Devices 2, 6, 96 6 x Available storing capacity kWh 2, 6> cat(getVars(model1SMS, format = "tex"))begin{description}... ...item[$ mathit{s}_{i}^{p}$] Available generation capacity (kW).... ...item[$ mathit{r}_{j,k}^{p,m,t}$] Energy stored (kWh).item[$ mathit{c}_{}^{}$] TotalCost (EUR).item[$ mathit{e}_{}^{p,m,t}$] Primary energy consumed (kWh).end{description}IV Jornadas de Usuarios de R, 2012 12/35
  13. 13. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyParameters> head(SMSpars(model1SMS)[, c(1,2,4,7, 10)])id symbol sDes units ind1 1 D Energy demand kWh 3, 6, 7, 82 2 G Generation capacity kW/Device 13 3 GS Storage capacity kW/Device 24 4 AG Generation aging factor kW/kWh 1, 115 5 AS Storage aging factor kW/kW 2, 116 6 AV Technology availability factor kW/kW 1, 6, 7, 8> cat(getPars(model1SMS, format = "tex"))begin{description}item[$ mathit{D}_{k}^{p,m,t}$] Energy demand (kWh).item[$ mathit{G}_{i}^{}$] Generation capacity (kW/Device).item[$ mathit{GS}_{j}^{}$] Storage capacity (kW/Device).... ...item[$ mathit{IL}_{}^{}$] Investment limit (EUR).... ...end{description}IV Jornadas de Usuarios de R, 2012 13/35
  14. 14. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyEquations> head(SMSeqs(model1SMS)[,c(1,2,6,7,8)])id symbol nature relation domain1 1 eqAvailg constraint eq 1, 62 2 eqAvails constraint eq 2, 63 3 eqDecomLimg constraint lte 1, 64 4 eqDecomLims constraint lte 2, 65 5 eqEnergyBal constraint gte 3, 6, 7, 86 6 eqOutputCalc constraint eq 1, 6, 7, 8, 20> head(model1SMS@terms[,c(1,6,7,8,9,10,11)])id eq side parent nature item setSums1 1 1 l NA vars 3 NA2 2 1 r NA pars 2 NA3 3 1 r 2 pars 4 NA4 4 1 r 3 vars 1 NA5 5 1 r 3 vars 2 NA6 1 2 l NA vars 6 NA> cat(getEq(model1SMS, 1, format = "tex"))IV Jornadas de Usuarios de R, 2012 14/35
  15. 15. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyEquations (cont.)mathit{s}_{i}^{p} = mathit{G}_{i}^{} cdotsum _{ mathit{a} leq mathit{p} , mathit{a}geq mathit{0} } mathit{AG}_{i}^{mathit{p}-mathit{a}}cdot left ( mathit{si}_{i}^{mathit{a}}-sum _{ mathit{a} leq mathit{p} ,mathit{a} > mathit{a} }mathit{sd}_{i}^{mathit{a},mathit{a}} right)qquad forall ;i in mathcal{I},; p in mathcal{P}IV Jornadas de Usuarios de R, 2012 15/35
  16. 16. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyComplete ModelIV Jornadas de Usuarios de R, 2012 16/35
  17. 17. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyOutline1 IntroductionReproducible Research2 Integrated FrameworkSymbolic Model Specification3 ApplicationThe EnRima ProjectDSS DescriptionSolver ManagerReportingIV Jornadas de Usuarios de R, 2012 17/35
  18. 18. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyObjectiveThe overall objective of EnRiMa is todevelop a decision-support system (DSS)for operators of energy-efficient buildingsand spaces of public use.IV Jornadas de Usuarios de R, 2012 18/35
  19. 19. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyConsortiumIV Jornadas de Usuarios de R, 2012 19/35
  20. 20. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyEnRiMa DSSIV Jornadas de Usuarios de R, 2012 20/35
  21. 21. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyDecision ScopeEnRiMaDSSStrategicModuleOperationalModuleStrategicDVsStrategicConstraintsUpper-LevelOperational DVsUpper-LevelEnergy-BalanceConstraintsLower-LevelEnergy-BalanceConstraintsLower-LevelOperational DVsIV Jornadas de Usuarios de R, 2012 21/35
  22. 22. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyInstanceIV Jornadas de Usuarios de R, 2012 22/35
  23. 23. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyInstance (cont.)> instancePars(model1Instance, "CI")[sort(sample(1:975,10, FALSE )),]i p a value251 CHP 22 19 1021.45984313 CHP 25 12 830.54032450 PV 16 4 18.57636476 PV 17 14 24.96507517 PV 20 1 17.00000578 PV 22 21 30.70389581 PV 23 2 17.51000586 PV 23 7 20.29889669 Wind 6 3 212.18000758 Wind 15 2 206.00000> instanceSets(model1Instance, c("i"))[1] "CHP" "PV" "Wind"IV Jornadas de Usuarios de R, 2012 23/35
  24. 24. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyProblem> wProblem(example1Instance, "basicExample.gms", "gams", "lp")*GAMS file created with R$if NOT set outfile $set outfile outSolSetsi Technology / RTE, PV, CHP/j Period / winter, spring, summer, autumn/t Year / 2013, 2014, 2015, 2016, 2017/;...parameterD(j,t) Demand Level/ winter .2013 = 5.25spring .2013 = 5.83333333333333...autumn .2017 = 7.75833333333333/ ;Variablesx(i, t)y(i, j, t)s(i, t)z;Positive variable x ;IV Jornadas de Usuarios de R, 2012 24/35
  25. 25. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyProblem (cont.)Positive variable y ;Positive variable s ;;EquationseqAvail (i,t) Available technologies capacity calculationeqDemand (j,t) Production plan for demandeqCapacity (i,j,t) Technologies capacityCost Total Cost;eqAvail(i,t) .. s(i,t) =e= s(i,t-1)+x(i,t)-x(i,t-LT(i)) ;eqDemand(j,t) .. Sum((i), y(i,j,t)) =e= D(j,t) ;eqCapacity(i,j,t) .. y(i,j,t) =l= G(i,j,t)*s(i,t) ;Cost .. z =e= Sum((t), (Sum((i), CI(i,t)*x(i,t))+Sum((i,j), CO(i,j,t)*DT(j,t)*y(i,j,t))))Model Deterministic1 /all/;solve Deterministic1 using lp minimizing z ;scalars modelstat, solvestat, obj;modelstat = Deterministic1.modelstat;solvestat = Deterministic1.solvestat;obj = Deterministic1.objVal;execute_unload %outfile%, modelstat, solvestat, obj, x, y, s, z ;IV Jornadas de Usuarios de R, 2012 25/35
  26. 26. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyArchitectureIV Jornadas de Usuarios de R, 2012 26/35
  27. 27. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyArchitecture (cont.)> # .... Data preparation> load("./data/exampleCMS.RData")> wProblem(mod1Instance, "example.gms", "gams", "lp")> #> # solve> gams("example.gms --outfile=exampleSol.gdx")> #> ## import solution> oldOpt <- options(stringsAsFactors= FALSE)> importGams(model1Instance)<- "exampleSol.gdx"> options(oldOpt)> #> getsolution(model1Instance)IV Jornadas de Usuarios de R, 2012 27/35
  28. 28. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyDSS IntegrationIV Jornadas de Usuarios de R, 2012 28/35
  29. 29. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographySolution and reportSweave file example:%documentclass[a4paper]{article}usepackage{Sweave}title{Example Symbolic Model Specification}author{urjc}begin{document}maketitlesection{Data analysis}<<>>=# Some code for importing the# Symbolic Model and analyzing the# input data ...#Generate tex filewProblem(myImplem,filename = "myImplem.tex",IV Jornadas de Usuarios de R, 2012 29/35
  30. 30. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographySolution and report (cont.)format = "tex",solver = "lp" )#generate gams filewProblem(initStochImplem,filename = "myImplem.gms",format = "gams",solver = "lp" )@section{Symbolic Model Specification}%Write the LaTeX equationsinput{myImplem}section{Call to solver}<<>>=require(gdxrrw)gams("myImplem.gms --outfile=mySol.gdx")@section{Solution Analysis}<<>>=lst <- list(name=solvestat,form=full,compress=TRUE)IV Jornadas de Usuarios de R, 2012 30/35
  31. 31. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographySolution and report (cont.)solverResults <- rgdx("mySol.gdx", lst)#Some analysis and charts over solverResults object@end{document}0.20.40.60.20.40.6PPSP1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25Time PeriodsPrice(EUR/kWh)Energy TypeElectricityNGEnergy Prices SimulationOptimisation Result − Operational DecisionsTechnology by YearOperationLevel 51015202013 2014 2015 2016 2017CHP2013 2014 2015 2016 2017PV5101520RTEIV Jornadas de Usuarios de R, 2012 31/35
  32. 32. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographySummaryIn this presentation the method used torepresent and solve the optimizationmodels developed within the EnRiMaDSS have been describedIV Jornadas de Usuarios de R, 2012 32/35
  33. 33. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographySummaryIn this presentation the method used torepresent and solve the optimizationmodels developed within the EnRiMaDSS have been describedOutlookAlgebraic Modeling Languages for R solversand APIsExtend representation formats: HTML,ODF, . . .Further formats: AMPL, XML, . . .user-friendly inputrelease roptim libraryIV Jornadas de Usuarios de R, 2012 32/35
  34. 34. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyAcknowledgementsR-projectGAMS SoftwareEnRiMa project partnersThis work has been partially funded by the projects:Energy Efficiency and Risk Management in Public Buildings (EnRiMa) EC’sFP7 project (number 260041)Project RIESGOS-CM: code S2009/ESP-1685AGORANET project (IPT-430000-2010-32)HAUS: IPT-2011-1049-430000EDUCALAB: IPT-2011-1071-430000DEMOCRACY4ALL: IPT-2011-0869-430000CORPORATE COMMUNITY: IPT-2011-0871-430000IV Jornadas de Usuarios de R, 2012 33/35
  35. 35. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyReferencesCOIN-OR Foundation. Internet, 2012. URL http://www.coin-or.org/.retrieved 2012-06-12.EnRiMa. Energy efficiency and risk management in public buildings.www.enrima-project.eu, 2012.GAMS. gdxrrw: interfacing gams and R. Internet, 2012. URLhttp://support.gams-software.com/doku.php?id=gdxrrw:interfacing_gams_and_r. retrieved 2012-03-06.Josef Kallrath. Algebraic modeling languages: Introduction and overview. InJosef Kallrath, editor, Algebraic Modeling Systems, volume 104 ofApplied Optimization, pages 3–10. Springer Berlin Heidelberg, 2012.ISBN 978-3-642-23591-7. doi: 10.1007/978-3-642-23592-4 1. URLhttp://dx.doi.org/10.1007/978-3-642-23592-4_1.R Development Core Team. R: A Language and Environment for StatisticalComputing. R Foundation for Statistical Computing, Vienna, Austria,2012. URL http://www.R-project.org/. ISBN 3-900051-07-0.Stefan Theussl. CRAN task view: Optimization and mathematicalprogramming, 2012. URL http://cran.r-project.org/.IV Jornadas de Usuarios de R, 2012 34/35
  36. 36. ReproducibleOperations ResearchIV Jornadas REmilio L. CanoJavier M. MoguerzaIntroductionReproducible ResearchFrameworkSymbolic Model SpecificationApplicationEnRiMa ProjectDSS DescriptionSolver ManagerReportingBibliographyDiscussion¡ Gracias !emilio.lopez@urjc.es@emilopezcanoIV Jornadas de Usuarios de R, 2012 35/35

×