ebook img

Optimization of Energy Supply Systems: Modelling, Programming and Analysis PDF

301 Pages·2019·5.932 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Optimization of Energy Supply Systems: Modelling, Programming and Analysis

Lecture Notes in Energy 69 Janet Nagel Optimization of Energy Supply Systems Modelling, Programming and Analysis Lecture Notes in Energy Volume 69 LectureNotesinEnergy(LNE)isaseriesthatreportsonnewdevelopmentsinthe studyofenergy:fromscienceandengineeringtotheanalysisofenergypolicy.The series’ scope includes but is not limited to, renewable and green energy, nuclear, fossil fuels and carbon capture, energy systems, energy storage and harvesting, batteries and fuel cells, power systems, energy efficiency, energy in buildings, energy policy, as well as energy-related topics in economics, management and transportation.BookspublishedinLNEareoriginalandtimelyandbridgebetween advanced textbooks and the forefront of research. Readers of LNE include postgraduate students and non-specialist researchers wishing to gain an accessible introduction to a field of research as well as professionals and researchers with a needforanup-to-datereferencebookonawell-definedtopic.Theseriespublishes single- and multi-authored volumes as well as advanced textbooks. More information about this series at http://www.springer.com/series/8874 Janet Nagel Optimization of Energy Supply Systems Modelling, Programming and Analysis 123 Janet Nagel Berlin, Germany ISSN 2195-1284 ISSN 2195-1292 (electronic) Lecture Notesin Energy ISBN978-3-319-96354-9 ISBN978-3-319-96355-6 (eBook) https://doi.org/10.1007/978-3-319-96355-6 LibraryofCongressControlNumber:2018948711 ©SpringerInternationalPublishingAG,partofSpringerNature2019 Thisworkissubjecttocopyright.AllrightsarereservedbythePublisher,whetherthewholeorpart of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission orinformationstorageandretrieval,electronicadaptation,computersoftware,orbysimilarordissimilar methodologynowknownorhereafterdeveloped. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publicationdoesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfrom therelevantprotectivelawsandregulationsandthereforefreeforgeneraluse. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authorsortheeditorsgiveawarranty,expressorimplied,withrespecttothematerialcontainedhereinor for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictionalclaimsinpublishedmapsandinstitutionalaffiliations. ThisSpringerimprintispublishedbytheregisteredcompanySpringerNatureSwitzerlandAG Theregisteredcompanyaddressis:Gewerbestrasse11,6330Cham,Switzerland Preface This book continues my strong commitment to energy supply as a topic. It repre- sents a return to my roots in energy supply modeling and optimization of energy supply systems. The first time I worked on the topic of optimizing energy supply systems was more than 20 years ago. Even then, the models selected differed enormously, some favored heuristic models, some focused on agency, and others used classic linear optimization models. In the context of the energy transition in Germany, this topic has garnered significantly more interest than before. Around theglobe, countless questions abouthow tosolve theenergy supply problem for a sustainable future for all urgently await an answer. Almost by accident, I found out about an exciting new project, or rather, an exciting new system of program in this field, the Open Energy System Modelling Framework (OEMEF). This project, or rather, this tool, can make an important contributiontoansweringthesemyriadquestionsonoptimizingenergysupplyand thuscancontributetomakingtheGermanandtheglobalenergytransitionareality. OEMOF providesa genericapproach for the modeling andoptimizationof energy supply systems. Generic approaches, i.e., approaches that work in many different contexts,areakeyfeatureofobject-orientedprogramming.Thegenericconceptof OEMOF is reflected in the generic and recurring description of classes and func- tions. This allows OEMOF to be applied to very different types of problems. Ihadstartedworkingondatabasesmorethan15yearsagoandwasparticularly interested in generic approaches. My idea was that having to reprogram databases again and again and having to continually adapt data models seemed inefficient. I therefore looked into creating a generic data model. More information about publications on this topic can be found at http://www.risa.eu/de/safetyanalyses/ publications.php. The OEMOF project is also inspired by the vision that those interested in optimizing energy supply systems will no longer have to create all their models from scratch but can make use of this wonderful resource to concentrate on reflecting the specific aspects of their optimization problem. At the moment, this system of program is still in its development stage. As this is an open source v vi Preface project, this means that you are all invited to improve its design and use your knowledge to further its development. OEMOF is continually being improved and redeveloped by the OEMOF com- munity. Even while I was writing this book, OEMOF development moved on to a new stage by issuing Release v0.2.0. As this new version was released just before the book was completed, it was not possible to include user feedback on how this new Release handles here. This book is designed to be a first step toward bringing the OEMOF user and developer community together and introducing the tool to potential modelers. When I started working with the tool I wanted to understand and to pass on tomy readershowtheprogrammingofthemodelingsoftwarewascarriedout.Thisisthe reasonwhythisbookgivesseveralsourcecodeexcerptsandprovidesanumberof examples of OEMOF applications. TheOEMOFdevelopercommunity,andinparticularthosewhohavestartedthis projectandcontinuetoworkonit,willhavetheirveryownviewsonOEMOFand onhowtowriteaboutit.Afterall,theyhavedevelopedthetoolandgaveitlife.For this reason, this is a book about OEMOF and not a book by OEMOF, i.e., written by the OEMOF community. Nevertheless, I am convinced that this book will be a greathelpforgettingstartedwithmodelinginOEMOF.Myownworkresearching at university level has shown me that modelers who have never before worked on optimization questions can find it hard to understand how to work with this tool. Therefore,Ibelievethatthisbook,thoughitcannotanswerallyourquestions,will help get you into OEMOF. The quality of books depends on the expert knowledge and range of topics contained in them; this is something that I have made use of here as in all my previous books. The experts that have to be acknowledged here are first and foremost the OEMOF community. They have helped me gain a deep insight into the program by providing workshops and discussions and by commenting parts of the manuscript for this book. I would like to thank them very much for their support. I would also like to give a special thanks to Dr. Stöhr from B.A.U.M. Consult GmbH for his active support of this book project. By means of discussions and constructiveexchanges,hisviewsandinsightshavefedintothetopicofoptimizing energysupplysystems,whichissoprominentinthebook.Dr.Stöhr’sloveofdetail and his interest and enthusiasm for portraying mathematical aspects as clearly and preciselyaspossiblehaveinspiredmetodelvemoredeeplyintothissubject.Aswe all know how precious time is in our professional lives and how busy Dr. Stöhrs diary, I am even more grateful for how generous he has been with his time and support in passing on his expert knowledge. I had always planned to publish this book in English. This was made possible withtheassistanceofProf.Dr.VerenaJungoftheAKADUniversity,professorof linguisticsandtranslation.HerexpertiseintranslatingthisbookintoEnglishmakes it available to a wider readership. I would like to thank her for completing this important task. Preface vii Scenario building plays a vital role in developing energy models. Within the workinggroup“InternetofEnergy”oftheBDI(TheFederationofGermanIndustries), especially with Detlef Schumann, BridgingIT GmbH, I discussed important method- ical approaches for this chapter. I would like to thank Mr. Schuhmann for these inspiring talks and impulses. AsthisbookislargelyconcernedwiththePythonprogramminglanguage,Ihave soughtouttheexpertsupportofHenrikFahlke,developerandPythonspecialist.He answeredallmyquestionsonPythonandhelpedmewritemyownlittleexamplein code. I would like to thank him very much for his time and his support. IwouldalsoliketothankmyfaithfulpublishingcolleagueDr.SilviaPorstmann, CEOofSeramunDiagnosticaGmbH,forhersupportandworkonthismanuscript. In particular, her proofreading of the English translation has been invaluable. Iwouldliketothankherforherkeeninterestandhercommitment,withwhichshe also supported my previous two book projects. A book project can only thrive if it is supported by its publisher. Springer Publications have been a very competent and supportive partner in this endeavor. I would like to thank all Springer Publications employees involved in this project. Last but not least, my very particular thanks must go to my family. Not only have they actively supported me in this book project, but more importantly, they took the many hours that I worked on this project during our holidays or on the weekend in their stride. Without your support, none of these projects would have been possible. Thank you so much! Finally,Iwouldliketowishallreadersofthisbook,energymodelers,andfuture OEMOF developers an enjoyable introduction to this wonderful tool. Together we will get the energy transition off the ground! Berlin, Germany Janet Nagel April 2018 Contents 1 The OEMOF Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Methods for Developing Strategies and Options. . . . . . . . . . . . . . 4 1.2 What Is OEMOF Based on? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 Linear Programming (LP) and Mixed-Integer Linear Programming (MILP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.3.1 Linear Programming (LP) . . . . . . . . . . . . . . . . . . . . . . . . 16 1.3.2 Example Biogas Production . . . . . . . . . . . . . . . . . . . . . . . 17 1.3.3 Formal Structure of LP . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.3.4 Mixed-Integer Linear Programming (MILP) . . . . . . . . . . . 25 1.3.5 Sensitivity Analyses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2 The Generic Base Model in OEMOF . . . . . . . . . . . . . . . . . . . . . . . . 31 2.1 Python Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.1.1 Classes, Objects and Methods . . . . . . . . . . . . . . . . . . . . . 34 2.1.2 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.1.3 Creating Classes, Objects and Methods. . . . . . . . . . . . . . . 38 2.1.4 Class Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.1.5 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 2.1.6 Programming Your Own Analyses in Python . . . . . . . . . . 43 2.2 Structure of the Generic Model in OEMOF . . . . . . . . . . . . . . . . . 49 2.3 Libraries in OEMOF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2.3.1 The Oemof-Network Library . . . . . . . . . . . . . . . . . . . . . . 53 2.3.2 The Oemof-Solph Library . . . . . . . . . . . . . . . . . . . . . . . . 55 2.3.3 The Oemof-Outputlib Library. . . . . . . . . . . . . . . . . . . . . . 59 2.3.4 The Feedinlib Library . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 2.3.5 The Library Demandlib . . . . . . . . . . . . . . . . . . . . . . . . . . 63 2.4 Key Packages and Modules in OEMOF. . . . . . . . . . . . . . . . . . . . 63 2.4.1 Module Energy_System . . . . . . . . . . . . . . . . . . . . . . . . . . 64 2.4.2 Module Groupings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 ix x Contents 2.4.3 The oemof.outputlib Package . . . . . . . . . . . . . . . . . . . . . . 68 2.4.4 The oemof.solph Package. . . . . . . . . . . . . . . . . . . . . . . . . 69 2.4.5 The oemof.tools.Package . . . . . . . . . . . . . . . . . . . . . . . . . 91 2.5 The Process of Developing Your Own Model . . . . . . . . . . . . . . . 92 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 3 Mathematical Description of the Objects . . . . . . . . . . . . . . . . . . . . . 101 3.1 Mathematical Equations in the Module blocks.py. . . . . . . . . . . . . 110 3.1.1 Class Flow(SimpleBlock). . . . . . . . . . . . . . . . . . . . . . . . . 111 3.1.2 Class InvestmentFlow(SimpleBlock). . . . . . . . . . . . . . . . . 118 3.1.3 Class Bus(SimpleBlock). . . . . . . . . . . . . . . . . . . . . . . . . . 122 3.1.4 Class Transformer(SimpleBlock). . . . . . . . . . . . . . . . . . . . 123 3.1.5 Class NonConvexFlow(SimpleBlock) . . . . . . . . . . . . . . . . 124 3.2 Mathematical Equations in the Module components.py. . . . . . . . . 129 3.2.1 Class GenericStorage(network.Transformer) . . . . . . . . . . . 129 3.2.2 Class GenericStorageBlock(SimpleBlock) . . . . . . . . . . . . . 131 3.2.3 Class GenericInvestmentStorageBlock(SimpleBlock) . . . . . 133 3.2.4 Class GenericCHP(network.Transformer) . . . . . . . . . . . . . 137 3.2.5 Class GenericCHPBlock(SimpleBlock) . . . . . . . . . . . . . . . 140 3.2.6 Class ExtractionTurbineCHP(solph_Transformer) . . . . . . . 145 3.2.7 Class ExtractionTurbineCHPBlock(SimpleBlock). . . . . . . . 146 3.3 Mathematical Equation System in the Module constraints.py. . . . . 149 3.4 Mathematical Equations in the Module custom.py . . . . . . . . . . . . 151 3.4.1 Class ElectricalLineBlock(SimpleBlock) . . . . . . . . . . . . . . 151 3.4.2 Class GenericCAESBlock(SimpleBlock) . . . . . . . . . . . . . . 153 3.5 Methods Provided in the Module models.py. . . . . . . . . . . . . . . . . 159 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 4 Modeling in OEMOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 4.1 Working with the OEMOF Framework . . . . . . . . . . . . . . . . . . . . 163 4.1.1 A Deeper Insight into Programming in Python . . . . . . . . . 164 4.1.2 Oemof-Energy_System. . . . . . . . . . . . . . . . . . . . . . . . . . . 169 4.1.3 Oemof-Groupings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 4.1.4 Oemof-Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 4.1.5 Oemof-Solph. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 4.1.6 Oemof-Outputlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 4.1.7 Oemof-Feedinlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 4.1.8 Oemof-Demandlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 4.2 Procurement of Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 4.3 The Program Spyder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 4.3.1 Spyder Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 4.3.2 Variable Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.