FUZZY CONTROL AND MODELING
IEEE Press Series on Biomedical Engineering The focus of our series is to introduce curren...
199 downloads
950 Views
13MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
FUZZY CONTROL AND MODELING
IEEE Press Series on Biomedical Engineering The focus of our series is to introduce current and emerging technologies to biomedical and electrical engineering practitioners, researchers, and students. This series seeks to foster interdisciplinary biomedical engineering education to satisfy the needs of the industrial and academic areas. This requires an innovative approach that overcomes the difficulties associated with the traditional textbook and edited collections. Metin Akay, Series Editor Dartmouth College
Advisory Board Thomas Budinger Ingrid Daubechies Andrew Daubenspeck Murray Eden James Greenleaf
Simon Haykin Murat Kunt Paul Lauterbur Larry McIntire Robert Plonsey
Richard Robb Richard Satava Malvin Teich Herbert Voigt Lotfi Zadeh
Editorial Board Eric W. Abel Dan Adam Peter Adlassing Berj Bardakjian Erol Basar Katarzyna Blinowska Bernadette Bouchon-Meunier Tom Brotherton Eugene Bruce Jean-Louis Coatrieux Sergio Cerutti Maurice Cohen John Collier Steve Cowin Jerry Daniels Jaques Duchene Walter Greenleaf Daniel Hammer Dennis Healy
Gabor Herman Helene Hoffman Donna Hudson Yasemin Kahya Michael Khoo Yongmin Kim Andrew Laine Rosa Lancini Swamy Laxminarayan Richard Leahy Zhi-Pei Liang Jennifer Linderman Richard Magin Jaakko Malmivuo Jorge Monzon Michael Neuman Banu Onaral Keith Paulsen Peter Richardson
Kris Ropella Joseph Rosen Christian Roux Janet Rutledge Wim L. C. Rutten Alan Sahakian Paul S. Schenker G. W. Schmid-Schonbein Ernest Stokely Ahmed Tewfik Nitish Thakor Michael Unser Eugene Veklerov Al Wald Bruce Wheeler Mark Wiederhold William Williams Andy Yagle Yuan-Ting Zhang
Books in the IEEE Press Series on Biomedical Engineering Akay, M., Time Frequency and Wavelets in Biomedical Signal Processing Hudson, D. L. and M. E. Cohen, Neural Networks and Artificial Intelligence for Biomedical Engineering Khoo, M. C. K., Physiological Control Systems: Analysis, Simulation, and Estimation Liang, z-~ and P C. Lauterbur, Principles of Magnetic Resonance Imaging: A Signal Processing Perspective Akay, M., Nonlinear Biomedical Signal Processing: Volume I Fuzzy Logic, Neural Networks, and New Algorithms Akay, M., Nonlinear Biomedical Signal Processing: Volume II Dynamic Analysis and Modeling Ying, H., Fuzzy Control and Modeling: Analytical Foundations and Applications
FUZZY CONTROL AND MODELING Analytical Foundations and Applications
Hao Ying Department ofPhysiology and Biophysics Biomedical Engineering Center The University of Texas Medical Branch, Galveston
IEEE Engineering in Medicine and Biology Society, Sponsor
A. T
IEEE Press Series on Biomedical Engineering Metin Akay, Series Editor
IEEE PRESS
The Institute of Electrical and Electronics Engineers, Inc., New York
This book and other books may be purchased at a discount from the publisher when ordered in bulk quantities. Contact: IEEE Press Marketing Attn: Special Sales 445 Hoes Lane ~O. Box 1331 Piscataway, NJ 08855-1331 Fax: +1 732 981 9334 For more information about IEEE Press products, visit the IEEE Online Catalog & Store: http://www.ieee.org/org/ieeestore.
© 2000 by the Institute of Electrical and Electronics Engineers, Inc., 3 Park Avenue, 17th Floor, New York, NY 10016-5997. All rights reserved. No part of this book may be reproduced in any form, nor may it be stored in a retrieval system or transmitted in any form, without written permission from the publisher. Printed in the United States of America. 10
9
8
7
6
5
4
3
2
ISBN 0-7803-3497-3 IEEE Order No. PC5729
Library of Congress Cataloging-in-Publication Data Ying, Hao, 1958Fuzzy control and modeling : analytical foundations and applications / Hao Ying. p. em, - - (IEEE Press series on biomedical engineering) Includes bibliographical references and index. ISBN 0-7803-3497-3 1. Automatic control. 2. Fuzzy systems. 3. Mathematical models. I. Title. II. Series. TJ211.Y562000 629.8- -dc21 00-022760
To my parents and my family
IEEE Press 445 Hoes Lane, ~O. Box 1331 Piscataway, NJ 08855-1331
IEEE Press Editorial Board Robert 1. Herrick, Editor in Chief M. Akay 1. B. Anderson ~
M. Anderson
1. E. Brewer
M. Eden M. E. El-Hawary R. F. Hoyt S. V. Kartalopoulos
M. S. Newman . M. Padgett W. D. Reeve G. Zobrist
D. Kirk
Kenneth Moore, Director ofIEEE Press Catherine Faduska, Senior Acquisitions Editor Linda C. Matarazzo, Associate Acquisitions Editor Surendra Bhimani, Production Editor IEEE Engineering in Medicine and Biology Society, Sponsor EMB-S Liaison to IEEE Press, Metin Akay Cover design: William T. Donnelly, WT Design
Technical Reviewers Anna Bianchi, Polytechnic ofMilan Guanrong Chen, University ofHouston Oscar Gonzalez, Old Dominion University, Norfolk, VA Reza Langari, Texas A & M University Frank L. Lewis, University of Texas at Arlington Liang Wang, CASA, Inc., Los Alamos, NM John Yen, Texas A & M University
Books of Related Interest from the IEEE Press ROBUST VISION FOR VISION-BASED CONTROL OF MOTION Edited by Gregory D. Hager and Markus Vincze A volume in the SPIE/IEEE Press Imaging Science & Engineering Series 2000 Hardcover 264 pp IEEE Order No. PC5403 ISBN 0-7803-5378-1 EVOLUTIONARY COMPUTATION: Toward a New Philosophy ofMachine Intelligence Second Edition David B. Fogel 2000 Hardcover 296 pp IEEE Order No. PC5818 ISBN 0-7803-5379-X UNDERSTANDING NEURAL NETWORKS AND FUZZY LOGIC: Basic Concepts and Applications Stamatios V. Kartalopoulos A volume in the IEEE Press Understanding Science & Technology Series 1996 Softcover 232 pp IEEE Order No. PP5591 ISBN 0-7803-1128-0 THE CONTROL HANDBOOK Edited by William S. Levine A CRC Handbook published in cooperation with IEEE Press 1996 Hardcover 1566 pp IEEE Order No. PC5649
ISBN 0-8493-8570-9
Contents
FOREWORD PREFACE
xvii
xix
ACKNOWLEDG MENTS LIST OF FIGURES
xxiii
xxv
CHAPTER 1 Basic Fuzzy Mathematics for Fuzzy Control and Modeling 1 1.1. Introduction 1 1.2. Classical Sets, Fuzzy Sets, and Fuzzy Logic 1 1.2.1. Limitation of Classical Sets 1 1.2.2. Fuzzy Sets 1 1.2.3. Fuzzy Logic Operations 6
1.3. Fuzzification 7 1.4. Fuzzy Rules 8 1.4.1. Mamdani Fuzzy Rules 8 1.4.2. TS Fuzzy Rules 9
1.5. Fuzzy Inference 10 1.6. Defuzzification 11 1.6.1. Generalized Defuzzifier 12 1.6.2. Centroid Defuzzifier, Mean of Maximum Defuzzifier, and Linear Defuzzifier 12
1.7. Summary 13 1.8. Notes and References 13 Exercises 13 vii
Contents
viii
CHAPTER 2
Introduction to Fuzzy Control and Modeling
15
2.1. 2.2. 2.3. 2.4. 2.5.
Introduction 15 Why Fuzzy Control 15 Conventional Modeling 16 Why Fuzzy Modeling 17 Two Types of Fuzzy Control and Modeling: Mamdani Type and TS Type 17 2.6. Typical SISO Mamdani Fuzzy Controllers 17 2.6.1. 2.6.2. 2.6.3. 2.6.4.
Fuzzification 18 Fuzzy Rules 21 Fuzzy Inference 23 Defuzzification 24
2.7. Typical MISO Mamdani Fuzzy Controllers 26 2.8. Typical MISO and SISO TS Fuzzy Controllers 28 2.9. Relationship between Fuzzy Control and Conventional Control 29 2.10. Fuzzy Control vs. Classical Control 30 2.10.1. Advantages of Fuzzy Control 30 2.10.2. Disadvantages of Fuzzy Control 30
2.11. When to Use Fuzzy Control 31 2.11.1. Two Criteria 31 2.11.2. Applicability of Fuzzy Control 32 2.11.3. When to Avoid Fuzzy Control 32
2.12. Analytical Issues in Fuzzy Control 33 2.12.1. Brief Background 33 2.12.2. Significant, Inherent Difficulties for Analytical Study of Fuzzy Control 34 2.12.3. Analytical Issues 34
2.13. Fuzzy Modeling 35 2.13.1. Mamdani Fuzzy Model 35 2.13.2. TS Fuzzy Model 36 2.13.3. Relationship between Fuzzy Model and Fuzzy Controller 36
2.14. Applicability and Limitation of Fuzzy Modeling 36 2.15. Analytical Issues in Fuzzy Modeling 37 2.16. Summary 37 2.17. Notes and References 38 Exercises 38
CHAPTER 3
Mamdani Fuzzy PID Controllers
41
3.1. Introduction 41 3.2. PID Control 42 3.2.1. Position Form and Incremental Form 42
Contents
ix 3.2.2. PI and PD Controllers and Their Relationship 42
3.3. Different Types of Fuzzy Controllers 43 3.3.1. Linear Fuzzy Controller and Nonlinear Fuzzy Controller 43 3.3.2. Fuzzy PID Controller, Fuzzy Controller of PID Type, and Fuzzy Controller of Non-PID Type 43
3.4. Fuzzy PIjPD Controllers as Linear PIjPD Controllers 44 3.4.1. Fuzzy PI Controller Configuration 44 3.4.2. Derivation and Resulting Structures 47
3.5. Fuzzy PIjPD Controllers as Piecewise Linear PI/PD Controllers 47 3.6. Simplest Fuzzy PI Controller as Nonlinear Variable Gain PI Controller 51 3.6.1. Derivation and Resulting Structure 51 3.6.2. Characteristics of Gain Variation 52 3.6.3. Performance Enhancement Due to Gain Variation 53
3.7. Another Simplest Fuzzy PI Controller as Nonlinear Variable Gain PI Controller 55 3.8. Simulation Comparison between Fuzzy and Linear PI Controllers 56 3.8.1. System Models and Comparison Conditions 56 3.8.2. Comparison Results for the Linear Models 57 3.8.3. Comparison Results for the Time-Delay Model and the Nonlinear Model 58 3.8.4. Superior Fuzzy Control Performance at a Price 64
3.9. Simplest Fuzzy PI Controllers Using Different Fuzzy Inference Methods 65 3.9.1. 3.9.2. 3.9.3. 3.9.4.
Configurations of Fuzzy PI Controllers 65 Derivation and Resulting Structures 66 Characteristics of Gain Variation 68 Performance Enhancement by Gain Variation 70 3.9.5. Unreasonable Gain Variation Characteristics Produced by the Bounded Product Inference Method 70 3.9.6. Conclusion on Fuzzy Inference Methods for Control 73
3.10. Simplest TITO Fuzzy PI Controller as TITO Nonlinear Variable Gain PI Controller 73 3.10.1. Fuzzy Controller Configuration 73 3.10.2. Derivation and Resulting Structure 75
3.11. Fuzzy PD Controllers 76 3.12. Fuzzy PID Controllers as Nonlinear PID Controllers with Variable Gains 77
Contents
x
3.13. Summary 78 3.14. Notes and References 78 Exercises 79
CHAPTER 4
Mamdani Fuzzy Controllers of Non-PID Type 4.1. 4.2. 4.3. 4.4.
81
Introduction 81 Multilevel Relay 81 Linear Fuzzy Rules and Nonlinear Fuzzy Rules 83 Fuzzy Controller with Linear Fuzzy Rules as Linear Controller 84 4.4.1. Fuzzy Controller Configuration 84 4.4.2. Structure Derivation and Explicit Results 86
4.5. Typical Fuzzy Controller with Linear Fuzzy Rules 87 4.5.1. Structure Derivation 88 4.5.2. Resulting Structure 89 4.5.3. Relationship with the Simplest Fuzzy PI Controller 92
4.6. Fuzzy Controller Using Linear Fuzzy Rules and Trapezoidal Output Fuzzy Sets 92 4.7. Fuzzy Controller Using Linear Fuzzy Rules and Three Input Variables 94 4.8. Typical TITO Fuzzy Controller with Linear Fuzzy Rules 96 4.8.1. Fuzzy Controller Configuration 96 4.8.2. Derived Structure 97
4.9. Typical Fuzzy Controller with Nonlinear Fuzzy Rules 98 4.9.1. 4.9.2. 4.9.3. 4.9.4. 4.9.5.
Fuzzy Controller Configuration 98 Derivation and Resulting Structure 100 Structure Decomposition and Duality 105 Gain Variation Characteristics 105 Direct Generation of Other Fuzzy Controllers' Structures 106
4.10. Structure Decomposition of General Fuzzy Controllers 109 4.10.1. Configuration of General Fuzzy Controllers 109 4.10.2. Structure Decomposition Theorem 111 4.10.3. Structure of Global Controllers for Linear Fuzzy Rules 112
4.11. Limit Structure of General Fuzzy Controllers 113 4.11.1. Degree of Nonlinearity for Fuzzy Controllers with Linear Fuzzy Rules 113 4.11.2. Limit Structure for Fuzzy Controllers with Linear Rules 114 4.11.3. Limit Structure for General Fuzzy Controllers with Nonlinear Rules 115
xi
Contents
4.12. Structure Decomposition and Limit Structure of General Fuzzy Models 116 4.13. Summary 117 4.14. Notes and References 117 Exercises 117
CHAPTER 5 TS Fuzzy Controllers with Linear Rule Consequent
119
5.1. Introduction 119 5.2. Why Not Use Nonlinear Rule Consequent 119 5.3. General TS Fuzzy Controllers as Nonlinear Variable Gain Controllers of PID Type 120 5.3.1. Configuration of General Fuzzy Controllers 120 5.3.2. Analytical Structure as Nonlinear Controllers of PID Type 120 5.3.3. General Fuzzy Controllers as Linear Controllers 121
5.4. Simple TS Fuzzy PI/PD Controllers as Nonlinear Variable Gain PI/PO Controllers 121 5.4.1. 5.4.2. 5.4.3. 5.4.4.
Configuration of Fuzzy Controller 121 Derivation and Resulting Structure 122 General Characteristics of Variable Gains 124 Three Specific Types of Gain Variation Characteristics 127 5.4.5. Performance Improvement Due to Variable Gains 128 5.4.6. Design of Gain Variation Characteristics 132 5.4.7. Simulated Control of Tissue Temperature in Hyperthermia 133
5.5. Typical TS Fuzzy PI/PO Controllers as Nonlinear Variable Gain PI/PO Controllers 135 5.5.1. 5.5.2. 5.5.3. 5.5.4.
Fuzzy Controller Configuration 135 Derivation and Resulting Structure 137 Analysis of Gain Variation Characteristics 141 Relationship with the Simple TS Fuzzy Controller 143 5.5.5. Simulated Control of Tissue Temperature in Hyperthermia 143
5.6. Simplified TS Fuzzy Rule Scheme 145 5.6.1. Disadvantages ofTS Fuzzy Rule Scheme 145 5.6.2. Simplified Linear TS Fuzzy Rule Scheme 147 5.6.3. Parameter Reduction as Compared with Original TS Rule Scheme 148 5.6.4. Simplified Nonlinear TS Fuzzy Rule Scheme 149 5.6.5. General Analytical Structure of Fuzzy Controllers with Simplified TS Fuzzy Rules 149
Contents
xii
5.7. Simple Fuzzy PI/PD Controllers with Simplified Linear TS Fuzzy Rule Consequent 150 5.7.1. Configuration and Explicit Structure Derivation 150 5.7.2. Gain Variation Characteristics and Their Effect on Enhancing Control Performance 152 5.7.3. Attaining Desired Gain Variation Characteristics 154 5.7.4. Other Simple Fuzzy PI/PD Controllers with Simplified Linear TS Fuzzy Rule Consequent 155
5.8. Fuzzy PID Controller with Simplified Linear TS Rule Scheme 157 5.8.1. Configuration and Explicit Structure Derivation 157 5.8.2. Simulated Control of Mean Arterial Pressure 158
5.9. Comparing TS Fuzzy Control with Mamdani Fuzzy Control 160 5.9.1. Major Features of Mamdani Fuzzy Control 160 5.9.2. Primary Characteristics of TS Fuzzy Control 162 5.9.3. Comparison Conclusions 162
5.10. Summary 163 5.11. Notes and References 163 Exercises 163
CHAPTER 6
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems 165 6.1. Introduction 165 6.2. Global Stability, Local Stability, and BIBO Stability 166 6.2.1. Why Study Local Stability Instead of Global Stability 166
6.3. Local Stability of Mamdani and TS Fuzzy PID Control Systems 167 6.3.1. Local Stability Determined by Lyapunov's Linearization Method 167 6.3.2. System Linearizability Criterion 168
6.4. Local Stability of Mamdani Fuzzy Control Systems of Non-PID Type 169 6.5. Local Stability of General TS Fuzzy Control Systems 170 6.5.1. Theoretical Development 170 6.5.2. Numeric Example 171
6.6. Bmo Stability ofMamdani Fuzzy PI/PD Control Systems 173
Contents
xiii
6.6.1. Small Gain Theorem 173 6.6.2. BffiO Stability Conditions 175 6.6.3. Numeric Example 176
6.7. BIBO Stability of TS Fuzzy PI/PD Control Systems 177 6.7.1. Theoretical Derivation 177 6.7.2. Numeric Example 179
6.8. Design ofMamdani Fuzzy Control Systems 180 6.8.1. 6.8.2. 6.8.3. 6.8.4. 6.8.5. 6.8.6.
Design Principle 180 Justifications for Design Principle 181 Design Procedure 182 Design Example 184 System Tuning Guidelines 186 Examples of Designing More Complicated Fuzzy Control Systems 187
6.9. Design of General TS Fuzzy Control Systems 191 6.9.1. Design Technique 191 6.9.2. Design Examples 192
6.10. General TS Fuzzy Dynamic Systems as Nonlinear ARX Systems 193 6.11. General TS Fuzzy Filters as Nonlinear FIR/IIR Filters 195 6.12. Local Stability of General TS Fuzzy Models 195 6.12.1. Local Stability Conditions and Their Use for Model Quality Check 195 6.12.2. Numeric Example 197
6.13. Design of Perfect Tracking Controllers for General TS Fuzzy Models 199 6.13.1. Controller Design via Feedback Linearization Method 199 6.13.2. Stability of Designed Controllers 200 6.13.3. Numeric Examples 202
6.14. Summary 206 6.15. Notes and References 207 Exercises 207
CHAPTER 7
Mamdani and TS Fuzzy Systems as Functional 209
~pproximators
7.1. Introduction 209 7.2. Fuzzy Controller and Fuzzy Model as Functional Approximators 209 7.3. Polynomial Approximation of Continuous Functions 210 7.4. Sufficient Approximation Conditions for General MISO Mamdani Fuzzy Systems 211
Contents
xiv 7.4.1. Formulation of General Fuzzy Systems 211 7.4.2. Statement of Approximation Problems 211 7.4.3. Uniform Approximation of Polynomials by General Fuzzy Systems 211 7.4.4. General Fuzzy Systems as Universal Approximators 214 7.4.5. Sufficient Approximation Conditions 215 7.4.6. Numeric Examples 217
7.5. Sufficient Approximation Conditions for General MISO TS Fuzzy Systems 219 7.5.1. Sufficient Approximation Conditions 219 7.5.2. Numeric Example 223
7.6. Necessary Approximation Conditions for General SISO Mamdani Fuzzy Systems 224 7.6.1. Problem Statement and Assumptions 224 7.6.2. Configuration of General Fuzzy Systems 225 7.6.3. Lemmas for Establishing Necessary Conditions 226 7.6.4. Necessary Approximation Conditions 227 7.6.5. Strength and Limitation of SISa Mamdani Fuzzy Systems as Functional Approximators 229
7.7. Necessary Approximation Conditions for General MISO Mamdani Fuzzy Systems 230 7.7.1. Configuration of General Fuzzy Systems 230 7.7.2. Lemmas for Developing Necessary Conditions 231 7.7.3. Necessary Approximation Conditions 236 7.7.4. Merits and Pitfalls of MISO Mamdani Fuzzy Systems as Functional Approximators 238 7.7.5. Numeric Example 238
7.8. Necessary Approximation Conditions for Typical TS Fuzzy Systems 240 7.8.1. Configuration of Typical Fuzzy Systems 240 7.8.2. Preparation for Setting Up Necessary Conditions 242 7.8.3. Necessary Approximation Conditions 247 7.8.4. Advantages and Disadvantages of TS Fuzzy Systems as Functional Approximators 248
7.9. Comparison of Minimal Approximator Configuration Between Mamdani and TS Fuzzy Systems 248 7.9.1. IfTS Fuzzy Systems Use Trapezoidal or Triangular Input Fuzzy Sets 248 7.9.2. If TS Fuzzy Systems Use Other Types of Input Fuzzy Sets 250 7.9.3. Comparison Results 251
7.10.
Conclusions on Mamdani and TS Fuzzy Systems as Functional Approximators 251 7.11. Summary 251
Contents
xv
7.12. Notes and References 252 Exercises 252 CHAPTER 8
Real-Time Fuzzy Control of Biomedical Systems
255
8.1. Introduction 255 8.2. Common Complexity of Biomedical Systems Ideal for Fuzzy Control 255 8.3. Mamdani Fuzzy PI Control of Mean Arterial Pressure in Postsurgical Cardiac Patients 256 8.3.1. 8.3.2. 8.3.3. 8.3.4.
Hypertension After Cardiac Surgery 256 Patient Model 257 Design of Fuzzy Control Drug Delivery System 257 Clinical Implementation and Fine-Tuning of Fuzzy Controller 259 8.3.5. Clinical Results 262
8.4. Thermal Treatment of Tissue Lesions 265 8.4.1. Different Kinds of Thermal Therapies 265 8.4.2. Statement of Problems 266 8.4.3. Laser Thermal Therapies 267
8.5. Fuzzy PD Control of Tissue Temperature During Laser Heating 268 8.5.1. Experimental Setup 268 8.5.2. Design of Mamdani Fuzzy PD Controller 269 8.5.3. Derivation of Fuzzy Controller Structure and Explicit Results 271 8.5.4. Temperature Control Performance for Laser Hyperthermia, Coagulation, and Welding 277
8.6. Ultrasound-Guided Fuzzy PD Control of Laser-Tissue Coagulation 280 8.6.1. Development of Noninvasive Ultrasonic Sensor 281 8.6.2. Setup for Ultrasound-Guided Fuzzy Control Experiments 285 8.6.3. Design of the Mamdani Fuzzy PD Controller 286 8.6.4. Control Results of Laser-Tissue Coagulation 287
8.7. Summary 290 8.8. Notes and References 290 BIBLIOGRAPHY
291
INDEX 305 ABOUT THE AUTHOR 309
Foreword
Close to a quarter of a century has passed since fuzzy control made its debut. During this period, the literature on fuzzy control and its applications has grown at a geometrical rate. Taking as an index of growth, the number of papers in the INSPEC database with "fuzzy control" in the title have grown from 38 during 1970-1979 to 214 during 1980-1989 and to 4,356 during 1990-1999, with the data for 1999 not yet complete. And yet fuzzy control has been, and remains, an object of controversy with some--especially within the academic control systems establishment-expressing the view that anything that can be done with fuzzy control can be done equally well with conventional methods. This view is reflected in the fact that almost no papers on fuzzy control have been published in the IEEE Transactions on Automatic Control and this is the backdrop against which the publication of Professor Ying's monumental work Fuzzy Control and Modeling: Analytical Foundations and Applications should be viewed. First, a bit of history. When I wrote my first paper on fuzzy sets in 1965, my expectation was that the theory of fuzzy sets would find its main applications in the realm of what may be called humanistic systems-systems exemplified by economic systems, societal systems, biological systems, linguistics, and psychology. It did not take me long, however, to see that the theory could be applied to mechanistic systems, especially to control. The groundwork for such applications was laid in my papers "Toward a Theory of Fuzzy Systems" (1971); "A Rationale for Fuzzy Control" (1972); "Outline of a New Approach to the Analysis of Complex Systems and Decision Processes" (1973); and "On the Analysis of Large Scale Systems" (1974). These papers, especially my 1973 paper, introduced the basic concepts ofa linguistic variable, fuzzy if-then rule, and fuzzy graph. These concepts have played, and are continuing to play, key roles in almost all applications of fuzzy set theory (or fuzzy logic), including fuzzy control. Although the basic ideas underlying fuzzy control were introduced in these papers, it was the seminal work of Mamdani and Assilian in 1974-1975, which showed that the ideas could be used to construct a working model of a fuzzy control system. This was the beginning of the era of fuzzy control. xvii
xviii
Foreword
What is not fully recognized, however, is that fuzzy control (FC) and conventional crisp control (CC) are, for the most part, complementary rather than competitive. Thus, FC is rulebased whereas CC is differential-equation-based; FC is task-oriented whereas CC is set-pointoriented; and CC is model-based whereas, in the case ofFC, what suffices is a linguistic, rulebased description of the model. Today we see more clearly that fundamentally CC is measurement-based whereas FC is perception-based. In this sense, the role model for FC is the remarkable human capability to perform a wide variety of tasks without any measurements and any computations. A canonical example of such tasks is that of driving a car in city traffic. Classical control provides no methods for automation of tasks of this type. Because it is close to human intuition, fuzzy control is easy to learn and easy to apply. For this reason, there are many applications of fuzzy control in the realm of consumer products. However, as a system becomes more complex, a limited mastery offuzzy rule-based techniques ceases to be adequate. This is when a deep understanding of the theory of fuzzy control becomes a necessity, and it is this necessity that motivates the analytical theory of fuzzy control developed in the work of Professor Ying. Professor Ying's book contains much that is new, important, and detailed. Particularly noteworthy are the chapters that focus on the Mamdani and Takagi-Sugeno types of controllers. In these chapters, a novel approach to stability theory is described and a theory of universal approximation is developed in detail. His linkage of basic theory to real-world applications is very impressive. The last chapter in the book deals with a subject in which Professor Ying is a foremost authority, namely, application of fuzzy control to biomedical systems. Such applications are likely to grow in importance in the years ahead. Professor Ying's work should go a long way toward countering the view that fuzzy control is a collection of applications without a solid theory. The deep theory of fuzzy control developed by Professor Ying is of great importance both as a theory and as a foundation for major advances in applications of fuzzy control in industry, biomedicine, and other fields. As the author of Fuzzy Control and Modeling: Analytical Foundations and Applications, he and the publisher, the IEEE Press, deserve our thanks and congratulations. Lotfi A. Zadeh Berkeley, CA February 27, 2000
Preface
In the past decade, fuzzy system technology - especially fuzzy control which is its most active and victorious component - has gained tremendous acceptance in academia and industry. The worldwide success of countless commercial products and applications has proved the technology to be not only practical and powerful, but also cost effective. Realworld systems are nonlinear; accurate modeling is difficult, costly, and even impossible in most cases. Fuzzy control has the unique ability to successfully accomplish control tasks without knowing the mathematical model of the system, even if it is nonlinear and complex. Applications are currently being developed in an ad hoc manner requiring significant trial-and-error effort, however. The fuzzy systems developed are mostly treated as (magic) black boxes with little analytical understanding and explanation. Thus, there is an urgent need for developing an analytical theory of fuzzy systems to support and accelerate the growth of the technology and eliminate the existing misunderstanding and controversy. The overall objective of this book is to establish comprehensive and unified analytical foundations for fuzzy control and modeling. My approach is first to establish explicit relationships between fuzzy controllers/models and their classical counterparts, and then to utilize the well-developed conventional linear and nonlinear system techniques for analytical analysis and design of fuzzy systems. The results are unified in an analytical framework and presented cohesively.
UNIQUENESS OF THE BOOK This is a unique textbook whose contents are unavailable in any other book. It is the only book at present that exclusively addresses analytical issues of fuzzy control and modeling by rigorously connecting fuzzy controllers/models to classical controllers/models. In comparison with other books, the text is unique in the following aspects: xix
xx
Preface
Completely Analytical Approach From the beginning to the end, every topic in the book is treated analytically. Every fuzzy controller and fuzzy model is studied mathematically using analytical techniques. All the results are analytical and rigorous. Connection to Classical Control and System Theories Every result derived and technique developed is rigorously linked to conventional control and system theories. The connection is clearly presented and explained in the context of the conventional theories. Comprehensive and In-Depth Coverage Major types of fuzzy controllers and models are covered. For every type, typical configurations are systematically examined. The focus is not only on individual fuzzy systems, but also on their general classes. Many analytical issues in the analysis and design of fuzzy systems are extensively studied. Practicality To make the theory practically useful, the system model is assumed to be unknown throughout the book, except for a portion of the stability analysis. My approach is to concentrate on fuzzy controllers, as opposed to fuzzy control systems, and to relate their analytical structures and gain characteristics to their control behavior in such a way that the linkage holds for general systems. This approach is effective as evidenced by applications, including a life-critical real-time control application. Unified and Cohesive Presentation A wide variety of fuzzy controllers are unified in one analytical framework, which also unifies the fuzzy models. The common framework makes the presentation consistent and cohesive. Latest and Long-Term Research Findings Presented in a Textbook Style The book contents are based on my fuzzy system publications since 1987, including 37 peerreviewed journal papers. A significant amount of introductory and background materials have been added. The materials from the papers are logically integrated and organized as well as systematically enhanced. Coupled with the above-mentioned unique features, this book is a self-contained textbook that provides up-to-date information on some of the most active and fruitful frontiers of analytical research and development of fuzzy systems.
INTENDED READERSHIP OF THE BOOK
This self-contained textbook is intended for anyone seeking to understand fuzzy control and modeling in the context of traditional control and modeling. It is also for anyone who is interested in analytical aspects of fuzzy control and modeling and wants to know precisely their connections with the classical counterparts. The book is written for readers who possess a basic knowledge of control and modeling. Fuzzy mathematics is not a prerequisite nor is highly advanced mathematics; undergraduate calculus suffices. To facilitate the reading and understanding, I provide a brief introduction or review for every major classical concept, algorithm, and technique before it is used. Analytical derivation is presented step by step, complete, and easy to follow. Concrete numeric examples and computer simulation are provided to highlight or confirm the analytical work. Graphical representation, including three-dimensional plots, is extensively utilized to illustrate the theoretical development. The book can be used as a textbook for engineering senior and graduate students. Since the book presents state-of-the-art analytical research, a particular topic may be selected for a research project leading to a Ph.D., M.S., or senior graduation thesis. The text can also be
Preface
xxi
used in conjunction with other books as a supplement or reference book to provide analytical insight and in-depth knowledge on the relevant topics. This is also a self-study book ideal for engineering professionals in diverse technical fields and industries, especially those in the fields of control and modeling. The book helps those people take advantage of their expertise in conventional techniques when using fuzzy system technology to solve particular problems. It provides a familiar entrance into the field of fuzzy systems. Given that the analytical theory of fuzzy control and modeling is still in its early development stage, combining one's expertise with the book could be fruitful in generating significant theoretical and practical results. OVERVIEW OF THE BOOK
The book consists of eight chapters that can be divided into four parts. The first part is two chapters long and contains background material for the rest of the book. Chapter 1 provides a minimum but adequate amount of fuzzy mathematics and notations for fuzzy control and modeling. In Chapter 2, both Mamdani and Takagi-Sugeno (TS) fuzzy controllers and models are introduced. They are mathematically formulated to demonstrate that fuzzy controllers and models are actually conventional nonlinear variable gain controllers and models, respectively. The advantages and disadvantages of fuzzy control are pointed out in comparison with conventional control. This is followed by a discussion of when fuzzy control should and should not be used, the major analytical issues, and the special technical difficulties associated with fuzzy control study. Brief background information is also included regarding the early attempts in analytical studies. Finally, fuzzy modeling and its strengths, weaknesses, and usability are discussed. Chapters 3 to 5 form the second part, which focuses on the analytical structures and characteristics of a variety of fuzzy controllers and their precise connections to the conventional controllers. Chapter 3 concentrates on different types of Mamdani fuzzy PID controllers and compares their performances with the linear PID controller in computer simulation using various system models. Chapter 4 deals with more complicated and general classes of Mamdani fuzzy controllers that are of the non-PID type. Structure decomposition property as well as limit structure are revealed for the fuzzy controllers when the number of fuzzy rules becomes infinitely large. Different TS fuzzy controllers with linear rule consequent are investigated in Chapter 5. A new, simplified TS fuzzy rule scheme is introduced to reduce the number of design parameters. The third part, which contains Chapters 6 and 7, provides analytical analysis and design of different types of fuzzy systems. In Chapter 6, local stability as well as bounded-input bounded-output (BIBO) stability conditions are established for both Mamdani and TS fuzzy control systems. System design techniques are developed, including a feedback linearization scheme for controlling general TS fuzzy models to achieve perfect output tracking control. Fuzzy systems are also related to nonlinear ARX models and nonlinear FIR/IIR filters. Chapter 7 examines whether fuzzy systems are universal approximators and establishes the sufficient and necessary approximation conditions. It also compares Mamdani fuzzy approximators with TS fuzzy approximators in terms of minimal system configuration and draws conclusions on the strengths and limitations of the fuzzy approximators as a whole. Chapter 8, the last part, shows three real-world applications that we have developed using the analytical work. In one application, a Mamdani fuzzy PI controller is designed, tuned, and clinically implemented to control mean arterial pressure in real time in postsurgical cardiac patients in the Cardiac Surgical Intensive Care Unit.
xxii
Preface
The bibliography at the end of the book lists the publications cited in the text as well as other relevant publications that are not cited. Significant effort has been made to ensure the inclusion of all the publications relevant to the topics and approaches of the book. Nevertheless, given the vast volume of the literature, it is inevitable that the bibliography is still incomplete. Hao Ying Department ofPhysiology and Biophysics Biomedical Engineering Center The University of Texas Medical Branch, Galveston
Acknowledgments
I extend my appreciation, first to my parents, Meilang Ying and Yiying Zhang. Much of what I have accomplished can be attributed to their nurturing and love and to their years as my role models. Their continued encouragement, advice, and help have been invaluable. I am also very appreciative of my wife Julia Cheng for her understanding and support throughout the writing of this book for more than two years. I am deeply indebted to my little son Andrew Y. Ying, who was not able to get my full attention during this time. I am pleased to be able to devote more time now to my newborn daughter Alice C. Ying. I wish to thank my Ph.D. advisor, Professor Louis C. Sheppard, for his support and encouragement. I am also grateful to my master's advisor, Professor Shihuang Shao, for bringing me into the field of fuzzy control in 1981. My thanks also go to Professor Metin Akay for inviting me to write this book and for giving me thoughtful advice, as well as to the IEEE Press editors, Karen L. Hawkins, Linda Matarazzo, and Surendra Bhimani for their assistance. I am appreciative of my former Ph.D. student Dr. Yongsheng Ding for drawing part of the figures in the first three chapters and compiling part of the bibliography. My appreciation also extends to the anonymous reviewers for their constructive suggestions and useful comments. A significant portion of the results in the book was achieved throught my research projects partially funded by the Whitaker Foundation and the Texas Higher Education Coordinating Board. I am very grateful for their support. Hao Ying Department ofPhysiology and Biophysics Biomedical Engineering Center The University of Texas Medical Branch, Galveston
xxiii
List of Figures
1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9
A possible description of the vague concept "young" by a crisp set. A possible description of the vague concept "young" by a fuzzy set. Two more possible descriptions of the vague concept "young" by fuzzy sets. An example of the membership function of a singleton fuzzy set. An example of a subnormal fuzzy set. A definition of the center of a fuzzy set for four different cases. An example of a convex fuzzy set. An example of a nonconvex fuzzy set. Examples of four commonly used input fuzzy sets in fuzzy control and modeling: (a) trapezoidal, (b) triangular, (c) Gaussian and (d) bell-shaped. Note that they are all continuous, normal, and convex fuzzy sets. 1.10 An example showing how fuzzification works. 1.11 Graphical illustration of the definitions of the four popular fuzzy inference methods whose mathematical definitions are provided in Table 1.1: (a) the Mamdani minimum inference method, (b) the Larsen product inference method, (c) the drastic product inference method, and (d) the bounded product inference method. 1.12 For Mamdani fuzzy controllers and models using singleton fuzzy sets in the rule consequent, the outcome of using the four different inference methods is identical. 2.1 2.2 2.3 2.4 2.5 2.6
Structure of a SISO Mamdani fuzzy control system, which is comprised of a typical Mamdani fuzzy controller and a system under control. Illustration of how input variables are fuzzified by input fuzzy sets. Example of singleton fuzzy sets as output fuzzy sets for Mamdani fuzzy controllers. A graphical description of the fuzzy controller example to show concretely how fuzzification, fuzzy inference, and defuzzification operations work. Structure of a typical MISO Mamdani fuzzy controller. Structure of a typical SISO TS fuzzy control system. xxv
xxvi
List of Figures
3.1
3.2 3.3 3.4
3.5 3.6
3.7
3.8
3.9
3.10
3.11
3.12
Graphical definitions of input and output fuzzy sets used by the linear fuzzy PI controller: (a) two input fuzzy sets Positive and Negative for E(n) and R(n), and (b) three singleton output fuzzy sets, Positive, Zero and Negative. Illustration of how merely four fuzzy rules can cover all possible situations. Division of the E(n) - R(n) input space into 12 regions for applying the Zadeh fuzzy AND operation in the four fuzzy rules. (a) Three-dimensional plot of L\u(n) of the piecewise linear fuzzy PI controller with respect to e(n) and r(n) whose ranges are [-2L,2L], and (b) L\u(n) of the corresponding linear PI controller, L\u(n) = 0.5e(n) + 0.25r(n), for the same ranges of e(n) and r(n). The values of the parameters are: L = H = 1, K; = 1, K; = 0.5, and K Au = 1. Three-dimensional plots of p(e,r) with respect to e(n) and r(n) whose ranges are [-L,L]. The values of the parameters are: L = H = 1, K Au = 1, K; = 1, and (a) K, = 1, (b) K, = 0.6, and (c) K; = 0.2. Three-dimensional plots of L\u(n) of the simplest nonlinear fuzzy PI controller with respect to e(n) and r(n) whose ranges are [-2L,2L]. The values of the parameters used to generate plots (a}-(c) are the same as those used in Figs. 3.5a-e, respectively. Performance comparison between the simplest nonlinear fuzzy PI controller and the corresponding linear PI controller when the linear first-order system model (3.14) is used: (a) output of the two control systems and (b) trajectory of E(n) vs. R(n). For the fuzzy controller, the values of the parameters are: L = H = 1, K; = 0.3, K; = 16, and K Au = 1. The gains of the corresponding PI controller are: Kp(O,O) = 4 and Ki(O,O) = 0.075. Performance comparison between the simplest nonlinear fuzzy PI controller and the corresponding linear PI controller when the linear second-order system (3.15) is used: (a) output of the two control systems and (b) the trajectory of E(n) vs. R(n). For the fuzzy controller, the values of the parameters are: L = H = 1, K; = 0.3, K; = 60, and K Au = 0.075. The gains of the corresponding PI controller are: Kp(O,O) = 1.125 and Ki(O,O) = 0.005625. Performance comparison between the simplest nonlinear fuzzy PI controller and the corresponding linear PI controller when the linear second-order system model (3.15) is used. The values of the parameters of the fuzzy PI controller are the same as those given in Fig. 3.8, but the gains of the linear PI controller are fine tuned to achieve a comparable performance to the fuzzy control performance. For the linear PI controller, Kp(O,O) = 1.33125 and Ki(O,O) = 0.005625. Performance comparison between the simplest nonlinear fuzzy PI controller and the corresponding linear PI controller when the first-order system with a time delay (3.16) is used: (a) output of the two control systems, and (b) trajectory of E(n) vs. R(n). For the fuzzy controller, the values of the parameters are: L = H = 1, K; = 0.3, K; = 50, and K Au = 0.0078. The gains of the corresponding PI controller are: Kp(O, 0) = 0.0975 and Ki(O,O) = 0.000585. Performance comparison between the simplest nonlinear fuzzy PI controller and the corresponding linear PI controller when the first-order system with a time delay (3.16) is used. The values of the parameters of the fuzzy PI controller are the same as those given in Fig. 3.10. For the linear PI controller, (a) Kp(O,O) = 0.002175 and Ki(O,O) = 0.0006525, and (b) Kp(O,O) = 0.0035 and Ki(O,O) = 0.00105. Performance comparison between the simplest nonlinear fuzzy PI controller and the corresponding linear PI controller when the nonlinear system (3.17) is used: (a) output of the two control systems, and (b) trajectory of E(n) vs. R(n). For the fuzzy controller,
List of Figures
3.13
3.14 3.15 3.16
xxvii
the values of the parameters are: L = H = 1, K; = 0.595, K, = 12, and K Au = 45. The gains of the corresponding PI controller are: Kp(O,O) = 135 and K;(O,O) = 6.60375. Performance comparison between the simplest nonlinear fuzzy PI controller and the corresponding linear PI controller when the nonlinear system (3.17) is used. The values of the parameters of the fuzzy PI controller are the same as those given in Fig. 3.12. The gains of the linear PI controller are carefully tuned: (a) Kp(O,O) = 81 and K;(O,O) = 6.69375 and (b) Kp(O,O) = 56.25 and K;(O,O) = 6.69375. Three trapezoidal output fuzzy sets for the simplest nonlinear fuzzy PI controllers using the four different inference methods. Fuzzy inference results: Shadow areas representing the results of applying the four different inference methods to the trapezoidal output fuzzy sets. A three-dimensional plot of pM(e,r) for visualizing its properties analyzed in the text. For the plot, (J = 0, K; = K; = K Au = L = H = 1. It can be seen that starting from the minimum at Kee(n) = and Krr(n) = 0, pM(e,r) strictly monotonically increases with an increase of Kele(n)1 and Krlr(n)1 in all directions. pM(e,r) achieves its maximum at (L,-L) and (-L,L). A three-dimensional plot of pL(e, r) and pDP(e,r) for visualizing their properties analyzed in the text. For the plot, (J = 0, K, = K; = K Au = L = H = 1. It can be seen that starting from the minimum at Kee(n) = and Krr(n) = 0, pM(e,r) strictly monotonically increases with an increase of Kele(n)1 and Krlr(n)1 in all directions. pL(e,r) and pDP(e,r) achieves their maximum when Kele(n)1 = L and Krlr(n)1 = L A three-dimensional plot of pBP (e,r) for visualizing its properties analyzed in the text. For the plot, K; = K; = K Au = L = H = 1. (a) (J = 0. happens at (L,-L) and (-L,L), and takes place at (0.634L, 0.366L), (O.366L, 0.634L), (-0.634L, -0.366L), and (-0.366L, -0.634L) (b) (J = 0.5. happens at (0,0), and takes place at (L, 0.4772L), (O.4772L, L), (-L, -0.4772£), and (-0.4772L, -L). Structure of a simplest nonlinear TITO fuzzy PI controller. Graphical definition of five singleton output fuzzy sets: Positive Large, Positive Small, Approximately Zero, Negative Small, and Negative Large. One combination of fuzzy PI control and fuzzy D control to form fuzzy Pill control. A combination of fuzzy PI control and fuzzy PD control to realize fuzzy PID control.
°
3.17
°
3.18
p:n
3.19 3.20 3.21 3.22 4.1 4.2 4.3 4.4
4.5 4.6 4.7
p:n
P:X P:X
An example of one-dimensional multilevel relay: a one-dimensional three-level relay. An example of two-dimensional multilevel relay: a two-dimensional three-level relay. An example of triangular membership functions that meet the conditions set in (4.3). Here, N = 7 (i.e., J = 3) and S = 5. ICs of E(n) and R(n) must be considered for the Zadeh fuzzy AND operation in the four fuzzy rules rl to r4: (a) four ICs when both E(n) and R(n) are within [-L,L], and (b) 8 ICs when either E(n) or R(n) is outside [-L,L]. 4J + 1 uniformly distributed trapezoidal output fuzzy sets for L\u(n). 2J + 1 uniformly distributed trapezoidal input fuzzy sets. Division of [is, (i + 1)8] x ([jS, (j + 1)8] in E(n) - R(n) input space for applying the Zadeh fuzzy AND operation in the four fuzzy rules rl * to r4*: (a) 16 les when both E(n) and R(n) are within [-L,L], and (b) 12 ICs when either E(n) or R(n) is outside [-L,L].
xxviii
List of Figures
5.1 5.2
5.3 5.4
5.5 5.6 5.7
5.8
5.9
5.10
5.11
5.12
5.13
5.14
5.15 5.16 5.17
Graphical definitions of two input fuzzy sets of the TS fuzzy PI controller, Positive and Negative for both e(n) and r(n). A three-dimensional plot of an example constant proportional-gain shows Kp(e,r) when b i = b2 = b 3 = b4 = 5. The gain surface is a plane parallel to the e(n) - r(n) plane. The values of Kp(e,r) at (0,0) as well as in IC6, IC8, ICI0, and ICI2. A three-dimensional plot showing the first type of gain variation with e(n) and r(n). The parameter values are: b l = 4, b2 = 2, b3 = 3, and b4 = 1. Without loss of generality, L = 1. A three-dimensional plot showing the first type of gain variation with e(n) and r(n). The parameter values are: hi = 4, b2 = 2, b3 = 2, b4 = 1, and L = 1. Because b2 = b3 , the gain surface is symmetric with respect to the line e(n) = r(n). A three-dimensional plot showing the second type of gain variation with e(n) and r(n). The parameter values are: b l = 4, b2 = 1, b3 = 2, b4 = 3, and L = 1. The gain surface is asymmetric. A three-dimensional plot showing the second type of gain variation with e(n) and r(n). The parameter values are: b l = 4, b2 = 1, b3 = 1, b4 = 4, and L = 1. The gain surface is symmetric in terms of both the line e(n) = r( n) and the line e(n) = - r( n). A three-dimensional plot showing the third type of gain variation with e(n) and r(n). The parameter values are: b l = 4, b2 = 3, b3 = 1, b4 = 2, and L = 1. The gain surface is asymmetric. A three-dimensional plot showing the third type of gain variation with e(n) and r(n). The parameter values are: b l = 4, b2 = 1, b3 = 1, b4 = 1, and L = 1. The gain surface is symmetric with respect to the line e(n) = r(n). Simulated performance of the simple TS fuzzy PI control of tissue temperature using the hyperthermia model (5.7). The temperature setpoint is 43°C. Between 0 and 799 seconds, the nominal model parameters (K = 1.1, 't = 250 and 'td = 45) are used. To test the stability and robustness of the fuzzy control system, at time 800 seconds, K and r are suddenly increased by 20% and then abruptly returned to their nominal values at time 1500 seconds Three-dimensional plots of Kp(e,r) and Ki(e,r) of the simple TS fuzzy PI controller controlling the hyperthermia model (5.7): (a) Kp(e,r) with the parameters being b i = 2, b2 = 1.62, b 3 = 1.4, and b4 = 2, and (b) Ki(e,r) with the parameters being al = 0.005, a2 = 0.007, a3 = 0.004, and a4 = 0.006, and L = 1. Illustrative definitions of N = 2J + 1 trapezoidal input fuzzy sets for e(n) and r(n), where 2A and 28 are the upper and lower sides, respectively. Division of input space for analytically deriving structure of the typical TS fuzzy PI controller: (a) 12 ICs for the cases when both e(n) and r(n) are within [-L,L], and (b) eight ICs for the cases when either e(n) or r(n) is outside [-L,L]. Illustrative definitions of three trapezoidal input fuzzy sets used for typical TS fuzzy PI control of tissue temperature in computer simulation, where A = 0.2 and 8 = 1. Simulated fuzzy control performance of tissue temperature using a typical TS fuzzy PI controller and the hyperthermia temperature model (5.7). The temperature setpoint is 43°C. Three-dimensional plots of Kp(~e,~r) and Ki(~e,~r) of the typical TS fuzzy PI controller controlling the hyperthermia temperature model (5.7): (a) Kp(~e,~r), and (b) Ki(~e,~r). The e(n)-r(n) plane is divided into nine ICs for the structure derivation of the simple TS fuzzy PI controller with the simplified linear TS rules.
List of Figures
xxix
5.18 Three-dimensional plot of p(e,r) when k1 = 1, k2 = k3 = 0, k4 = 1, and L = 1. The gain surface is symmetric in terms of the line e(n) = r(n) and the line e(n) = -r(n). 5.19 Three-dimensional plot of p(e,r) when k 1 = 1, k2 = k3 = 0, k4 = 1/3, and L = 1. The gain surface is symmetric in terms of the line e(n) = r(n). 5.20 Three-dimensional plot of p(e,r) when k, = 1, ~ = k3 = 0, k4 = -1, and L = 1. The gain surface is symmetric in terms of the line e(n) = r(n). The plot shows that inappropriate values of '9 can lead to unreasonable and illogical gain variation characteristics and hence an unusable controller. Specifically in this example, P= 0, resulting in zero control gain at the equilibrium point. 5.21 Three-dimensional plot of p(e,r) when k 1 = 1, ~ = 1/8, k3 = 1/2, k4 = 1, and L = 1. The gain surface is symmetric in terms of the line e(n) = r(n). 5.22 Three-dimensional plot of pee, r) when k 1 = 1, k2 = 1/8, k3 = 1/4, k4 = 1/2, and L = 1. The gain surface is asymmetric. 5.23 Comparisons of simulated control performance between the fuzzy Pill controller with the simplified linear TS rules and the corresponding linear Pill controller that uses the steady-state gains of the fuzzy controller (i.e., P(O,O,O)· a., i = 1,2,3). The patient model is given in (8.1). The parameter values are: k 1 = 1, k2 = 0.5, k3 = k4 = k5 = k6 = 0, k7 = 0.1, kg = 0.85, L = 40, al = -0.024, a2 = -1.6, and a3 = -25. The sampling period is 10 seconds. Once set, all the parameters are fixed for both controllers in all the comparisons: (a) the typical patients (K = -0.72), (b) the insensitive patients (K = -0.18), and (c) the oversensitive patients (K = -2.88). 6.1 6.2
Membership functions used by the TS fuzzy controller in Example 6.1. Block diagram of a general nonlinear control system for explaining the Small Gain Theorem and establishing BIBO stability for the Mamdani fuzzy control systems. 6.3 Performances of the PI control system and designed fuzzy control systems with 49 and 9 linear rules. 6.4 Performances of the PI control system and the designed fuzzy control system: (a) initial performances and (b) final, tuned performances. 6.5 Initial and final performances of the PI control system and the designed fuzzy control system for mean arterial pressure control. 6.6 Illustrative definitions of the six fuzzy sets used in Example 6.9. The mathematical definitions are given in (6.25) and (6.26), with the parameter values being listed in Table 6.4. 6.7 Simulated output of the TS fuzzy dynamic system given in Example 6.9, confirming its instability determined analytically by the necessary and sufficient stability condition. The initial system output is set at 0.0001. 6.8 Output of the unstable TS fuzzy dynamic system controlled by an output tracking controller in Example 6.10, which is designed using the feedback linearization technique. Sign 0 represents the desired output trajectory whereas sign + represents the fuzzy system output. The figure shows that perfect tracking is achieved. Note that the final fixed position of the desired trajectory, Sf' is 0.4. 6.9 Output of the output tracking controller designed using the feedback linearization technique in Example 6.10. The controller is stable, confirming the result of the analytical determination. The steady-state output of the controller is 1.8461, the same as the value computed using (6.30). 6.10 Output of the unstable TS fuzzy dynamic system controlled by an output tracking controller in Example 6.11, which is designed in Example 6.10 using the feedback
List of Figures
xxx
linearization technique. Sign 0 represents the desired output trajectory whereas sign + represents the system output. The figure shows that perfect tracking is achieved. Note that the final fixed position of the desired trajectory, Sf' is 0.7 instead of 0.4 as shown in Fig. 6.9 for Example 6.10. 6.11 Output of the tracking controller in Example 6.11. Because of the change of the final position of the desired trajectory from 0.4 in Example 6.10 to 0.7 in Example 6.11, the controller becomes unstable, as predicted by using (6.29). 7.1 7.2 7.3 7.4 7.5 7.6 7.7
7.8
8.1 8.2 8.3
8.4
8.5 8.6 8.7
Illustrative definition of input fuzzy sets for the general SISO Mamdani fuzzy systems. Illustrative definition of triangular input fuzzy sets used by the general SISO Mamdani fuzzy systems. Note that J.li(xl) + J.li+l(Xl) = 1 on [Ci'Ci+ 1 ] for all i. Illustrative definition of input fuzzy sets for the general MISO Mamdani fuzzy systems. Graphical illustration of a simple but highly oscillatory function t/J(x) = Sin(2Xl) COS(3X2) on [0,3n] x [0,3n] which has 48 extrema on (0,3n) x (0,3n). Graphical illustration of trapezoidal input fuzzy sets. Dividing [C} , C} +1] X [CJ ' CJ +1] into nine regions for proving that the typical TS fuzzy 1 1 2. 2 1 1 2 2 systems have at most one extremum in [Ch'Cj1+ 1] x [Cj2,Cj2+2]. Comparison of the minimal system configuration between the typical MISO TS fuzzy systems and the general MISO Mamdani fuzzy systems. The example function to be approximated has two maximum points, whose locations are marked by symbol a, and two minimum points whose locations are marked by symbol e. Panel (a) gives one possible division of the input space for the TS fuzzy systems to be minimal, whereas panel (b) provides the necessary input space division for the Mamdani fuzzy systems to be minimal. Comparison of the minimal system configuration between the typical MISO TS fuzzy systems and the general MISO Mamdani fuzzy systems using another example function. The meanings of the symbols are the same as those in Fig. 7.7. This example function has the same number of extrema, but the locations of the minimum points are slightly different from those displayed in Fig. 7.7. Panel (a) gives one possible division of the input space for the TS fuzzy systems to be minimal, whereas panel (b) provides the necessary input space division for the Mamdani fuzzy systems to be minimal. Fuzzy SNP drug delivery control system for patients' MAP regulation. Computer simulation showing the effect of increasing the value of L from 10 to 16 on the performance of the fuzzy controller regulating MAP in the sensitive patients (K = -2.88). Computer simulation showing the effect of changing KfJ.u from - 0.8-0.6. on the performance of the fuzzy controller regulating MAP in the sensitive patients (K = -2.88). Computer simulation showing the effect of changing KfJ.u from - 0.8-0.6 on the performance of the fuzzy controller regulating MAP in the normal patients (K = -0.72). Simulated comparison of MAP in the sensitive patients (K = -2.88) before and after increasing the value of K; from 8.0 to 13.5. Simulated comparison of MAP in the normal patients (K = -0.72) before and after increasing the value of K; from 8.0 to 13.5. (a) MAP response for a patient obtained by using the fuzzy control SNP delivery system clinically; and (b) the corresponding SNP infusion rate. The patient had blood sampled at 12:57,13:42,15:18,15:56, and 17:50. Suctioning the patient began at 13:04,17:00,
List of Figures
8.8
8.9
8.10 8.11 8.12 8.13 8.14 8.1S 8.16
xxxi
and 19:17. The patient was bathed between 15:36 and 15:50. Changing bed linens started at 19:45 and lasted several minutes. Injection of Valium took place at 13:09, 14:41, and 17:57. The drugs Pavulon and Morphine were injected into the patient at 14:50 and 17:10, respectively. Comparison of the variable proportional-gain of the nonlinear PI controller realized by the fuzzy PI controller to the constant proportional-gain of the corresponding linear PI controller (i.e., (Kp(e,r) - Kp(O, O))/Kp(O, 0) showed change of Kp(e,r) over time corresponding to the nonlinearities in MAP for this patient. Change of K;(e,r) over time is the same as that of Kp(e,r) since (K;(e,r) - K;(O,O))/K;(O, 0)) = (Kp(e,r) - Kp(O,O))/Kp(O,O). Simulated MAP for sensitive patients (K = -2.88), normal patients (K = -0.72), and insensitive patients (K = -0.18), using the clinically fine-tuned parameters of the fuzzy controller. Experimental setup for fuzzy laser control of tissue temperature. Block diagram of fuzzy temperature control system. Fuzzy sets for input variable E(t k) and R(tk) of the fuzzy controller. Singleton output fuzzy sets of the fuzzy controller: (a) four fuzzy sets for Ton(tk), and (b) four fuzzy sets for t« (tk)' Division of E(tk) - R(tk) plane into 28 ICs for analytically deriving the fuzzy controller structure. M consecutive Ton (tk) and N consecutive Toff(tk) signals in one on-off cycle, [tk, tk+M=N]' Three-dimensional plots of TojJ (~ and TOll(t~ of the ~ controller for laser hyperthermia: (a) Toff(tk) where 'T:~ = 80rns, 'T:~ = 50ms, 'T:~ = 30ms, 'T:~ = Oms, and L = 1, (b) Ton(tk) where 'T:Ln = 800 ms, 7:}j = 600 ms, 'T: n = 500 ms, 'T:VS = 300 ms, and L = 1. Fuzzy control performance in a laser hyperthermia experiment with temperature setpoint being 43°C. The maximum positive and negative derivations of controlled temperature are O.ll°C and 0.21°C, respectively. Fuzzy control performance in another laser hyperthermia experiment with the temperature setpoint being 43°C. The maximum positive and negative derivations of controlled temperature are 0.31°C and 0.94°C, respectively. Fuzzy control performance in a laser coagulation experiment with the temperature setpoint being 65°C. The maximum positive and negative derivations of controlled temperature are 0.78°C and 0.30°C, respectively. Fuzzy control performance in a laser welding experiment with the temperature setpoint being 85°C. The maximum positive and negative derivations of controlled temperature are 3.0°C and 2.2°C, respectively. Comparison between visually and ultrasonically determined coagulation depths for 35 experiments. Progress of the coagulation front during laser heating in one of the 35 experiments, as determined by the ultrasound technique. Experimental setup for ultrasound-guide fuzzy control of laser-tissue coagulation. Graphical definitions of the fuzzy sets Small and Large for E(n) and R(n). Division of the E(n)-R(n) plane into 12 les for analytical structure derivation of the Mamdani fuzzy PD controller. The input fuzzy sets are shown in the last figure. One experimental result of real-time fuzzy control of laser coagulation. The target coagulation depth is 12 mm. Dynamic progress of coagulation depth, measured by the
s
8.17 8.18
8.19
8.20 8.21 8.22 8.23 8.24 8.2S 8.26
xxxii
List of Figures
ultrasonic technique, and the corresponding laser intensity are shown. The final coagulation position is confirmed by gross inspection. 8.27 The laser coagulation control results in all 21 experiments as compared with the corresponding setpoints ranging from 4mm to 14mm with a 2-mm increment.
Basic Fuzzy Mathematics for Fuzzy Control and Modeling 1.1. INTRODUCTION Fuzzy control and modeling use only a small portion of the fuzzy mathematics that is available; this portion is also mathematically quite simple and conceptually easy to understand. In this chapter, we introduce some essential concepts, terminology, notations, and arithmetic offuzzy sets and fuzzy logic. We include only a minimum though adequate amount of fuzzy mathematics necessary for understanding fuzzy control and modeling. To facilitate easy reading, these background materials are presented in plain English and in a rather informal manner with simple and clear notation as well as explanation. Whenever possible, excessively rigorous mathematics is avoided. The materials covered in this chapter are intended to serve as an introductory foundation for the reader to understand not only the fuzzy controllers and models in this book but also many others in the literature.
1.2. CLASSICAL SETS, FUZZY SETS, AND FUZZY LOGIC 1.2.1. Limitation of Classical Sets In traditional set theory, membership of an object belonging to a set can only be one of two values: 0 or 1. An object either belongs to a set completely or it does not belong at all. No partial membership is allowed. Crisp sets handle black-and-white concepts well, such as "chairs," "ships," and "trees," where little ambiguity exists. They are not sufficient, however, to realistically describe vague concepts. In our daily lives, there are countless vague concepts that we humans can easily describe, understand, and communicate with each other but that traditional mathematics, including the set theory, fails to handle in a rational way. The concept "young" is an example. For any specific person, his or her age is precise. However, relating a particular age to "young" involves fuzziness and is sometimes confusing and difficult. What age is young and what age is not? The nature of such questions is deterministic and has nothing to do with stochastic concepts such as probability or possibility. 1
2
Chapter 1 •
Basic Fuzzy Mathematics for Fuzzy Control and Modeling
Membership
Young
o
35
.. Age (year)
Figure 1.1 A possible description of the vague concept "young" by a crisp set.
A hypothetical crisp set "young" is given in Fig. 1.1. This set is unreasonable because of the abrupt change of the membership value from 1 to 0 at 35. Although a different cutoff age at which membership value changes from 1 to 0 may be used, a fundamental problem exists. Why is it that a 34.9-year-old person is completely "young," while a 35.1-year-old person is not "young" at all? No crisp set can realistically capture, quantitatively or even qualitatively, the essence of the vague concept "young" to reasonably match what "young" means to human beings. This simple example is not meant to discredit the traditional set theory. Rather, the intention is to demonstrate that crisp sets and fuzzy sets are two different and complementary tools, with each having its own strengths, limitations, and most effective application domains.
1.2.2. Fuzzy Sets Fuzzy set theory was proposed by Professor L. A. Zadeh at the University of California at Berkeley in 1965 to quantitatively and effectively handle problems of this nature [277]. The theory has laid the foundation for computing with words [285][287]. Fuzzy sets theory generalizes 0 and 1 membership values of a crisp set to a membership function of a fuzzy set. Using the theory, one relates an age to "young" with a membership value ranging from 0 to 1; o means no association at all, and 1 indicates complete association. For instance, one might think that age 10 is "young" with membership value 1, age 30 with membership value 0.75, age 50 with membership value 0.1, and so on. That is, every age/person is "young" to a certain degree. By plotting membership values versus ages, like the one shown in Fig. 1.2, we generate a fuzzy set "young." The curve in the figure is called the membership function of the fuzzy set "young." All possible ages, say 0 to 130, form a universe of discourse. From this example, a definition of fuzzy sets naturally follows. Fuzzy set: A fuzzy set consists of a universe of discourse and a membership function that maps every element in the universe of discourse to a membership value between 0 and 1. Unless otherwise stated, we always use a capital letter and tilde (e.g., A) to represent a
fuzzy set in this book. If an element is denoted by x E X, where X is a universe of discourse,
the membership function of fuzzy set A is mathematically expressed as J..lA(x), J..lA' or simply u. We will use all three representations in the book; the decision of which one to use depends
Section 1.2. •
Classical Sets, Fuzzy Sets, and Fuzzy Logic
3
Membership
0.75 Young
o
10
30
50
90
70
Age (year)
Figure 1.2 A possible description of the vague concept " young" by a fuzzy set.
on the circumstance. For the above age example, X = [0,130]. Letting A denote fuzzy set "young," we can represent its membership function by J1.A(x), where x EX. People have different views on the same (vague) concept. Fuzzy sets can be used to easily accommodate this reality. Continue the age example. Some people might think age 50 is "young" with membership value as high as 0.9, whereas others might consider that 20 is " young" with membership value merely 0.2. Different membership functions can be used to represent these different versions of " young." Figure 1.3 shows two more possible definitions of the fuzzy set "young." Not only do different people have different membership functions for the same concept, but even for the same person, the membership function for "young" can be different when the context in which age is addressed varies . For instance, a 40-year-old president of a country would likely be regarded as young, whereas a 40-year-old athlete would not. Two different fuzzy sets "young" are needed to effectively deal with the two situations. These examples show that (1) fuzzy sets can practically and quantitatively represent vague concepts; and (2) people can use different membership functions to describe the same vague concept. We now introduce some definitions needed to describe fuzzy controllers and models. Membership
"--- t - - - --t--
o
10
30
===---+------==::::f=-
50
70
-
-
---f---. Age (year)
90
Figure 1.3 Two more possible descriptions of the vague concept "young" by fuzzy sets .
Chapter 1 • Basic Fuzzy Mathematics for Fuzzy Control and Modeling
4
o
------~-----------.x
3.5
Figure 1.4 An example of the membership function of a singleton fuzzy set.
Continuous fuzzy sets: A fuzzy set is said to be continuous if its membership function is continuous. Most fuzzy controllers and models nowadays use continuous fuzzy sets. Singleton fuzzy sets: A fuzzy set that has nonzero membership value for only one element of the universe of discourse is called a singleton fuzzy set. Figure 1.4 exhibits a singleton fuzzy set whose membership value is 0 everywhere except at x = 3.5 where the membership value is 1. The majority of typical fuzzy controllers and models employ singleton fuzzy sets in the consequent of fuzzy rules, as will be shown later in this book. Support of a fuzzy set: For a fuzzy set whose universe of discourse is ~ all the elements in X that have nonzero membership values form the support of the fuzzy set. As an illustrative example, the support for the fuzzy set "young," shown in Fig. 1.2, is [0,70]. Height of a fuzzy set: The largest membership value of a fuzzy set is called the height of the fuzzy set. For instance, the height of the fuzzy set "young" in Fig. 1.2 is 1. The height of the fuzzy sets used in fuzzy controllers and models is almost always 1. Normal fuzzy set and subnormal fuzzy set: A fuzzy set is called normal if its height is 1. If the height of a fuzzy set is not 1, the fuzzy set is said to be subnormal. The fuzzy sets in Figs. 1.2 and 1.3 are normal fuzzy sets, whereas the fuzzy set in Fig. 1.5 is a subnormal one. Subnormal fuzzy sets are rarely used in fuzzy controllers and models. Center of a fuzzy set: We need to define this concept for four different situations. If the membership function of a fuzzy set reaches its maximum at only one element of the universe of discourse, the element is called center of the fuzzy set (Fig. 1.6a). If the membership function of a fuzzy set achieves its maximum at more than one element of the universe of discourse and all these elements are bounded, the middle point of the element is the center (Fig. 1.6b). If the membership function of a fuzzy set attains its maximum at more than one element of the universe of discourse and not all of the elements are bounded, the largest element is the center if it is bounded (Fig. 1.6d); otherwise, the smallest element is the center (Fig. 1.6c).
Section 1.2. •
Classical Sets, Fuzzy Sets, and Fuzzy Logic
5
0.4 Figure 1.5 An example of a subnormal fuzzy set.
x
o
7
Convex fuzzy sets: Fuzzy set A, whose universe of discourse is [a, b), is convex if and only if
where mint) denotes the minimum operator that uses the smaller membership value of the two memberships as the operation result. The fuzzy set illustrated in Fig. 1.7 is convex, whereas the one shown in Fig. 1.8 is not. To avoid possible confusion, it is important to note that the definition of convex fuzzy sets does not necessarily imply that the membership functions of convex fuzzy sets are convex functions. Nevertheless, the definition requires membership functions to be concave. Of course, according to the definition of convex fuzzy sets, if the membership function of a fuzzy set is convex, the fuzzy set is convex. Typical fuzzy controllers and models employ convex fuzzy sets.
o
o
center (a)
center
(c)
x
o
x
o
center (b)
center (d)
x
x
Figure 1.6 A definition of the center of a fuzzy set for four different cases .
According to the definition of fuzzy sets, any function, continuous or discrete, can be a membership function as long as its value falls in [0,1]. The discrete type is uncommon,
Chapter 1 • Basic Fuzzy Mathematics for Fuzzy Control and Modeling
6
J.1(X)
o
x
Figure 1.7 An example of a convex fuzzy set.
fl(X)
o
x
Figure 1.8 An example of a nonconvex fuzzy set.
however. Indeed, one of the key issues in the theory and practice offuzzy sets is how to define the proper membership functions of fuzzy sets. Fuzzy control and modeling are no exception. Primary approaches include (1) asking the control/modeling expert to define them; (2) using data from the system to be controlled/modeled to generate them; and (3) making them in a trial-and-error manner. Each different approach has its benefits and drawbacks. In more than 25 years of practice, it has been found that the third approach, though ad hoc, works effectively and efficiently in many real-world applications. Numerous applications have shown that only four types of membership functions are needed in most circumstances: trapezoidal, triangular (a special case of trapezoidal), Gaussian, and bell-shaped. Figure 1.9 shows an example of each type. All these fuzzy sets are continuous, normal, and convex. Among the four, the first two are more widely used. In the figure, we purposely use asymmetric membership functions to make the illustration more general. More often than not, however, symmetric functions are used. 1.2.3. Fuzzy Logic Operations In classical set theory, there are binary logic operators AND (i.e., intersection), OR (i.e., union), NOT (i.e., complement), and so on. The corresponding fuzzy logic operators exist in fuzzy set theory. Fuzzy logic AND and OR operations are used in fuzzy controllers and models. Unlike the binary AND and OR operators whose operations are uniquely defined, their fuzzy counterparts are nonunique. Numerous fuzzy logic AND operators and OR operators have been proposed, some of them purely from the mathematics point of view. To a large extent, only the Zadeh fuzzy AND operator, product fuzzy AND operator, the Zadeh
Section 1.3. • Fuzzification
7
J1{x)
o
J.L(x)
0
.. x
-"""----------~
(a)
(b)
f.l(x)
~(x)
o
.. x
-"------~---
o
(c)
.. x
-----'"--------~-
(d)
Figure 1.9 Examples of four commonly used input fuzzy sets in fuzzy control and modeling: (a) trapezoidal, (b) triangular, (c) Gaussian, and (d) bell-shaped. Note that they are all continuous, normal, and convex fuzzy sets.
OR operator, and the Lukasiewicz OR operator have been found to be most useful for fuzzy control and modeling [79]. Their definitions are as follows: Zadeh fuzzy logic AND operator:
JllniJ{x) = min{JlA{x), JlA{x))
product fuzzy logic AND operator:
Jl:4ni1{x) = JlA{x) x JliJ{x)
Zadeh fuzzy logic OR operator:
Jl:4uil{x) = max(JlA{x), JliJ{x))
Lukasiewicz fuzzy logic OR operator:
JlAuA{x) = min{,uA{x) + JlA{x), 1)
where max{) and mint) are the maximum operator and minimum operator, respectively. As a concrete demonstration, suppose that a specific age, say 30, is "young" (a fuzzy set) with a membership value of 0.8 and is "old" (another fuzzy set) with a membership value of 0.3. Then, the membership value for the age being "young and old" (a newly formed fuzzy set) is 0.3 if the Zadeh fuzzy AND operator is used or 0.24 if the product fuzzy AND operation is applied. By the same token, the membership value for the age being "young or old" (another newly formed fuzzy set) is 0.8 if the Zadeh fuzzy OR operator is utilized, or 1 if the Lukasiewicz fuzzy OR operation is involved.
1.3. FUZZIFICATION Fuzzy control and modeling always involve a process called fuzzification at every sampling time. Fuzzification is a mathematical procedure for converting an element in the universe of discourse into the membership value of the fuzzy set. Suppose that fuzzy set A is defined on [a,b]; that is, the universe of discourse is [a,b]; for any x E [a,b], the result offuzzification is simply Jl:4{x). Figure 1.10 shows an example in which the fuzzification result for x = 7 is 0.4.
Chapter 1 • Basic Fuzzy Mathematics for Fuzzy Control and Modeling
8
0.4
o
x
7
Figure 1.10 An example showing how fuzzification works.
1.4. FUZZY RULES A fuzzy controller or model uses fuzzy rules, which are linguistic if-then statements involving fuzzy sets, fuzzy logic, and fuzzy inference. Fuzzy rules playa key role in representing expert control/modeling knowledge and experience and in linking the input variables of fuzzy controllers/models to output variable (or variables). Two major types of fuzzy rules exist, namely, Mamdani fuzzy rules and Takagi-Sugeno (TS, for short) fuzzy rules [202].
1.4.1. Mamdani Fuzzy Rules A simple but representative Mamdani fuzzy rule describing the movement of a car is: IF Speed is High AND Acceleration is Small THEN Braking is (should be) Modest, where Speed and Acceleration are input variables and Braking is an output variable. "High," "Small," and "Modest" are fuzzy sets, and the first two are called input fuzzy sets while the last one is named the output fuzzy set. The variables as well as linguistic terms, such as High, can be represented by mathematical symbols. Thus, a Mamdani fuzzy rule for a fuzzy controller involving three input variables and two output variables can be described as follows: IF
Xl
is A AND Xl is lJ AND x3 is
C THEN ul
is
D,
Ul
is E,
(1.1)
where Xl' Xl' and x3 are input variables (e.g., error, its first derivative and its second derivative), and ul and Ul are output variables (e.g., valve openness). In theory, these variables can be either continuous or discrete; practically speaking, however, they should be discrete ~ec~us~ virtually ~ll fuzzy controllers and models are implemented using digital comyuters. A, B, C, D, and E are fuzzy sets, and AND are fuzzy logic AND operators. "IF Xl is A AND Xl is lJ AND X3 is C" is called the rule antecedent, whereas the remaining part is named the rule consequent. The structure of Mamdani fuzzy rules for fuzzy modeling is the same. The variables involved, however, are different. An example of a Mamdani fuzzy rule for fuzzy modeling is
A AND yen - 1) is lJ AND Yen AND u(n - 1) is E THEN Yen + 1) is P, IF Yen) is
2) is
C AND u(n) is iJ
(1.2)
Section 1.4. • Fuzzy Rules
9
where A, B, C, D, E, and F are fuzzy sets, y(n), y(n - 1), and y(n - 2) are the output of the system to be modeled at sampling time n, n - 1 and n - 2, respectively. And, u(n) and u(n - 1) are system input at time n and n -:- 1, respectively; y(n + 1) is system output at the next sampling time, n. + 1. Obviously, a general Mamdani fuzzy rule, for either fuzzy control or fuzzy modeling, can be expressed as IF
VI
is
81 AND ... AND vM is 8M
THEN ZI is
Wi, ... , Zp is Wp
(1.3)
where Vi' i = 1, ... , M!., is an input variable and Zj' j = 1, ... , P, is an output variable. 8i is an input fuzzy set and Wj an output fuzzy set. As mentioned earlier, for most fuzzy controllers and models, input fuzzy sets are continuous, normal, and convex and are usually of the four common types. Output fuzzy sets are most often of the singleton type. Thus, the general Mamdani fuzzy rule (1.3) can be reduced to IF where
Pj
VI
is
81 AND ... AND vM is 8M
represents singleton fuzzy set
THEN ZI is
PI' •.• , Zp
tfJ that is nonzero only at Zj =
is
pp,
(1.4)
Pj'
1.4.2. TS Fuzzy Rules Now, let us look at the so-called TS fuzzy rules. Unlike Mamdani fuzzy rules, TS rules use functions of input variables as the rule consequent. For fuzzy control, a TS rule corresponding to the Mamdani rule (1.1) is IF Xl is A AND X2 is iJ AND x3 is
C THEN
UI
= f(x1 ,x2,x3), U2 = g(XI ,x2,X3),
where fO and g() are two real functions of any type. Similarly, for fuzzy modeling, a TS rule analogous to the Mamdani rule (1.2) is in the following form: IF y(n) is A AND y(n - 1) is iJ AND y(n - 2) is AND u(n - 1) is E THEN y(n
+ 1) =
C AND u(n) is D
F(y(n),y(n - 1),y(n - 2), u(n), u(n - 1)),
where FO is an arbitrary function. In parallel to the general Mamdani fuzzy rule (1.3), a general TS rule for both fuzzy control and fuzzy modeling is IF
VI
is 81 AND ... AND
THEN z1 =fi(vI"'"
vM
is
VM)"'"
8M Zp =fp(vI"'"
(1.5) VM)'
In theory, fj() can be any real function, linear or nonlinear. It seems to be appealing to use nonlinear functions for all the rules or to use a combination of linear and nonlinear functions as rule consequent (i.e., linear functions for some rules and nonlinear ones for the remaining). In this way, rules are more general and can potentially be more powerful. Unfortunately, this idea is impractical, for properly choosing or determining the mathematical formalism of nonlinear functions for every fuzzy rule is extremely difficult, if not impossible. This difficulty is fundamentally the same as those encountered in classical nonlinear control and modeling theory. It is well known that there is no general nonlinear control or modeling theory because general nonlinear system theory has not been, and most likely will not be, established. For these reasons, linear functions have been employed exclusively in theoretical research and practical development of TS fuzzy controllers and models. We call a TS rule employing a linear (nonlinear) function TS fuzzy rule with linear (nonlinear) rule consequent.
10
Chapter 1 • Basic Fuzzy Mathematics for Fuzzy Control and Modeling
In this book, we focus only on fuzzy controllers and models that use the linear TS rule
consequent.
1.5. FUZZY INFERENCE Fuzzy inference is sometimes called fuzzy reasoning or approximate reasoning. It is used in a fuzzy rule to determine the rule outcome from the given rule input information. Fuzzy rules represent control strategy or modeling knowledge/experience. When specific information is assigned to input variables in the rule antecedent, fuzzy inference is needed to calculate the outcome for output variable(s) in the rule consequent. Mamdani fuzzy rules and TS fuzzy rules use different fuzzy inference methods. For the general Mamdani fuzzy rule (1.3), the question about fuzzy inference is the following: Given Vi = (Xi' for all i, where (Xi are real numbers, what should Zj be? For fuzzy control and modeling, after fuzzifying Vi at (Xi and applying fuzzy logic AND operations on the resulting membership values in the fuzzy rule, we attain a combined membership value, /1, which is the outcome for the rule antecedent. Then, the question is how to compute "THEN" in the rule. Calculating "THEN" is called fuzzy inference. Specifically, the question is: Given /1, how should Zj be computed? Sinc~ mathematically, the computati0I! is the same for different output variables, we use Z and W to represent, respectively, Zj and Wj in the following discussion on fuzzy inference methods. A number of fuzzy inference methods can be used to accomplish this task (e.g., [163]), but only four of them are popular in fuzzy control and modeling and we will use them only in this book [157]). They are the Mamdani minimum inference method, the Larsen product inference method, the drastic product inference method, and the bounded product inference method. We denote them by RM , RL , RDP, and RBP, respectively. The definitions of these methods are given in Table 1.1, where /1w(z) is the membership function of fuzzy set tV in fuzzy rule (1.3) and /1 is the combined membership in the rule antecedent. For a better understanding, we graphically illustrate the definitions in Fig. 1.11. The results of the four fuzzy inference methods are the fuzzy sets formed by the shaded areas. Obviously, the resulting fuzzy sets can be explicitly determined since the formulas describing the shaded areas can be derived mathematically. Among the four methods, the Mamdani method is used most widely in fuzzy control and modeling. TABLE 1.1 Definitions of Four Popular Fuzzy Inference Methods for Fuzzy Control and Modeling: (a) Mamdani minimum inference, (b) Larsen product inference, (c) drastic product inference, and (d) bounded product inference. Fuzzy Inference Method Mamdani minimum inference, RM Larsen product inference, R L Drastic product inference, R DP Bounded product inference, Rap
Definition" min(,u, ,uw(z», for all z ,u x ,uw(z), for all z ,u, for ,uw(z) = 1 ,uw(z), for,u = 1 { 0, for ,u < 1 and ,uw(z) < 1 max(,u + ,uw(z)- 1,0)
8 General Mamdani fuzzy rule (1.3) is utilized in the definitions. ,uw(z) is the membership function of fuzzy set tv representing "Hj in the rule consequent, whereas ,u is the final membership yielded by fuzzy logic AND operators in the rule antecedent.
Section 1.6. •
Defuzzification
11
Membership
Figure 1.11 Graphical illustration of the definitions of the four popular fuzzy inference methods whose mathematical definitions are provided in Table 1.1: (a) the Mamdani minimum inference method, (b) the Larsen product inference method, (c) the drastic product inference method, and (d) the bounded product inference method.
Membership
z Figure 1.12 For Mamdani fuzzy controllers and models using singleton fuzzy sets in the rule consequent, the outcome of using the four different inference methods is identical.
As stated above, typical Mamdani fuzzy controllers and models employ singleton output fuzzy sets as the rule consequent (see rule (1.4). Under this condition, the four different inference methods produce the same inference result, as shown in Fig. 1.12. For TS fuzzy rules, fuzzy inference is simpler and only one method exists . For general TS fuzzy rule (1.5), the result of the fuzzy inference is Jl xfj(v\ •...• vM) for Zj ' Instead of viewing this as a fuzzy inference result, one may also think of it as the rule consequent being weighted by the combined membership value from the rule antecedent.
1.6. DEFUZZIFICATION Defuzzification is a mathematical process used to convert a fuzzy set or fuzzy sets to a real number. It is a necessary step because fuzzy sets generated by fuzzy inference in fuzzy rules must be somehow mathematically combined to come up with one single number as the output of a fuzzy controller or model. After all, actuators for control systems can accept only one value as their input signal, whereas measurement data from physical systems being modeled are always crisp.
12
Chapter 1 •
Basic Fuzzy Mathematics for Fuzzy Control and Modeling
Every fuzzy controller and model uses a defuzzifier, which is simply a mathematical formula, to achieve defuzzification. For fuzzy controllers and models with more than one output variable, defuzzification is carried out for each of them separately but in a very similar fashion. In most cases, only one defuzzifier is employed for all output variables, although it is theoretically possible to use different defuzzifiers for different output variables. Different types of defuzzifiers are suitable for different circumstances; below, we present some of the more popular ones. Since most fuzzy controllers and models use singleton fuzzy sets in the fuzzy rule consequent, our presentation will concentrate on singleton output fuzzy sets. Nonetheless, extending the discussion to nonsingleton fuzzy sets is straightforward.
1.6.1. Generalized Defuzzifier The generalized defuzzifier represents many different defuzzifiers in one simple mathematical formula [64]. Assume that the output variable of a fuzzy controller or model is z. Suppose that evaluating N Mamdani fuzzy rules using some fuzzy inference method produces N membership values, J11' ... , J1N' for N singleton output fuzzy sets in the rules (one value for each rule). Let us say that these fuzzy sets are nonzero only at z = PI' ... , PN. The generalized defuzzifier produces the following defuzzification result: N
LJ1ic·Pk
k=l
z=--N--
(1.6)
LJ1ic
k=l
where ex is a design parameter. Continue the above case, but assume that the fuzzy controller or model uses TS rules instead. Let us say that the rule consequents in the N fuzzy rules are gk(v 1 , ••• , VM), k = 1, ... ,N; then defuzzification outcome is achieved using the generalized defuzzifier N
L J1ic X gk(vI'···' vM) k=l z= --------
(1.7)
1.6.2. Centroid Defuzzifier, Mean of Maximum Defuzzifier, and Linear Defuzzifier
Different types of defuzzifiers are realized using different ex values in the generalized defuzzifier, where 0 ::::; ex + 00. When ex = 1, the most widely used centroid defuzzifier is obtained. The defuzzifier is of the centroid type because it computes, in a sense, the centroid of the singleton fuzzy sets from different rules. The occasionally used mean of maximum defuzzifier is realized when ex = 00.
13
Exercises
A few studies in the literature use a linear defuzzifier. When Mamdani fuzzy rules are involved, the defuzzification result is N
Z
=
L, Ilk
k=1
X
13k'
(1.8)
On the other hand, for TS fuzzy rules, we get Z
=
N
L, Ilk
k=1
X
gk(Vl, ... , VM)'
The difference is obvious: A linear defuzzifier does not have the denominator. We will use the centroid defuzzifier and generalized defuzzifier only in this book because of their popularity. 1.7. SUMMARY
This chapter introduces the concept of fuzzy sets and their advantages over the classical sets. Also presented are concepts and notations of different types of fuzzy sets and fuzzy logic operations. The common building blocks of typical fuzzy controllers and models are described. They include fuzzification, fuzzy rules, fuzzy inference, and defuzzification. 1.8. NOTES AND REFERENCES
There are a number of introductory textbooks on fuzzy set theory and fuzzy systems (e.g., [101][102][242][293]). Fuzzification, fuzzy rules, fuzzy inference, and defuzzification are basic components of a typical fuzzy system, fuzzy controller, or fuzzy model. More information on these segments can be found in these books as well. A brief history of fuzzy sets, fuzzy logic, and fuzzy systems is given in [151]. EXERCISES 1. List some concepts in our daily lives that cannot be accurately described by conventional sets but can be by fuzzy sets.
2. Graphically draw your definitions of continuous fuzzy set "young" in some different circumstances. Can they be described by mathematical formulas? If not, can you approximate your definitions by formulas? Do your definitions belong to the four common types of fuzzy sets mentioned in this chapter? 3. Answer the same questions as in Problem 2 for continuous fuzzy set "middle age." 4. For the fuzzy sets that you defined in the above two problems, what are their supports, heights, and centers? Are they normal? Are they convex?
5. Derive two new fuzzy sets "young and middle age" and "young or middle age" from the fuzzy sets established in Problems 2 and 3. Use different fuzzy logic AND and OR operators discussed in this chapter. Do this exercise graphically and mathematically, if possible. 6. Describe a fuzzy integer 5 using the Gaussian fuzzy set (i.e., use the Gaussian formula in statistics). How do you use a singleton fuzzy set to represent integer 5? 7. What are the apparent similarities between fuzzy set and probability? What are the fundamental differences between them? What are the implications of the differences to application?
14
Chapter 1 • Basic Fuzzy Mathematics for Fuzzy Control and Modeling 8. Make some Mamdani fuzzy rules and TS fuzzy rules of your own. Which type would you prefer? Why? 9. Is it meaningful to compare the effects of the different defuzzifiers? If yes, how can you compare them? If no, why? 10. If the same questions as Problem 9 are asked for the different fuzzy inference methods, what are your answers?
Introduction to Fuzzy Control and Modeling
2.1. INTRODUCTION Fuzzy set theory has been used successfully in virtually all the technical fields, including control, modeling, image/signal processing, and expert systems. The most successful and active field, however, is fuzzy control. In this chapter, we first introduce configuration and operation of typical fuzzy controllers and models, both the single-input single-output (8180) type and the multipleinput single-output (M180) type. We then show that fuzzy controllers and fuzzy models are actually conventional nonlinear controllers and nonlinear models, respectively, with peculiar but advantageous structural changes with input state. Based on this insightful view, we point out the advantages and disadvantages of fuzzy control and modeling and indicate when they should be utilized in practice. Finally, we discuss various analytical issues in fuzzy control and modeling.
2.2. WHY FUZZY CONTROL The world's first fuzzy controller was developed by Professor E. H. Mamdani at the University of London in 1974 [141]. The concept and theoretical foundation of fuzzy control and systems, however, had been developed by Professor L. A. Zadeh a few years earlier (e.g., [279][280][281 ]). The primary thrust of this novel control paradigm is to utilize the human control operator's knowledge and experience to intuitively construct controllers so that the resulting controllers can emulate human control behavior to a certain extent. Compared to the traditional control paradigm, the advantages of the fuzzy control paradigm are twofold. First, a mathematical model of the system to be controlled is not required, and, second, a satisfactory nonlinear controller can often be developed empirically in practice without complicated mathematics. The core value of these advantages is the practicality. Of course, as
15
16
Chapter 2 • Introduction to Fuzzy Control and Modeling
for any paradigms, no technological advantages or benefits come without tradeoffs and pitfalls; fuzzy control is no exception. We discuss them in detail later in this chapter. Proper use of fuzzy control can significantly shorten product research and development time with reduced cost. Since the mid-1980s, companies around the world, particularly those in Japan, have utilized fuzzy control extensively to make better, cheaper, and smarter products. Many of them are commercially available on the market, including fuzzy controlled auto-focus cameras, fuzzy controlled image stabilizer video cameras, fuzzy controlled air conditioners, and fuzzy controlled automobiles, to name just a few (e.g., [120][146] [196][243]).
2.3. CONVENTIONAL MODELING System modeling and system control are two closely related areas. In order to design a conventional controller for controlling a physical system, the mathematical model of the system is needed. A common form of the system model is differential equation for continuous-time systems or difference equation for discrete-time systems. Strictly speaking, all physical systems in existence are nonlinear. Unless physical insight and the laws ofphysics can be applied, establishing an accurate nonlinear model using measurement data and system identification methods is difficult in practice. Nonlinear systems are complex; worse yet, no general theory exists for modeling them. Though difficult, different nonlinear system modeling techniques have still been developed, including the Volterra and Wiener theories of nonlinear systems. Such developed nonlinear system models are called black-box models because they only attempt to mimic the system's input-output relationship with the measurement data and hence can hardly provide any insight on the internal structure of the system. As an alternative, nonlinear systems are usually modeled as (piecewise) linear systems. This approach is sometimes oversimplistic, and it fails to capture diverse and peculiar nonlinear system behaviors, such as limit circles, chaos, and bifurcation. A variety of techniques rely on input-output measurement data to establish a linear discrete-time system model linking input variables to output variables of the system. The popular linear model types include AR (Auto Regressive), ARX (Auto Regressive with eXtra input) and ARMA (Auto Regressive Moving Average), and they are different types of difference equations [135]. These models are black-box models. The linear system models are often adequate for control system development. The whole knowledge base of linear control theory, from classic linear proportional-integralderivative (PID) control to modem linear robust control, has been developed based mainly on the notation of linear system models. Once designed, control performance and system stability, as well as other properties of the linear control system, can usually be examined mathematically. This is because these linear models are difference equations and thus can be analyzed in detail. Whether this linear control development approach will succeed in practice depends largely on whether the linear model captures the essence of the nonlinear physical system and whether it is a reasonable representation and approximation of the physical system. For any modeling problems, linear or nonlinear, two tasks need to be accomplished. The first task is model structure identification, and the second is model parameter identification. Linear system modeling is relatively easy in that there already exists a set of model structures to choose from (e.g., AR, ARX, or ARMA). Once the structure is selected, the
Section 2.6. •
Typical SISO Mamdani Fuzzy Controllers
17
model parameters can be found using the system's input-output data and some system optimization procedures. Nonlinear system modeling, however, is far more complicated because an infinite number of possible model structures exist. Correctly assuming a nonlinear model structure is a very difficult problem in nonlinear system modeling theory. One of the latest advances in this field is the development of artificial neural network system models, which are nonlinear and black box in nature (e.g., [180]). The primary merit of this new approach is that model structure is not preassumed and a neural network can learn it from the system's input-output data. The major drawbacks are: (1) a large amount of training data and long training time are required, and (2) a neural network model can hardly be analytically analyzed or related to the conventional modeling theory.
2.4. WHY FUZZY MODELING Fuzzy modeling is another new modeling paradigm for nonlinear systems. Fuzzy models are nonlinear dynamic models. Compared with the conventional black-box modeling techniques, linear or nonlinear, which can only utilize numerical data, the fuzzy modeling approach is unique in its ability to utilize both qualitative and quantitative information [240]. This advantage is practically important and even crucial in many circumstances. Qualitative information is human modeling expertise and knowledge, which are captured and utilized in the form of fuzzy sets, fuzzy logic, and fuzzy rules. The expertise and knowledge are actually nonlinear structures of physical systems, and the structures are represented in an implicit and linguistic form rather than an explicit and analytical form, as dealt with by the conventional system modeling methodology. Numerous applications have shown the power of fuzzy dynamic modeling. Fuzzy models are more intuitive and easier to understand than neural network models because fuzzy sets, fuzzy logic, and fuzzy rules are all intuitive and meaningful. However, fuzzy models are not as simple as those models that can be expressed in mathematical formulas. In general, fuzzy models should be regarded as black-box models. Under certain conditions, the analytical structure of some fuzzy models can be derived, depending on their configurations. When this is the case, a fuzzy model is no longer a black box.
2.5. TWO TYPES OF FUZZY CONTROL AND MODELING: MAMDANI TYPE AND TS TYPE The two major types of fuzzy controllers are Mamdani type and TS type [202]. The classification depends on the type of fuzzy rules used. If a fuzzy controller or fuzzy model uses the TS type of fuzzy roles, the fuzzy controller or fuzzy model is called the TS fuzzy controller or TS fuzzy model. Otherwise, the controller or model is named the Mamdani fuzzy controller or model. We will first study a typical SISO Mamdani fuzzy controller. Much of the contents hold for MISO Mamdani fuzzy controllers, SISO TS fuzzy controllers, and MISO TS fuzzy controllers, which are examined later in this chapter.
2.6. TYPICAL SISO MAMDANI FUZZY CONTROLLERS Figure 2.1 depicts the structure of a fuzzy control system, which is comprised of a typical SISO Mamdani fuzzy controller and a system under control. The system may be linear or
18
Chapter 2 • Introduction to Fuzzy Control and Modeling
r------------------------------------------------------1
I I I I
,
Typical SISO Mamdani fuUJ' controller
, I
I I I I I I
De~ired output trajectory S(n) I
r------:ll...------,
,+ I I
~--
--------------------------------------------------Figure 2.1 Structure of a SISO Mamdani fuzzy control system, which is comprised of a typical Mamdani fuzzy controller and a system under control.
nonlinear, and its model mayor may not be mathematically known. Virtually all the realworld fuzzy controllers use digital computers for implementations. Hence, fuzzy controllers are discrete-time controllers. For practical purposes, there is no point in considering fuzzy controllers as continuous-time controllers, and we certainly will not do so in this book. The major components of the typical fuzzy controller are fuzzification, fuzzy rule base, fuzzy inference, and defuzzification. They have been described individually in the previous chapter, and we now explain how they operate together to make a fuzzy controller work.
2.6.1. Fuzzification In Fig. 2.1, system output is designated by y(n), where n is a positive integer. The sampling time is nT, where Tis the sampling period. However, as a notational convention, we will use n instead of nT to represent sampling time throughout the book. The desired system output trajectory is denoted as S(n), which can be either constant or time-varying. At time n, y(n) and S(n) are used to compute the input variables of the fuzzy controller. In many cases, error and change of error (for convenience we call it rate) ofy(n) are used as input variables. There are two input variables only because the number of fuzzy rules needed increases dramatically with the increase of the number of input variables (we will explain this in detail later in this chapter). The input variables then are e(n) = S(n) - y(n),
(2.1)
r(n) = e(n) - e(n - 1) = y(n - 1) - y(n).
(2.2)
Both e(n) and r(n) have their ranges, and we assume them to be [at ,btl and [a2,b 2], respectively, which are their respective universes of discourse. Scaling factors are used to scale the input variables before fuzzification (They are called input scaling factors). The purpose is to make fuzzy controller design easier. With them, input fuzzy sets are defined on the scaled universes of discourse instead of on [at ,btl and [a2,b 2]. This allows one to conveniently manipulate the effective fuzzification of the input variables by
Section 2.6. •
19
Typical SISO Mamdani Fuzzy Controllers Membership
Negative Large
Negative Small
Positive Small
Positive Large
0.6 t------+----~-~ 0.21-----lF---
---+
__
E(n)
-4
-2
o
2
2.4
4
Figure 2.2 Illustration of how input variables are fuzzified by input fuzzy sets.
simply changing the values of the scaling factors. Assume the scaling factors for error and rate are K; and K r , respectively. The scaled error is (2.3) and the scaled rate is (2.4) Without loss of generality, E(n) and R(n) are assumed to be defined on [At,Btl and [A 2,B2 l, respectively. The scaled variables are then fuzzified by input fuzzy sets. Input fuzzy sets are fuzzy sets that are defined on [At,Btl and [A2,B2 l. Two arrays offuzzy sets are needed: one for E(n) and the other for R(n). Figure 2.2 shows four input fuzzy sets for E(n) that are hypothetically used by the fuzzy controller. The membership functions are purposely selected as a mixture of three different types, namely, triangular, trapezoidal, and bell-shaped. The use of "Positive" and "Negative" in the linguistic names is necessary because e(n) and r(n) can be positive and negative. Suppose that K; = 2 and at time n = n*, e(n*) = 1.2. Then, E(n*) = 2.4. The fuzzification results, shown in Fig. 2.2, are membership value 0.2 for fuzzy set Positive Small and 0.6 for Positive Large. The membership values for Negative Small and Negative Large are O. Fuzzification can be formulated mathematically. For mathematical convenience, the linguistic naming system should be replaced by a numerical index system. For instance, o~e ~y us_e Ai' i = -2, -1,1,2, to represent the four fuzzy sets for E(n). Thus, {A_ 2 , A_ t, At, A 2 } symbolize {Negative Large, Negative Small, Positive Small, and Positive Large}. Such an indexing system is essential as it makes mathematical analysis of fuzzy control and modeling possible. Now, the example fuzzification of e(n*) = 1.2 can be described as JJA 2 (e(n*) = 0.6,
(2.5)
JJA 1 (e(n*» = 0.2,
(2.6)
JJA -I (e(n*)) = 0,
(2.7)
JJA -2 (e(n*) = O.
(2.8)
20
Chapter 2 •
Introduction to Fuzzy Control and Modeling
Now, let us look at fuzzification of R(n). The fuzzy controller supposedly uses fuzzy sets {.8-2, .8-1, .80' .8 1, .82} for R(n), which symbolize {Negative Large, Negative Small, Approximately Zero, Positive Small, and Positive Large}. The specific definitions of these fuzzy sets are not given, as they are unimportant for the point we are going to make. Assume that R(n*) = 3.5 is computed from r(n*) = 7 and K; = 0.5 and that the fuzzification results are
Jlil2 (r(n*)) = 0,
(2.9)
Jlil l (r(n*)) = 0,
(2.10)
Jlilo(r(n*)) = 0.3,
(2.11)
Jlil -1 (r(n*)) = 0.5,
(2.12)
Jlil -2 (r(n*)) = O.
(2.13)
Having shown concrete examples, let us consider some important and practical design issues. First, input fuzzy sets must cover entire scaled universes of discourse so that any value of input variables will produce at least one nonzero membership value. The number of input fuzzy sets, and their linguistic names and shapes are design parameters determined by the fuzzy controller developer. The basis for the developer's decision includes the characteristics of the system to be controlled, the control operator's knowledge of and experience with the system, the developer's experience with fuzzy control, and personal preference. At present, proper determination of the design parameters is, to a great extent, more an art than a science. No mathematically rigorous formulas or procedures exist to accomplish the design of input fuzzy sets. What do exist in the literature are rules of thumb and empirical knowledge accumulated through many years of practice and studies. Generally, two to 13 fuzzy sets are used for each input variable; a larger number is uncommon. Different numbers of fuzzy sets may be used for different input variables. The shape of fuzzy sets may be different for the same input variable or different input variables. Each input fuzzy set is assigned a linguistic name, preferably unique. The common names include Negative Large, Negative Medium, Negative Small, Approximately Zero, Positive Small, Positive Medium, and Positive Large. They are often abbreviated as NL, NM, NS, AZ, PS, PM, and PL, respectively. Of course, one may employ any other linguistic names. Different naming will not affect the fuzzification result as long as the membership functions remain unchanged. As stated in Chapter 1, the most widely used types of input fuzzy sets are triangular, trapezoidal, Gaussian, and bell-shaped. Regardless of the shape, input fuzzy sets are usually required to be so positioned that (1) any two adjacent membership functions overlap once and (2) at any sampling time, two nonzero membership values are yielded by fuzzification of each input variable. The rationale behind the requirements is to limit the number of fuzzy rules executed at any time to an adequate level. These two requirements are unachievable, however, for Gaussian input fuzzy sets, for a Gaussian function has two infinitely long "tails." This type of fuzzy set is used in the literature largely because the function and its derivatives are smooth and continuous, making the mathematical analysis more tractable and simpler than the other three types of membership functions.
Section 2.6. •
21
Typical SISO Mamdani Fuzzy Controllers
2.6.2. Fuzzy Rules Fuzzification results are used by fuzzy logic AND operations in the antecedent of fuzzy rules to make combined membership values for fuzzy inference. Before we can discuss fuzzy logic operations and fuzzy inference in the next section, we first need to study fuzzy rules. An example of a Mamdani fuzzy rule is IF E(n) is Positive Large AND R(n) is Negative Small
(2.14)
THEN u(n) (or L\u(n)) is Positive Medium,
where Positive Large and Negative Small are input fuzzy sets and Positive Medium is an output fuzzy set. The output variable can either be fuzzy controller output, u(n), or increment of controller output, L\u(n). In essence, rule (2.14) states that if system output is significantly smaller than the desired system output and system output is decreasing slowly, the controller output should be positive medium (or the increment of controller output should be moderate, if L\u(n) is used in the rule consequent instead). Throughout this book, we use u(n) and L\u(n) to represent, respectively, the. output and incremental output ofa fuzzy controller. The scaled versions are denoted as U(n) and L\U(n), respectively (see below). The quantity, linguistic names, symbolic names, and membership functions of output fuzzy sets are all design parameters determined by the controller developer. Linguistic names are similar to those of input fuzzy sets; they can be symbolized as well in similar fashion. In theory, output fuzzy sets can be any shape. Nevertheless, numerous successful applications of fuzzy control have led to the extensive use of singleton fuzzy sets. Figure 2.3 shows five example singleton output fuzzy sets. Using singleton fuzzy sets is by no mean restrictive, both mathematically and functionally. Because of their enormous popularity and practicality, we will study mostly the fuzzy controllers using singleton output fuzzy sets. The number of output fuzzy sets relates to the number of input fuzzy sets. If there are N, and N2 distinct input fuzzy sets for E(n) and R(n), respectively, then there are N, x N 2 different combinations of the input fuzzy sets. Thus, N, x N 2 different fuzzy rules are needed. Subsequently, up to N, X N2 different output fuzzy sets may be required. But usually the actual amount in practice is markedly less than this maximum. Fuzzy rules are often so designed that some of them use the same output fuzzy sets, reducing significantly the number Membership Negative Large
Negative Small l
l
1
Positive Medium
Positive Very Large
l
Approximately Zero
u(n) or Au(n)
-6
-4.5
-3
-1.5
o
3 3.5
6
Figure 2.3 Example of singleton fuzzy sets as output fuzzy sets for Mamdani fuzzy controllers.
22
Chapter 2 • Introduction to Fuzzy Control and Modeling
of different output fuzzy sets needed. The number of output fuzzy sets ranges from three to seven; a larger quantity is usually unnecessary. A modest amount of fuzzy rules usually suffices for a typical fuzzy controller. The exact quantity is determined by the number of input fuzzy sets. A N, x N 2 two-dimensional table is often used to conveniently represent N, x N 2 rules; but this table scheme is not applicable when more than two input variables are involved. Given a particular application, the controller developer and/or the expert operating the system may design fuzzy rules. Rule design is an empirical process that depends partially on trial-and-error effort. There does not exist a set of fuzzy rules universally applicable to any system with guaranteed superior control performance. Using the numerical indexing system, a general fuzzy rule is expressed as IF E(n) is Ai AND R(n) is Bj THEN u(n) (or ~u(n» is Vk'
(2.15)
If Vk is a singleton fuzzy set that is nonzero only at u(n) = Vk (or ~u(n) = Vk), where Vk is a real number, then the general rule becomes IF E(n) is Ai AND R(n) is Bj THEN u(n) (or ~u(n» is Vk'
(2.16)
For any fuzzy rule, the output fuzzy set is always related to input fuzzy sets in certain ways because the rule represents knowledge or experience of human beings. For instance, in rule (2.14), output fuzzy set Positive Medium is linked to input fuzzy set Positive Large for ~(n) and Negative Small for R(n). More generally, in rule (2.1~, Vk depends on Ai and Bj ; this dependence can be represented by relating the indexes of Ai and Bj to Vk as follows. (The same can be said of rule (2.15), but we will not go into detail as it does not use the singleton output fuzzy set.) IF E(n) is Ai AND R(n) is Bj THEN u(n) (or ~u(n») is JfOJ)'
(2.17)
where k = f(i,}). fO can be any function of i and} as long as its value is an integer at every combination of i and}, because the index for Vk must be integer. Without loss of generality, we introduce another function h(i,}) and let h(i,}) = JfOJ) = Vk'
(2.18)
Obviously, he) can be any function, and its value at i and} does not have to be integer. Now, fuzzy rule (2.17) can be expressed as IF E(n) is Ai AND R(n) is Bj THEN u(n) (or ~u(n») is h(i,}). At any sampling time, usually only a handful of fuzzy rules are activated. A fuzzy rule is activated if, after fuzzification.jhe membership values of the input fuzzy sets for E(n) and R(n) are both not zero for the rule. An activated rule contributes its share in calculation of new controller output. If, on the other hand, either of the membership values is zero, the rule will not be activated and subsequently will make no contribution. This principle of determining rule activation applies to all the fuzzy rules.
Section 2.6. •
Typical SISO Mamdani Fuzzy Controllers
23
Let us continue our concrete demonstration. For the fuzzification results in the last section, among the total 20 fuzzy rules (i.e., Nt = 4 and N 2 = 5), only the following four will be activated at time n *: IF E(n) is At AND R(n) is B_ 1 THEN u(n) (or Au(n)) is h(I,-I)
(2.19)
IF E(n) is At AND R(n) is Bo THEN u(n) (or Au(n)) is h(I,O)
(2.20)
IF E(n) is A2 AND R(n) is s, THEN u(n) (or Au(n)) is h(2,-I) IF E(n) is A2 AND R(n) is Bo THEN u(n) (or Au(n)) is h(2,0).
(2.21) (2.22)
Because of the fuzzification, at time n* the membership values for E(n) is At, E(n) is A2, R(n) is B_ t , and R(n) is Eo are 0.2, 0.6, 0.5, and 0.3, respectively (see (2.5) to (2.13)). These membership values now need to be combined by fuzzy logic AND operations. In fuzzy control, the most widely used AND operators are the Zadeh AND operator and the product AND operator. Using other types is rare. For any specific fuzzy controller, it is customary to employ only one type of AND operator for all the fuzzy rules. The reason is perhaps to keep fuzzy rules and hence controllers simple. Theoretically, a mixture of different fuzzy AND operators may be used in different fuzzy rules and/or in a fuzzy rule if three or more input variables are involved.
2.6.3. Fuzzy Inference The membership values produced by fuzzification are first combined by fuzzy logic AND operation in the rule antecedent. The result is then related to the (singleton) output fuzzy set by fuzzy inference (Fig. 2.1). The most popular inference method in fuzzy control is the Mamdani minimum inference method. As pointed out in Chapter 1, the four common inference methods produce the same inference result if the output fuzzy set is singleton. For the four fuzzy rules (2.19) to (2.22), using the Zadeh fuzzy logic AND operator and anyone of the four inference methods yields the following inference results: JlZt = min(JlA 1 (e(n*)), JlB_ 1(r(n*))) = min(0.2, 0.5) = 0.2 for h(l, -1), JlZ2 = min(JlA 1 (e(n*)), JlBo(r(n*))) = min(0.2, 0.3) = 0.2 for h(1,0), JlZ3
= min(JlA
2(e(n*)),
JlB_1(r(n*))) = min(0.6, 0.5)
= 0.5
JlZ4 = min(JlA2(e(n*)), JlBo(r(n*))) = min(0.6, 0.3) = 0.3
for h(2,-I), for h(2,0).
If the product fuzzy logic AND operator is used instead, the inference results will be: Jlpt
= JlA 1(e(n*))
Jln = JlA 1(e(n*)) JlP3 = JlA2(e(n*)) Jlp4
= JlA
2(e(n*))
= 0.2 x 0.5 = 0.1 x Jl.Bo(r(n*)) = 0.2 x 0.3 = 0.06 x Jl.B_1(r(n*)) = 0.6 x 0.5 = 0.3 x Jl.Bo(r(n*)) = 0.6 x 0.3 = 0.18 x JlB_ 1(r(n*))
for h(l, -1), for h(I,O), for h(2,-I), for h(2,0).
Conceptually, anyone of these inference results may be thought as the singleton output fuzzy set weighted (or scaled) by the membership value combined by the fuzzy logic AND operation. If output fuzzy sets in some rules are the same, fuzzy logic OR operation is sometimes used to combine the memberships. This step, however, is not essential; many fuzzy controllers
24
Chapter 2 •
Introduction to Fuzzy Control and Modeling
can function properly without it. We will investigate both cases in this book. The commonly used types are the Zadeh fuzzy logic OR operator and the Lukasiewicz fuzzy logic OR operator. We now demonstrate the calculation by continuing the above example. Suppose that rules (2.20) and (2.21) employ the same singleton fuzzy set. This is to say, suppose that we let h(I,O) = h(2,-I). Subsequently, we need to combine the two membership values, and the outcomes are membership values for h(l, 0) (equivalently for h(2,-I)): (1) if the Zadeh fuzzy logic OR and AND operators are used, J.lZORl = max(J.lz2,J.lz3)
= max(0.2,0.5) = 0.5;
(2) if the Zadeh fuzzy logic OR operator and the product fuzzy logic AND operator are used, J.lZOR2
= max(J.ln,J.lP3) =
max(0.06,0.3)
= 0.3;
(3) if the Lukasiewicz fuzzy logic OR operator and the Zadeh fuzzy logic AND operator are used, J.lLORI
= min(J.lz2 + J.lz3,1) =
min(0.2
+ 0.5,1)
= 0.7;
(4) if the Lukasiewicz fuzzy logic OR operator and the product fuzzy logic AND operator are used, J.lLOR2 = min(J.ln
+ J.lp3,1) =
min(0.06
+ 0.3,1)
= 0.36.
2.6.4. Defuzzification The membership values computed in fuzzy inference are finally converted into one number by a defuzzifier. The most prevalent defuzzifier is the centroid defuzzifier. In the following example, calculations with the centroid defuzzifier, we assume, without losing generality, h(I,-I) = 10, h(l,O) = h(2, -1) = 5, h(2,0) = 8, K u = 1, and K~u = 1. If the Zadeh fuzzy logic AND and OR operators are used, the defuzzifier output at time n* is
U(n*)
= K, Ilzl ·h(1, -I) + IlZORl ·h(1,O) + IlZ4 ·h(2,O) = J.lzl
+ J.lZORl + J.lz4
6.9,
(2.23)
where K u is an output scaling factor for u(n). The defuzzification result is the same if L\u(n) is employed in the rule consequent: One only needs to replace U(n*) by L\U(n*) and K u by K~u, a scaling factor, in the above equation. Using K~u is for notational consistence. If the product fuzzy logic AND operator and the Zadeh fuzzy logic OR operator are employed by the fuzzy rules,
U(n*) = K; Ilzl ·h(I,-I) + IlZOR2 ·h(I,O) + IlZ4 ·h(2,O) = 7.375. J.lzl
+ J.lZOR2 + J.lz4
(2.24)
Defuzzification results for the other two combinations of fuzzy logic AND and OR operators in the last section can easily be obtained. As said earlier, not all fuzzy controllers use fuzzy logic OR operations to combine the membership values for the like output fuzzy sets. Some fuzzy controllers use the membership
N
(II
fuzzy rule (2.22)
fuzzy rule (2.21)
fuzzy rule (2.20)
fuzzy rule (2.19)
E(n)
..
~
B.
o
2(II +JI + 1) + (I2 +J2 + 1)](1
= K/(M,M) (el(n) _
(II
:~)(~~ 1)'
:~.5)j +K~(M,M)(rl(n) _
+ ()I [Kl(M,M) (e2(n) _
(12 ~.5)S)
+K;(M,M) (r2(n) - (J2 ~.5)j AU},I(M,M) = ()2[ Kl(M,M) (el(n) _ (II +K;(M,M) (rl(n) - (JI
+~(M,AR)(r2Cn) _ In these expressions, I
where
= (11,12) ,
J.
:~.5)S)
:rS)j]+
Ki(M,M)(e2(n) _ (12 ~.S)S)
(J2 ~.5)S).
J = (J1 , J 2 ) , M
= (M1,M2 ) ,
and AR = (AR 1 , AR 2 )
+ 0.5)8, (JI + 0.5)8, (12 + 0.5)8, (J2 + 0.5)8.
M 1(n) = E 1(n) - (II M 1(n) = R 1(n) M 2 (n) = E2 (n) M 2 (n) = R2 (n) -
The variable proportional-gains of the local nonlinear PI controllers are I
=
2
=
3
=
Kp(M,AR) Kp(M,AR) Kp(M,AR) 4
Kp(M,AR) =
(JI :~.S)S)
K!·KAu ·H 2L(1 ~ e»
PI (AE,M),
K; ·KAu1 ·H ·1()t1 U(1 + e» P2(M,AR),
K!.KAu2 · H
2L(1 + e»
K;·KAu ·H U(1'; e»
· I()2 1
PI (AE,AR),
P2(AE,M),
98
Chapter 4 • Mamdani Fuzzy Controllers of Non-Pill Type
whereas the variable integral-gains are
PI (M,M) and P2(M,M) are as follows:
PI (M,M) =
N1(M,M) '¥(M,M) ,
where
N1(M,M) = 2S8 - S2(1 - 0)(0.5st + 2AE~S2 + 8AE~R~ + 2M~)(AEIMI + 0.45S2), N2(M ,M ) = 2S8 - S2(1 - 0)(0.5~ + 2AErS2 + 8AErMi + 2Mi)(AE2M2 + 0.25S2), \P(M,M) = (1.9375 + 0.06250)S8 - (1 - 0)[0.25S2(AEr + Mi)(st + 2AE~S2
+ 16AE~M~ + 2M~S2) + 0.25S2(AE~ + AR~)(st + 2AErS2 + 16AErARi + 2ARiS2) + (AErMi + AE~AR~)st + 16AErARiAE~AR~].
The detailed derivation of this structure and analysis of the gain variation characteristics can be found in [262].
4.9. TYPICAL FUZZY CONTROLLER WITH NONLINEAR FUZZY RULES 4.9.1. Fuzzy Controller Configuration In this section, we study a fuzzy controller whose configuration is the same as the one in Section 4.4 except for the following two differences. First, nonlinear fuzzy rules are employed. Second, trapezoidal input fuzzy sets are used. Both extensions make the present fuzzy controller much more general and also make the fuzzy controllers in the earlier sections, which use triangular input fuzzy sets and linear rules, its special cases.
99
Section 4.9 . • Typical Fuzzy Controller with Nonlinear Fuzzy Rules
Membership
~OO
~
i
NOO
~~ r::
\
,
\ \
\
\
\
E(n)
\
o -JS
-(J-l)S
(i-l)S
is
(i+l)S
(i+2)S
(J-l)S
JS
R(n)
Figure 4.6 2J + 1 uniformly distributed trapezoidal input fuzzy sets.
The locations of the N = 2 J + 1 uniformly distributed trapezoidal input fuzzy sets are identical to the triangular ones, and their shapes are described by (see Fig. 4.6): for -J+l ~i~J-l, 0,
(1)
x-(i-l)S S-A
(i-l)S~x~i·S-A
1,
Jli(X) =
x < (i - I)S
i·S-A~x~i·S+A
x-(i+l)S S-A
i · S + A ~ x ~ (i x > (i
0,
+ I)S
+ I)S
for i = J or i = -J,
(2)
JlAx) =
{
0, x - (J - I)S S-A'
x < (J - I)S
1,
J .S - A
(J-l)S~x~J·S-A ~
x
(-J+l)S
where 2A and 2S are the upper and lower bases of the trapezoid, respectively. We also use the ratio of the upper and lower bases of the trapezoid
o=~s to quantitatively characterize the membership functions. When 0 = 0 (or equivalently, A = 0), a triangular membership function results. To avoid intersection of two adjacent upper bases, we restrict 0 .s A ~ 0.5S, making 0 s 0 .s 0.5. The fuzzy controller uses N 2 nonlinear fuzzy rules obeying the following format: IF E(n) is Ai AND R(n) is Bj THEN L1u(n) isf(iJ)V,
(4.11)
100
Chapter 4 • Mamdani Fuzzy Controllers of Non-PID Type
where f can be any function as long as its value is integer with respect to all combinations of i and j. The role of f is to generate the fuzzy rules, linear or not, desired by the designer; different rules can be generated by using different f. Fuzzy rules are nonlinear if they are generated by f that is the nonlinear function of i and j. Using f is more general, systematic, and concise than the common way of describing fuzzy rules in the form of a rule table. In addition, it makes mathematical manipulation easier. The number of output fuzzy sets obviously depends on f. We use W=2K+l
uniformly distributed singleton output fuzzy sets, where K = maxt] f(iJ) I),
-J
.s i, j .s J.
K fuzzy sets are for positive ~u(n), another K sets are for negative Jiu(n), and the remaining one is for near zero ~u(n). The distance between two adjacent fuzzy sets is
H
H
V=2K=W-l·
The configuration of this fuzzy controller is typical.
4.9.2. Derivation and Resulting Structure We first reveal its structure by the following theorem and then explain how to derive it. Theorem 4.3. The structure of the typical fuzzy controller using nonlinear fuzzy rules is the sum of a global nonlinear controller, ~UG(i,j), and a local nonlinear PI controller, ~UL(M,M):
~U(n)
The expressions for ~UG(i,j) and shown in Fig. 4.7. In the tables,
PI(M,M)=
P2(M,M) =
P3(M,M) =
= ~UG(i,j) + ~UL(M,M).
~UL(M,M)
are given in Tables 4.6a--e, and the ICs are
S 28 _ 2 IAE(n)I,
for ICI, IC2, IC5, and IC6
S 28 _ 2IM(n)1 '
for IC3, IC4, IC7, and IC8,
S (2.SS -A) - 2IM(n)1 - IM(n)1 '
for ICl', IC2', ICS', and IC6'
S (2.SS -A) - IM(n)1 - 2IM(n)I'
for IC3', IC4', IC7', and ICg',
S (1.58 -A) -IM(n)I'
for IC9, ICIO, IC13, and ICl4
S (1.58 -A) -IM(n)I'
for ICll, ICI2, ICI5, and ICI6,
C 1(iJ) = O.S[f(i + l,j + 1) - 3f(i + l,j) + f(iJ C 2(iJ) = O.S[f(i + l,j + 1) + f(i
+ l,j) -
+ 1) + f(iJ)], 3f(i,j + 1) + f(iJ)].
101
Section 4.9. • Typical Fuzzy Controller with Nonlinear Fuzzy Rules TABLE 4.6a-d Sets.
Analytical Structure of the Fuzzy Controller Using Nonlinear Fuzzy Rules and Trapezoidal Input Fuzzy
TABLE 4.6a
ICNo. 1,2,5, & 6 3,4,7, & 8 l' 4' 2' 3' 5' & 6' 7' & 8'
f(i + I,j)· V ·KAu f(i,j + 1)· V ·KAu f(i + I,j)· V . K Au f(i,j + 1)· V . K Au f(i + 1,j) . V . K Au f(i,j + 1)· V ·KAu f(i + I,j)· V . K Au f(i,j + 1)· V . K Au
PI(AE, M)[Ce(i,j)· AE(n) + Cr(i,j)· M(n) + C1(i,j)· S]V ·KAu/S PI(AE, M)[Ce(i,j)· AE(n) + Cr{i,j)· M{n) + C2{i,j) ·S]V ·KAu/S P2{AE, M)[Ce(i,j)· AE{n) + Cr{i,j)· M{n) + C 1 (i,j)· S]V . KAu/S P2{AE, M)]Ce(i,j)· AE{n) + Cr(i,j)· M{n) + C2(i,j)· S]V . KAu/S P2(AE, M)[Ce(i,j)· AE{n) + Cr(i,j)(O.5S - A) + C 1 (i,j)· S]V . KAu/S P2{AE, M)[Ce(i,j){O.5S -A) + Cr(i,j)· M(n) + C2(i,j) ·S]V ·KAu/S P2{AE, M)[Ce(i,j)· AE{n) + Cr{i,j) . M{n) + C{i,j){O.5S - A) + C 1 (i,j) . S]V . KAu/S P2(AE, M)[Ce(i,j)· AE(n) + Cr(i,j)· M(n) + C(i,j)(O.5S - A) + C2(i,j) . S]V . KAu/S
TABLE 4.6b
ICNo. 1,2, 1', & 2' 3,4,3', & 4' 5&6 7&8 5' 6' 7' 8'
C(i,j) 2f(i + I,j) - f(i,j + 1) - f(i,j) f(i + I,j + 1) -f(i,j + 1) f(i + I,j + 1) - f(i + I,j) f(i + I,j) - f(i,j) f(i + I,j + 1) - f(i + I,j) f(i + I,j + 1) -f{i + I,j) f{i + I,j) - f{i,j + 1) f{i,j + 1) - f{i,j)
f{i + I,j + 1) - f(i + I,j) 2f{i,j + 1) - f(i + I,j) - f{i,j) f{i,j + 1) - f{i,j) f(i + I,j + 1) - f{i,j + 1) f{i + I,j) - f(i,j) f(i,j + 1) - f(i + I,j) f(i + I,j + 1) - f(i,j + 1) f(i + I,j + 1) - f(i,j + 1)
o o o o
f(i,j + 1) - f(i + I,j) f(i,j) - f{i + I,j) f(i,j) - f(i,j + 1) f(i + I,j) - f(i,j + 1)
TABLE 4.6c
jS ~ R(n) s ts +A jS + A ~ R{n) ~ (j + I)S - A (j + I)S - A ~ R(n) s (j + I)S
is ~ E(n) ~ is +A is +A ~ E(n) ~ (i + I)S-A (i+ I)S-A ~E(n) ~ (i+ I)S
IC9 or ICIO
ICI3 or ICI4
f(i + I,j + 1)· V ·KAu f{i + I,j + 1)· V . K Au f(i + I,j + 1)· V ·KAu
f(i,j f{i,j f{i,j
ICII or ICI2
ICI5 or ICI6
f(i + I,j + 1)· V ·KAu f(i + I,j + 1)· V ·KAu f(i + I,j + I)· V ·KAu
f(i f(i f(i
IC9, ICIO, ICI3 or ICI4
+ 1)· V ·KAu P3(AE, M)· C(i,j)· (A - S)V ·KAu/S
+ 1)· V . K Au + 1)· V ·KAu
+ I,j)· V ·KAu + I,j)· V ·KAu + i.n V ·KAu
Cr(i,j)[R(n) - (j + I)S]V . KAu/S P3(AE, M)· Cr(i,j)[R(n)(j + I)S]V ·KAu/S
ICII, ICI2, ICI5 or ICI6 P3(AE, M)· C(i,j)· (A - S)V ·KAu/S Ce(i,j)[E(n) - (i + I)S]V ·KAu/S P3(AE, M)· Ce(i,j)[E(n)(i + I)S]V· KAu/S
ICI7
ICI8
ICI7
ICI8
f(J,J)· V ·KAu
f(-J,J)· V ·KAu
o
o
ICI9
IC20
ICI9
IC20
f( -J, -J). V . K Au
f{J, -J) . V . K Au
o
o
102
Chapter 4 •
Mamdani Fuzzy Controllers of Non-Pill Type
TABLE 4.6d IC9 or ICIO R(n) satisfies
jS
~
R(n)
jS+A
~jS
+A
~R(n) ~
(j + I)S - A
~
(j+ I)S-A
R(n)
:s (j + I)S
ICII or ICI2
Ce(i,j)
Cr(i,j)
C(i,j)
Ce(i,j)
Cr(i,j)
C(i,j)
0
0
0
0
0
f(i+ I,j+ 1) -f(i + l,j) f(i+ I,j+ 1) -f(i + I,j)
f(i + I,j + 1) -f(i + I,j) 0
f(i + I,j + 1) -f(i,j + 1) f(i+I,j+I) -f(i,j + 1)
0
f(i + I,j + 1) -f(i,j + 1) 0
0
0
0
0
ICI3 or ICI4 E(n) satisfies is
.s E(n) .s is +A
is +A
:s E(n):s (i +
I)S-A
(i+ I)S -A:s E(n):s (i+ I)S
ICIS or IC16
Ce(i,j)
Cr(i,j)
C(i,j)
Ce(i,j)
Cr(i,j)
C(i,j)
0
0
0
0
0
f(i,j + 1) -f(i,j) f(i,j + 1) -f(i,j)
f(i,j + 1) -f(i,j) 0
f(i + l,j) -f(i,j) f(i + I,j) -f(i,j)
0
f(i + l,j) -f(i,j) 0
0
0
0
0
In IC1 to IC8 and IC1' to le8', the local PI controller has three terms instead of two, and we still call it a PI controller in a broader sense. The extra term changes with the input variables and is regarded as a variable offset to the control action of the two-term PI controller. The proof of the theorem is similar to the fuzzy controllers using linear fuzzy rules. At sampling time n, only the following four nonlinear fuzzy rules are executed: IF E(n) is Ai+ 1 AND R(n) is Bj + 1 THEN L\u(n) isf(i + 1,j + l)V
(r1*)
IF E(n) is Ai+ 1 ANDR(n) isBj THEN L\u(n) isf(i+ 1,j)V
(r2*)
IF E(n) is Ai AND R(n) is Bj + 1 THEN L\u(n) isf(i,j + l)V
(r3*)
IF E(n) is Ai AND R(n) is Bj THEN L\u(n) isf(i,j)V.
(r4*)
The results of the Zadeh fuzzy logic AND operation in these four rules are given in Table 4.7. Substituting the results into the defuzzifier will generate the results shown in Table 4.6. For regions IC9, IC10, IC13, and IC14, where (j + l)S - A::s R(n)::s (j + l)S, L\UL(M,M) is a local nonlinear P controller whose input variable, r(n), is with respect to a changing point (j + l)SjKr and whose proportional-gain is
When jS + A ::s R(n) ::s (j + l)S - A, L\UL(M,M) is a local linear P controller whose input variable, r(n), is with respect to a changing point (j + l)SjKr and whose proportionalgain is
103
Section 4.9. • Typical Fuzzy Controller with Nonlinear Fuzzy Rules
R(n) (j+I)S
(j+I)S-A
IC3 IC2 E(n)
is
is+A
(i+I)S
(i+I)S-.4
ICI jS+A
Ie7
res
tcr IC8
jS
I
is
is+A
U+O.5)S
I
(i+l)S-A (i+ l)S
E(n)
•
(a) R(n) ~
ICI8
ICl2
L
ICII
ICI3
ICI?
ICIO
E(n) -L
L
0
ICl4
IC19
IC9
ICIS
-L
IC16
IC20
(b)
Figure 4.7 Division of [is, (i + I)S] x [jS, (j + I)S] in E(n) - R(n) input space for applying the Zadeh fuzzy AND operation in the four fuzzy rules rl * to r4*: (a) 16 ICs when bothE(n) andR(n) are within [-L,L], and (b) 12 ICs when either E(n) or R(n) is outside [-L,L].
Finally, whenjS ~ R(n) changing control offset:
~jS
+A, AUL(AE,M) is unrelated to R(n) and becomes merely a
P3(AE,AR) . C(ij) . (A - S) . K Au • V S
(4.12)
104
Chapter 4 • Mamdani Fuzzy Controllers of Non-PID Type TABLE 4.7. Results of Evaluating Zadeh Fuzzy AND Operations in the Four Nonlinear Fuzzy Rules rl * to r4* for the 16 ICs Shown in Fig. 4.7a. IC No.
rl *
r2*
r3*
r4*
1&2 3&4 5&6 7&8 I' 2' 3' 4' 5' 6' 7' 8'
Jlj+l (r) Jli+l (e) Jli+l (e) Jlj+l (r) Jlj+l (r)
Jlj(r) Jlj(r)
Jli(e) Jli(e) Jlj+l (r) Jlj+l (r) Jli(e) Jli(e) Jli(e)
Jli(e) Jlj(r) Jlj(r) Jli(e) Jli(e) Jlj(r) Jlj(r) Jlj(r) Jlj(r)
Jli+l (e) Jli+l (e)
I
I I
Jlj(r) Jlj(r) Jlj(r)
Jli+l (e) Jli+l (e) Jli+l (e) Jlj+l (r) Jlj+l (r)
Jli+l (e) Jli+l (e) Jli+l (e)
I
1 I
I I
Jlj+l (r) Jlj+l (r) Jlj+l (r)
Jli(e)
TABLE4.7b Results of Evaluating Zadeh Fuzzy AND Operations in the Four Nonlinear Fuzzy Rules rl * to r4* for the 12 ICs Shown in Fig. 4.7b. IC9 or ICIO R(n) satisfies
rl*
jS s R(n) ~jS +A jS+A ~R(n) ~ 0+ I)S-A (j + I)S - A s R(n) ~ 0 + I)S
Jlj+l (r) Jlj+l (r)
I
ICI3 or ICI4
r2*
r3*
r4*
rl *
r2*
r3*
I
0 0 0
0 0 0
0 0 0
0 0 0
Jlj+l (r) Jlj+l (r)
Jlj(r) Jlj(r)
is s E(n) .s is +A is+A ~ E(n)::: (i+ I)S-A (i + I)S - A ::: E(n) ::: (i + I)S ICNo. 17 18 19 20
I Jlj(r) Jlj(r)
in ICIS or ICI6
ICII or ICI2 E(n) satisfies
I
r4*
rl*
r2*
r3*
r4*
rl*
r2*
r3*
r4*
Jli+l (e) Jli+l (e)
I
I
0 0 0
Jli(e) Jli(e)
0 0 0
0 0 0
Jli+l (e) Jli+l (e)
0 0 0
Jli(e) Jli(e)
rl*
r2*
r3*
r4*
I 0 0 0
0 0 0 I
0 I 0 0
0 0 I 0
I
1
By the same token, for regions ICII, ICI2, ICIS, and ICI6, liUL(M,M) is a local nonlinear I controller whose input variable, e(n), is with respect to a changing point (i + I)S jK; and whose integral-gain is K;(M,M)
= P3(IiE,M). CeCiJ) · Ke • K Au • V
8 when (i + I)S - A ~ E(n) ~ (i + 1)8. liUL(M,M) is a local linear I controller whose input variable, e(n), is with respect to a changing point (i + I)SjKe and whose integral-gain is
K.(M M) = Ce(iJ) . K e . K tiu · V I , 8
Section 4.9. • Typical Fuzzy Controller with Nonlinear Fuzzy Rules
105
when is +A .s E(n) ~ (i + I)S -A. When is:::: E(n) ~ is +A, ~UL(M,AR) is unrelated to E(n) and becomes the same changing control offset as described in (4.12). For regions ICl7 to IC20, AUL(M,AR) = 0 because Ce(iJ), Cr(i,j) and C(iJ) are always zero. The analytical structure of the local controller is determined not only by the membership functions of the input fuzzy sets, but also by all the other components of the fuzzy controller. Using the trapezoidal membership functions is a necessary but not sufficient condition for the local controller to be a nonlinear PI controller. The analytical structure of the global controller is fundamentally determined only by fuzzy rules. Later in this chapter, we will generalize these two points to an even more general fuzzy controller: It uses almost any type of input fuzzy sets, any fuzzy rules, any fuzzy AND and OR operators [79], any fuzzy inference method, and the centroid defuzzifier.
4.9.3. Structure Decomposition and Duality Structural decomposition of the fuzzy controller into a global controller and a local controller is not unique. That is, there is more than one way to express the structure as the sum of a global controller and a local controller. For instance, ~UG(iJ) could be written as f(iJ)· V . K au consistently for all the ICs. In these cases, ~UL(M,AR) will still be a local nonlinear PI controller. One drawback of doing so, however, is that the duality of the controller structure, described below, would not be preserved, making analysis of the properties of the fuzzy controller more difficult. Several structure dualities exist. For ICI to IC8 and ICI' to IC8', one observes from Tables 4.6a-e that there exists duality between Ce(iJ) and Cr(iJ) and between C 1(iJ) and C2(iJ). Ce(iJ) , Cr(i,j), and C 1(iJ) for IC3, IC4, IC3', and IC4' equal, respectively, Cr(iJ), Ce(iJ) and C2(iJ) for ICI, IC2, ICI', and IC2', after f(i + l,j) and f(iJ + 1) exchange their positions. This property also holds between IC5 and IC6 and IC7 and IC8, between IC5' and IC8', and between IC6' and IC7'. Furthermore, the property applies to C(iJ) between ICS' and IC8', and between IC6' and IC7'. The property also holds for C(i,j) alone between the other above-mentioned ICs. Moreover, according to Tables 4.6a-e, the duality also holds for the global nonlinear controller, AUG(iJ), between ICI, IC2, IC5, IC6, ICI', IC2', IC5', and IC6' and IC3, IC4, IC7, IC8, IC3', IC4', IC7', and IC8', respectively. In these "paired" ICs, the first part of the pair is always the ICs in which IM(n)1 ~ IAR(n)l, and the second part is always the ICs where IM(n)I .s IAR(n)l. Also, according to Tables 4.6a-e, Cr(iJ) and C(iJ) for IC9, ICIO, ICI3, and ICl4 equal, respectively, Ce(iJ) and C(iJ) for ICII, ICI2, ICI5, and ICI6, afterf(i+ IJ) and f(i,j + 1) exchange their positions. Similarly, the duality holds for the global nonlinear controller between ICl3 and ICl4 and ICl5 and ICI6. In these "paired" ICs, the first part of the pair is always the ICs where IE(n)I ~ IR(n)l, and the second part is always the ICs where IE(n)I ~ IR(n)l.
4.9.4. Gain Variation Characteristics The gains of the local nonlinear PI controller vary dynamically with the input variables. They change both globally with i andj and locally with M(n) and AR(n), and their ranges
106
Chapter 4 • Mamdani Fuzzy Controllers of Non-Pill Type
depend on the ranges of Pl(M,M), P2(M,M), and P3(M,M). WhenE(n) andR(n) are in ICI to IC8,
Cr(iJ) ·K, ·KAu· V < K (M M) < Cr(i,j) ·Kr ·KAu· V 28 -p' 8 ' Ce(iJ) -Ke . KAu . V < K.(M M) < Ce(iJ)· K e . KAu . V . 28 -I' 8 ' when E(n) and R(n) are in ICI' to IC8',
Cr(iJ) -Kr ·KAu· V < K (M M) < C,(i,j) -Kr ·KAu· V (1 + 20)8 - p , (1 - 8)8 ' Ce(iJ) -Ke · KAu . V < K.(M M) < Ce(i,j)· Ke -KAu - V . (1 + 20)8 - 1 , (1 - 8)8 ' and when E(n) and R(n) are in IC9 to ICI6,
Cr(i,j)-Kr·KAu·.V _ IAE(n) I
+ Iql)J + [w],
Obviously, AUG(iJ) is a global two-dimensional multilevel relay with respect to i andj. The constants, (p + w)H . K A u / K and (q + w)H . K Au / K, can be regarded as an offset to the respective relay.
As pointed out earlier in this section, the shape of the input fuzzy sets is one of the factors determining the structure of the local nonlinear PI controller as well as the ranges of the proportional-gain and integral-gain. The following example uncovers the specific structure of the local nonlinear PI controller when the triangular input fuzzy sets and linear fuzzy rules are used. EXAMPLE 4.2 In Example 4.1, if (1) the triangular input fuzzy sets are used instead, and (2) p = q, derive AUL(iJ).
Solution Use of the triangular membership functions means A = 0, and hence () = o. When A = 0, ICl' to IC8' do not exist any more and only ICI to IC20 stay. For ICI to IC8, C(iJ) is always zero. In addition, C1(iJ) = 0 and C2(iJ) = 0 whenp = q because
C1(iJ) = 0.5[f(i + l,j + 1) - 3f(i + l,j) + f(iJ and
C1(iJ) = 0.5[f(i + l,j + 1) + f(i
+ l,j) -
+ 1) + f(iJ)] =
q- p = 0
3f(iJ + 1) + f(iJ)] = P - q = O.
Consequently, the local nonlinear PI controller loses the extra term and becomes a normal nonlinear PI controller with only two terms. For IC9 to ICI6, only the conditions is-: E(n) s (i + I)S and jS s R(n) ::; (j + I)S exist. Therefore, only the local linear I controller and the local linear P controller exist. For IC 17 to IC20, the local controller is constantly zero.
In Example 4.3, we directly obtain the structure of the fuzzy controllers with the same linear rules used in Section 4.5. EXAMPLE 4.3 In Example 4.1, ifp = q = 1 and w = 0, derive AUG(iJ) and AUL(AE,AR).
Solution The coefficients Ce(iJ), Cr(iJ) and C(iJ) can easily be calculated. For ICI to IC8 and ICl' to IC8', the results are -1, 0, or 1. For IC9 to IC 16, the results are always 1. For IC 17 to IC20, the coefficients are always O. As shown in Example 4.2, both C 1(ij) and C2 (iJ ) are o. Substituting the resultant Ce(iJ), Cr(iJ), C(iJ), C 1 (iJ) and C2(iJ) into Tables 4.6a and b, one gets the structure as shown in Table 4.8.
108
Chapter 4 • Mamdani Fuzzy Controllers of Non-Pill Type TABLE 4.8a Analytical Structure of the Fuzzy Controller Using the Linear Fuzzy Rules I(i,j) Trapezoidal Input Fuzzy Sets; (a) ICI to IC8, and ICI' to IC/. ICNo.
~UG(i,j)
and
~UL(AE,M)
K!1 ·H
1 to 8
(i + j
1/, 4/, 5/, & 8'
K!1 ·H (i+j+ I)_U_ N-I
2/
(i + j
+ 1) N ~ 1
3/
(i + j
+ 1) N ~ 1
6/
K!1 ·H (i+j+I)-UN-I
7/
(i + i
TABLE 4.88b
= i +j
PI (AE,M)(AE(n) + M(n»
+ 1) N ~ 1
K!1 ·H
K!1 ·H
K!1 ·H ~
K!1 ·H
P2(AE,M)(AE(n)
+ M(n»~
P2(AE,M)(AE(n)
+ (0.5S -
P2(AE,M)«0.5S - A)
K!1 ·H
A»~
K!1 ·H
+ M(n»~
K!1 ·H P2(AE,M)(AE(n) - (0.5S - A»~
K!1 ·H
+ 1) N ~ 1
P2(AE,M)( -(0.5S - A)
K!1 ·H
+ M(n»~
(b) IC9 to IC20 ~UL(AE,
~UG(i,i)
M)
IC9 or ICIO
ICI3 or ICI4
IC9, ICIO, ICI3, or ICI4
::SiS +A
K!!,. ·H (J+j+I)-UN-I
K!1 ·H (-J +i+ I)_U_ N-I
PiAE, M)(A - S) K",~~ H
jS+A ::SR(n)::s U+ I)S-A
K!1 ·H (J +j+ I)_U_ N-I
K!!,. ·H (-J+j+I)-UN-I
[R(n) - (j
(i+ I)S -A::s R(n)::s (i+ I)S
K!!,. ·H (J+i+I)-UN-I
K!!,. ·H (-J+i+I)-UN-I
K!!,. ·H P3(AE, JiR)[R(n) - U + I)S]~
ICII or ICI2
ICl5 or ICl6
ICII, ICI2, ICI5, or ICl6
K!1 ·H (i+J+ 1)_U_ N-I
(i -J + I)K!1u ·H N-I
P3(AE, M)(A -
K!1 ·H (i+J+ I)_U_ N-I
(i -J + I)K!1u ·H N-I
[E(n) - (i
K!!,. ·H (i+J+I)-UN-I
(i -J + I)K!!,.u ·H N-I
K!!,. ·H P3(AE, JiR)[E(n) - (i + 1)S]~
jS
::s R(n)
is ::s E(n) -s is + A is + A ::s E(n) ::s (i + I)S (i
+ I)S -
A
A
::s E( n) ::s (i + I)S
+ l)S]K~H
+
S)K~H K!!,. ·H
I)S]~
ICI7
ICI8
ICI7
IC18
-K!1u· H
IC19
0 IC20
0 IC19
0 IC20
KAu·H
0
0
0
Section 4.10. •
109
Structure Decomposition of General Fuzzy Controllers
Before proceeding to the next section, we point out that if the fuzzy controller in Example 4.3 uses the triangular fuzzy sets (i.e., A = 0), the local nonlinear PI controller will become a normal two-term nonlinear PI controller. The structure of such a fuzzy controller will be exactly the same as that presented in Section 4.5.
4.10. STRUCTURE DECOMPOSITION OF GENERAL FUZZY CONTROLLERS 4.10.1. Configuration of General Fuzzy Controllers From the fuzzy controllers studied in this chapter so far, one may observe that their analytical structures are always decomposed into the sum of a global controller and a local controller. This is the case regardless of the controllers' configuration. A logical question to ask is whether this kind of structure decomposition holds for general fuzzy controllers. The answer is affirmative. In this section, we show that for a broad class of general and typical fuzzy controllers, they can always be represented as the sum of a global controller and a local controller. Let us first define the configurations of these controllers. They have M input variables. Each variable is denoted as xi(n), where 1 ~ i ~ M. The scaling factor for xi(n) is (Xi' and the scaled variables are (4.13)
Xj(n) = (Xi' xi(n).
Without losing generality, we assume -L
~
Xj(n) :::: L.
Xj(n) is fuzzified by N = 2J + 1 input fuzzy sets, each of which is denoted as AI..' where -J 1. Hence, fJ(O,O) = (1 + A)/4A. Different values of A can create different degrees of biased control. If A = 3 (other reasonable A values such as 2 or 4 are also fine), k4 = 1/3, fJ(-L ,-L) = k4 = 1/3, and P(O,O) = 1/3. This means that (1) the controller gain at (L,L) is three times as large as that at (0,0) or (-L,-L), and (2) fJ(e,r) in the third quadrant is quite "flat" (because fJ(O,O) = fJ(-L,-L», meaning the gain variation in that quadrant is small. This fJ(e,r) is plotted in Fig. 5.19. Indeed, the biased control strategies and the gain variation in the first quadrant are much bigger and steeper than those in the third quadrant. Like the fuzzy controllers using the original TS rule scheme, fuzzy controllers using the simplified TS rule scheme can also become unreasonable from the standpoint of control, if inappropriate values of '9 are used. (The chances of making such mistakes , however, are
~(e,r)
Figure 5.19 'Three-dimensional plot of p(e,r) when k. = I, k,. = k3 = 0, k4 = 1/3, and L = 1. The gain surface is symmetric in terms of the line e(n) = r(n) .
Section 5.7. • Simple Fuzzy PljPD Controllers with Simplified Linear TS Fuzzy Rule Consequent
155
1 0.5
o
~(e,r) -0.5
-1~~ -2 ~ o e(n)
e(n)
1
Figure 5.20 Three-dimensional plot of p(e,r) when k[ = I , kz = k3 = 0, k4 = -I, and L = 1. The gain surface is symmetric in terms of the line e(n) = r(n) . The plot shows that inappropriate values of kj can lead to unreasonable and illogical gain variation characteristics and hence an unusable controller. Specifically in this example, P(O,O) = 0, resulting in zero control gain at the equilibrium point.
probably smaller owing to fewer design parameters.) As an example, if the values of '9 are so chosen that
then p(e,r) for ICI is
k1
p(e,r) = 4L2 [(1 + k:!
+ (1 - k:! -
-
k3
-
k4)L·e(n) + (1 -
k:! + k3 -
k4)L ·r(n)
k3 + k4)e(n)r(n)] .
Obviously, P(O,O) = 0, meaning that the proportional-gain and integral-gain at the equilibrium point are zero . This class of p(e,r) is unusable as far as control is concerned. A plot of one such p(e,r) is shown in Fig. 5.20, where we let k 1 = 1, k2 = k3 = 0, and k4 = -1. This example highlights the importance of selecting proper '9 values.
5.7.4. Other Simple Fuzzy PI/PO Controllers with Simplified Linear TS Fuzzy Rule Consequent The fuzzy PI controller discussed so far uses the product fuzzy logic AND operator in the fuzzy rules. If all the components of the controller are kept the same but the product AND operator is replaced by the Zadeh AND operator, p(e,r) can also be quite straightforwardly derived. The resulting structures are listed in Table 5.7. (The 20 ICs are given in Fig . 3.3.) The characteristics of p(e,r) can be analyzed in a similar fashion. For brevity, we leave this task to the reader as an exercise. For a better understanding of this p(e,r), we provide threedimensional visualization in Fig. 5.21, where k1 = 1, k2 = 1/8, k3 = 1/2, and k4 = I, as well as in Fig . 5.22, where k1 = 1, k2 = 1/8, k3 = 1/4, and k4 = 1/2. In both figures , L = 1.
156
Chapter 5 • TS Fuzzy Controllers with Linear Rule Consequent TABLE 5.7 The Explicit Expressions of fJ(e,r) Derived for the 12 Ies That Divide Up the e(n) - r(n) Plane Shown in Fig. 3.3." ICNo.
fJ(e,r) A[B - (k 3
+ k4)e(n) + (1 -
kz)r(n)]
2L - e(n) A[B
2
+ (I
- k3 )e(n) - (kz + k4 )r(n)] 2L - r(n)
+ (1 + kz)e(n) + (k3 - k4 )r(n)] 2L + e(n) A[B + (kz - k4)e(n) + (1 + k3)r(n)] 2L + r(n) A[(I + kz)L + (1 - kz)r(n)] A[B
3 4
5
6
~
A[(I + k3)L + (1 - k3 )e(n)]
7 8
k 1k3
9
A[(k3
+ k4)L + (k3 -
A[(k2
+ k4)L + (kz -
10
k4)r(n)]
k 1k4
11 12 Note: A =
ik
k4)e(n)]
k1kz
and B = (1 + kz + k3 + k4)L
"This TS fuzzy PI Controller Uses the Zadeh Fuzzy Logic AND Operator.
1~~
0 .75
~(e,r) O~ 2~
o
-2
e(n)
Figure 5.21 Three-dimensional plot of fJ(e,r) when k1 = 1, kz = 1/8, k3 = 1/2. k4 = 1, and L 1. The gain surface is symmetric in terms of the line e(n) r(n) .
=
=
157
Section 5.8. • Fuzzy PID Controller with Simplified Linear TS Rule Scheme
1~~~~~11~
0. 75
~(e,r) O~ 2~ o -2
Figure 5.22 Three-dimensional plot of fl(e,r) when k] = I, k2 and L = I. The gain surface is asymmetric.
e(n)
= 1/8, k3 = 1/4, k4 = 1/2,
5.8. FUZZY PID CONTROLLER WITH SIMPLIFIED LINEAR TS RULE SCHEME 5.8.1. Configuration and Explicit Structure Derivation When the fuzzy PI controller using product fuzzy logic AND operator in Section 5.7 employs den) as an additional input variable, it becomes a fuzzy Pill controller. The following eight simplified linear rules are needed in the study of a fuzzy Pill controller: IF e(n) is Positive AND r(n) is Positive AND den) is Positive THEN !J.U(n) = k1(ale(n)
+ a2r(n) + a3d(n))
IF e(n) is Positive AND r(n) is Positive AND den) is Negative THEN !J.U(n) = k2(ale(n)
+ a2r(n) + a3d(n))
IF e(n) is Positive AND r(n) is Negative AND den) is Positive THEN !J.U(n) = k3(al e(n) + a2r(n)
+ a3d(n))
IF e(n) is Positive AND r(n) is Negative AND den) is Negative THEN !J.U(n)
= k4(ale(n) + a2r(n) + a3d(n))
IF e(n) is Negative AND r(n) is Positive AND den) is Positive THEN !J.U(n) = kS(ale(n)
+ a2r(n) + a3d(n))
IF e(n) is Negative AND r(n) is Positive AND den) is Negative THEN !J.U(n)
= k6(ale(n) + a2r(n) + a3d(n))
IF e(n) is Negative AND r(n) is Negative AND den) is Positive THEN !J.U(n)
= k7(ale(n) + a2r(n) + a3d(n))
IF e(n) is Negative AND r(n) is Negative AND den) is Negative THEN !J.U(n)
= kg(ale(n) + a2r(n) + a3d(n)).
158
Chapter 5 • TS Fuzzy Controllers with Linear Rule Consequent
The result is a nonlinear PID controller
J1U(n) = p(e,r,d)(ate(n) + a2r(n)
+ a3d(n»
with variable proportional-gain, integral-gain, and derivative-gain denoted, respectively, as p(e,r,d)·a2' p(e,r,d)·al' and p(e,r,d)·a3. Specifically,
p(e,r,d)
= k t J1,p(e)J1,p(r)J1,p(d) + ~J1,p(e)J1,p(r)J1,i/(d) + k3J1,p(e)J1,Fl(r)/lp(d) + k4 J1,p(e)J1,Fl(r)J1,i/ (d) +~~~~W~OO+~~~~W~OO
+ k7J1,Fl(e)J1,Fl(r)J1,p(d) + k gJ1,Fl(e)J1,Fl(r)J1,i/ (d) . In the cube [-L,L] x [-L,L] x [-L,L], which is of most nonlinearity and importance,
p(e,r,cl) =
8;'3 (c
3 + c2e(n)L2 + c3r(n)L2 + C4 d (n)L 2 + cse(n)r(n)L
1L
+ c6e(n)d(n)L + c7r(n)d(n)L + cge(n)r(n)d(n» where
+ k3 + k4 + ks + k6 + k7 + kg, C2 + k3 + k4 - ks - k6 - k7 - kg, C3 = 1 + ~ - k3 - k4 + ks + k6 - k7 - kg, C4 = 1 - ~ + k3 - k4 + ks - k6 + k7 - kg, Cs = 1 + ~ - k3 - k4 - ks - k6 + k7 + kg, C6 = 1 - ~ + k3 - k4 - ks + k6 - k7 + kg, C7 = 1 - k2 - k3 + k4 + ks - k6 - k7 + kg, Cg = 1 - k2 - k3 + k4 - ks + k6 + k7 - kg. Ct
= 1 + k2 = 1+~
For the regions outside the cube [-L,L] x [-L,L] x [-L,L], p(e,r, d) can also be found. The derivation is not difficult owing to use of the product fuzzy logic AND operator. (If the Zadeh fuzzy logic AND operator were used, derivation would be more difficult.) p(e,r, d) is four-dimensional and hence direct graphical illustration is impossible. The fuzzy PID controller has one more input variable (i.e., d(n» and five more parameters than the fuzzy PI and PD controllers (i.e., a3 and ks to kg). Hence, it is harder to analyze because of the higher dimensionality. In theory, its control performance should be enhanced by the additional degrees of freedom introduced by the extra parameters. Such enhancement, however, is at the expense of difficult parameter tuning and complicated controller structure. One remedy is to let some parameters be zero, as we did above for the fuzzy PI and PD controllers.
5.8.2. Simulated Control of Mean Arterial Pressure Useful and interesting nonlinear gain variation characteristics can still be generated to produce a superior TS fuzzy Pill controller, even when the majority of '9 are zero. As an example, we now use the fuzzy Pill controller in the last section to realize the biased control strategies for mean arterial pressure control. The patient model is given in (8.1). After experimenting with some parameter values, we found the following values to be adequate: k1 = 1, ~ = 0.5, k3 = k4 = ks = k6 = 0, Iv, = 0.1, kg = 0.85, L = 40, at = -0.024, a2 = -1.6, and a3 = -25. There are seven nonzero parameters, excluding k i . The sampling period is still 10 seconds. Figure 5.23 shows a simulated control performance comparison between the fuzzy Pill controller and the corresponding linear
Fuzzy Pill Controller with Simplified Linear TS Rule Scheme
Section 5.8. •
159
150 I--------.----------,--~===~=:=:::;l fuzzy PI control -_. tinear PI control ........ setpolnl
,, ~
130
,, , ,, ,, I
,,
I
,,
,, ,
~ 120
£
i
\
110
[i
Gl
~ 100
\
\
" ...........
...........
,.. . ,... .,.,.. . ,.,',.,.. . ."., ',." . . ..,.= . .... . . . . . .
~,~I.., IM
~
90
80 '--
o
-'-
---'1000
500
-----1
1500
lime (second)
(a)
Figure 5.23 Comparisons of simulated control performance between the fuzzy PID controller with the simplified linear TS rules and the corresponding linear PID controller that uses the steady-state gains of the fuzzy controller (i.e., P(O. 0, 0) . a., i = I, 2, 3). The patient model is given in (8.1). The parameter values are: k t = I, k2 = 0.5, k3 = k4 = ks = k6 = 0, k7 = 0.1, kg = 0.85, L = 40, at = -0.024, a 2 = -1 .6, and a 3 = -25. The sampling period is 10 seconds. Once set, all the parameters are fixed for both controllers in all the comparisons: (a) the typical patients (K = - 0.72).
Pill controller that uses the steady-state gains of the fuzzy controller (i.e., {3(0,0, 0) . ai' i = 1, 2, 3). The typical (K = -0.72), insensitive (K = -0.18), and oversensitive (K = -2.88) patient cases are included in the comparison. Once set, all the parameters are fixed for both controllers in all the comparisons. For the typical and insensitive patients, according to Fig. 5.23, the rise-time of fuzzy and conventional Pill control systems is about the same, although the response of the fuzzy control system is slightly slower during the initial time period (i.e., 0 to 300 seconds for the typical patients and 0 to 600 seconds for the insensitive patients). In either case, no mean arterial pressure (MAP) overshoot exists. For the oversensitive patients, however, the fuzzy control system performs much better with little overshoot and much more stable MAP response as compared with 15 mm Hg overshoot and oscillatory MAP performance of the Pill control system. The settling time of the Pill control system is also significantly longer. The superiority of the fuzzy controller is especially convincing because it results in a smaller overshoot and a smaller rise-time at the same time. According to linear control theory, simultaneously achieving these two performance objectives is contradictory, and one can only achieve one objective at the expense of the other. The fuzzy Pill control system can do both because it is nonlinear and time-varying.
160
Chapter 5 • 150 i
TS Fuzzy Controllers with Linear Rule Consequent
- - - - - - - ..-- - - - - - - --,-- -;:= =;:= :;== :=:::;""] fulzy PI control _ •• linear PI control "," ," setpoinl
140
~
130
g ~ 120
£ iii
'ij 110
~
c:
I'll
~ 100 90
80 ' - - - - - - - - - - - - ' - - - - - - - - - - - - ' - - - - - - - - - - - '
o
1000
500
1500
l1me (second) (b)
Figure 5.23 Comparisons of simulated control performance between the fuzzy PID controller with the simplified linear TS rules and the corresponding linear PID controller that uses the steady-state gains of the fuzzy controller (i.e., P(O, 0, 0) · Q/, i 1,2,3). The patient model is given in (8.1). The parameter values are: kl = 1, ~ = 0.5, k3 = k4 = ks = k6 = 0, k7 = 0.1, ks = 0.85, L = 40,01 = -0.024, Q2 = - 1.6, and Q3 = -25. The sampling period is 10 seconds. Once set, all the parameters are fixed for both controllers in all the comparisons: (b) the insensitive patients (K = -0.18),
=
To be fair, one needs to keep in mind that the performance gain by the fuzzy controller is at the expense of more parameters, nine more to be exact, even after the simplified linear rule scheme is used.
5.9. COMPARING TS FUZZY CONTROL WITH MAMDANI FUZZY CONTROL Having derived and analyzed the analytical structures of various Mamdani and TS fuzzy controllers, we now compare and summarize their major differences, advantages, and disadvantages.
5.9.1. Major Features of Mamdani Fuzzy Control A Mamdani fuzzy controller uses fuzzy sets as rule consequent. Hence, fuzzy rules are more intuitive and can more easily be extracted from expert knowledge and experience. For this type of fuzzy controller, many different types of fuzzy inference methods are available to
Section 5.9. • Comparing TS Fuzzy Control with Mamdani Fuzzy Control
161
150 i-------....,...-----------r----;:=====::::;-, fuzzy PI control -_. linear PI control ..... ... setpoint 140
¥
130
I
~ 120
•, •
i
ii
'i
I
,
I I
110
I
:
~ e
"
I
III
I
~ 100
I
I
I
I II
I I•
.... ~
~: ,
I
\ : ,'I'
90
80 '--
o
1 ......
~, ..~.. ...".~r-~-..."C:'
.
" \\ I I
-----------------l
-'-
--1.
500
1000 Time (second)
----J
1500
(c)
Figure 5.23 Comparisons of simulated control performance between the fuzzy PID controller with the simplified linear TS rules and the corresponding linear PID controller that uses the steady-state gains of the fuzzy controller (i.e., P(O, 0, 0) · OJ, i = 1,2 ,3). The patient model is given in (8.1). The parameter values are: k( = I, ~ = 0.5, k3 = k4 = ks = k6 = 0, 10 = 0.1, kg = 0.85, L =40,0( = -0.024'02 = -I.6, and 03 = -25. Thesarnplingperiodis 10 seconds. Once set, all the parameters are fixed for both controllers in all the comparisons: (c) the oversensitivepatients (K = -2.88).
be adopted. The TS fuzzy rule scheme, on the other hand, possesses little linguistic meaning and hence is not intuitive. Utilization of expert knowledge and experience in the rule design process is also difficult. Unlike Mamdani fuzzy controllers, a TS fuzzy controller does not use fuzzy inference in a strict sense. A Mamdani fuzzy rule consequent is a fuzzy set, of either the singleton or regular type . For the majority of applications, using singleton fuzzy sets is sufficient. The Mamdani rule scheme is not only economic but also more tunable because the rule consequent has clear meaning and intuitively relates to system control performance. The TS rule scheme not only lacks intuition but also involves many design parameters in the rule consequent. These parameters are troublesome to determine and tune, owing to the lack oflinguistic and intuitive meaning of the parameters as well as their disconnections to system control performance. For fuzzy controllers of both types, the number of design parameters rises quickly with the increase of the number of input and output variables. However, the situation worsens much faster for TS fuzzy controllers owing to its rule structure. Combining these factors , building a Mamdani fuzzy controller is most likely to be easier.
162
Chapter 5 • TS Fuzzy Controllers with Linear Rule Consequent
5.9.2. Primary Characteristics of T5 Fuzzy Control Most TS fuzzy controllers use linear rule consequent. Their analytical structures are always nonlinear controllers of PID type with variable gains. In contrast, Mamdani fuzzy controllers can be configured to form many different types of nonlinear controllers, including the PID type. The general analytical structure is the sum of a global nonlinear controller, whose structure is fuzzy rule-dependent, and a local nonlinear controller. Mamdani fuzzy control is able to generate more diverse nonlinear controllers than TS fuzzy control. TS fuzzy control can generate more than the Pill type of nonlinear controllers if nonlinear rule consequent are used. Properly determining the nonlinear functions is a major obstacle and a technically challenging issue. This issue is even more complicated, if one also considers how to determine the parameters in the nonlinear functions. Compared with the Mamdani fuzzy PID control, the gain variation characteristics produced by the TS fuzzy PID control are more diverse. The characteristics, governed and parametrized by the parameters in the rule consequent, are flexible in design to meet desired shape and specifications. As a result, TS fuzzy PID control is capable of offering more, and possibly better, solutions to a wider variety of nonlinear control problems. Variable gains of the TS fuzzy controllers mayor may not be derivable in an analytic form. For the TS fuzzy controllers in this chapter, the gains have been explicitly derived. There exist many other configurations whose gains cannot be expressed analytically. They are, however, always available in a numeric form, regardless of configuration complexity. This is because the gains are characterized by (5.4), which is readily computable. One can always use the formula to generate the data and then plot the variable gains and investigate the gain variation characteristics numerically. For example, one can make three-dimensional graphics of the gain surface without analytical expressions for TS fuzzy PI or PD controllers. If more than two input variables are involved, one may vary their values and study how the gains change. In comparison, although variable gains of a Mamdani fuzzy controller of PID type also mayor may not be analytically derivable, in most cases they cannot be calculated in a numeric form. This is because a Mamdani fuzzy controller is generally not readily expressed as a linear combination of input variables multiplied by the nonlinear gains. As a result, if the analytical expressions are not obtainable for a Mamdani fuzzy controller, its gain variation characteristics usually cannot be studied even numerically.
5.9.3. Comparison Conclusions In summary, each type of fuzzy controller has its advantages and disadvantages, and no one type is absolutely better or worse than the other. Which type to use depends on the application, experience of the controller designer, and his/her personal preference. It also depends on the amount of knowledge and data available about the system to be controlled. Fuzzy controllers are merely nonlinear and time-varying controllers. As such, they are also partially subject to the same disadvantages and constraints as their traditional counterparts. Since a general nonlinear system theory does not exist, designing a classic nonlinear controller is often more an art than a science, which is certainly true of fuzzy controllers as well. In conventional control, human judgment is always required even for linear controller design: Selecting controller structure (e.g., Pill control, robust control, or optimal control) and controller order. Fuzzy control, however, requires more selections because more components are present. As always, a certain amount of trial-and-error effort is unavoidable for either type of fuzzy controllers. Between the two, TS fuzzy control almost certainly requires more.
163
Exercises
5.10. SUMMARY The general TS fuzzy controllers are inherently nonlinear controllers of PID type, with variable gains changing with state of input variables. The gain variation characteristics, peculiar and beneficial for improving control performance, empower the fuzzy controllers to outperform linear (Pill) controllers. We have investigated in depth two TS fuzzy PI/PD controllers, one simple and one typical. They are also used to control tissue temperature in hyperthermia based on computer simulation. A simplified TS fuzzy rule scheme is developed to dramatically reduce the prohibitively large number of design parameters in the original TS fuzzy rule scheme. The new scheme is a special case of the original one. Fuzzy PID controllers with simplified linear rule scheme are examined in detail. One of them is used to control the mean arterial pressure model. It convincingly outperforms a linear PID controller. The tradeoff, however, is the selection and tuning of a few more design parameters. Finally, Mamdani fuzzy control is compared with TS fuzzy control in terms of their differences, merits, and shortcomings. 5.11. NOTES AND REFERENCES That a TS fuzzy controller is a nonlinear controller of Pill type with variable gains was first rigorously established in [269][270] and then generalized in [265], which is the content of Section 5.3. Structure of the simple TS fuzzy PI/PD controllers was derived and used for the temperature control application (i.e., Section 5.4) in [54]. The materials in Section 5.5 can be found in [56]. The simplified TS fuzzy rule scheme in Section 5.6 was introduced in [269] [270]. The fuzzy PI and PD controllers using the simplified linear rule scheme (i.e., Section 5.7) were developed in [269][270]. Finally, the results in Section 5.8 are given in [274]. EXERCISES 1. Is a fuzzy controller using linear TS rule consequent always a linear fuzzy controller? 2. In theory, a nonlinear TS rule consequent is more powerful than a linear one. Why is it not widely used then? What are the practical difficulties of using it?
3. Can a TS fuzzy controller realize linear or nonlinear control of the non-Pill type? Ifno, why? 4. Under what conditions does a TS fuzzy controller become a linear Pill controller? 5. Both the Mamdani fuzzy controllers and the TS fuzzy controllers inherently introduce gain variation. Generate various gain variation characteristics three-dimensionally and compare them. Can one say that one type of gain variation is better than other types? Give your rationale for your answer. 6. In comparison with the original (linear) TS rule scheme, what are the advantages and tradeoff of the simplified (linear) TS rule scheme? 7. Following the example in Section 5.7.3, design the gain variation of characteristics that interest you. 8. Derive the analytical structure of the fuzzy PI/PD controllers in Section 5.7.4. 9. Use the fuzzy Pill controller in Section 5.8 to control various system models to explore its performance gain over the corresponding linear Pill controller. Do you feel the parameter tuning is overwhelming for the fuzzy controller? 10. Compare Mamdani fuzzy control with TS fuzzy control. Which type do you prefer to use?
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
6.1. INTRODUCTION Stability is always a fundamental issue in the analysis and design of control systems, be it linear, nonlinear, or fuzzy. The preceding three chapters have clearly shown the Mamdani and TS fuzzy controllers to be nothing but nonlinear, time-varying controllers. Unlike common types of nonlinear, time-varying controllers, the fuzzy controllers are unique owing mainly to their peculiar gain variation characteristics. In theory, all the well-developed stability tools in classical control theory are applicable to fuzzy control systems, but the tasks are technically more challenging. In this chapter, we will study local stability as well as the bounded-input bounded-output (BmO) stability of the fuzzy control systems. Design is another fundamental issue in any control technology. Traditionally, fuzzy controllers are empirically constructed case by case instead of being systematically designed, using the time-consuming trial-and-error method, which often fails, especially for complex systems. In critical applications such as those in biomedicine, aerospace, and nuclear engineering, little trial-and-error effort can be tolerated. Hence, a theoretically sound and practically usable design theory is needed to reduce the cost and time associated with development of the fuzzy control system. Based on explicit structural knowledge, we now show how to design Mamdani and TS fuzzy control systems. In the last few sections, we will prove the general TS fuzzy systems to be nonlinear ARX (Auto-Regressive with the eXtra input) systems or nonlinear IIR/FIR filters, depending on system configuration. We will utilize the feedback linearization technique to design stable controllers capable of controlling the general TS fuzzy systems in achieving the perfect tracking of any desired output trajectory.
165
166
Chapter 6 •
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
6.2. GLOBAL STABILITY, LOCAL STABILITY, AND BIBO STABILITY First, we briefly review the major concepts of system stability. Stability is an inherent property of a dynamic system. Whether or not a system is stable depends only on its structure and is independent of its input signal. Different definitions exist for characterizing different aspects of system stability behavior. They include global (asymptotic), local, BmO, asymptotic, and exponential stability. Global stability and local stability describe, respectively, the global and local behavior of a system with respect to its equilibrium point/points. A system is said to be globally asymptotically stable if it is asymptotically stable for any initial states, no matter how far the initial state is from the equilibrium point. In other words, the system is stable in the whole state space. In contrast, local stability guarantees system stability only in a region around the equilibrium point, called basin. If the initial state is in the basin, the system will be stable; otherwise it will not be. For linear systems, local stability implies global stability and vice versa. This, however, is not true for nonlinear systems for which local stability does not necessarily mean global stability; indeed, in most cases, this does not hold. BIBO stability simply means that the system output should not become infinitely large as long as the magnitude of the system input is limited. As such, Bmo stability is a weaker definition than asymptotic stability that guarantees the system output convergence with time, provided that the input is not infinitely large. By definition, if the output of a system is oscillating and the oscillation magnitude is huge but not infinite, the system is still Bmo stable. This system is neither asymptotically stable nor globally or locally stable.
6.2.1. Why Study Local Stability Instead of Global Stability This book focuses more on the local stability of fuzzy control systems than on their global stability. The motivation and justification are as follows. In our opinion, the two types of stability are equally important; one cannot replace the other, for each type has its distinctive merits and drawbacks. A global stability condition determines system stability in the whole state space. For nonlinear systems, global stability conditions are, in most cases, sufficient conditions; necessary ones are uncommon. Except for linear systems, a global stability condition is rarely a necessary and sufficient condition. The most widely used and effective methodology for global stability determination was developed by A.M. Lyapunov, which requires a Lyapunov function to be constructed for the control system involved. For any specific system, more than one Lyapunov function exists. Regardless of the methodologies, the foremost assumption for establishing a global stability condition, sufficient or necessary, is the availability of the analytical expressions of both the controller and the system. This assumption is critical: Global stability analysis is impossible without it. This assumption is rather unrealistic and impractical not only to specific fuzzy controllers, but also to the fuzzy control paradigm as a whole. First of all, the explicit structures of many fuzzy controllers are not analytically derivable. A fuzzy controller is made up of several interrelated nonlinear components (e.g., input and output fuzzy sets, fuzzy rules, fuzzy logic AND and OR operators, fuzzy inference, and a defuzzifier). The structures and parameters of these components are chosen by the controller designer at will and involve little restriction. As such, the structures of most fuzzy controllers are inherently complex and can virtually be any nonlinear form, making analytical derivation very challenging. Second, the mathematical model of the nonlinear system involved mayor may not be available. (It makes
Section 6.3. •
Local Stability of Mamdani and TS Fuzzy PID Control Systems
167
little sense to use a fuzzy controller to control a linear system.) A nonlinear system model may be developed by two approaches. The first approach analytically derives a model by using the natural laws governing the system. This approach often fails if the system is too complicated. The second approach is system identification using data describing the system's dynamic behavior, which is a black-box approach. Accurate nonlinear system identification is difficult because very often the modeler cannot even correctly assume the system's nonlinear structure to begin with. The second difficulty is true for any control methodologies, not fuzzy control alone. Even when this strict assumption is met, properly determining global stability for fuzzy control systems can still be difficult. Lyapunov functions are system-dependent, and their construction currently is more an art than a science. They often require skills and experience as well as trial-and-error effort. There does not exist a general method to automatically construct an appropriate Lyapunov function for any given nonlinear system. Because of the structural complexity and peculiarity of fuzzy controllers (that is, nonlinear and timevarying), Lyapunov function construction is challenging. At best, the global stability of fuzzy control systems may be judged on a case-by-case basis with no general solutions. Determining global stability for the general fuzzy control systems, Mamdani type or TS type, is certainly out of question at present. Given these difficulties associated with global stability determination, one would be better off by concentrating on local stability. It should be emphasized that local stability does not mean system stability at the equilibrium point only. Rather, it means system stability in a region around the equilibrium point. Local stability can be determined without much information and assumption on the fuzzy controller and system. As we will show, only two pieces of information are needed: (1) the fuzzy controller structure around the equilibrium point and (2) the linearizability of the system at the equilibrium point. Both are obtainable in many cases, even for the general Mamdani and TS fuzzy controllers. These simple requirements also make the local stability results for fuzzy control systems practically usable.
6.3. LOCAL STABILITY OF MAMDANI AND TS FUZZY PID CONTROL SYSTEMS
6.3.1. Local Stability Determined by Lyapunov's Linearization Method Most physical systems are nonlinear, and nonlinear control can achieve better control performance than linear control. However, designing a linear control system is significantly easier than developing a nonlinear control system. Lyapunov's linearization method (e.g., [191]) provides a theoretical justification for using a linear controller to control a nonlinear system. The basis of the method is the continuity of a nonlinear control system: The method assumes the nonlinear control system to be continuously differentiable at the equilibrium point. In essence, Lyapunov's linearization method states that if the linearized control system is strictly stable (or unstable), then the equilibrium point is locally stable (or unstable) for the nonlinear control system. If the linearized control system is marginally stable, then the local stability of the nonlinear control system cannot be determined by the linearized system. When this is the case, the higher-order terms of the nonlinear system in the Taylor expansion need to be examined to judge local stability. In this book, we will not address the marginal stability of a fuzzy control system because it depends on the structures of the fuzzy controller and
168
Chapter 6 •
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
system. In other words, it is system-dependent and hence lacks the generality and significance for fuzzy control systems at large. Nevertheless, such an analysis could be conducted using structures of the fuzzy controllers. In Chapters 3 and 5, various Mamdani and TS fuzzy PID controllers (PI and PD controllers are special cases) were proved to be nonlinear PID controllers with variable gains. At an equilibrium point, the variable gains become constant gains (i.e., static gains), and the fuzzy controllers become linear Pill controllers, called corresponding linear PID controllers. On the basis of Lyapunov's linearization method, it immediately follows that if a fuzzy Pill control system is continuously differentiable and its corresponding linear PID control system is strictly stable (or unstable) at the equilibrium point, the fuzzy control system is locally stable (or unstable). Hence, we have the following result. Theorem 6.1. Assume that a Mamdani or TS fuzzy Pill controller is used to control a nonlinear system and both the controller and the system are continuously differentiable at an equilibrium point. The fuzzy control system is locally stable (or unstable) if and only if the corresponding linear PID control system is strictly stable (or unstable). Using this theorem offers at least three practically important advantages. First, it is a necessary and sufficient condition. Unlike the sufficient or necessary global stability conditions in the literature, this condition is not conservative and is the tightest possible stability condition. Second, only analytical structure of the fuzzy controller around the equilibrium point is required. Availability of the complete analytical structure is unnecessary. Third, the criterion can be used to determine local stability, not only when the system model is explicitly available, but also when the model is unavailable but is known to be linearizable about the equilibrium point. (Most physical systems are linearizable.) In the latter case, one can devise a linear PID controller and use it to control the nonlinear system. If the resulting control system is observed to be locally stable (unstable), then the same system controlled by a linearizable fuzzy PID controller whose static gains equal the gains of the linear Pill controller will be locally stable (unstable). This approach is important because, in practice, physical systems are often too complex and costly to be precisely modeled. Since any model is merely an approximation to the physical system, it is rational to seek a method capable of determining system stability without the accurate model. These merits and advantages hold not only for the fuzzy Pill control systems but also for other types of fuzzy control systems that are much more general. (See Sections 6.4 and 6.5.) The geometry and size of a basin depend on the control system in question. It can be small or large; sometimes it may be large enough to cover the region of interest in the state space. It is usually difficult to exactly determine the geometry and size. In most cases, a computed basin is rather conservative. For practical applications, because local stability guaranteed by Theorem 6.1 provides a good starting point, it may not be too difficult for a fuzzy control system to be tuned manually using the trial-and-error method in achieving global stability. After all, many real-world Pill control systems are tuned manually to obtain satisfactory performance as well as global stability.
6.3.2. System Linearizability Criterion Theorem 6.1 is established under the following assumption: Both the controller and the system are continuously differentiable (that is, linearizable) about the equilibrium point, making the fuzzy control system linearizable about the equilibrium point. The linearizability
Section 6.4. • Local Stability of Mamdani Fuzzy Control Systems of Non-Pill Type
169
requires the system to be differentiable at least once with respect to all input variables and the resulting derivatives at the equilibrium point to be unique for every input variable. Thus, before utilizing the theorem to reach a stability conclusion, the validity of this assumption must be checked. One may check the linearizability of the fuzzy controller and the system separately. If both are linearizable, the fuzzy control system is linearizable; otherwise, the system is not linearizable. The linearizability of a fuzzy controller depends on its components and configuration. It is easy to verify that all the TS fuzzy Pill, PI, and PD controllers in Chapter 5 are linearizable except the one that uses the Zadeh fuzzy AND operator. However, none of the nonlinear Mamdani fuzzy PI and PD controllers in Chapter 3 is linearizable about (0,0). Take the Mamdani fuzzy PI controller described in Table 3.3 as an example:
8~u(n)1 8e(n)
(0,0)
8~U(n) I 8r(n)
=KAu·Ke·H, 4L
for ICI and IC3
= K Au ·Kr .H,
for IC2 and IC4.
4L
(0,0)
Therefore,
8~U(n) I 8e(n)
(0,0)
=J aAU(n) I 8r(n)
(0,0)'
which means this fuzzy controller is not linearizable at (0,0). The cause is the use of the Zadeh fuzzy AND operator that leads to two different control algorithms in IC 1 to IC4 around (0,0). In general, caution should be exercised in validating the linearizability test for a fuzzy controller that uses the Zadeh fuzzy AND operator in its rules. Whenever this is the case, input space around the equilibrium point must be divided into several ICs, resulting in one control algorithm per IC. The algorithms may be different in different ICs. This can yield more than one derivative result at the equilibrium point, failing the linearizability test. At this point, it is still mathematically unclear whether using the Zadeh fuzzy AND operator always causes a fuzzy controller to fail the test. Control algorithms in different regions depend not only on the AND operator but also on other components of the controller. Many different situations need to be examined before a solid conclusion can be made in this regard. Our conjunction is that the test fails whenever the Zadeh fuzzy AND operator is employed. The test will not fail for Mamdani and TS controllers of PID type if they use other fuzzy AND operators. Thus, Theorem 6.1 is general and widely applicable. If a fuzzy control system is not linearizable about the equilibrium point, the theorem should not be used to derive stability information. This, however, does not imply system instability. It simply means that the system fails to satisfy the assumption required by the theorem, making it inapplicable to the particular case. Whenever this happens, one needs to use other stability analysis methods. As an alternative, we will develop Bmo stability conditions for those Mamdani and TS fuzzy PID controllers that fail the linearizability test.
6.4. LOCAL STABILITY OF MAMDANI FUZZY CONTROL SYSTEMS OF NON·PID TYPE We now develop local stability conditions for fuzzy control systems involving the Mamdani fuzzy controllers of non-Pill type that use linear or nonlinear fuzzy rules. We directly extend Theorem 6.1 to cover these fuzzy control systems.
170
Chapter 6 •
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
Theorem 6.2. Assume that a typical Mamdani fuzzy controller with linear fuzzy rules is used to control a nonlinear system and suppose that the fuzzy controller and the system are continuously differentiable at the equilibrium point. The fuzzy control system is locally stable (or unstable) if and only if the corresponding linear control system is strictly stable (or unstable). This conclusion also holds for the typical Mamdani fuzzy controller with nonlinear fuzzy rules. There are many different fuzzy controllers with linear or nonlinear rules, and the theorem is in principle applicable to all of them. Like Theorem 6.1, however, one should first check the linearizability of the fuzzy control system in question before drawing any stability conclusion. For the particular configurations of the fuzzy controllers with linear rules in Chapter 4, they are not linearizable at (0,0). Again, the reason is the use of the Zadeh AND operator. Nevertheless, if the product fuzzy AND operator is used and the rest of the controllers' components remain the same, the controllers will be linearizabale.
6.5. LOCAL STABILITY OF GENERAL TS FUZZY CONTROL SYSTEMS 6.5.1. Theoretical Development The local stability results on the Mamdani fuzzy controllers can be extended to TS fuzzy controllers. According to Theorem 5.1, the general TS fuzzy controllers are nonlinear controllers of Pill type, with variable gains changing with state of input variables: (6.1) where o
_
L Jlj(x,A) . aij -
bi(x,A) =
j=l
-0----
for i = 0, ... , M.
(6.2)
LJlj(x,A)
j=l
Without loss of generality, assume that the system to be controlled, designated as P(x), is linearizable about the equilibrium point. Then, according to Lyapunov's linearization method, the TS fuzzy control system consisting of P(x) controlled by a TS fuzzy controller of the general class is locally stable around the equilibrium point x = if and only if the control system consisting of P(x) and the linear constant-gain controller
°
(6.3) is strictly stable around x = O. Here, bi(O) caI! be calculated using (6.2) because aij and ~ are known for any given fuzzy controller; Jlj(x,A) and Q are readily computable based on the input fuzzy sets, fuzzy rules, and fuzzy logic AND operator. We state this necessary and sufficient stability condition as follows. Theorem 6.3. Assume that a TS fuzzy controller of the general class and a system to be controlled are linearizable about the equilibrium point. The fuzzy control system is locally stable (or unstable) if and only if the linearized fuzzy control system is strictly stable (or unstable) about the equilibrium point.
Section 6.5. • Local Stability of General TS Fuzzy Control Systems
171
The linearizability of a TS fuzzy controller depends on its configuration. When widely used components (e.g., triangular, trapezoidal, or Gaussian membership functions for input fuzzy sets, product fuzzy logic AND operator, centroid defuzzifier) are used, the controller is likely linearizable about the equilibrium point. In some circumstances, one can even determine the linearizability of a fuzzy controller without its explicit structure. For example, if, by some means, we know the structure of a fuzzy controller to be a polynomial function around the equilibrium point, then we know the controller to be linearizable even without explicit knowledge about the polynomial function (e.g., the degree of the polynomial and its coefficients). If such qualitative knowledge is not available, then analytical expression of the controller structure around the equilibrium point is necessary for the linearizability test. We emphasize that analytical expression of the controller structure for the whole input space is not needed. The theorem can be used even when the system model, P(x), is unavailable but is known to be linearizable about the equilibrium point. One can construct a TS fuzzy controller of the general class that is linearizable about the equilibrium point and computes bi(O) using (6.2). One can then devise a linear controller whose input variables are the same as those of the TS fuzzy controller and whose gains are respectively bi(O). Now, one can use the linear controller to control the system. If the resulting control system is observed to be locally stable (unstable), the fuzzy control system is locally stable (unstable) too. Using Theorems 6.1, 6.2, and 6.3 only requires minimal information on the fuzzy controller and the system. Moreover, they cover very broad classes ofMamdani and TS fuzzy control systems. None of these merits would be possible for global stability analysis of the same fuzzy control systems.
6.5.2. Numeric Example Having developed the theory, let us see how to use it by a numeric example. The example uses a forced pendulum as P(x) whose motion is described by a second-order nonlinear differential equation [66]: ...
() + b(} + 0)2 sin () =
1': (t)
--!!!.-
ml2
(6.4)
where () is the angle between a rigid rod holding the pendulum and a vertical line, b is the coefficient of viscous friction, m is the mass of the pendulum, I is the length of the rod, 0)2 = gil, and Tin(t) is input torque applied to the rod. After being linearized about the equilibrium point () = 0, system (6.4) becomes
(j + bO + olo
= Tin~) . ml
(6.5)
We use mP = 1, b = 0.25, and 0)2 = 100. To discretize the continuous-time system, a sampling period of 0.01 seconds (i.e., T = 0.01 seconds) is adopted.
172
Chapter 6 •
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
EXAMPLE 6.1 Suppose that one wants to use a nonlinear TS fuzzy controller of the general class to control the forced pendulum. Assume that the designed controller has two input variables: e(n) = S(n) - O(n)
and r(n) = e(n) - e(n - 1) T
where S(n) is the setpointjreference signal. The chosen membership functions for e(n) and r(n) are shown in Fig. 6.1, where ell = -1, el2 = -0.7, el3 = 0.4, el4 = 0.8, PI = -1.1, P2 = -0.6, P3 = 1.7, and P4 = 2.1. There are four fuzzy rules covering the input space around the equilibrium point. (Note that the complete rulebase contains more than four rules, but we do not need to know the rest of them.)
= all e(n) + a21 r(n) IF e(n) is Al AND r(n) is B2 THEN U(n) = aI2e(n) + a22r(n) IF e(n) is A2 AND r(n) is BI THEN U(n) = a13 e(n) + a23r(n) IF e(n) is Al AND r(n) is BI THEN U(n)
IF e(n) is A2 AND r(n) is B2 THEN U(n) = aI4e(n) + a24r(n)
where all = 20, a21 = 1, a12 = 24, a22 = -18, a13 = 7, a23 = 2, al4 = 13, and a24 = 6. The product fuzzy logic AND operator is used in the rules, and the centroid defuzzifier is employed. One wants to know whether this TS fuzzy control system is locally stable around the equilibrium point.
Solution The nonlinear system is obviously linearizable, as we are using the linearized system. One needs to determine the linearizability of the fuzzy controller. The fuzzy controller is described by
U(n) = Kp(e,r)e(n)
+ K;(e, r)r(n) ,
(6.6)
Membership
e(n)
Membership
r(n)
o Figure 6.1 Membership functions used by the TS fuzzy controller in Example 6.1.
Section 6.6. •
173
BillO Stability of Mamdani Fuzzy PI/PD Control Systems
= 4 (only the four rules
which is a nonlinear PD controller with variable gains. Using (6.2) and noting Q are of interest and relevant), K (e,r) =
/JA (e)/JiJ (r)all 1
P
1
+ /JA (e)/JiJ (r)a12 + /JA (e)/JiJ (r)a13 + /JA (e)/JiJ (r)a14 + /JA (e)/JiJ (r) 1
2
2
1
/JA 1 (e)/JiJ l (r) + /JA 1 (e)/JiJ 2 (r) + /JA 2 (e)/JiJ l (r)
2
2
2
2
and
K.(e r) l
= /JA (e)/JiJ (r)a21 + /JA (e)/JiJ (r)a22 + /J'A- (e)/JiJ (r)a23 + /JA (e)/JiJ (r)a24 1
1
1
2
/JA 1 (e)/JiJ l (r) + /JA 1 (e)/JiJ2 (r)
,
+ JlA
2 2
1
2
2
(e)/JiJ l (r) + JlA 2 (e)/JiJ2 (r)
•
The membership functions relevant to local stability determination are just four segments of the straight lines covering the equilibrium point. The remaining part of the triangular /JAl(e) and /JiJ2 (r) and trapezoidal /JA 2 (e) and /JiJ t (r) is irrelevant. As a result, one can know, even without any computation, that the numerator and denominator of Kp(e,r) and Ki(e,r) are second-order polynomials in terms of e(n)r(n). Therefore, the result of the first-order derivative of U(n) with respect to e(n) or r(n) at the equilibrium point is unique. As pointed out earlier, in many cases, one can conclude a fuzzy controller to be linearizable about the equilibrium point even without seeing the actual mathematical formulation of the fuzzy controller. This example shows this point and also demonstrates the practicality of the local stability conditions.
We then compute:
JlA 1 (O)JliJ 1 (0) = 0.2182,
fJA 1 (O)JliJ2 (0) = 0.4321,
JlA 2 (O)JliJ 1 (0) = 0.1429,
fJA 2 (O)JliJ2 (0) = 0.2828.
Hence,
Kp(O,O) = 18.0405
and
Ki(O,O) = -6.4456.
The closed-loop transfer function of the fuzzy PD control system around the equilibrium point can easily be determined as follows:
O(z) -0.0549z + 0.0567 S(z) = z2 - 2.0412z + 1.0533 ' which has two poles 1.0206±0.1081i. Both poles are outside the unit circle; hence the designed fuzzy control system is locally unstable at the equilibrium point. Here, S(z) is the z-transform of S(n).
6.6. BIBO STABILITY OF MAMDANI FUZZY PI/PD CONTROL SYSTEMS 6.6.1. Small Gain Theorem The Mamdani fuzzy PI and PD controllers using the Zadeh fuzzy AND operator in fuzzy rules are not linearizable around the equilibrium point. Thus, Theorem 6.1 cannot be used to determine the local stability of these fuzzy control systems. Alternatively, in this section, we use the Small Gain Theorem to explore their Bmo stability. The Small Gain Theorem is an analytical method for determining the BffiO stability of general nonlinear control systems (e.g., [48][98]). Figure 6.2 shows a general nonlinear control system in a block diagram form, where C is a (nonlinear) controller, conventional or fuzzy, and 11
2
~ [t(Oj + h;) + 101- 03 + hi -
h31] 114>11
3
~ [t(Oj + hj)+ 103- 04 + h3 -
h 1] 114>11
~ [~(Oj + hj)+ 102 -
h4 1] 114>11
4
5
11 6, 8, 10 and 12 a The
+ a2 + b, + b2)IIt1l11 + a3 + b I + b3 )IIt1l11 (a3 + a4 + b3 + b4 )IIt1l11 (a2 + a4 + b2 + b4 )IIt1l 11
(al (al
7 9
04
o
12 ICs are shown in Fig. 3.3.
+ h2 -
4
180
Chapter 6 • Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
EXAMPLE 6.3 In Section 5.4.7, a simple TS fuzzy PI controller is designed to control the hyperthermia temperature model (5.7). The resulting fuzzy control system appears to be stable according to the simulation.
Assuming the simulation has not been conducted, determine the Bmo stability of the designed fuzzy control system.
Solution
= 0.008. From Section 5.4.7, the values of the TS fuzzy PI controller parameters are: al = 0.005, 02 = 0.007, 03 = 0.004, 04 = 0.006, b 1 = 2, b2 = 1.62, b3 = 1.4, and b4 = 2. Using Table 6.1, one can easily find that all the conditions are met. Thus, the TS fuzzy PI control system is BffiO stable.
In Example 6.2, we found the system norm 1/11
6.8. DESIGN OF MAMDANI FUZZY CONTROL SYSTEMS 6.8.1. Design Principle In this section, we develop a systematic, practical design procedure for fuzzy control systems involving the Mamdani fuzzy controllers in Chapters 3 and 4. We concentrate on the fuzzy controllers with nonlinear rules (see Table 4.6). The underlying assumption for the procedure is the unavailability of the mathematical model of the system to be controlled. A Mamdani fuzzy controller consists of a number of components: input and output fuzzy sets, fuzzy rules, fuzzy logic AND and OR operators, fuzzy inference, and a defuzzifier. They can be classified into two different types: structural parameters and functional parameters. The structural parameters, which determine the controller structure, are I (fuzzy rules), N, and f}. It is generally difficult to calculate or theoretically determine exact structural parameters. The designer needs to determine them empirically case by case, based mainly on the system type, the knowledge of the system operator from whom fuzzy rules are obtained, and the designer's experience with fuzzy control. Empirically selecting the structural parameters is a necessary step in fuzzy controller design, just as manually selecting a specific controller structure is a necessary step in classical controller design. We will establish guidelines for determining N and f}. The functional parameters, which determine the system performance once the structural parameters are fixed, include K e , K; K Au ' L, and H. After the structural and functional parameters are determined, the remaining parameters, J, S, V and A, can be calculated. The basis of the design procedure is the analytical structure of the fuzzy controllers with linear or nonlinear fuzzy rules. The analytical structure of the fuzzy controller with linear rules constructed via I(i,}) = i +} is given in Table 4.8. Its limit structure is a linear PI controller (see (4.22)): ·
AU() n
1 L1 N~
= K e ·K2LAu ·H e() K r ·KAu ·H ( ) n + 2L rn .
(6.11)
Since the limit structure and analytical structure are related, the limit structure can be used to systematically design the analytical structure. We will go a step further and use the limit controller (i.e., the linear PI controller) to develop a three-step design procedure for the fuzzy controllers with linear or nonlinear fuzzy rules. In the first step, the designer uses a linear PI controller to regulate the system. The proportional-gain and integral-gain of the PI controller are tuned to obtain at least an acceptable system output. In the second step, the values of the functional parameters,
Section 6.8. •
Design of Mamdani Fuzzy Control Systems
181
Ke , Kr, K!!,.u' L, and H, are calculated using the tuned proportional-gain and integral-gain as well as the system output of the tuned PI control system. Other parameters, J, S, ~ and A, are also calculated. In the last step, the structural parameters.j", N, and (), are determined based on intuitive and sensible guidelines.
6.8.2. Justifications for Design Principle For the following reasons, utilizing the limit controller corresponding to a fuzzy controller with linear control rules, instead of nonlinear control rules, is technically justified for developing the design procedure. First, the limit controller corresponding to a fuzzy controller with nonlinear fuzzy rules is usually more difficult to obtain. The result will be a nonlinear controller and will not be a linear controller of the PID type. Thus, such a controller is difficult to deal with and is more forbidding to be utilized as a vehicle for the fuzzy controller design. Second, linear rules represent common-sense strategy to control general systems. Nonlinear rules, though different from case to case, share some common characteristics that are similar to those of the linear rules. For example, Table 6.2 shows 49 nonlinear control rules, whereas Table 6.3 provides the corresponding 49 linear rules. There are 22 different rules between the tables. The similarities are as follows. The linear rules are symmetric about the off-diagonal of the table, as are the nonlinear rules. Also, within a row, ~u(n) gradually increases from left to right, whereas within a column, ~u(n) gradually increases from top to bottom. Finally, ~u(n) corresponding to the central area of the tables is small. Because of these characteristics, nonlinear rules usually deviate from the corresponding linear rules in TABLE 6.2
B_ 3 B_ 2 B-1 Bo BI B2 B3
Forty-nine Nonlinear Fuzzy Rules. a
A_3
A_2
VV_ V_ 4s V- 4 * V- 2 V_I Vo
V- 6 * V- s* V- 4 * V- 3 * V- 2 * Vo VI
6
A-I
Ao
Al
A2
A3
V- 4
V- 4 * V- 2 V- 2 * Vo V2* V2 V4 *
V_ 2 * Vo VI V3 * V4 * V4
V- 2
V-I Vo V2 * V3 * V4 * Vs* V6 *
Vo
V- 4 * V- 3 * V-I
Vo V2* V2
VI V2
V4 * V4 Vs V6
The rules that are different from the corresponding linear rules, shown in Table 6.3, are marked with *. There are 22 of them.
a
TABLE 6.3 Forty-nine Linear Fuzzy Rules Corresponding to the 49 Nonlinear Rules Given in Table 6.2.
B_ 3 B_ 2 B-1
Bo BI
B2 B3
A_3
A_2
VV- s
V- s
6
V- 4 V- 3
V- 2
V-I Vo
V- 4
V- 3 V- 2 V-I
Vo VI
A-I V- 4
Ao
Al
V- 2
V- 2 V-I
V- 3 V- 2 V-I Vo VI
V- 3
Vo VI V2
V2 V3
V-I Vo VI V2
V3 V4
A2 V-I
Vo VI V2
V3 V4 Vs
A3 Vo VI V2
V3 V4 Vs V6
182
Chapter 6 •
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
only a mild way. Another factor preventing rules from being severely nonlinear is that N often has to be quite small in practice to make construction of a fuzzy controller manageable. Third, a linear Pill controller can adequately be tuned through trial-and-error effort. The effort is minimal because it can be guided by qualitative knowledge about the system as well as numerous theoretical and practical methods (e.g., [10][185]). Usually, satisfactory control performance can be achieved quickly even if the explicit system model is unavailable. Considering the popularity and practicality of the Pill controller, making use of it in the fuzzy controller design process is desirable. This is the case even when the limit controller corresponding to a fuzzy controller with nonlinear rules can be derived. In addition to these reasons, the following inequality about the fuzzy controller with the linear rules provides further justification: IAU(n) -
J~ AU(n) I .s 2~~u~~).
(6.12)
The proof is quite simple. When E(n) and R(n) are in ICI to IC8, according to Table 4.8, we have
.
~U(n) - J~~U(n)
I
H I = K/!"u· N _ 1 (1 -
Pt(M,M» I1 - (E(n) S
-
l.) -
(R(n) S
- ]·)1 .
Using minimum Pt(M,M) = 0.5, minimum E(n) = is, and minimum R(n) =jS +A, we can achieve the maximum of this equation as K/!"uH(1 - ()/2(N - 1), which is less than K/!"uH/2(N - 1). The same can be proven true for ICl' to IC8'. Inequality (6.12) provides an estimate for the incremental output difference between the fuzzy controller with the linear rules and its limit controller (i.e., the linear PI controller). It discloses that if the fuzzy controller employs a large N, it will perform somewhat like the PI controller. If N is small, in a global sense, the fuzzy controller and the PI controller will act differently. For the fuzzy controllers with nonlinear rules, it is logical to reason that if the rules covering the region around the equilibrium point are linear, the fuzzy controllers should behave in a similar fashion in the area as the linear PI controller does. The two control systems will have the same local stability if the fuzzy controller is linearizable at the equilibrium point.
6.8.3. Design Procedure Next we will design a fuzzy controller with nonlinear rules to control a nonlinear system whose mathematical model is unknown. In the first step of this design procedure, the designer appropriately chooses the sampling period, T, according to the observed/estimated characteristics of the system. Since this is not a fuzzy controller specific issue, all the methods in conventional control theory can be used. The designer then tunes a linear PI controller to control the system. The time response period of the control system should be sufficiently long to cover the transient phase as well as the major portion of the steady-state phase. It should be assumed that at least acceptable system output performance is achieved. This requirement minimizes the likelihood of physical damage to the system when the PI controller is later replaced by the fuzzy controller designed according to the procedure. It is desirable, though not critical, to achieve as good a system output as possible. The better the system output of the tuned PI control system, the more appropriately the functional parameter values of the fuzzy controller will be
Section 6.8. •
183
Design of Mamdani Fuzzy Control Systems
calculated, and hence less tuning efforts will be needed to adjust the calculated values. Let the proportional-gain and integral-gain of the tuned linear PI controller be K; and K1, respectively. The corresponding maximal absolute value of e(n) and r(n) of the system output are emax and rmax' respectively. The design then enters the second step, in which the designer calculates first the five functional parameter values (i.e., K e , K; K au' L, and H) and then the values of J, S, "K and A. The sampling period of the fuzzy control systems should be the same as that of the PI control system because the sampling period depends only on the system's dynamics. This step encompasses three phases:
s;
(1) Calculating the functional parameters x; K au. The relationship between the gains of the PI controller and the scaling factors in the limit controller is
Obviously, if K, is known, K; can be calculated, and vice versa. The values of K; and K; are not critical, but their ratio is. The value of K; (or K r ) can be any number, but for simplicity let K; = 1. The value of K r , therefore, can be calculated:
K* K r - K~p r:
t :
From K; or K; K au can be calculated if L and H are known. (Recall K; = K au . Kr · H /2L and K1 = K au · K; . H /2L.) For simplicity, H and L are assumed to be equal. (Such an assumption will be shown valid later.) Under this condition, K au can be calculated by I
2K* K au =_P-
s;
or
(2) Calculating the functional parameters L and H. It is desirable that E(n) and R(n) most often fall into [-L, L]. This may be achieved by letting L = max(emax,rmax ) , because the designed fuzzy controller is expected to behave somewhat like the PI controller in a global sense. Next, H needs to be calculated. Because K au and H always appear as a product in the analytical structure (see Table 4.6; this is true for all the fuzzy controllers), the value of H is not critical, but the value of KauH is. To simplify the calculation of K au' we assumed H = L. (3) Calculating J, S, K and A.
184
Chapter 6 •
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
Calculation of these parameters is straightforward once N and fJ are decided in the third step: N-1 J=-2-' L
S=J' H V=2J'
and A = fJS.
The third step of the design procedure completes the design. The designer empirically selects the structural parameters of the fuzzy controller, namely, N, fJ, and f. Different values of N result in different nonlinearity. For linear rules, the larger the N, the .closer the nonlinear fuzzy controller is to a linear PI controller. Mathematically assessing the effect of different values of N on the fuzzy control system performance is difficult, and the effect is also system-dependent. According to the literature, N is usually moderate, with a typical value ranging from 3 to 16. Different fJ values result in different nonlinearity. According to Table 4.6, different values of fJ do not alter the structure of the global controller, but they do change the structure of the local PI controller (i.e., A and P2(M,M)). For different fJ values, the size of the square configured by [(i + 0.5)S - A, (i + 0.5)S + A] on the E(n) axis and [(j + 0.5)S - A, (j + 0.5)S + A] on the R(n) axis is different, and so is the size outside this square but inside the square configured by [i· S, (i + 1)S] and [j. S, (j + 1)S]. As an extreme, IC1' to IC8' will disappear if fJ = 0 (i.e., triangular input fuzzy sets). Analytically estimating the effect of different fJ values on control performance is virtually impossible. The effect is system-dependent as well. It appears reasonable to use fJ = 0.25 as an initial value for trial, which is midpoint of the fJ range, 0 to 0.5. As for the nonlinear fuzzy rules, they reflect the control operator's knowledge and experience with the system. They are application-specific and thus should be determined by the designer case by case.
6.8.4. Design Example Having described the design procedure, let us use an example to determine its effectiveness and practicality. EXAMPLE 6.4 In this example, a first-order nonlinear differential equation y'(t) - 3.Sy(t) + y(t) = u(t)
(6.13)
serves as the system to be controlled. The sampling period T is chosen as 0.01, and the setpoint is arbitrarily chosen as 3. To be realistic and practical, we assume the system to be mathematically unknown to the designer.
Section 6.8. • Design of Mamdani Fuzzy Control Systems
185
The first task is to use the design procedure to design two fuzzy controllers: one with the 49 linear rules in Table 6.3 and the other with 9 linear rules. The second task is to compare their control performance to appreciate the effect of different N values. Solution
Using the trial-and-error method guided by prior qualitative knowledge about the system, one can empirically tune the gains of the linear PI controller. A good control performance, shown in Fig. 6.3, is achieved when the proportional-gain x.; = 1.1 and the integral-gain K1 = 2. From the recorded output of the tuned PI control system, the maximal absolute value of e(n) is found to be 3 (i.e., emax = 3) and the maximal absolute value of r(n) to be 3.2837 (rmax = 3.2837).
Based on this information, we design the desired fuzzy controllers. Let us work on the 49-rule case first (N = 7). Let () = 0.25 and K, = I, the default values for these parameters. Then, the following parameters can be calculated:
K*
s, = ~ = 0.55, I
L = max(emax, rmax ) = 3.2837, H
= L = 3.2837,
J_ N- 1_ 7- 1_3 -
2
S=
J=
L
-
2
-
,
1.0946,
H V = - = 0.5473 2J 4.5,..----r------"'T---..,..-----y---__r----_--. 4
3.5 3
\ PI
0.5 Olo-oo-_ _-......_ _--.a. o 0.5
..&-_ _........._ _----'a....-_
2
2.5
_
~
3
Figure 6.3 Performances ofthe PI control system and designed fuzzy control systems with 49 and 9 linear rules.
186
Chapter 6 •
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
and
A
= OS = 0.274.
The absolute value of the maximum increment for the fuzzy controller is K/1uH = 13.1348. Simulated output of this designed fuzzy control system is shown in Fig. 6.3. We now handle the 9-rule case (i.e., N = 3). Still, let 0 = 0.25, and K; = 1. Then the values of K r, K/1u, L, and H are the same as those in the 49-rule case. Nevertheless, J = (N - 1)/2 = 1, S = L/J = 3.2837, V = H/2J = 1.64185, and A = OS = 0.821. The absolute value of the maximum increment for the fuzzy controller remains 13.1348. The simulated performance of this fuzzy control system is also given in Fig. 6.3. Now compare the performances of the three control systems. Among them, the fuzzy control system with N = 3 is clearly the best. Compared with the fuzzy control system with N = 7, its rise-time is significantly less. This is because the fuzzy controller with the smaller N is more nonlinear and therefore is able to control the nonlinear systems better. The performance of the fuzzy controller with 49 rules is slightly worse than that of the linear PI controller owing to the small overshoot. As expected, the larger the N, the more similar the performance. If N = 00, the fuzzy control performance would be exactly the same as the PI control performance. Assuming the performances of either fuzzy control systems meet the designer's specifications, the design is finished.
6.8.5. System Tuning Guidelines As is true of any control system, especially nonlinear ones, the performance of a designed fuzzy controller may not be that specified prior to design. This may be especially true if the performance of the tuned PI control system is barely acceptable. When this is the case, the calculated functional parameters need to be carefully fine tuned to obtain the desired performance. The following practical guidelines, based on the structure of the fuzzy controller, should help during the fine-tuning process: 1. The value of L should not be modified first because (1) it is calculated from emax and rmax' and (2) the increase of K; and K; is somewhat equivalent to the decrease of L, and vice versa. 2. The value of H need not be modified, as the adjustment of K/1u is equivalent to the adjustment of H. 3. Theoretically assessing the role of 0 is difficult, whereas practical assessment requires a lot of trial-and-error effort. Hence, 0 should be adjusted later, ifnecessary. 4. The fuzzy rules acquired by the designer are usually reasonable, and only minor modifications may be needed. Modifying rules at a later time is wise because it is difficult to identify the individual rules responsible for overall unsatisfactory control performance. Moreover, the rule effect is determined not solely by the rules themselves, but also by the functional parameters, mainly K e, K r, and K/1u. Without adequate parameter values, rule refinement can be troublesome.
Section 6.8. • Design of Mamdani Fuzzy Control Systems
187
In summary, K e , K r , and K tiu should be tuned first. The role of these three parameters can be seen from the limit controller (6.11) in relation to the gain and integral-time of the linear PI controller, which can be expressed as
(6.14) where T, is the integral-time. Note that (6.11) can be rewritten as
J~ AU(n) = Kr·~1u·H (~: e(n) + r(n)). We can see that changing K; only affects the integral control term (i.e., the e(n) term). Increasing K; is equivalent to decreasing Ti , which, according to the PID control theory, will result in a more oscillatory system output and less system stability. Decreasing K; will produce the opposite effect to the system output. If K; is too small, it will take a long time to eliminate the steady-state error of system output owing to too weak integral action. Changing K; only affects the proportional control term (i.e., the r(n) term). Increasing K; results in a more responsive system output with less rise-time but longer settling-time. A too large K; causes a too large Kp which destabilizes the system. Decreasing K, causes K p to decrease, which produces the opposite effects. Changing K tiu affects both the proportional control term and the integral control term, and it is equivalent to changing Kp in (6.14). Therefore, increasing K tiu produces a more responsive but less stable control system. Decreasing K ti u produces the opposite result. Finally, it should be pointed out that changing Land H is equivalent to changing Kp in (6.14).
6.8.6. Examples of Designing More Complicated Fuzzy Control Systems We now continue Example 6.4 and design fuzzy controllers with nonlinear fuzzy rules to demonstrate the usefulness of the tuning guidelines as well as the design procedure. EXAMPLE 6.5 Design a fuzzy controller with the 49 nonlinear rules in Table 6.2 to control the system (6.13).
Solution According to Tables 6.2 and 6.3, the difference between the nonlinear and linear rules is significant; there are 22 different rules, accounting for 45% of the total rules.
The poor but acceptable performance of the PI control system shown in Fig. 6.4a is presumably the best performance that the designer is able to achieve after trial-and-error tuning effort. The tuned proportional-gain = 2 and integral-gain K1 = 2. The poor performance is hypothetical because much better performance can be achieved when = 1.1 and K1 = 2, shown in Example 6.4 (see Fig. 6.3). But to demonstrate that a good PI control system performance is not critical for designing an adequate fuzzy control system and that an acceptable performance will suffice, the PI control performance is deliberately set poor. From the tuned PI control system output, the maximal absolute value of e(n) is found to be three (i.e., emax = 3) and the maximal absolute value of r(n) is found to be 7.0956 (i.e., rmax = 7.0956).
K;
K;
188
Chapter 6 •
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
4.5r---~---~--~~--~-----,
4
luzzy control system
3.5 3 "S c. "S 2.5
o ~
2
ili
1.5
'iii
Figure 6.4 Performances of the PI control system and the designed fuzzy control system : (a) initial performances, and (b) final, tuned performances.
Now, design a fuzzy controller with the nonlinear rules using the information provided by the PI control. Again, let () = 0.25 and K, = 1. The parameter computation is as follows:
K! K =....J!....= 1 r Ki ' K Au =2Ki =4, L = max(e max , rmaJ = 7.0956,
H = L = 7.0956, N-l 7-1 J=-2-=-2-=3,
S
L
= J = 2.3652, H
= 2J = 1.1826, A = ()S = 0.5913 . V
Section 6.8. •
189
Design of Mamdani Fuzzy Control Systems
The maximum increment of the fuzzy controller is computed as K Au ' H = 28.3824. The simulated output of the designed fuzzy control system with these calculated parameter values is shown in Fig. 6.4a. The performance is unsatisfactory (but supposedly acceptable), with too much oscillation and too large rise-time. The parameters need to be tuned to eliminate the oscillation and significantly reduce the rise-time. According to the tuning guidelines, the first option is to tune K e , K r , and K Au ' Decreasing K Au alone can eliminate the oscillation but at the expense of longer rise-time, whereas increasing K Au produces the opposite result. Increasing K; alone can significantly reduce the rise-time, but the oscillation still exists. It is found that decreasing K; can achieve the goal. K; is gradually reduced with improving system performance. A good performance is achieved, as shown in Fig. 6.4b, when K; = 0.276. This good control performance is obtained by merely tuning K; from 1 to 0.276. Simultaneously adjusting more than one scaling factor may achieve even better results. However, higher dimensional parameter search is far trickier than one-dimensional search, especially when the fuzzy control system is complex and highly nonlinear. The PI control system performance is also included in Fig. 6.4b for comparison, where is calculated based on the tuned value of K; (Le., 0.276) and KT remains unchanged since it is not related to K: Evidently, the PI control system is unstable. Example 6.6 is more realistic for it represents a real-world application.
K;
EXAMPLE 6.6 Suppose a fuzzy controller is designed with the nonlinear rules in Table 6.2 to control the model of MAP in patients (see (8.1)). It is known that the sampling period T = 10 seconds is adequate. The initial MAP and the target MAP are 140mmHg and lOOmmHg, respectively. How should the fuzzy controller be designed?
Solution We first design and then tune a linear PI controller to control the patient model. Supposedly, we can only achieve the performance labeled as PI (initial) in Fig. 6.5. The performance is poor because MAP decreases too slowly, but it is still clinically acceptable as far as the patient's safety is concerned. We 150 r----..,---~--....----..--__-
f
140
! 130
i
120
~
110
~c
100
!
!
J
...
' ... ",.
.........
" 50. Thus, the tracking controller to be designed will be stable. The tracking controller is u(n)
= f/Jo~n»
(-
~ Bj(y(n»y(n -
i) - f/Jl(v(n»u(n - 1) + r(n
+
1)).
According to (6.30), the steady-state output of the designed controller at Sf is
From the given fuzzy system, we compute the values of (J;(Sf) and (fJ/(Sf) as (JO(Sf) = -3.9851, (Jl(Sf) = -5.5249, (J2(Sf) = -2.0732, (fJo(Sf) = 1.4641, and (fJl(Sf) = 1.2623. Consequently, uf = 1.8461. Figure 6.8 displays the system output along with the desired trajectory. The trajectory is always perfectly tracked. The corresponding controller output is exhibited in Fig. 6.9. The controller is stable, and indeed the steady-state output is 1.8461, as calculated. 50 r-----~---r----r---.,..---.,.__--__--....._--_--__--_..
40 30
-10
-20
-30---..I..---..a---""'----..a.---..a.---..a.---.......- -........--~-- ..... o 100 80 10 70 30 40 50 80 90 20 Tim. Index n Figure 6.9 Output of the output tracking controller designed using the feedback linearization technique in Example 6.10. The controller is stable, confirming the result of the analytical determination. The steady-state output of the controller is 1.8461, the same as the value computed using (6.30).
Section 6.13. • Design of Perfect Tracking Controllers for General TS Fuzzy Models
205
In the next example, we show that the controller designed in Example 6.10 becomes unstable for the same fuzzy system at a different value of Sf. EXAMPLE 6.11 In Example 6.10, if the final fixed position of the desired trajectory is 0.7 instead of 004, for 51 :::: n :::: 100, will the designed controller still be stable?
Solution
Now Sf = 0.7. One can calculate that CPO(Sf) = 1.2081 and CP!(Sf) = 1.4867, and hence the root is z = -1.2307 (outside the unit circle). Thus, the fuzzy system becomes a nonminimum-phase system when y(n) = Sf = 0.7, and consequently the designed controller becomes unstable for the new final trajectory position. Although the perfect tracking is still achieved, as shown in Fig. 6.10, the controller output grows without bound and the controller is unusable (Fig. 6.11), as predicted.
0.8
~ 'Iii
Ell Ell Ell
Ell
0,4
$
~
$
i
0.2
u..
e Ell
e
~
I
DE
r>.
'1)
0.6
Ell Ell
6)
$
Ell $ $
e Ell $
Ell Ell
8 -0.2 o
i-
O ,4
-0.6
(fl
Ell $
E!' Ell $ III III Ell
Ell,
-0.8 -1 L--_ _L-_---.JL-_---l_ _--.l._ _-..L_ _--L_ _- L_ _-'--_ _-'--_ _- ' 40 50 60 70 80 90 100 10 30 o 20 lime Index n
Figure 6.10 Output of the unstable TS fuzzy dynamic system controlled by an output tracking controller in Example 6.11, which is designed in Example 6.10 using the feedback linearization technique. Sign 0 represents the desired output trajectory, whereas sign + represents the system output. The figure shows that perfect tracking is achieved. Note that the final fixed position of the desired trajectory, Sf' is 0.7 instead of 0.4 as shown in Fig. 6.9 for Example 6.10.
Chapter 6 •
206
Stability Analysis and Design of Mamdani and TS Fuzzy Control Systems
2500 2000 1500 1000
i
500
~
I
0 -500
-1000 -1500 -2000
0
10
20
30
40
50 80 Time Indexn
70
80
90
100
Figure 6.11 Output of the tracking controller in Example 6.11. Because of the change of the final position of the desired trajectory from 0.4 in Example 6.10 to 0.7 in Example 6.11, the controller becomes unstable, as predicted by using (6.29).
6.14. SUMMARY Necessary and sufficient local stability conditions are derived for the Mamdani and TS fuzzy control systems. The conditions can be used not only for determining stability but also for designing (locally) stable general fuzzy systems. Only minimal system information is required (i.e., the system's linearizability and analytical structure around the equilibrium point). The conditions are sometimes usable even without system models. Bmo stability conditions for the Mamdani and TS fuzzy PI/PD control systems are also established. Based on the limit structure of the fuzzy controllers with linear fuzzy rules, a three-step design procedure and practical tuning guidelines are developed for designing nonlinear Mamdani fuzzy controllers with nonlinear rules to control nonlinear systems. General TS fuzzy models and filters are proved to be nonlinear ARX models and nonlinear FIR/IIR filters, respectively. A local stability criterion is established, and it can be used to invalidate a TS fuzzy model as a means of model quality test. Using feedback linearization technique, we can design stable controllers to achieve perfect output tracking control of the TS fuzzy models.
Exercises
207
6.15. NOTES AND REFERENCES Local stability of the Mamdani fuzzy control systems (Sections 6.3 and 6.4) was first studied in [254] and was then extended to cover the TS fuzzy PID control systems (Section 6.5) [269][270]. BIBO stability of fuzzy control systems was first investigated in [36] for the Mamdani fuzzy PI controller (Section 6.6). Then, it was studied in [55] for the simple TS fuzzy PI control systems (Section 6.7) and in [56] for more general TS fuzzy control systems. The design techniques in Sections 6.8 and 6.9 were developed respectively in [259] and [265]. The relationships in Sections 6.10 and 6.11 were established in [268][272]. The results in Sections 6.12 and 6.13 are from [272]. Stability analysis and design of fuzzy control systems are important subjects, and many investigators have made much effort with abundant results. The bibliography provides a partial list of the publications.
EXERCISES 1. Regardless of the type of controller involved, classical or fuzzy, what are the necessary conditions for global stability study? Can these conditions be satisfied in practice by fuzzy control systems? 2. What are the pros and cons of studying the local stability of (fuzzy) control systems, as opposed to global stability?
3. How do you determine whether a fuzzy controller is continuously differentiable (i.e., linearizable) at an equilibrium point? For the fuzzy controllers studied in Chapters 3 to 5, which fuzzy controllers are linearizable and which are not? 4. Perform the calculations in all the numeric examples in this chapter. The details and every step are required.
5. Use the design technique in Section 6.8 to design a Mamdani fuzzy control system that interests you. 6. Utilize the design method in Section 6.9 to build a TS fuzzy control system that is not only (locally) stable but also well-performing. 7. General TS fuzzy filters are nonlinear FIR/IIR filters. What are the possible benefits of such nonlinear filters?
8. Modify the parameters of the fuzzy model in Example 6.9 so that it becomes locally stable. 9. What are the pitfalls for a controller designed based on the feedback linearization method? To find out how robust the controller designed in Example 6.10 is, modify some of the model parameters in Example 6.9. Does the control performance deteriorate substantially?
10. In Section 6.13.3, design a controller to control the same TS fuzzy model but to achieve perfect output tracking of different reference trajectories.
Mamdani and TS Fuzzy Systems as Functional Approximators
7.1. INTRODUCTION A system capable of uniformly approximating any continuous function is called either a functional approximator or a universal approximator. In mathematics, the term functional approximator is widely used, whereas in the fields of fuzzy systems and neural networks, the convention is to use universal approximator. We use both terms interchangeably. In this chapter, we study fuzzy systems, including fuzzy controllers and fuzzy models, as universal approximators.
7.2. FUZZY CONTROLLER AND FUZZY MODEL AS FUNCTIONAL APPROXIMATORS Up to this chapter, we have studied a variety of Mamdani and TS fuzzy controllers and models. As far as system input-output relationship is concerned, the role that a controller or model plays is mathematically the same: It provides nonlinear functional mapping between input and output of the controller or model. This point can be understood by comparing (2.27) with (2.32) for Mamdani controllers/models and (2.30) with (2.34) for TS controllers/ models. The mathematical meaning of these paired systems is identical. In this chapter, we use a generic termfuzzy system to represent either a fuzzy controller or a fuzzy model and to investigate functional approximation capabilities of fuzzy systems. The issue of universal approximation is crucial to fuzzy systems. In the context of control, the question is whether a fuzzy controller can always be constructed to uniformly approximate any desired continuous, nonlinear control solution with enough accuracy. For modeling, the question is whether a fuzzy model can always be established which is capable of uniformly approximating any continuous, nonlinear physical system arbitrarily well. These 209
210
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximators
are qualitative questions. If the answers to them are yes, the more meaningful and quantitative issues are as follows. First, what are the conditions, necessary or sufficient, for the fuzzy systems, Mamdani type and TS type, to be functional approximators? Second, given a continuous function, how can a fuzzy system be designed to uniformly approximate it with a required approximation accuracy? More specifically, how should each component (e.g., input fuzzy sets, fuzzy logic operators and fuzzy rules) be selected? Third, what are the strengths and limitations of fuzzy systems as functional approximators? Last but not least, is Mamdani type better or worse than TS type as a functional approximator? The answers to these questions are of both theoretical and practical importance. Iffuzzy systems are proved to be universal approximators, then one may feel more comfortable in utilizing them as controllers and models. The answers can also lead to more effective design techniques for fuzzy controllers and more efficient selection of structure and parameters for fuzzy modeling. This chapter provides answers to all these questions.
7.3. POLYNOMIAL APPROXIMATION OF CONTINUOUS FUNCTIONS Functional approximation is a matured field in classical mathematics after longtime extensive studies (e.g., [41][174]). Well-known approximation techniques include the Taylor expansion, Fourier expansion, and polynomial approximation, to name a few. We now briefly review the polynomial approximation, as it will be used in this chapter. The foundation of polynomial approximation is the Weierstrass Approximation Theorem, which states as follows (e.g., [18]). To any function t/J(x), which has M independent variables X; E [a;,b;] and is continuous in [al,b 1 ] x ... x [aM,bM], and to any error bound 8 > 0, there exists a polynomial P(x) such that liP -
t/JII
= max IP(x) - t/J(x) I < X; E[a;
p;l
8.
The order of P(x) is related to t/J(x) as well as the magnitude of 8. For any given t/J(x) and 8, P(x) can be calculated precisely through various techniques (e.g., [41]). The Taylor expansion is one of these techniques and is a relatively simpler one. The other techniques are mathematically better but also more complicated. Throughout this chapter, we use the following notation for a polynomial: M
LA;
= d,
;=1
where d is the order of P(x). More concisely, M
Ld;~d. ;=1
(7.1)
Section 7.4. • Sufficient Approximation Conditions for General MISO Mamdani Fuzzy Systems
211
7.4. SUFFICIENT APPROXIMATION CONDITIONS FOR GENERAL MISO MAMDANI FUZZY SYSTEMS
7.4.1. Formulation of General Fuzzy Systems We now investigate whether the general Mamdani fuzzy system (4.16) is a universal approximator. For notational convenience, we drop all the scaling factors K!1u and a, in (4.13). We then replace the left side of (4.16) by F M(X) and obtain
(7.2)
Here F M{X) signifies, with the subscript, that the system is of Mamdani type and is a function of input variable vector x. Without loss of generality, assume that L = 1 and thus Xi E [-1, 1] for i = 1, ... , M. This means F M{X) is defined over eM[ -1, 1], M dimensional product of [-1,1]. Accordingly, P{x) is supposed to be any multivariate polynomial defined over eM[-1,1]. For better notation, we will use Xi and 'OJ to represent xi{n) and 1I1{n), respectively, and we will use n in the place of J. Be careful that n in this chapter represents an integer, not sampling time as in other chapters. The meanings of the rest of the notations stay the same as those given in Section 4.10.
7.4.2. Statement of Approximation Problems The following two issues are resolved in this section: 1. Given
IIFM
-
any
continuous
t/JllcM[-l,l]
function
.p{x)
and
8,
can
FM{x)
achieve
< 8?
2. If it can, how many fuzzy rules should be used and how should all the other system components be determined? We now develop a two-step approach to address the first issue. The key is to use polynomial as a "bridge" to connect two proof steps. In the first step, we prove FM(X) to be capable of uniformly approximating P{x) to any degree of accuracy. In the second step, the Weierstrass Approximation Theorem is utilized to prove that FM{X) can uniformly approximate t/J{x) with arbitrary precision.
7.4.3. Uniform Approximation of Polynomials by General Fuzzy Systems We first state the result as follows:
Theorem 7.1. F M{X) can uniformly approximate P{x).
212
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximators
We now constructively prove it. We use P(x) to construct fuzzy rules of F M(X). Specifically, letf(p) be a dth order polynomial with respect to Pi:
J(P) =
d~JL
d1" ' dM ·n
d
if{ ~t)
where L dt"'dM are integers calculated from Pdt ...dM of P(x): l
L dt"'dM = 10
X
Pdt ...dM
(7.3)
where A. is the smallest positive integer that makes all 10l x Pdt".dM integers. For instance, if P(x) = 1.2 + 0.23x1 + 1.542x2 + 0.07823x1X2, then Poo = 1.2, P10 = 0.23, POI = 1.542, and P11 = 0.07823. Thus, A. = 5. Consequently, L oo = 120,000, L 10 = 23,000, L 01 = 154,200, and L 11 = 7,823. Choosing such Ldt."dM is necessary because f(p) must be integer with respect to integer inputs Pi. Kin (4.14) can be computed as K = n
d
L
ILdt".dMI.
(7.4)
di~O
If one chooses (7.5) then
where
I!.. = n
(PI, ... ,PM).
\n
n
Recall that fuzzy rules are determined by f(P). For this reason, we call P(Pln) transformed fuzzy rules, where the transformation is realized via polynomial P(x) . The transformed rules can be derived directly from P(x) by replacing x with pin. The value of f(P) at p is always integer, but PepIn) does not have to be. Using the transformed fuzzy rules, we can neatly express FM(x) in (7.2) as follows:
FM(x) =
t ,u~(X,A).P(P + m=l
'UJ'
L
_
bm )
n
,u~(x,A)
m=l
and its calculation is simpler. At any time, the following is true: Pi -
n
Pi+ 1
~ Xi ~ - - ,
n
i = 1, ... , M
leading to
· Pi +1 1im -= 1·un Pi --=Xi'
n-+oo ni
n-+oo
n
(7.6)
Section 7.4. • Sufficient Approximation Conditions for General MISO Mamdani Fuzzy Systems
213
and hence · P 1un -=X.
n-+oo n
Therefore,
t
lim
Pr:,,(X,A).P(P + bm )
t ,u~(x,A)
m=l
n-+oo
n
= P(x).
m=l
This means that when the number of fuzzy sets or fuzzy rules is large, the general fuzzy systems will approach the polynomial, and, to the limit, will become the polynomial. We need to go a step further to prove the approximation to be uniform. To accomplish this, we will derive a formula that can calculate a positive integer n*, based on 8, such that for any n > n*,
t
m-l
max
-
x;E[-I,l]
Pr:,,(x,A).P(P + b m ) n ~
L
-P(x)
1 cases can be treated similarly. WhenM= 1,
t ,u~(Xl,A)'P(PI + bl"')
max Xl
E[-l,l]
m-l
-
~ ""' L..." m=l
n
A) Pm Xl'
-P(Xl )
IX (
(7.8)
According to (7.6),
214
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximators
and we also note that
IXll .s 1 and (PI
+ II/n .s 1. Thus, for 1 s d l
~
d,
It :bl~rl_xfll ~ r- :bl~-X11IEtl :bl~rl-VX¥-ll 1
1
(7.9) Substituting (7.9) into (7.8), we get max XIE[-l,l]
IF(Xl) - P(xl)1 -s ! t (Ipd I·d
l) .
nd1=O
1
Therefore, if we choose
n* >
L~l (IPdJd
(7.10)
1) ,
F(Xl) will uniformly approximate P(Xl). Without showing the lengthy mathematical derivation, we provide the following formula for M > 1 cases: (7.11) Owing to different paths of derivation, (7.11) does not reduce to (7.10) when M = 1. In other words, (7.11) does not contain (7.10) as a special case.
7.4.4. General Fuzzy Systems as Universal Approximators So far, we have shown that the general Mamdani fuzzy systems can uniformly approximate any multivariate polynomial to any degree of accuracy. We are only halfway through and need to take the second step to prove that F M(X) can approximate any continuous function t/J(x). This part of the proof is easy. According to the Weierstrass Approximation Theorem, one can always find P(x) such that liP - t/J II < 81. Also, we have just proved that one can always find n* so that IIFM - PII < 82. Therefore, one can always find n*, 81 and 82' where 81 + 82 < 8, so that max IFM(X) - t/J(x) I = max IFM(X) - P(x)
x;E[-l,l]
x;E[-l,l]
:::: max IFM(X) - P(x)1 X;E[-l,l]
+ P(x) -
t/J(x)1
+ x;E[-l,l] max IP(x) -
t/J(x)1
e d~O [
= 0.38, Pll = -0.06,
(
l.Bd1.. ·d)2i =M1
)
and A. = 2. Note that 61
=0
and
-1.Bo...ol ]
1 1 1 2 = QJ"(0.52 + 0.1 x 2 + 0.38 x 2 + 0.06 x 2 - 0.52) = 12. Thus, the minimal upper bound is 13, and the transformed fuzzy rules are described by
p(~) =
0.52 + 0.1
~~ + 0.38~~ -
0.06
;:;2.
P
The other parameters can be computed: 2n + 1 = 27 fuzzy sets for each input variable, 729 fuzzy rules, S = lin = 1/13, k = 132 x (52 + 10 + 38 + 6) = 17,914, H = 10-2 x 106 = 1.06, V = HIK = 5.9171 x 10-5 , and the fuzzy rules are represented by f(P) =
s-e
= 8788
+ 130p, + 494pz -
6p, ·pz.
Just as in the previous example, any fuzzy logic AND and OR operators and any fuzzy inference method may be used.
We now use an example to compare n* calculated by (7.14) with that by (7.11). EXAMPLE 7.3 For Example 7.2, calculate the minimal upper bound using (7.14) and compare the result with the one computed by (7.11).
219
Section 7.5. • Sufficent Approximation Conditions for General MISO TS Fuzzy Systems
Solution
n*
~ ~ L [(IPd1.. d) 1=1 tA) -IPo...ol] = 011• [0.52 + 0.1 x 1 + 0.38 (ldl~O
x 1 + 0.06(1 + 1) -
0.52]
= 6.
According to (7.15),
0.1 [(1 +~) - 1] +0.38[(1 +~) - 1] +0.06[(1 +~) (1 +~) - 1] = 0.10167 >
8
= 0.01.
So, we need to increase n* to 7, which makes B = 0.087. This minimal upper bound is much smaller than the one obtained in Example 7.2, which is 13. Consequently, all the other components of the fuzzy system are also more economic.
From this example, one sees that n* can be quite accurately estimated using (7.14) even when n* is as low as 7. The estimation accuracy improves as n* increases.
7.5. SUFFICENT APPROXIMATION CONDITIONS FOR GENERAL MISO TS FUZZY SYSTEMS 7.5.1. Sufficient Approximation Conditions We now extend the investigation to the general TS fuzzy systems described in (5.2): n _ j~ J1.j(x,A)(aoj
FTS(x) =
+ aljxl + ···+ aMjxM)
n
'
(7.16)
LJlJ(x,A) j=l
where the subscript TS stands for the TS type. For simplicity, Xi has replaced xi(n), and it is assumed that Xi E [-1,1] for i = 1, ... , M. Additional constraints are attached to the general TS fuzzy systems as follows. The interval [-1, 1] is partitioned into 2n equal intervals, each of which is [k/ n, (k + 1)/n] where k = -n, ... , n - 1. Over the 2n intervals, 2n + 1 fuzzy sets are defined for fuzzifying each variable. Membership functions of the fuzzy sets can be any continuous types, including, but not limited to, triangular, trapezoidal, Gaussian, and bell-shape types. Little restriction on the fuzzy sets is possible because, just as in Section 7.4, we will establish approximation conditions that are independent of the membership functions. Of the 2n + 1 fuzzy sets, one is defined over [-I,-(n - 1)/n], another over [(n - 1)/n,I], and each of the remaining 2n - 1 ones over [(k - 1)/n,(k + 1)/n], where -(n - 1) :::: k :::: n - 1. The fuzzy sets mayor may not be identical for different input variables or for the same input variable. To prove that the general TS fuzzy systems are universal approximators, we use the same two-step constructive approach developed in Section 7.4. The key is to use polynomial as a bridge to connect the two proof steps. We now accomplish the first step-proving that the general TS fuzzy systems can uniformly approximate any multivariate polynomial to any degree of accuracy.
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximators
220
For brevity and better presentation, we will prove the case of two variables (i.e., M = 2); the proof for more variables is similar. According to (7.1), a polynomial of two variables is
where d = Al + A2 is the degree of the polynomial. Supposing that P(XI, X2) is explicitly known, we use it to construct n = (2n + 1)2 fuzzy rules. The jth rule is
That is, we let the parameters in the jth rule be I I,j 12,j) ao·=P ( - , -
n
Y
alj
=
a2j =
n
IIJ
-PIO--
n
P0 1 12,j n
PIO POI·
Note that aij are still constants. Thus, F TS(XI ,X2) becomes
t
F TS(XI ,X2) =
1=1
2i) - PIO II,} - POI h} + PIOXI + POlX2)]
JlJ(x,A) [(p(IIJ ,I n
n
n
n LJlj(x,A)
n
·
(7.17)
j=1
Because at any time, L:
I... + 1
n
n
..!.d.. :::: Xi :::: _',_1__ ,
(7.18)
hence L . . Ii,j + 1 . II,j lim ..2L = lim - - = Xi' lim PIO n n-+oo n n-+oo n
n-+oo
= PIOXI
and
As a result, n (II. [,2 .) LJlj(x,A).P ~,~ .
.
Inn F TS(XI ,X2) = lim
n-+oo
n-+oo
j=I
n n LJlj(x,A)
n
= P(XI,X2)·
j=I
This means that when the number of fuzzy sets is large enough, the fuzzy systems will approach P(XI,X2) and, to the limit, will become it.
Section 7.5. • Sufficent Approximation Conditions for General MISO TS Fuzzy Systems
221
We now prove the approximation to be uniform. To accomplish this, we will derive a formula that can calculate a positive integer n", based on given 8, so that for any n > n*,
According to (7.17), this inequality is achieved when the following holds:
We are going to determine n* from it; note that
(7.19)
Due to (7.18),
t.,
0i,j
n
n
-=Xi--'
where 0
~ (Ji,j ~
fori= 1,2,
1, and
1"1
I(J··I < -. 1 x, - -!.!l.. = -!.L-
I' n n
n
Hence, for the second and third terms in the last part of (7.19), the following inequalities hold:
Ip (
/I,j)
10 XI - -
n
I < IPlol n
---
and
Ip01 (x2 -
/2,j) 1~ -nIPoII ·
--;:;
For the first part of (7.19), the following is true:
(7.20)
222
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximators
In the above derivation, the following relations are utilized:
Ix;I ~ 1, where 11 2:: 1, 1 1 ->n - n""
10i,jl
k _
L Cn k=O
k _ - (
n
2 where Cn
n
_
n! k)'k l • ..
Therefore, (7.20) becomes
LAl LA2 IPd d II( XI d =0 d =0 l
2
l 0 1 .)d ( X2 n
-!l...
I 2
-
02 n
.)d -xd1 d22I ~ -1 LAl LA2 IPd n d =0 d =0 2
1X
-!l...
l
2
d
1(2dl+d2 - 1).
I 2
Combining all these inequalities, we have
Hence, we have derived what we wanted: IPlol + IPoII
n*
~
Al
A2
+L L
IPdld21(2dl+d2 - 1) d - - - - - -l=Od2=0 --------s
(7.21)
By deriving this formula, we have actually completed the task of proving that the general TS fuzzy systems (7.16) can uniformly approximate any multivariate polynomials with arbitrarily high approximation accuracy.
Section 7.5. • Sufficent Approximation Conditions for General MISO TS Fuzzy Systems
223
The second step of the proof is straightforward and similar to what has been done with the general Mamdani fuzzy systems in Section 7.4:
max IFrs(x) - t/f(x)I = max IFrs(x) - P(x)
x;E[-I,l]
~
x;E[-I,l]
max IFrs(x) - P(x)1
X;E[-I,l]
+ x;E[-I,l] max IP(x) -
+ P(x)
- fjJ(x) I
fjJ(x)1
Vg(i+l) , FM(XI) decreases monotonically as Xl increases from C, to Ci+l. Otherwise, FM(XI) increases monotonically as Xl increases. We observe that FM(XI) is a continuous, convex function on [Ci,Ci+l] for all i. In Lemma 7.3, the assumption of Vg(i) # Vg(i+l) is necessary because when Yg(i) = Vg(i+l)' the two fuzzy rules in the form of (7.26) will have the same output fuzzy set Bj for two different input fuzzy sets, resulting in FM(XI) == Vg(i) instead of a monotonic function on [Ci,Ci+I]. This situation is avoided in Lemma 7.3, and "'(Xl) is not assumed to be a constant on [Ci,Ci+I]· Lemma 7.4. At Xl = Ci, FM(xI) = Vg(i) for i = 0, ... , N. This is true because when Xl = Ci, Jli+l(Xl) = 0, resulting in qJ(XI) = 1. As a result, FM(xI) = Vg(i)'
7.6.4. Necessary Approximation Conditions Having preparing these lemmas, we are now in a position to establish some necessary conditions for the general SISO fuzzy systems as universal approximators of the minimal system configuration.
Theorem 7.5. Given that A. distinct extrema of "'(Xl) are ml' ... , ml taking place at hI' ... , h1, the following necessary conditions must simultaneously be satisfied in order for the general SISO fuzzy systems (7.25) to achieve approximation (7.23) with minimal system configuration:
228
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximators
(1) [a,b] must be divided into at least A + 1 subintervals. That is, N :::: A + 1. (2) A + 1 of the N subintervals must be such that Co = a, C, = hi (1 :::: i :::: A) and Cl + I =b. (3) Two fuzzy rules in (7.26) must be assigned to each subinterval [Ci,Ci+ l ] for all i = 0, ... , A. That is, the number of fuzzy rules Q = A + 1. Also, Vg(i) must be so chosen that it satisfies
m, -
B :::: Vg(i) ::::
m, + B,
for i = 1, ... , A.
To prove this theorem we use contradiction argument to show that N :::: A + 1 (i.e., condition (1)) is necessary. Suppose that N < A + 1. Let the partition of [a,b] be
Then there must exist at least one subinterval, say [Dj,Dj+ I], on which t/!(XI) is nonmonotonic. That is, t/!(XI) has at least one extremum inside the subinterval but not at the two end points, Dj and Dj + l . Without losing generality, assume that there is one maximum, mh (1 :::: h :::: A), at Xl = D* E (Dj,Dj+ I). Suppose, for an arbitrarily small approximation error bound B, the following inequality holds:
This implies that the following three inequalities must hold simultaneously: IFM(Dj) - t/!(Dj) I .s IFM(D*) - mhl ::::
(7.29)
B,
(7.30)
B,
IFM(Dj+ l) - t/!(Dj+ l) I ::::
B.
(7.31)
However, that mh is a maximum means mh > t/!(Dj) and mh > t/!(Dj+ l). Hence, t/!(XI) increases monotonically on [Dj,D*] and decreases monotonically on [D* ,Dj+ l]. According to Lemma 7.3, FM(XI) is monotonic on [Dj,Dj + I]. If FM(XI) increases monotonically, then inequalities (7.29) and (7.30) may hold for any B, but inequality (7.31) cannot hold at the same time if B is small enough. Similarly, ifFM(XI) decreases monotonically, then inequalities (7.30) and (7.31) may hold for an arbitrarily small B, but inequality (7.29) cannot be true simultaneously for small enough B. In either case, inequalities (7.29), (7.30), and (7.31) cannot be true simultaneously. This analysis is also clear geometrically. The contradiction means that [a,b] must be divided into at least A + 1 subintervals. That is, N :::: A + 1, which is the necessary condition (1). Furthermore, according to the above analysis, when N = A + 1, the subintervals must be divided in such a way that t/!(XI) reaches its A extrema only at Xl = hi (i = 1, ... , A). That requires C, = hi to form A + 1 subintervals, [Ci,Ci+ I ] , for i = 0, ... ,A, which is necessary condition (2). Now let us analyze the necessity of condition (3). First, according to Lemma 7.2, it is necessary to assign two fuzzy rules in (7.26) to each subinterval [Ci,Ci+ l ] for i = 0, ... ,A so that F M(xI) is a continuous function. Moreover, to realize the approximation (7.23), the following inequality must be satisfied:
Section 7.6. • Necessary Approximation Conditions for General SISO Mamdani Fuzzy Systems
229
According to Lemma 7.4, this inequality can be rewritten as
IVg(i)
- mil
.s 8,
or m, -
8 ~
Vg(i) ~ mi. + 8,
for all i.
This completes the proof of Theorem 7.5. According to Theorem 7.5, selection of Vg(i) of fuzzy set Bg(i) directly depends on approximation error bound 8. The smaller the 8, the narrower the range of Vg(i) value. To a limit, Vg(i) = mi for all i when 8 = O.
7.6.5. Strength and Limitation of SISO Mamdani Fuzzy Systems as Functional Approximators Theorem 7.5 sheds some light on the strength and limitation of the general SISO Mamdani fuzzy systems as universal approximators. Note that N relates to A in a certain way. Specifically, the number of fuzzy rules N increases with the rise of the number of extrema of t/!(XI), A. Therefore, if A is a small number, N can be a small number. Better yet, N does not relate to 8. These observations suggest that, even if a given 8 is very small, a small number of fuzzy rules may suffice to uniformly approximate those continuous functions that have a complicated formulation but a relatively small number of extrema. This insightful analysis offers a possible explanation for the fact that the majority of practically successful fuzzy controllers and fuzzy models only had to use a small number of fuzzy rules to accomplish the objectives. On the other hand, the limitation of the fuzzy systems is also exposed by the fact that the number of fuzzy rules needed increases with the increase of A. A large number of fuzzy rules are necessary for uniform approximation of functions that are simple but have a lot of extrema. For instance, a simple function like t/!(XI) = Sin(nxl) has 21nl extrema on [O,2n]. If Inl is large, a large number of fuzzy rules are needed. Thus, the fuzzy systems are not ideal functional approximators for periodic or highly oscillatory functions. Although 8 and N in general are not related, there are some situations in which 8 and N can be tightly related. Use of the triangular input fuzzy sets, shown in Fig. 7.2 is one such special situation. When the triangular fuzzy sets are used, J.li(XI) + J.li+I(XI) = 1 on [Ci,Ci+ l] for all i. Hence, q>(XI) = J.li(XI), which is linearly decreasing on [Ci,Ci+I]. Thus, (7.27) becomes FM(XI) = Vg(i+l) + J.li(XI)(Vg(i) - Vg(i+l»)'
Xl E
[Ci,Ci+I].
Clearly, FM(XI) either increases linearly, if Vg(i+l) > Vg(i) , or decreases linearly, if Vg(i+l) < Vg(i) , on [Ci,Ci+I]. Therefore, if there is at least one subinterval, say [Cp,Cp+ I], on which t/!(XI) is not a linear function, the subinterval must be further divided into more and more smaller subintervals to satisfy smaller and smaller approximation error bounds 8k. It can be concluded that a necessary condition for the general SISO fuzzy systems to achieve the approximation (7.24) is N ~ 00 as 8k ~ 0 (when k ~ 00). This condition may seem intuitive and trivial when it is considered as a sufficient condition. It is also a necessary condition, however. This finding is meaningful as triangular membership functions are commonly used in many practical fuzzy systems. In light of this
230
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximators Membership
o
Figure 7.2 Illustrative definition of triangular input fuzzy sets used by the general SISO Mamdani fuzzy systems. Note that Jli(XI) + Jli+l (Xl) = 1 on [Ci, Ci+tl for all i.
condition, using triangular fuzzy sets may not be desirable in constructing the fuzzy systems as high-precision functional approximators.
7.7. NECESSARY APPROXIMATION CONDITIONS FOR GENERAL MISO MAMDANI FUZZY SYSTEMS 7.7.1. Configuration of General Fuzzy Systems We now extend the SISO results to the general MISO fuzzy systems. The approach and the results will be similar, but mathematical derivation will be more complicated and difficult. One major difference between the SISO and MISO fuzzy systems is the use of fuzzy logic AND operators in the MISO systems. M input variables are defined over El in (7.22). The interval [ai,bi] is divided into N, subintervals:
=
i
i
=
a·lCO < · .P · < CN b. i
for all i.
On Eli' N i + _1. fuzzy sets, denote~ asA;i (0 s ). ~ N i), are used to fuzzify Xi' The membership function of Ali' designated as ttli' is a~ost arbitrary: !t is continuous, convex, and normal: In the rest of this c~apter, we will use ttli to represent ttli(Xi) for mo~e co~cise pr~sentation. ttli is O. at Xi.= CJi-:- 1 and increases monotonically. on ~Cli-l ,CJi-1 + <Xli-I]' where o ~ <xji- l ~ eli -:- eli-l'i and reaches 1i at Xi.= Cli- 1 .+ <xji- 1· Then, ttli is 1 on [Cli- l + <Xji-1,CJi+ 1 - Pji+I.]' wh~re 0 < Pji+l ~ Cli+ I - Cli' .and ~ecreases monotonically ~d becomes ~ at Xi =.CJi+ I' ttj. i~ 0 .whe~ Xi is outside [iCli-I'~li+l]: For the end points Co = a, and CN. = bi' tto is 1 on [co'Cl - PI]' where 0 < PI ~ C1- Co' and then decreases monotonically to 0 at Xi = C{; ttk. is 0 at Xi = C1:.-1 and then increases monotonically to 1 at Xi = C1:.-1 + <xk.-l' where 0 < <xk.-l ~ C1:. - Ck.-I' and remains to be 1 until Xi = C1:.. And tt~ and ~~i are 0 elsewhere. tt;i intersects only P,)i- 1 and J,l)i+ 1' and only once with each of them. Illi does not intersect any other fuzzy sets. For each variable, the membership function definitions, illustrated in Fig. 7.3, are the same as those used for the SISO fuzzy systems. n Mamdani fuzzy rules in the following form are used: (7.32)
Section 7.7. • Necessary Approximation Conditions for General MISO Mamdani Fuzzy Systems
231
Membership
1
o
aCi-P{ , . c{
C~; C~;-l + a~J-l
C1;-1
Figure 7.3 Illustrative definition of input fuzzy sets for the general MISO Mamdani fuzzy systems.
where Bg(I}J ... ,IM) is a singleton output fuzzy set that is nonzero only at FM(x) = Vg(It, ... ,IM). The product fuzzy logic AND operator is employed to evaluate the ANDs in the fuzzy rules, and the combined membership for Bg(It, ... ,IM) is designated as n~l J.l}i. No fuzzy OR operation is employed. The fuzzy inference methods allowed are the Mamdani minimum inference, the Larsen product inference, the drastic product inference, and the bounded product inference. They produce the same inference result due to the use of the singleton output fuzzy sets. Using the generalized defuzzifier, we find that the output of the general MISO fuzzy systems is
(7.33)
This configuration is general but differs from the general MISO fuzzy systems in Section 7.4.1. The input fuzzy sets here are less restrictive. Nevertheless, there are some restrictions on the fuzzy logic operation (i.e., use of the product fuzzy AND operator only) and the fuzzy inference methods.
7.7.2. Lemmas for Developing Necessary Conditions The following three lemmas, Lemmas 7.5, 7.6, and 7.7 are parallel to Lemmas 7.1, 7.2, and 7.3, respectively. Lemma 7.5 deals with the continuity of FM(X) in relation to assignment of fuzzy rules. Lemma 7.5. FM(x) is continuous on entire e if and only if all the 2M fuzzy rules in the form of (7.32) are assigned to each of the N, x··· X N M different combinations of subintervals.
232
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximators
We first prove the sufficiency of the condition. Without losing generality, assume x E [C]l,C}l+l] x .. · x [Cft,Cft+I]' Because of the way the input fuzzy sets are defined, only
two nonzero memberships result for each input variable after fuzzification. They are and
Ilft
and
for
Ilft+l
Xl
for XM'
Consequently, 2 M fuzzy rules relating to these memberships are executed, resulting in
where (Il]l+i l · .. Ilft+iM)rJ. is a continuous function of x on e and Vg(il+il, ...,iM+iM) is constant. Thus, F M(X) is continuous on 8. We now prove the necessity of the condition. When at least one of the 2M rules is not used, say the following one is not executed: IF Xl is All AND ... AND XM is Aft THEN FM(x) is Bg(il, ...,iM)'
°
(7.34)
Then, ~t the point (C]l' ... ,Cft), all combinations of the M memberships are except n~l Ill;· However, this membership combination does not exist because fuzzy rule (7.34) is not used. As a result, both the numerator and denominator of(7.33) is 0, meaning FM(x) has no definition at (C]l ' ... , cft). So, F M(X) is not continuous on e. This indicates the necessity of the condition in Lemma 7.5. The next lemma also relates the continuity of F M(X) to assignment of fuzzy rules. Lemma 7.6. Suppose that 8 is divided into N I x .. · x N M cubes, each of which is [CJl,CJl+tlX ... x[Cj~,Cft+tl for jjM=O, ... ,Nj-l, where i=l, ... ,M. FM(x) is
ni=l
(N, + 1) fuzzy rules in the form of (7.32) are used. continuous on e if and only if n = Let us prove it. According to Lemma 7.5, for each cube [C]l,C}l+l] x ... x [Cft,Cft+I]' all 2M different combinations of the Mmemberships should be used to form 2M fuzzy rules in order to gain the continuity of F M(X) on the cube. This means that to ensure the continuity of F M(X) on e, all the possible combinations of the M memberships should be used. There are n~I(Ni + 1) such membership combinations, resulting in the same number of fuzzy rules. Lemma 7.7. At x = (C]l"." Cft) for ji = 0 ... , N, where i = 1, ... ,M,FM(x) = Vg(i!, ....lu)' The proof is easy. At x = (Cj~, ... , Cft), Il;; = 1 and ,uJ;+1 = 0, forji = 0, ... .N, - 1. Therefore, only the following one fuzzy rule is executed: IF Xl is A)l AND. · · AND xM is Aft THEN F M(X) is Bg(it, ...-lu)' After using the product fuzzy AND operator, Bg(il,...,iM) is assigned a membership value of 1 and consequently F M(X) = Vg(il, ...,iM)' At x = (C]l' ... ,Cft), it is straightforward to prove that FM(x) = Vg(il,...,iM)'
Section 7.7. • Necessary Approximation Conditions for General MISO Mamdani Fuzzy Systems
233
In the following lemma, we reveal a decomposition property of the general MISO Mamdani fuzzy systems. It will be important in establishing Lemma 7.9.
Lemma 7.8. A general MISO Mamdani fuzzy system can always be decomposed to the sum of M simpler fuzzy systems: The first system has one input variable, the second two input variables, and the last one M input variables. There exist a total of Ml such decompositions, but they are all equivalent. One of the decompositions is: FM(x) = R I (Xl) + QI (XI)3(X3) + ... + QM-2(Xt, ... ,XM-2)q>M-I (XM-I)
+ QM-I(XI,··· ,XM-I)q>M(XM), where
(J.tJJ"Vg(h,h+1,h,ooo,jM) QI(Xt) =
+ (J.tJt+1)"'Vg(h+1,h+1,h,o..,jM) - (J.tj~)"'Vg(j"Oo.,jM) -(J.tJ[+l) IXVg(h+ 1,h,00.,jM)
----------..;..-~-----------
(J.tJt)'" + (J.tJt +1 )'" The decomposition is not unique inasmuch as there are different arrangements of the M input variables. For example, the following is another decomposition: FM(x) = TI (XM) + Sl (XM)CfJM-I (XM-I)
+ S2(XM-I ,XM)q>M-2(XM-2) + ...
+ SM-2(X3, .. · ,XM)CfJ2(X2) + SM-I (X2' · . · ,XM)q>1 (Xl)· Because there are in total Ml different arrangements of the input variables, there exist the same number of different decompositions. Importantly, however, all these decompositions have the same property: The general fuzzy system is decomposed to the sum of M simpler
Section 7.7. • Necessary Approximation Conditions for General MISO Mamdani Fuzzy Systems
235
fuzzy systems, with the first system having one input variable, the second two input variables, and the last one M input variables. This concludes the proof. Lemma 7.8 enables the development of the following lemma which establishes the general fuzzy systems to be monotonic in each cube configured by M subintervals. The monotonicity is the key to developing the necessary conditions stated in Theorem 7.6.
Lemma 7.9. When the conditions set in Lemma 7.5 are met, F M(X) is monotonic on [Cj~ ,C}l+l] x··· X [Cj~,CZ+I] for t. = 0, ... , M- 1, where i = 1, ... ,M. For better presentation, we will only prove the M = 2 case here. The results can be extended to a higher dimension. Without losing generality, assume Xl E [ClI,C}t+l] and X2 E [CJ;.,Cj~+I]' Using the decomposition property stated in Lemma 7.8, we find that
where
We now prove that F M (X I , X2) does not have any extrema on [Cll ,C}l+l] x [CJ;.,C~+I]' which means F M(XI ,X2) is monotonic. Note that
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximators
236
The necessary conditions for FM(Xl,X2) to have extrema are aF/ aXl = 0 and aF/ aX2 = o. Because on [C~,C~+ll, dJ-lh+l/dx2 ~ 0 and dJ-l];/dx2 ~ 0, and both cannot be 0 at the same time, we have
Thus, the only possibility for aF/aX2 and hence
= 0 is when
Q(Xl)
= 0,
which results in ~F/a~
=0
D=
Only when dQ/ dx, = 0 will D become o. When dQ/ dx, to Vg (h ,j2) = Vg (h +l ,j2)' which in turn means FM(Xl ,X2)
= 0, aF/ aXl = dR/ dx, = 0, leading
= Vg(h ,j2) = Vg (h +l ,j2)·
That is, FM(Xl ,X2) becomes a constant and does not have extrema. Thus, D < 0 on [Cj~,CJ}+ll x [C~,Ch+ll and consequently F M(xl,x2) has no extrema, or equivalently, is monotonic. Extending this analysis to more than two input variables, F M(X) should be monotonic one.
We have completed the proof of Lemma 7.9. 7.7.3. Necessary Approximation Conditions Recall that when formulating (7.23), it was assumed that A distinct extrema of t/J(x), taking place at x = H j = (hJ, ... , hj!), where j = 1, ... , A, are given. For x;, the A extrema occur at x, = h~, ... , h~. Without loss of generality, assume that hj are inside [a;,b;l but not at the two end points of the intervals. Although the extrema are distinct, hj mayor may not be distinct. We will only keep distinct hj and arrange them in ascending order to form the following set: 1j=(pi, ... ,pk), t
i= 1, ... ,M,
(7.35)
where pi < · .. < pk.. Here, we suppose that T; has K; (1 ~ K; ~ A) distinct points. Obviously, T; divides' [a;,b;l into K; + 1 subintervals. Now, extremum mh"",jM occurs at x = (pJ} , ... , p~). Using (7.35) and Lemmas 7.5 to 7.9, we now establish the following necessary conditions for the general MISO fuzzy systems to be universal approximators with minimal system configuration. Like the SISO cases in Section 7.6, the monotonicity of the MISO fuzzy systems in each of the cubes configured by M subintervals plays a key role in establishing these conditions.
Section 7.7. • Necessary Approximation Conditions for General MISO Mamdani Fuzzy Systems
237
Theorem 7.6. Given (7.35), the following necessary conditions must be satisfied simultaneously in order for the general MISO Mamdani fuzzy systems to achieve the approximation (7.23) with minimal system configuration: (1) For i = 1, ... , M, [ai,bi] must be divided into at least K,
+ 1 subintervals. That is,
Ni~Ki+l.
+ 1 ofthe N, subintervals must be so formed that Ch = a., C} = P] (1 ~i ~ K i ) , and Ck-;+1 = b.. (3) 2M fuzzy rule of (7.32) must be assigned to each of the M-dimensional cubes, [C}I ,C]I+l] x··· X [0~,0~+1] forii = 0, ... ,Ki . That is, the total number of fuzzy
(2) K,
rules is (4)
n = n~1 o; + 2).
Vg(h, ...-lu) must be so chosen that it satisfies
We will only prove the M = 2 case for condition (1), and the cases with more input variables can be proved in a similar fashion. Just as in the case of the SISO fuzzy systems, we use the contradiction argument again to show that N, ~ K, + 1 is necessary. Suppose that N, < K, + 1. Let the partition of [ai' bi] be a, = Ch < C~ < .. · < C1..-1 < C1.. = b.. Then there must exist at least one two-dimensional rectangle, say [011 ,C]I+l] ~ [C~,0~'+I]' on which t/J(x) is nonmonotonic. That is, t/J(x) has at least one extremum inside this rectangle but not at the four vertexes of the rectangle. Assume the maximum to be mh,j2 occurring at Xi = eJ; E (C};,C};+I)' where i = 1,2. Suppose, for an arbitrarily small approximation error bound B, the following inequality holds:
IFM(x) - t/J(x)1 ~
max
B.
X;E[C); ,c;;+I]
This implies that the following three inequalities must hold simultaneously:
IFM(Cl,Ck) - t/J(C]I,Ck)1 ~ IFM(e)t'
eh) -
mh,j2
1
(7.36)
B,
s B,
(7.37)
IFM(CJI+I,Ck+l) - t/J(C]I+l,Ck+l)1 ~
B.
(7.38)
However, that mh,j2 is a maximum means mjl,j2 > t/J(C}I ,C~) and mhi2 > t/J(C]I+l ,C~+I)· Hence, t/J(x) increases monotonically from (C}I'C];) to «()I' (h) and then decreases monotonically from «()1' (~) to (C]t+ 1,C];+I). According to Lemma 7.9, F M(X) is monotonic on [C}I ,Cj~+I] x [C~,C~+I]. Inequalities (7.36), (7.37), and (7.38) cannot all be true simultaneously. This contradiction means that [ai,bi] must be divided into at least K i + 1 subintervals; that is, N; ~ K, + 1, which is the necessary condition (1). Furthermore, according to the above analysis, when N, ~ K, + 1, the subintervals must be divided in such a way that t/J(x) reaches its A. extrema onl~ at x = .(pll' .: · ,pZ). This requir~s K, + 1 of the N; subintervals must be so formed that = a., Cj = pj (1 ~i ~ K i ) , and CK;+ 1 b., which is the necessary condition (2). Now analyze the necessity of condition (3). According to Lemma 7.6, it is necessary to assign 2M fuzzy rules in the form of (7.32) to each M-dimensional cube [Cit ,C~+I] x··· X [0~,C~+I]' forii = 0, ... , K i , where i = 1, ... , M, to ensure the conti-
=
Co
238
Chapter 7 •
Mamdani and TS Fuzzy Systems as Functional Approximators
nuity of FM(x) on each cube. Conse;juently, the total number of fuzzy rules needed to ensure the continuity of F M(X) on e is Di=l(K, + 2). Finally, let us look at the necessity of condition (4). To realize the approximation (7.23), the following inequality must be satisfied
IFM(C]I' ... , C;~)
-
"'(C]I' ... ,
cf:)1 = IFM(C]I' ... , C.t:) -
mj...... jM
I:: :
e
for all A. extrema. Using Lemma 7.7, we can rewrite the above inequality as IVg(jt, ...,jM) -
mh, ...,jM
1 ::: B,
or
We have completed the proof of the theorem.
7.7.4. Merits and Pitfalls of MISO Mamdani Fuzzy Systems as Functional Approximators According to Theorem 7.6, the selection of Vg(h, ,jM) directly depends on B. The smaller the B, the narrower the range of Vg(h, ,jM). As an extreme, when B = 0, Vg(h, ...,jM) = mh, ...,jM for t, = 1, ... .N, - 1. The general SISO fuzzy systems have exactly the same property. Theorem 7.6 exposes the strengths and limitations of the general MISO fuzzy systems as universal approximators; they are the same as those revealed by Theorem 7.5 for the general SISO fuzzy systems. N, somewhat relates to K, + 1. The minimal number of fuzzy rules, n, increases with the rise of K i • If K, is small, n can also be small. Because n and B are not related, even if B is very small, n can still be small. In other words, a small amount of fuzzy rules may be enough for a uniform approximation of complicated continuous functions with a small number of extrema. On the other hand, n increases with A.. Hence, many fuzzy rules must be used for a uniform approximation of those t/J(x) that are simple but have a lot of extrema, such as periodic or highly oscillatory functions. In short, fuzzy controllers and fuzzy models with a small number of fuzzy rules can be good enough to achieve satisfactory results for many control and modeling problems in practice. However, they are not efficient and economic solutions for problems where systems are periodic or highly oscillatory.
7.7.5. Numeric Example We now illustrate Theorem 7.6 by a numeric example. EXAMPLE 7.5. What is the minimal number of fuzzy rules and fuzzy sets needed by a MISO fuzzy system of the general class to uniformly approximate t/J(x} ,X2) = sin(mx}) COS(nx2) defined on [O,3n] x [O,3n]? Here, m and n are positive integers.
Section 7.7. • Necessary Approximation Conditions for General MISO Mamdani Fuzzy Systems
239
Solution For visualization, we plot "'(XI,X2) = sin(2x I ) cos(3x2) in Fig. 7.4. To determine how many extrema the function has, we do the following:
Ot/J = m cos(mxl) COS(nx2), ax l
a:;; = _m sin(mxl) COS(nx2), 2
I
::: = -n sin(mxl) sin(nx2)'
~=
_n 2 Sin(mxl) COS(nx2),
2
Consequently,
(jlljJ
D=
8xt8x2
= m2n2[sin2(mxt) COS2(nx2) - cos2(m.xt) Sin2(nx2)] '
Figure 7.4 Graphical illustration of a simple but highly oscillatory function !/J(x) sin(2x1)coS(3x2) on [0,311] x [0,311] which has 48 extrema on
=
(0,311) x (0,311).
Chapter 7 • Mamdani and TS Fuzzy Systems as Functional Approximatoi
240
Let at/!/ ax l =
°and af/J/ 8X2 = 0, Xl
=
2k 1n + n 2m '
kl
~n , n
k2 = 1, ... , 3n - 1
X2 = -
= 0, ... , 3m -
1,
at which D > 0, meaning t/J(x) has a total of3m(3n - 1) extrema on (O,3n) x (0,3n). Even i
m or/and n are moderate, a large number of fuzzy rules are needed for the approximation according to Theorem 7.6. For example, if m = 10 and n = 12, then f/J(XI,X2) has 1,05( extrema on (0,3n) x (O,3n). As a result, at least 32 and 37 fuzzy sets are necessary for Xl anc X2,
respectively, and 1,184 fuzzy rules are needed.
This example demonstrates that a large number of fuzzy rules must be employed ir order to approximate a simple but periodic function.
7.8. NECESSARY APPROXIMATION CONDITIONS FOR TYPICAL TS FUZZY SYSTEMS A logical step to take now is to derive necessary approximation conditions for TS fuzzy systems. In this section, we study typical TS fuzzy systems only. Necessary conditions for general TS fuzzy systems are technically more challenging to derive and remain an open issue. The differences between the typical and general fuzzy systems are restrictions on input fuzzy sets and defuzzifier.
7.8.1. Configuration of Typical Fuzzy Systems For simpler notation and derivation, the typical TS fuzzy systems use two input variables, Xl and X2, defined over E> = [al,b l] x [a2,b2 ] (see (7.22)). [ai,b;] is divided into N, subintervals: ai = cb < · . ·