Fuzzy Logic Control in Energy Systems with design applications in MatLab/Simulink _ ş Ismail H. Alta The Institution of Engineering andTechnology PublishedbyTheInstitutionofEngineeringandTechnology,London,UnitedKingdom TheInstitutionofEngineeringandTechnologyisregisteredasaCharityinEngland& Wales(no.211014)andScotland(no.SC038698). †TheInstitutionofEngineeringandTechnology2017 Firstpublished2017 TheInstitutionofEngineeringandTechnology MichaelFaradayHouse SixHillsWay,Stevenage Herts,SG12AY,UnitedKingdom www.theiet.org BritishLibraryCataloguinginPublicationData AcataloguerecordforthisproductisavailablefromtheBritishLibrary ISBN978-1-78561-107-0(hardback) ISBN978-1-78561-108-7(PDF) TypesetinIndiabyMPSLimited PrintedintheUKbyCPIGroup(UK)Ltd,Croydon Contents Preface xi Acknowledgments xv 1 Introduction 1 1.1 Introduction 1 1.2 Fuzziness 3 1.3 Fuzzy membership functions 4 1.4 Fuzzy sets 5 References 5 2 Fuzzy sets 7 2.1 Introduction 7 2.2 Fuzzy sets and fuzzy membership functions 13 2.2.1 Triangular membership function 13 2.2.2 Trapezoid membership function 17 2.2.3 Gaussian membership function 22 2.2.4 Bell membership function 23 2.2.5 Cauchy membership function 24 2.2.6 Sinusoid membership function 26 2.2.7 Sigmoid membership function 32 2.3 Properties of fuzzy membership functions 36 2.4 Fuzzy set operations 43 2.4.1 Intersection: t-norm 43 2.4.2 Union: t-conorm 46 2.4.3 Complement 48 2.4.4 De Morgan laws 52 2.5 Adjustment of fuzziness 53 2.6 Problems 55 References 60 3 Fuzzy partitioning 63 3.1 Introduction 63 3.2 Theoretical approaches 66 3.3 Fuzzy partition examples inenergy systems 67 3.4 Problems 83 References 87 4 Fuzzy relation 89 4.1 Introduction 89 4.2 Fuzzy relation 89 4.3 Operation with fuzzy relations 99 4.3.1 Intersectionof two fuzzy relations 99 4.3.2 Union of two fuzzy relations 99 4.3.3 Negation of a fuzzy relation 100 4.3.4 Inverse of afuzzy relation 102 4.3.5 Composition of fuzzy relations 102 4.3.6 Compositional rule of inference 108 4.3.7 The relational joint 110 4.4 Binary relations 110 4.5 The extension principle 112 4.5.1 The cylindrical extension 113 4.6 Fuzzy mapping 117 4.7 Problems 122 References 126 5 Fuzzy reasoning andfuzzy decision-making 127 5.1 Introduction 127 5.2 Fuzzy implications 127 5.3 Approximate reasoning 134 5.4 Inference rules of approximate reasoning 136 5.4.1 Entailment rule of inference 137 5.4.2 Conjunction rule of inference 137 5.4.3 Disjunction rule of inference 137 5.4.4 Negation rule of inference 138 5.4.5 Projection rule of inference 138 5.4.6 Generalized modus ponens rule of inference 139 5.4.7 Compositional rule of inference 139 5.5 Fuzzy reasoning 140 5.5.1 Inference engine with single inputsingle rule 142 5.5.2 Inference engine with multiple input single rule 143 5.5.3 Inference engine with multiple input multiple rule 146 5.6 Problems 156 References 158 6 Fuzzy processor 161 6.1 Introduction 161 6.2 Mamdani fuzzy reasoning 161 6.2.1 Fuzzification 166 6.2.2 Fuzzy rule base 168 6.2.3 Fuzzy conclusion 168 6.2.4 Defuzzification 171 6.3 Takagi–Sugeno fuzzy reasoning 178 6.4 Tsukamoto fuzzy reasoning 185 6.5 Problems 189 References 196 7 Fuzzy logic controller 199 7.1 Introduction 199 7.2 Physical system behaviors and control 200 7.3 Fuzzy processor for control 210 7.3.1 Fuzzy rules: the modeling of thoughts 211 7.3.2 The input–output interaction 218 7.4 Modeling the FLCin MATLAB 222 7.5 Modeling the FLCin Simulink 231 7.6 Problems 244 References 248 8 System modelingandcontrol 251 8.1 Introduction 251 8.2 System modeling 252 8.3 Modeling electrical systems 259 8.4 Modeling mechanical systems 271 8.4.1 Mechanical systemswithlinear motion 272 8.4.2 Mechanical systemswithrotational motion 279 8.5 Modeling electromechanical systems 282 8.5.1 Field subsystem 286 8.5.2 Armature subsystem 287 8.5.3 Mechanical subsystem 287 8.5.4 Electromechanic interaction subsystem 288 8.5.5 Modeling DCmotors 290 8.5.6 Modeling ACmotors 301 8.6 Problems 301 References 307 9 FLCin powersystems 309 9.1 Introduction 309 9.2 Excitation control 312 9.2.1 Excitation system modeling 315 9.2.2 State–space model of excitation systems 321 9.2.3 FLC of excitation systems 323 9.3 LF control 328 9.3.1 Small signal modeling of power systems 329 9.3.2 FLC design for LFC 335 9.4 FLCin power compensation 347 9.4.1 Powerfactor improvement 348 9.4.2 Busvoltage control 351 9.5 Problems 356 References 359 10 FLC inwindenergy systems 363 10.1 Introduction 363 10.2 Wind turbine 364 10.3 Electrical generator 368 10.3.1 Dynamic modeling of induction generator 370 10.3.2 Self-excited induction generator 375 10.4 FLC examples in WEC systems 380 10.5 Problems 395 References 398 11 FLC inPVsolar energy systems 403 11.1 Introduction 403 11.2 PVcell modelings 406 11.2.1 Reference I–Vcharacteristics of a PVpanel 410 11.2.2 Effects of changes insolar irradiation and temperature 413 11.2.3 PVpanel modeling in Simulink 418 11.2.4 APVarray emulator 426 11.3 MPPsearch in PVarrays 429 11.3.1 MPPbylookup tables 430 11.3.2 MPPsearch algorithm based on measurements of S and T 431 X X 11.3.3 MPPsearch algorithm based on voltage and current measurements 432 11.3.4 MPPsearch algorithm based on online repetitive method 434 11.4 MPPT of PVarrays 435 11.4.1 Constant maximumpower angle approach 436 11.4.2 Online load matching approach 441 11.5 Problems 453 References 456 12 Energy management andfuzzy decision-making 459 12.1 Introduction 459 12.2 Distributed generation and control 461 12.3 Energy management in a renewable integrationsystem 463 12.3.1 Centralized control of distributed renewable energy systems 463 12.3.2 Distributed control of renewable energy systems 484 12.4 Problems 490 References 492 Index 495 Preface This book is about fuzzy logic controller (FLC) and its applications in energy systems.Itaimstogiveaninsightintoaclearunderstandinganddesignapproaches (cid:2) (cid:2) ofFLCsinMATLAB andMATLAB/Simulink environment.Itincludesabasic theoryoffuzzysetsandFLtopreparethereaderforabetterunderstandingoffuzzy partitioning, fuzzy relation and fuzzy decision-making processing, which are requiredfordesigningFLCs.Afuzzyunitcalledfuzzyprocessorisdevelopedand designed to be used as a fuzzy decision maker and a FLC depending on the application problem. Energy system is one of the application areas of FL. It is used to manage, control and operate electrical energy systems. Examples in the book are related to the control, operation and management of electrical energy utilization. The fol- lowing examples on FLC and fuzzy management are discussed and studied in the scope of the book. ● DCmotor speed and torque control ● excitation and load–frequency control in power systems ● multiarea load–frequency control in power systems ● wind energy controlsystems(WECS) ● photovoltaic (PV)solar energy control systems ● maximum power point tracking in PVsystems ● energy management in WECS ● energy management in PVsystems The book addresses undergraduate and graduate students as well as practicing engineersinelectricalpower,energyandcontrolsystems.Theywillbeabletoget sufficient knowledge of FL theory and a clear understanding of designing fuzzy decision maker and controller in MATLAB and Simulink. Those who study the bookwillbeabletodeveloptheirownfuzzyprocessorlibraryanddesigntheirown FL toolbox for the special problems they study. With the given examples, the readers will also get to know the modeling and simulation of electrical power and energy systems. AnovelFLCdesignapproach inbothMATLABandSimulink isgiveninthe book such that the user can see every step of the FL processor with the ability to interfere the code in MATLAB.m files and also in operational Simulink blocks. TheFLCdesignapproachwillmakethereadersnotjustassoftwareusersbutalso software developers. Chapters 1–7 can be used as an accompanying textbook for teaching Fuzzy LogicandFuzzyDecisionMakingasanundergraduatecourse.Chapters1–8canbe used as a textbook for teaching Fuzzy Logic Control in undergraduate or graduate levels. Chapters 5–9canbeusedinagraduate courseabout FLCinPowerSystem ControlassumingthatstudentshaveabasicknowledgeoffuzzysettheoryandFL. Chapters5–7and10–12canbeusedasanadvancedgraduatecourseaboutFLCin RenewableEnergyandDistributedGeneration.Chapters10–12canalsobeusedin an advanced graduate course to teach FL-controlled wind and PV energy conver- sion systems. The book is organized into 12 chapters. Chapter1.Introduction.Abriefhistoryoffuzzysettheoryanditsapplication areasaresummarizedinthischapter.Theconceptoffuzziness,fuzzymembership functions and fuzzy subsetsisintroduced. Chapter2.Fuzzysets.Typesandpropertiesoffuzzysetsarestudied.Modeling of fuzzy sets in MATLAB and MATLAB/Simulink are shown and MATLAB function files are developed to be used as a part of user-defined toolbox library. Fuzzy intersection,union and complement are also studied in this chapter. Chapter 3. Fuzzy partitioning. Fuzzy subclasses and partitioning of the uni- verses into fuzzy subsets are studied in this chapter. The importance of and meaning of the portioning are discussed withexamples. Chapter 4. Fuzzy relation. The concept of fuzzy relation, two-dimensional fuzzy sets, fuzzy extension principle, fuzzy projection and binary and n-ary fuzzy relationsarediscussedinthischapter.Representingverbaltermsandexpressionsas fuzzy relationsare also introduced in this chapter. Chapter 5. Fuzzy reasoning and fuzzy decision-making. Approximate reason- ing,fuzzyreasoningandfuzzydecision-makingprocessesaregiveninthischapter. Single-input single-rule, single-input multiple-rules and multiple-input multiple- rule base systems are studied and examples are given. The concept of fuzzy rea- soning is studied and user-defined MATLAB files are used to support the opera- tional behaviors of fuzzy decision-making. Chapter 6. Fuzzy processor. Fuzzy reasoning and fuzzy decision-making processes are carried ahead with multiple inputs, multiple rules and multiple decisions as the fuzzy processor. Known fuzzy reasoning algorithms such as Mamdani fuzzy reasoning, Sugeno fuzzy reasoning and Tsukamoto fuzzy reason- ing are discussed and steps toward FLCsare given. Chapter 7. Fuzzy logic controller. FLC is given in this chapter. Rule devel- opment,thewayofputtingexperts’ideasintorulesandinferencesystemstructure are studied. From crisp input variables to crisp output, all processes are discussed andshown.Defuzzification,ruleprocessing,fuzzyreasoningandcrispoutputafter defuzzification are explained. User-developed FLC examples are given. Chapter 8. System modeling and control. Mathematical modeling of physical systems is given in this chapter. The methods obtaining differential equations, simulation diagrams and state–space models of physical systems are studied. Runge–Kutta numerical solution method is discussed and user-based MATLAB software is developed to showthe meaning of controlling physical systems asone oftheapplication areasofFL.Thereaderwillbeabletodevelophis/herownFLC code in MATLAB and MATLAB Simulink. Examples of controlling electrical, mechanical and electromechanical systems will be given. Chapter 9. FLC in power systems. Application of FLC and decision maker to excitation control,load–frequencycontrolandpowercompensationisdiscussedin this chapter. Single and multiarea control of power systems are also studied as examples in the chapter. Chapter 10. FLC in wind energy systems. Application of FL control and decision-making processes to wind energy conversion systems is given in this chapter. After giving problems and control issues in wind energy conversion sys- tems, the utilization of FL in solving these problems is shown. Chapter 11. FLC in PV solar energy systems. Application of FL control and decision-making processes inPVsolar systemsisgiven inthischapter.Maximum power point tracking, sun tracking, voltage control, battery charging and manage- ment of the generated power are studied. Chapter12.Energymanagementandfuzzydecision-making.Theuseoffuzzy decision-making and control process in energy management systems is studied in thischapter.EnergymanagementinPVsolarandwindenergysystemsisdiscussed and examples are given. Chapter 1 Introduction Abriefhistoryoffuzzysettheoryanditsapplicationareasaresummarized inthis chapter.Theconceptoffuzziness,fuzzymembershipfunctionsandfuzzysubsetsis introduced. 1.1 Introduction Manywordsweusearbitrarilyinourdailylifeareusuallyfuzzyintermsofverbal meanings.Whenexpressingordescribingasystemoranevent,weusewordssuch asold,young,tall,short,cold,warm,hot,sunny,cloudy,fast,slow,etc.,whichare fuzzy in nature. We, the humans, use uncertain, vogue and muddy words when discussing something or taking decisions to perform some actions. Depending on his/herage,wecallapersonold,middleaged,young,veryoldandveryyoung.We pressthegasorbrakemoreorlessaccordingtotheroadconditionwhetheritisdry, slippery,ramporflat.Ifthelightsinourstudyroomarelow,weincreasebrightness alittle, else wedecrease it. Allthese examples showhowourbrainacts and takes decisions during the situations that are uncertain and fuzzy. Studies on systems with uncertainty and muddy data have reached a new era with the publication of the article ‘‘Fuzzy sets’’ by Lotfi A. Zadeh [1]. Although this article was first published in 1965, the use of fuzzy logic (FL) has increased afterthesecondhalfofthe1970swhenLotfiA.Zadehpublishedtwomorearticles [2,3], in which the application of fuzzy set theory to uncertain systems and decision-making was described. FL applications have been gaining a high speed ever since the Japanese started using them in commercially available appliances. Nowadays,it ispossible tofind fuzzy-based applicationsinalmost every area [4]. Some of the utilization areas of FL are listed next. FLisusedinrobotics,automation,trackingsystems,temperaturecontrol,flow control, motion control, commercial products and many more utilization areas of automatic control systems [4–7]. It is used in information systems as a database tool to store and recall knowledge, uncertain data, experts’ ideas and operational behavior of machines. Image processing, signal aliasing and human–machine interactionarealsosomeoftheapplicationareaswhereFLisused[4].Itispossible to find many more FL-based applications in social and medical sciences as well [4]. FL is also used as a mathematical tool in areas such as function optimi- zation, filtering, curve fitting, etc. [4].