Design Considerations of Time in Fuzzy Systems Applied Optimization

Volume 35

Series Editors: Panos M. Pardalos University of Florida, U.S.A.

Donald Hearn University of Florida, U.S.A. Design Considerations of TilTIe in Fuzzy Systellls

by Jemej Virant Faculty of Computer and Information Science. University of Ljubljana. Slovenia

.... "Springer-Science+Business Media, B.V. A C.I.P. Catalogue record for this book is available from the Library of Congress.

ISBN 978-1-4613-7115-1 ISBN 978-1-4615-4673-3 (eBook) DOI 10.1007/978-1-4615-4673-3

Printed on acid-free paper

All Rights Reserved © 2000 by Springer Science+Business Media Dordrecht Originally published by Kluwer Academic Publishers in 2000 Softcover reprint of the hardcover lst edition 2000 No part of the material protected by this copyright notice may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording or by any information storage and retrieval system, without written permission from the copyright owner. This book is dedicated to understanding the meaning of time in fuzzy structures and systems. Contents

List of Figures Xlll List of Tables xxv Foreword xxvii Preface XXIX Acknowledgments xxxv

Part I THE FUNDAMENTALS OF FUZZY AND POSSIBILISTIC LOGIC 1. FUZZINESS AND ITS MEASURE 3 1. FUZZY VALUES AND FUZZY VARIABLES 3 2. MEASURES OF FUZZINESS 9 2. FUZZY OPERATIONS AND RELATIONS 19 1. INTRODUCTION 19 2. FUZZY APPROACH TO REASONING 19 3. PARAMETERS, CLASSES AND NORMS 23 4. EXTENDED OPERATIONS 28 5. FUZZY RELATIONS 40 3. FUZZY FUNCTIONS 47 1. INTRODUCTION 47 2. DEFINITION OF FUZZY FUNCTION 47 3. FUZZY OPTIMIZATION 49 3.1 Fuzzy Extremum of Crisp Function 49 3.2 Fuzzy Extremum of Fuzzy Function 53 4. FUZZY INTEGRATION 55 4.1 Integration Over Crisp Interval 55 4.2 Integration Over Fuzzy Interval 58 5. FUZZY DIFFERENTIATION 61 5.1 Differentiation Based on a-notation of Function 61 5.2 Differentiation of Fuzzy Function in LR-notation 63 vii viii DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

4. FUZZY ALGORITHMS 65 1. FUZZY RULE LIST 65 2. TRANSFER FUNCTION 68 3. FUZZY MODELING 77 5. PROCESS OF FUZZY INFERENCE 79 1. INTRODUCTION 79 2. FID 79 3. FUZZIFICATION 81 4. FUZZY INFERENCE 83 5. DEFUZZIFICATION 86 5.1 Center-of-Gravity Method 86 5.2 Center-of-Sums Method 88 5.3 First-of-Maxima Method 90 5.4 Height Method 91 5.5 Center-of-Largest-Area Method 91 5.6 Modified COG Method 92 5.7 Schematic Review of the FID Process 93 6. POSSIBILISTIC LOGIC 99 1. INTRODUCTION 99 2. POSSIBILITY AND NECESSITY 101 3. FORMALIZATION OF PROPOSITION 106 4. UNCERTAINTY OF PROPOSITION 108 5. POSSIBILISTIC KNOWLEDGE BASE 114 6. ACCOMPANIED SUBJECTIVITY 120 7. CONCLUSION 121

Part II FUZZY 7. TEMPORALITY OF PROPOSITIONS 125 1. INTRODUCTION 125 2. TIME IN NATURAL LANGUAGE LOGIC 126 3. TIME MODALITIES AND DYNAMICS 130 4. CLASSICAL VIEW OF POSSIBILITY AND NECESSITY IN THE TEMPORAL DOMAIN 132 5. THE MEANING OF TIME IN MODERN SYSTEMS 135 6. THE ROLE OF TIME IN FUZZY INFERENCE 136 7. CATEGORIES OF TEMPORAL OBSERVATIONS 140 8. INCONSISTENCY BASED ON NECESSITY OF FUZZY PROPOSITIONS 141 9. INCONSISTENCY CALCULATION 151 10. INCONSISTENCY BASED ON TEMPORAL NECESSITY- VALUED LOGIC 158 10.1 Fuzzy Temporal Logic 159 Contents lX

10.2 Calculation Based on Fuzzy Formulae 160 11. CONCLUSION 166 8. FUZZINESS OF TIME 167 1. INTRODUCTION 167 2. FUZZY DATE 168 3. BEFORE AND AFTER FUZZY DATE 172 3.1 Non-Relational Observation 172 3.2 Relational Observation 174 3.3 Relation Between Two Dates 185 3.4 Possible Fuzzy Zeros in Observations of Equality 191 4. FUZZY DURATION 194 4.1 Membership Function of Time Interval 195 4.2 Length of fuzzy interval 199 5. EQUALITIES OF FUZZY DATES 208 5.1 K-Equality 208 5.2 6-Equality of dates 215 6. INEQUALITY OF FUZZY DATES 218 7. CALCULATIONS WITH SEVERAL FUZZY DATES 223 8. TRANSPOSED 227 9. CONCLUSION 229 9. TEMPORALITY IN FUZZY INFERENCE MACHINES 233 1. INTRODUCTION 233 2. TIME DEPENDENT FUZZY SET 234 3. FUZZY TEMPORAL OPERATOR 239 3.1 Basic Definitions 239 3.2 Relation to Given Temporal Knowledge 242 4. INTRODUCING TIME INTO FUZZY RULES 243 5. INTRODUCTION OF TEMPORAL DEPENDENCE INTO INFERENCE MACHINES 245 6. FUZZY MEMORY CELLS 248 6.1 Transition from crisp to fuzzy JK memory cell 249 6.2 Fuzzy T Memory Cell 254 6.2.1 Introduction of FT Memory Cell into Inference Machine 257 6.3 Fuzzy RS Memory Cell 264 6.4 Fuzzy D Memory Cell 267 7. VARIABLES OF FUZZY MEMORY CELLS 269 7.1 Definition of Fuzzy Switching Variable 270 7.2 Input Functions of Fuzzy Memory Cells 275 8. FUZZY AUTOMATA 275 8.1 Fuzzy Relief of Automaton 278 8.2 F JK Memory Cell as Fuzzy Automaton 285 8.3 FT Memory Cell as Fuzzy Automaton 286 9. SOME HARDWARE IMPLEMENTATIONS 292 x DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

10.GRAPHS OF FUZZY DATES 295 1. INTRODUCTION 295 2. OPPOSITE AND SYMMETRICAL FUZZY SETS 295 3. NETWORK WITH TEMPORAL CONSTRAINTS 296 4. SETTING THE GRAPH OF THE DATES 298 5. MINIMAL GRAPH OF DATES 303 6. DIAGRAMS WITH FUZZY DELAY 307 6.1 Example of Diagram with Delays 307 6.2 Temporal Possibilities for Fuzzy Set in Diagram with Fuzzy Transition 308 7. FUZZY STATE-TRANSITION GRAPH 316 8. FUZZY PETRI NETS 319 8.1 From Classical to Fuzzy Petri Nets 319 8.2 Fuzzy Time Petri Nets 321

Part III FUZZY SETS COMPUTATION, REPRESENTATION AND SIMULATION l1.CALCULATION AND DISPLAY ERRORS 325 1. CALCULATION OF DEVIATIONS 325 2. ERRORS DUE TO DISCRETE CALCULATIONS 329 3. DISPLAYING MEMBERSHIP FUNCTIONS 333 4. INFLUENCE OF CALCULATION DENSITY 339 5. LINK TO Mathematica ENVIRONMENT 343 6. LINK TO MATLAB ENVIRONMENT 346 12.MATLAB SIMULATIONS OF FUZZY CIRCUITS 351 1. INTRODUCTION 351 2. BUILDING FUZZY MODELS 352 3. LIBRARY OF FUZZY BLOCKS 353 4. OUTLINES OF A SIMULATION 358 5. SIMULATION OF FUZZY MEMORY CELLS 359 5.1 FT Memory Cell 359 5.2 FRS Memory Cell 365 5.3 FD Memory Cell 365 6. SIMULATION OF FUZZY REGISTERS 366 6.1 Clearing the FT Memory Cell 366 6.2 Fuzzy Register FTDCreg 367 6.3 Fuzzy Data Shifting and Delaying 372 7. MODEL OF FUZZY NEURON 377 8. CRISP PROCESSOR - FUZZY PROCESSOR 386

Part IV PROGRAMS Appendices 391 Contents Xl

A- Mathematica AND MATLAB PROGRAMS 391 1. APPROACH TO Mathematica SUPPORT 391 2. COMMON PART OF Mathematica PROGRAMS 393 3. FRAME OF Mathematica PROGRAMS 394 4. RUNNING Mathematica PROGRAMS 395 5. FUZZY APPROACH TO MAT LAB SUPPORT 397 6. RUNNING MATLAB PROGRAMS 401 B- LIBRARY OF Mathematica PROGRAMS 407 1. PROGRAM LISTINGS 407 1.1 Program SKUP.MA 407 1.2 Declarations of Basic Vectors 410 1.3 Program ENTRO.MA 410 1.4 Program RELRMA 411 1.5 Program KSUMLMA 412 1.6 Program KINMA.MA 412 1.7 Program SUMIT.MA 413 1.8 Program INMAT.MA 414 1.9 Program REL_SQ.MA 415 1.10 Program INTER.MA 417 1.11 Program DOLIN.MA 418 1.12 Program REAL.MA 420 1.13 Program ENAKMA 421 1.14 Program DENA.MA 423 1.15 Program RAZLLMA 425 1.16 Program ENA.MA 427 1.17 Program DATU.MA 429 1.18 Program TSET.MA 430 1.19 Program HOJKMA 431 1.20 Program IMP.MA 432 1.21 Program HORS.MA 434 1.22 Program HOTOF.MA 436 1.23 Program FAVT .MA 438 1.24 Program HOJKA.MA 440 1.25 Program HOTA.MA 441 1.26 Program HOXY.MA 442 1.27 Program MEA.MA 443 1.28 Program NAPAKMA 448 1.29 Program PRIKMA 449 1.30 Program VEKRV.MA 451 1.31 Program RLPAC.MA 453 C- LIBRARY OF MATLAB PROGRAMS 455 1. PROGRAM LISTINGS 455 1.1 Program MATL.M 455 1.2 Program MFDATA.M 456 1.3 Program XDATA.M 456 1.4 Program FTCELL.MDL 458 References 467 xii DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

Index 473 List of Figures

1.1 Real line with crisp real number r = 4.5. 3 1.2 Number (4.5) represented as a fuzzy set. 4 1.3 Membership function of fuzzy value {4.5} and terms of fuzzy variable T. 6 1.4 Terms of fuzzy variable V. 6 1.5 Different degrees of fuzziness of fuzzy number (4.5). 7 1.6 FUll support of fuzzy set (4.5). 7 1.7 Various convex shapes of membership functions. 8 1.8 An example of positive fuzzy number A, negative fuzzy number B and fuzzy zero C . 9 1.9 Different degrees of fuzziness of fuzzy sets A and B . 10 1.10 Trapezoidal fuzzy set membership: (top) paramet- ric plot and (bottom) corresponding vector com- panion. 11 1.11 Complement of fuzzy set A for 0 < w S dolz. 13 1.12 Influence of parameter w on fuzzy measure of A. 13 2.1 Venn diagram interpretation of implication. 20 2.2 Presentation of (left) crisp predicate and (right) fuzzy predicate. 24 2.3 Different categories of basic operators. 24 2.4 Yager class of fuzzy complement. 26 2.5 Parameters needed for LR-presentation of a fuzzy set. 30 2.6 Characteristic function L(x) using Eq. 2.36. 34 2.7 Left side of triangle for m = a = 1. 35 2.8 Left side of triangle for a = 2 and m = 1. 35 2.9 Left side of triangle for a = 2 and m = 3. 35 2.10 Right side of triangle for m = f3 = 1. 36 2.11 Right side of triangle for m = 3 and f3 = 2. 36 Xlll XIV DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

2.12 Normal and expanded minO and maxO. 39 2.13 Conclusion on the basis of conditional crisp fact and fuzzy rule. 43 2.14 The influence of (left) fuzzy and (right) crisp con- ditional fact on the then-part of rule. 45 3.1 Mapping f in space S. 48 3.2 Crisp function f(x) and its optimum proximity. 50 3.3 Membership function of the maximizing set M. 50 3.4 Changing membership function with respect to pa- rameter a. 51 3.5 Fuzzy function ff(x) for given crisp function f(x). 53 3.6 Maximum of the fuzzy function ff(x). 54 3.7 Membership of a fuzzy integral fI(-30,+30)' 57 3.8 Fuzzily bounded interval of an integration. 58 3.9 Function given by Eq. 3.4 with slope Pa at point Xo. 62 3.10 Derivative at a fuzzy point (xo) . 63 3.11 Presentation of a fuzzy derivative of fuzzy function. 64 4.1 A scheme of fuzzy rule list. 66 4.2 Block scheme of a fuzzy controller. 68 4.3 Terms of the input E and the output K of con- troller Fe. 68 4.4 Transfer function for the rule list in (4.9) . 69 4.5 Transfer function for the rule list in (4.10). 70 4.6 Transfer function for the rule list in (4.11). 71 4.7 Transfer function for the center-density of error. 71 4.8 Transfer function for the edge-density of error. 72 4.9 Forming a stepwise transfer function f(e, k) . 72 4.10 ON-OFF type of transfer function (fuzzy imple- mentation of crisp switch). 73 4.11 Transfer function with hysteresis. 74 4.12 Simulation scheme for an operating fuzzy controller Fe. 74 4.13 Operation of Fe if prod implication and MOM- defuzzification are used. 76 4.14 Operation of Fe if Mamdani implication and COG- defuzzification are used. 76 5.1 Basic model of an inference machine. 80 5.2 Sequence of FID processing for one reasoning step. 81 5.3 Clock control of FID processing. 82 5.4 Fuzzification of input values. 82 5.5 Influence factor a for the case of fuzzy input (5) . 83 List of Figures xv

5.6 Comparison of Mamdani and GOdel transfer from conditional to concluding part of fuzzy rule. 84 5.7 Membership of the resulting fuzzy set after infer- ence I. 87 5.8 Computing crisp result by discrete COG method. 88 5.9 Example of COG defuzzification for one-rule fuzzy inference. 88 5.10 Comparison of FOM, MOM, and LOM defuzzifi- cation methods. 90 5.11 Height data needed for HM defuzzification. 91 5.12 Result R' of the (top) COG and (bottom) modified COG defuzzification. 93 5.13 Comparing inference schemes MAX-MIN and MAX- PROD. 94 5.14 Schematic overview of FID (two inputs, one out- put, two rules). 94 5.15 FID with fuzzy rules Rt, ... , Rm and one output. 95 6.1 Consistency of proposition 1 in the environment of given knowledge. 100 6.2 Formalization in the realm of proposition. 107 6.3 Switching circuit for two-input disjunction. 108 6.4 Relations between (left) possibility, necessity and (right) probability of the proposition k. 111 6.5 Possibility distributions: (left) normalized and (right) non-normalized. 115 6.6 Calculation of possibility and necessity of the propo- sition k. 120 7.1 Possible temporal relations with regards to present time point '0'. 136 7.2 Contemporary principle of managing systems dy- namics in the fuzzy approach. 139 7.3 Processing principle of contemporary computers. 139 7.4 Fuzzy approximation of temporal function. 141 7.5 Representation of Boolean lattice L = 2{k,I} . 142 7.6 Possibility distributions 7l'(wt} and 7l'(W6). 143 7.7 Certainly true and possibly true regions of propo- sitions k and I. 153 7.8 Necessities in knowledge bases K and K* consid- ering proposition 3'). 156 7.9 Necessities in knowledge bases K and K*, consid- ering proposition 3". 158 7.10 Memberships of individual fuzzy propositions. 161 XVI DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

7.11 Necessities of intersecting propositions of fuzzy knowl- edge base K. 162 7.12 Veitch diagram needed to compute incon(K). 162 7.13 Membership of 3'" and inconsistency of K. 163 7.14 Membership function of 3/1). 164 7.15 Membership function representing fuzzy set NK' (kl). 164 7.16 Membership function of minimal fuzzy set cert*(k1). 165 7.17 Establishing the possibility measure for w = k 1. 165 8.1 Fuzzy interpretation of 'crisp date a is equal to io'. 168 8.2 Possibility distribution of imprecise date a between io and il. 169 8.3 Kernel and support of a trapezoidal fuzzy date. 170 8.4 Doubtfullness of event related to date a. 171 8.5 Examples of fuzzy set memberships which are not useful. 171 8.6 Membership functions of dates appearing in propo- sitions k, 1 and m. 172 8.7 Memberships of attributes: (top) before and af- ter, (bottom) strictly before and strictly after. 173 8.8 Meaning of parameters c and 'l7 in fuzzy relation R. 175 8.9 p-membership of fuzzy set A = (0.6,0.8,1.2, 1.6)p. 177 8.10 Membership function of relation R(s, i). 178 8.11 A shift-outcome after different modes of calcula- tion for E = O. 179 8.12 A shift-outcome after calculation for c = -0.2. 179 8.13 Result representation at a four-times greater fre- quency of calculations. 180 8.14 Membership function for a2 = 0.9, skf = 5. 181 8.15 Membership function for a2 = 0,9 and skf = 20. 181 8.16 Membership function of fuzzy set ]A,+oo). 182 8.17 Membership function of fuzzy set (-00, A]. 184 8.18 Membership function piAoRt of the fuzzy set (-oo.A[. 184 8.19 Possibility distribution for the proposition 1 : 'date b is much after date a'. 186 8.20 Non-interactivity (left) and interactivity (right) of two dates. 187 8.21 Membership function of relation R(s, i) at c = 0 and 'l7 = 0.002. 187 8.22 v-membership functions f.LA(i) and f.LB(i). 189 8.23 Membership function of relation S(s, i) for 8 = 0.2 and p = 0.4. 190 List of Figures xvii

8.24 Membership function of relation Q(s, t) at c = 8 = 0.2 and TJ = P = 0.4. 190 8.25 Fuzzy zero OAA and fuzzy subtraction DAB. 192 8.26 Fuzzy zero OBB and fuzzy subtraction DBA. 193 8.27 All subtractions and fuzzy zeros of fuzzy sets A and B with central zero. 193 8.28 Possibility distributions for start, duration, and end of interval [A, B]. 195 8.29 Fuzzy start and fuzzy end of actual interval [A, B]. 197 8.30 Membership function of fuzzy time interval [A,B]. 197 8.31 Membership function of fuzzy interval ]A, B[. 198 8.32 Principle of duration of fuzzy interval. 200 8.33 Membership function of fuzzy distance L = B e A. 202 8.34 Membership function of fuzzy addition V s = A EB B. 202 8.35 Possibility distribution of B = A EB L, scaling ski = 20. 204 8.36 Membership function of fuzzy set V = A EB L. 205 8.37 Membership function of fuzzy set W = A e L. 205 8.38 Membership function of fuzzy set V = A EB L. 207 8.39 Membership function of fuzzy relation R(s, t) with c = 0.4 and rJ = 0.2. 208 8.40 Membership functions of fuzzy sets R[V,+oo) and [V, +00).208 8.41 Membership function of fuzzy set K. 210 8.42 Membership function of fuzzy set minPS at p = 0.1 and 8 = O. 211 8.43 Membership function of fuzzy set Kat p = 0.1 and 8 = O. 212 8.44 Membership function of fuzzy set K = (0,0,0, O)p, vector piKf. 212 8.45 Memberships of fuzzy sets PEBK, peK, and PoB at parameters (8, p) = (0.1 , 0). 213 8.46 Membership function of fuzzy set minPS at (p,8) = (0.2,0.2). 213 8.4 7 Membership function of fuzzy set K at parameters (8,p) = (0.2,0.2) . 214 8.48 Memberships of fuzzy sets PEBK, peK, and PoB at parameters (8, p) = (0.2,0.2) and skf = 5. 214 8.49 Membership function of fuzzy set P 0 B for pair (6, p) = (0.2,0.2) and ski = 20. 215 8.50 Plot of the absolute difference between J-LA and J-LB, skf = 50. 217 8.51 Plot of the absolute difference between J-L'A and J-La' skf = 50. 217 XVlll DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

8.52 Inaccurate calculation of absolute difference be- tween J.lA and J.lB at ski = 5. 218 8.53 Membership functions of crisp delay D2B, crisp J* and fuzzy set B at (s,1']) = (2,0). 220 8.54 Membership function of computed fuzzy set A = B EB J at parameters (s,1']) = (2,0.4) and given fuzzy set B. . 221 8.55 Membership function of computed fuzzy set B = A e J* at parameters (s,1']) = (2,0.4) and given fuzzy set A. 221 8.56 Membership function of computed fuzzy set B = A e J* at parameters (s,1']) = (2, 0.1) and given fuzzy set A. 222 8.57 Membership function of computed fuzzy set B = A e J at parameters (s,1']) = (1.8,0.2). 222 8.58 Membership function of computed fuzzy set B = A e J at parameters (s,1']) = (1.6,0.2). 223 8.59 Possibility coverage for date c from Eq. 8.50, ski =W. ~6 8.60 Possibility coverage for date c from Eq. 8.51, ski = 5. 226 8.61 Minima of absolute differences SI and C2 from Eqs. 8.52 and 8.52. 228 8.62 Membership functions offuzzy sets B, DEBAT and DEB A. 229 8.63 Membership functions of fuzzy sets A, CEBBT and C EBB. 230 9.1 Possible modifications of fuzzy set A within time. 236 9.2 Technically more suitable presentation of temporal fuzzy set A(t). 237 9.3 Fuzzy set A which is taken as value A(O). 238 9.4 function of time dependence of fuzzy set A, for ski = 10. 239 9.5 Time dependent fuzzy set A, for ski = 10. 239 9.6 Membership function of fuzzy set A(2, t). 240 9.7 Time independent fuzzy set A(x), for ski = 5. 240 9.8 Two modes of reasoning within a fuzzy inference machine. 246 9.9 Fuzzy word in an inference machine. 247 9.10 One-fuzzy-rule inference machine. 248 9.11 Gate circuit of FJK memory cell. 251 List of Figures XIX

9.12 DIQ behavior for FJK memory cell for Q = 0,0.25, 0.5, 0.75, and 1. 253 9.13 Input spaces of a JK binary and an FJK memory cell. 254 9.14 Next-state function of a basic FT memory cell. 256 9.15 Circuit representation of KD implication. 259 9.16 KD implication in (left) P-of-S and in (right) S-of- P forms. 262 9.17 M-implication in (left) P-of-S and in (right) S-of-P forms.262 9.18 Next state of FT-cell in (left) S-of-P and in (right) P -of-S forms. 263 9.19 S-of-P (left) and P-of-S (right) next-state behavior of FT cell for KD-implication, input fuzzy set A and memorized fuzzy set B. 264 9.20 Possible next-state functions of FRS memory cell. 267 9.21 Dl Q behavior for FRS memory cell if Q = 0, 0.25, 0.5, 0.75, and 1. 268 9.22 Next-state function of an FD memory cell. 269 9.23 Time functions D(t) (=S(t)) and DIQ(t) of FD memory cell. 270 9.24 Contour plot of DIQ for an FD memory cell with D = S . 270 9.25 Standard and non-standard fuzzy switching variable. 271 9.26 FT memory cell output piQT with less fuzziness (left) as compared to the intersection piQTa of ba- sic FT output and the same piQT. 273 9.27 Next-stat~ behavior of FT memory cell if member- ship values of T and Q are zero within [0.2,0.8]. 273 9.28 Next-state membership of FD memory cell if input membership is D = S = (0,0.5,0.5,1)p. 274 9.29 Contour plot of next state of FD memory cell if listD = listS = (0,0.5,0 .5,1)p. 274 9.30 Relief of next state of FJK memory cell for input relations j j end kk. 276 9.31 Three levels of fuzziness of state-transition diagram. 278 9.32 Membership of full state (y, x) = (0.2,0.2) in au- tomaton A. 279 9.33 Fuzzy relief R over the plane X -Y of fuzzy automa- ton A. 280 9.34 Simultaneous view of input data x(t) = P2A.DAT and corresponding output data y( t) = p2bt of au- tomaton A. This enables us to find y( x). 283 9.35 Going over "hill and dale" in relief R. 284 xx DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

9.36 Next-state function of an F JK memory cell which is running as automaton A with Q = 0.5. 287 9.37 fuzzy relief R(P) of automaton A running as an FT-memory cell. 288 9.38 Next-state function 8(Q, T) of automaton Ii run- ning as an FT memory cell. 289 9.39 Input-output relation of automaton A which runs as an FT memory cell. 289 9.40 Contour representation of trajectory correspond- ing to Fig. 9.39. 290 9.41 Damping of state oscillation resulting from calcu- lation errors. 290 9.42 Contour plot corresponding to Fig. 9.41. 291 9.43 Output Q(t) with calculation errors corrected. 292 10.1 Membership functions of fuzzy set A and opposite set -A. 297 10.2 Time-relation between date d2 and date d1 . 300 10.3 Time-relation between date d1 and date d2 . 301 10.4 Four different examples of fuzzy sets A and B. 302 10.5 Date d3 introduced into fuzzy graph from Fig. 10.2. 303 10.6 Example of calculated and given fuzzy sets of the dates ch and dj and calculation of minimum fuzzy connection between these dates. 304 10.7 Given graph of dates (left) and calculated graph of dates (right). 305 10.8 Comparison of two calculations a) and b) of prob- lem elimination in the process. 306 10.9 Temporal graph with fuzzy transitions between events A and F. 308 10.10 Three alternatives for fuzzy set A. 309 10.11 Membership functions of fuzzy sets A, B, C, D, and E according to Fig. 10.9. 311 10.12 Membership functions of fuzzy delays K 1 to K 7 according to Fig. 10.9. 311 10.13 Membership function of time independent fuzzy set Ax· 312 10.14 Membership function of fuzzy set DKI At. 312 10.15 Membership of fuzzy set Ax(t). 313 10.16 Membership of fuzzy set DKIAx(t). 314 10.17 Difference between fuzzy sets D9 A(5) and DKI A(5). 315 10.18 Membership functions of delays Ka to Kg. 316 List of Figures XXI

10.19 Membership functions of fuzzy sets expressed by Eqs. 10.15. 316 10.20 PN interpretation of fuzzy rule. 320 10.21 Four basic examples of PN. 321 11.1 Moment x inside interval]ti,ii+l[. 328 11.2 Four possible deviations in p-membership of set A. 329 11.3 Plot of v-type membership function of fuzzy set K (deviation at small and large membership values). 332 11.4 Plot of v-type membership function of fuzzy set K (deviation only at large membership values). 332 11.5 Plot of p-type membership function of fuzzy set K, without any deviation. 333 11.6 Plot of v-p-v-membership function of fuzzy set K. 333 11.7 Variations of deviations among different v-memberships of fuzzy set K. 334 11.8 Column-wise display of membership function of fuzzy set A. 335 11.9 Difference between line-wise and step-wise plotting of membership function of fuzzy set A. 336 11.10 Plots of p-membership functions of fuzzy set A and crisp number B. 337 11.11 Plots of v-membership functions of fuzzy sets A and B in Fig. 11.10, lin- and stp-plots. 337 11.12 Lin-plot and stp-plot of memberships f.LA and f.LB , skf = 10. 338 11.13 Rectangular and triangular v-membership, lin-plotting and stp-plotting. 338 11.14 Plot of p-membership functions of fuzzy sets A and B. 340 11.15 Plot of p-v-p-membership function of fuzzy set A, skf = 5. 341 11.16 Plots of v-membership functions of fuzzy sets hBB and AeB. 341 11.17 Comparison between v- and p-v-transformation ac- cording Eq. 8.30, skf = 5. 342 11.18 Influence of doubling the calculation density used in Fig. 11.17. 342 11.19 Col-display as bar chart of membership function f.LA(U) (Mathematica, Pack). 344 11.20 Lin-plotting of membership function f.LA(X) (Math- ematica, Fuzzy Logic Pack). 345 11.21 Membership function of fuzzy relation ReI (Math- ematica, Fuzzy Logic Pack). 345 XXll DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

11.22 3D-plot of membership function of fuzzy relation R (Mathematica, Fuzzy Logic Pack). 346 11 .23 Membership function fsl (MATLAB, Fuzzy Logic TOOLBOX). 348 11 .24 Membership function of relation rela (MATLAB, Fuzzy Logic TOOLBOX). 349 11.25 Plotting membership function of fuzzy relation R (MATLAB, Fuzzy Logic TOOLBOX). 349 12.1 Fuzzy controller, which is useed in tool SIMULINK. 352 12.2 Library of fuzzy blocks TSNORM.M 354 12.3 FT-memory cell from library TSNORM.M 354 12.4 Model of FSRcell from library TSNORM.M. 356 12.5 F JK memory cell from library TSNORM.M. 356 12.6 FD-memory cell from library TSNORM.M. 357 12.7 FTD memory cell in library TSFORM.M. 357 12.8 FTU-memory cell from library TSNORM.M. 357 12.9 Evaluation of simulated fuzzy logic circuit. 358 12.10 Comparison of next state DIQ and input D of FD memory cell. 359 12.11 Next output Dl Q of basic FT memory cell, T = /-LA · 360 12.12 Next output Dl Q of FT memory cell, T = /-LA' 360 12.13 Output Dl Q of FTD memory cell, T = /-LA' 361 12.14 Output Dl Q of FTU memory cell if T min = 0.6. 362 12.15 Response of crisp T memory cell considering input data in Fig. 12.12 362 12.16 Simulation scheme for KD-implication where one variable is memorized in FTD-memory cell. 363 12.17 Implication behavior of output Dl Q for a given input signal. 363 12.18 Reaction of FTD memory cell to the first drop of input signal x. 364 12.19 Fuzzy time-interval Dl[S, R[, simulation with FSR memory cell. 365 12.20 Membership function of delayed fuzzy set A(t + 1) . 366 12.21 A possible clearing concept of FT memory cell. 367 12.22 Clear action of FT memory cell at t = 100 s. 368 12.23 Testing of FTDC register of four fuzzy-bits, FTDCreg. 369 12.24 Inputs iIL5 and iIL6 for FTDCreg shown in Fig. 12.23. 370 12.25 Membership input data generated with Repeating Sequences 1 - 4 for FTDCreg. 370 List of Figures XX111

12.26 Correlation between inputs in-5 and in-60f FTDC register block. 371 12.27 Four membership values stored in FTDCreg. 371 12.28 Four fuzzy-bit shift-register with FTDC memory cell. 372 12.29 FTDC shift register for memberships with mono- tonic increasing and decreasing behavior. 373 12.30 Four fuzzy-bit shifting of a monotonic increasing membership function of K = h. 374 12.31 Four fuzzy-bit shifting of a triangle membership function of K = h 375 12.32 Delay of attribute much after, denoted by inter- val [Dn K,+oo) for n = 0, 10,20,30,40. 375 12.33 Four fuzzy-bit delay performed with FRS memory cells. 376 12.34 Delay of 16 time units with two output functions, DI6 K and [DI7 K, +00). 376 12.35 The result of Auto Scale Graph block from Fig. 12.34. 377 12.36 Yamakawa's fuzzy neuron. 377 12.37 8 fuzzy-bit FTCD register. 379 12.38 32 fuzzy-bit unit Half1. 380 12.39 Complete circuit of fuzzy neuron. 381 12.40 Block scheme of fuzzy neuron that can be used in fuzzy neural nets. 382 12.41 Memberships Fij for fuzzy neuron in Fig. 12.40, j = 1, .. . ,8. 383 12.42 Input fuzzy vectors Xij, j = 1, ... , 8. 383 12.43 Minimum of Cartesian elements (fLijk, Xijk). 384 12.44 Maximum of min[(fLijk, Xijk)] over index k = 1, 2, ... ,8. 384 12.45 Output of fuzzy neuron on Auto-Scale Graph in Fig. 12.40. 385 12.46 Working FTDC-register for MFIj through simula- tion period. 385 12.47 Simulation of fuzzy neuron over 80 s. 386 A.1 Approach to Mathematica using X.MA program- ming. 392 A.2 Possible access to MATLAB with X.M, X.MDL, and X.FIS programs. 397 A.3 Rule-Viewer for FID in Fig. 5.8. 399 A.4 Output fuzzy variable output1. 401 List of Tables

2.1 Truth table for implication. 20 2.2 Some useful implications in fuzzy logic. 23 3.1 Calculation of fuzzy set f(M). 52 3.2 Values of fuzzy function at a-cuts 0.25, 0.5, 0.75, and 1. 56 5.1 Matrix of 25 enumerated fuzzy rules with inputs A, B and output Q. Label ZE stands for value zero, first letters Sand L mean small and large, and second letters P nad N denote positive and negative values. 96 6.1 Confirmation of inclusion ml V mk V kl within l V m . 112 7.1 Values of four-valued logic which defines the se- mantics of proposition k. 150 9.1 Truth table of binary JK memory cell. 250 9.2 Truth table of binary T memory cell. 255 9.3 Truth table for T-realization of implication. 258 9.4 Truth table for binary RS memory cell. 265 9.5 Possible transitions of state Q to DIQ in FRS mem- ory cell. 266 9.6 Truth table of binary D cell 268 11.1 Time scaling. 327 12.1 Library TSNORM.M of 22 fuzzy blocks 355 12.2 Clear and Write specification of FTDC cell 368 12.3 Data specifications for TFDC register simulation 369 A.1 Programs using Mathematica environment. 396 A.2 MATLAB programs in visual form. 402

xxv Foreword

Fuzzy theory is an interesting name for a method that has been highly effective in a wide variety of significant, real-world applications. A few examples make this readily apparent. As the result of a faulty design the method of computer-programmed trading, the biggest stock market crash in history was triggered by a small fraction of a percent change in the interest rate in a Western European country. A fuzzy theory ap• proach would have weighed a number of relevant variables and the ranges of values for each of these variables. Another example, which is rather simple but pervasive, is that of an electronic thermostat that turns on heat or air conditioning at a specific temperature setting. In fact, actual comfort level involves other variables such as humidity and the location of the sun with respect to windows in a home, among others. Because of its great applied significance, fuzzy theory has generated widespread activity internationally. In fact, institutions devoted to research in this area have come into being. As the above examples suggest, Fuzzy Systems Theory is of fundamen• tal importance for the analysis and design of a wide variety of dynamic systems. This clearly manifests the fundamental importance of time con• siderations in the Fuzzy Systems design approach in dynamic systems. This textbook by Prof. Dr. Jernej Virant provides what is evidently a uniquely significant and comprehensive treatment of this subject on the international scene. As such it will provide an essential reference source for research engineers, computer scientists, students, professors, and many others for many years to come. Prof. Dr. Jernej Virant de• serves the appreciation of all of us for undertaking such a challenging and comprehensive treatment and making a contribution of substantive importance to the broadly significant subject of Design Considerations of Time in Fuzzy (Dynamic) Systems.

xxvii C. J. Leondes Preface

THE STARTING POINT Success in many of our society's activities is more and more linked with information and we are changing our basic attitudes towards in• formation in the planning, design, building and utilization of processes and systems. Information and language are directly interrelated. Lan• guage has its pragmatics, semantics and syntax. The evolution into an information society would not be possible if we had not been able to manipulate various languages, natural, artificial and programming, in a formal, mathematical way. We are seeing a rapid development in non• classical branches of logic such as linguistic, modal, dynamic, possibility, temporal and fuzzy, which are begining to play an important part in the design, building and utilization of systems. In the past we would nor• mally use mathematical modeling framed within the fields of classical mathematics involving differential calculus, number theory, probability, statistics and integral calculus. Today a variety of fields of logic are moving ahead, and have been receiving a great deal of interest over the past five decades. Let us consider the formally defined proposition from classical logic. It is a mathematical variable that can take two different values: 1 (the proposition is true) and 0 (the proposition is false). The content of the proposition may relate to anything within a certain process or a system, and is therefore of interest to the designer of the system, the engineer. However, it turns out that the propositions about the process or system given in a natural language soon become uncertain, imprecise and approximate. For this reason classical logic no longer provides all the tools we need. We can, of course, usestatistics, probability calculus, confidence intervals and so forth - in fact, in this century the infor• mation quantity for a symbol, word, message and proposition resulted

XXIX xxx DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS from probability theory using the unit of information, the bit. This ap• proach to the uncertainty of information is classical and belongs to the period where the non-classical, alternative logic was not emphasized or even acknowledged. It is only fair to say that probability will remain the fundamental tool for many fields of work, such as state administration. In the case of uncertain information however we get much more from the new approaches in logic like fuzzy and possibilistic logic. Here we encounter the notions of linguistic variable, linguistic value, linguistic attribute, which are mathematically well defined entities although they represent the uncertainty of information. It is of a great importance for the engineer to have available measures of possibility, necessity, fuzziness and plausibility to use when evaluating levels of uncertainty, possibility, correctness, consistency and the like as they relate to semantic issues. The approach to processes and systems based on fuzzy and possibilis• tic logic is especially important in cases where they are guided, managed or supervised by a human being. No classical mathematical model of a process or a system can incorporate the human factor and human ex• perience in such guidance, management or supervision. In this respect the fuzzy process and system models are extremely efficient and simple. Fuzzy modeling provides a way to incorporate knowledge gained by ex• perience, but in a manner different from that found in expert systems (AI) which can be designed without the use of fuzzy and possibilistic logic. The fuzzy logic almost always leads to a solution achievable by professionals who are not necessarily the experts in the field as is essen• tial in computer expert systems. The fuzzy approach to processes and systems is also suitable in the case of high complexity, even if there is no human factor involved. When the process or a system becomes so large that it cannot be manipulated or controlled by a classical mathematical model the fuzzy solution may prove to be among the feasible ones. The mathematics of fuzzy and possibilistic logic is actually an exten• sion of classical mathematics. The extension principle has been intro• duced which allows many of the results and facts from classical math• ematics to be brought into the frame of fuzzy and possibilistic logic. For this reason this book sets out to discuss the fuzzy number, fuzzy arithmetic, fuzzy relation, fuzzy function, fuzzy differentiation, fuzzy integration, fuzzy analysis, etc. We have already met the term uncertainty. Exactly what we mean may be appreciated by the following example. From the knowledge base we can take the proposition k : 'the statement is correct'. If the process is complex or depends on a human factor, then the proposition may appear in various forms, such as: Preface xxxi

• 'the statement is possible',

• 'the statement is partly correct',

• 'the statement is approximately correct',

• 'the statement is very plausible',

• 'the statement is partly uncertain',

• 'the statement is risky',

• 'the statement is nearly correct',

• and other.

Can we distinguish the above possibilities as strictly as we can the mathematical ones? Possibly not Our experience shows only that the fuzzy and possibilistic logic, as well as some other non-classical branches of logic, manage to achieve the highest formalism in distinguishing be• tween the above statements. The special topic of this book is the uncer• tainty of temporal propositions (temporal knowledge), where attention is devoted to natural, that is, measurable time. Time as a variable appears in most processes and systems therefore justifying a special and formal discussion of temporal issues. THE PURPOSE Our aim is to provide the engineer or other expert with a knowledge of fuzzy and possibilistic logic required for the fuzzy design, building and utilization of systems and processes. The book attempts to empha• size the application aspects, rather than entering a deeper discussion of theoretical or philosophical aspects of logic. As far as possible, we shall bring together the existing knowledge, technology, logic design and skills which are advantageous when compared to the use of logical models of the classical mathematical approaches. The main purpose of this book is to present the knowledge about fuzzy time as required in the contem• porary structure of fuzzy products. The book attempts to introduce and familiarize the reader with time-dependent fuzzy inference, including a concept of memorizing real numbers or more precisely fuzzy set member• ships in fuzzy memory devices. In our book there are a lot of programs (in Mathematica and MATLAB) with many numeric results and graphic presentations enabling the reader to rather quickly comprehend a great deal of the programming and logical skills needed in the logical design of fuzzy systems. XXXll DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

The book can be good training base for students. Each program in Part IV, Appendices A, Band C, can be taken as a completely-solved-in• detail exercise to enlarge understanding of fuzzy sets, fuzzy calculations, fuzzy sequential circuits, time dependency in fuzzy systems, and skills of respective programming (environment Mathematica or MATLAB).

THE CONTENT The book is divided in four parts:

Part I. The fundamentals of fuzzy and possibilistic logic Part II. Fuzzy temporal logic Part III. Fuzzy set computation techniques Part IV. Programs

The first part provides the reader with the basics of fuzzy and possi• bilistic logic which are employed in temporal proposition calculus through the rest of the book. We introduce definitions of the fuzzy number, fuzzy set, fuzzy relation, fuzzy arithmetic, fuzzy functions, fuzzy differentia• tion and integration. In this part we also introduce the reader to the principles of the reasoning and the development of fuzzy reasoning. The basics of the fuzzification and defuzzification processes before and after fuzzy inference are given. The fuzzy algorithm is presented in a view of transfer function - this allows us to configure the prescribed function using fuzzy numbers and fuzzy variables. Within the FID (fuzzification, inference, defuzzification) frame we get familiar with the essentials of fuzzy control. The discussions of the first part also include the fuzzy proposition, which conveys the piece of information from the knowledge base about the certain process or system under consideration. Here we emphasize the uncertainty measures of a proposition and the consistency of the knowledge base. This means that we are reaching into the field of se• mantics; we attempt to recognize its extent and aim at optimization of the knowledge which can be extracted from the set of propositions that represent the knowledge base. Part II starts with Chapter 7 where we introduce the temporal propo• sition. The procedure for consistency evaluation based on time is given. In order to operate with the temporal propositions we require the no• tions of fuzzy date, duration, time distance, fuzzy temporal relations and so on. The precise definitions are given in Chapter 8. In Chapter 9 we define the time dependent fuzzy set, the fuzzy temporal delay, and the time dependence of fuzzy rule. Once familiar with the temporal issues Preface XXXlll we may tackle the fuzzy inference machine where the fuzzy implication could also bear the temporal dependencies. Further in Chapter 9 we discuss the characteristics of fuzzy memorizing. We introduce the fuzzy memory cells which can be used in developing fuzzy registers, fuzzy mem• ories and time dependent inferences. We deal also with fuzzy automata conception using observed fuzzy memory cells. In Chapter 10 we move from the extensive temporal proposition and fuzzy memorizing to the graph or net and thus prepare the ground for solutions of the temporal problems based on fuzzy time restrictions. Part II shows how we present the function of time as a basis of fuzzy memory constructs like cells, registers and units of fuzzy inference pro• cessing. In Chapter 8 we have already dealt with the problem of error in fuzzy set and temporal relations processing. These errors emerge due to sparse fuzzy inference processing and are encountered also in the presen• tation of the membership results. To deal with this problem we present the essential engineering knowledge in Part III of this book. Chapter 11 describes experience with the package Mathematica. Chapter 12 dis• cusses simulation of fuzzy memory constructs based on the MATLAB and SIMULINK packages which turn out to be more appropriate than M athematica. Finally, in Part IV, Appendix A we present the approach to Mathe• matica and MATLAB programming. Appendices A, Band C contain 31 programs in Mathematica, and 4 programs in source code plus 23 graph• ics mode programs in MATLAB&SIMULINK. In Part IV we deal also with the Fuzzy Logic Pack (application package in Mathematica) and Fuzzy Logic TOOLBOX (application supplement in MATLAB). These programs cover all the topics from the book, described in Parts I - III.

THE READER'S FLOW The figure below suggests that the reader can use the book in three possible ways:

A Those who do not have enough basic knowledge on the fuzzy and pos• sibilistic logic we should acquire the fundamentals starting with the Part I, followed by the temporal characteristics of fuzzy propositions and the consistency evaluation (Part II). Finally, the engineering ex• ercises with fuzzy computing may be tackled in Part III.

B Readers familiar with the fields of fuzzy and possibilistic logic are invited to start their reading in the domain of fuzzy time (Part II) and then proceed to the engineering part of the book (Part III). XXXIV DESIGN CONSIDERATIONS OF TIME IN FUZZY SYSTEMS

C The reader may, however, be interested only in the experience gained by designing programs and routines for fuzzy, temporal and possi• bilistic logic, where the computing time is also an issue of interest (Parts III and IV). Such experience is necessary when it comes to optimizing the time available for inference processing. A B c

ESSENIlAlS OF FUllY AND PQSSJ8ll1S1IC LOGIC

A

nME DEPENDENI FUllY PflOPOsmONS. RELAnONS. OPERATORS FUllY MEMORY DEVICES. FUZZV SEQUENnAL CIRCUITS

A B

PROGRAMMING. ERRORS OF FUZZV INFERENCE COMPUTAnONS. FUZZV SET DISPlAYS AND SIMULAnONS

A B c

THE AUTHOR Acknowledgments

I wish to express my gratitude to my colleagues from the Laboratory for Computer Structures and Systems at the Faculty of Computer and Information Science, University of Ljubljana. My thanks go, in particu• lar, to Drs. Nikolaj Zimic and Miha Mraz for many hours of productive and highly competent discussion about the problems of time in fuzzy structures and systems. Iztok Lapanja MSc. solved many problems related to typesetting. He handled the necessary administration and management work for publishing the book and helped in finding the proper English terminology. The majority of the current content has its origin in a Slovene book dedicated to the same subject. The larger part of translation was made by Iztok Lapanja with considerable asis• tance from Talij Budau. I thank them both, particularly due to the time pressure they were put under. I gladly appreciate the improvement in manuscript quality as a result of the careful and detailed reading of Prof. Roger Pain. My deep gratitude goes to Prof. Dr. Cornelius T. Leondes whose dis• tinguished contribution to the field stimulated my colleagues and myself to write about fuzzy logic, both in the form of this book, and also as associate authors with him.

Ljubljana, August 15, 1999 J. Vimnt

xxxv