This action might not be possible to undo. Are you sure you want to continue?

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

For use with Mathematica 5.0. For the latest updates and corrections to this manual visit: documents.wolfram.com. Comments on this manual are welcomed at: comments@wolfram.com. © 2003 Wolfram Research, Inc. All rights reserved. No part of this document may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of the copyright holder. Wolfram Research is the holder of the copyright to the Mathematica software system described in this document, including without limitation such aspects of the system as its code, structure, sequence, organization, “look and feel,” programming language and compilation of command names. Use of the system unless pursuant to the terms of a license granted by Wolfram Research or as otherwise authorized by law is an infringement of the copyright. Wolfram Research, Inc. makes no representations, express or implied, with respect to the product, including without limitations, any implied warranties of merchantability, interoperability, or fitness for a particular purpose, all of which are expressly disclaimed. Users should be aware that included in the terms and conditions under which Wolfram Research is willing to license Mathematica is a provision that Wolfram Research and its distribution licensees, distributors, and dealers shall in no event be liable for any indirect, incidental or consequential damages, and that liability for direct damages shall be limited to the amount of the purchase price paid for Mathematica. In addition to the foregoing, users should recognize that all complex software systems and their documentation contain errors and omissions. Wolfram Research shall not be responsible under any circumstances for providing information on or corrections to errors and omissions discovered at any time in this document or the software it describes, whether or not they are aware of the errors or omissions. Wolfram Research does not recommend the use of the software described in this document for applications in which errors or omissions could threaten life, injury or significant loss. Mathematica, MathLM, and MathLink are registered trademarks of Wolfram Research. Windows is a registered trademark of Microsoft Corporation in the United States and other countries. Macintosh and Apple are registered trademarks of Apple Computer, Inc. Motif, Unix, and the “X” device are registered trademarks and The Open Group is a trademark of The Open Group in the United States and other countries. All other product names used herein are trademarks of their respective owners. Mathematica is not associated with Mathematica Policy Research, Inc. or MathTech, Inc. Printed in the United States of America.

XXXX XXXXX 0604.rcm

To my friends from the North America Fuzzy Information Processing Society and from the International Fuzzy Systems Association. Marian S. Stachowicz

To Linda Diane, Shane, Matt, and Christian. Lance Beall

Table of Contents

Introduction................................................................................................................................................... xi New Features in This Release.................................................................................................................... xix

Part 1 Manual

1 Creating Fuzzy Sets

1.1 Introduction...................................................................................................................................... 1.2 Basic Objects..................................................................................................................................... 1.3 Functions for Creating Fuzzy Sets...................................................................................................

3 3 5

**2 Creating Fuzzy Relations
**

2.1 Introduction...................................................................................................................................... 2.2 Basic Objects..................................................................................................................................... 2.3 Functions for Creating Fuzzy Relations..........................................................................................

17 17 19

3 Fuzzy Operations

3.1 Introduction...................................................................................................................................... 3.2 Fuzzy Set Operations....................................................................................................................... 3.3 Fuzzy Relation Operations............................................................................................................... 3.4 Fuzzy Set or Fuzzy Relation Operations.........................................................................................

25 25 32 34

4 Aggregation Operations

4.1 Introduction...................................................................................................................................... 4.2 Intersection (t-norm) and Union (s-norm) Operations................................................................... 4.3 Averaging Operations...................................................................................................................... 4.4 Difference Operations..................................................................................................................... 4.5 User-Defined Aggregators...............................................................................................................

43 44 50 54 57

...................................1 Introduction.............................. 7....................3 Operations on Ln Sets................................................ 10.....................2 Discrete Arithmetic on Triangular Fuzzy Numbers....................................................................1 Introduction....................... 119 ....................................... 109 11.........................................................2 Fuzzy Arithmetic Functions..................................... 89 90 10 Discrete Fuzzy Arithmetic 10...........................................................................................................5 Fuzzy Set Visualization 5......................................... 8.............................................................................................................................................................................. 8...................................... 112 12 Fuzzy Clustering 12...................................... 6.................1 Introduction.............................................................................................................................................................................2 Visualization Functions........................................................................................................................................................................................................1 Introduction.................................2 Inference Functions................................................... 103 11 Æukasiewicz Sets and Logic 11.........2 Composition Function..............................................................................................................................................................1 Introduction.................... 59 59 6 Fuzzy Relation Visualization 6.................................... 73 73 8 Fuzzy Inferencing 8........................................................................................................................................................... 67 67 7 Compositions 7..................................... 117 12..................... 117 12............................................................................ 79 79 80 84 9 Fuzzy Arithmetic 9......................................... 9............... 95 97 10............4 Rule-Based Inference............................................................2 Creating Æukasiewicz Sets.......................................................................................................................................................................................................................................................1 Introduction.......................1 Introduction...................... 5...........................2 Visualization Functions..............................2 Fuzzy C-Means Clustering (FCM).........................3 Composition-Based Inference. 109 11........3 Example......................................................................3 Discrete Arithmetic on Gaussian Fuzzy Numbers....................................................................1 Introduction..... 8...................................................................................

................2 Fuzzy Relation Form....................... 173 References......................................................................................................................................5 Composition of Two Fuzzy Relations................................................................ 142 References............................................................................ 126 Union Formulas........................................................................................ 146 2 Standard Operations 2.....................................1 Introduction.........................3 Graphic Interpretation of Sets......... 147 References....................... 165 3.......................................................1 Introduction................... 161 3............1 Introduction................................................................................................................................................................................. 127 Averaging Formulas............................................................ 177 ...................................... 129 Bibliography.................................................................................................................................................................................................................... 147 2........................... 129 Miscellaneous Formulas.........................................................................................................2 Fuzzy Operations.............................................. 125 Intersection Formulas.......... 161 3................................4 Fuzzy Operations...................... 131 Part 2 Demonstration Notebooks 1 Sets Versus Fuzzy Sets 1...........................Appendix Fuzzy Operator Formulas........................................... 139 1............................................................................................................. 139 1............................................................................................................................2 Characteristic Function and Membership Function.............................................................................................................. 169 3..........................................................................................................................................................................................................................................................................................................................................................................................................................3 Projection of a Fuzzy Relation............................6 Binary Relations.................................................................................................. 163 3........... 160 3 Fuzzy Relations 3.......................................................................................................................................................................................................................

............................. 193 5........................................................................................................................................................................................................................1 Introduction....3 Æukasiewicz Multivalued Logic.....................................................3 Defining Output Membership Functions.......................................... 203 7................5 Building the Model.. 200 References..................................................... 179 4...........................................................6 Test Run 1.......... 199 6..........................................................................1 Introduction.................................... 196 5................................................................................ 181 4.... 194 5..............................................................................................................2 Creating Fuzzy Numbers.......... 185 References............2 Representing the Model Input.............................................................................................................................................................. 187 5 Fuzzy Logic Control 5...............................................5 Simulation Functions.6 Using the Model................................................................................................................ 195 5............................................................... 179 4.................................................................................................................................................................................................................... 189 5............................................................................................................................................ 198 References...................... 199 6.................................................................................................................................................... 207 References........................................................4 Defining Control Rules........................................... 192 5....................................................................................................................................................4 Fuzzy Modeling 4................................................................................................2 Defining Input Membership Functions....................................................................................................... 189 5...........................................................................1 Introduction..............2 Creating Digital Fuzzy Sets............................................................................................... 198 6 Fuzzy Numbers 6................................................................................... 203 7.........................................7 Test Run 2....3 Representing the Model Output..................................................................................................8 Control Surface..........................................................................................4 Creating Linguistic Control Rules.......................................1 Introduction..............................3 Fuzzy Arithmetic............................................ 209 ................................................ 182 4................................... 202 7 Digital Fuzzy Sets and Multivalued Logic 7............. 183 4............................................................. 181 4.....7 Evaluating the Model........................................................................................................................................

....................................................................................................................10 Example 9: Image Processing.................................................................................................................................................... 212 8.............................................................................................5 Example 4: Natural Numbers............................................ 249 .............. 229 Index....7 Example 6: Distance Relation....................... 218 8.....2 Example 1: Classifying Houses........................................... 223 8.....................................................................................................................................................1 Introduction....................................................... 215 8........................................................................................................................................................................ 211 8..................................................... 213 8....................................6 Example 5: Fuzzy Hedges........................................................................................................3 Example 2: Representing Age.............................................................................................................................................................. 227 Reference Guide.... 221 8.......................................8 Additional Examples 8...........................................................................................9 Example 8: Digital Fuzzy Sets.8 Example 7: Choosing a Job............... 211 8......................... 225 References................................4 Example 3: Finding the Disjunctive Sum......... 220 8.......................................................................................................

.

nb notebook. The packages provided in Fuzzy Logic. provide a powerful tool for studying fuzzy logic and for developing fuzzy applications. many of the examples are from works listed in the 1_14_Bibliography.nb Demonstrates the functions used to create fuzzy relations and the options associated with each of these functions. and they contain many worked examples showing how this package can be used in real-world applications. Basic familiarity with Mathematica is assumed for use of Fuzzy Logic.nb. see below or contact Wolfram Research. The notebooks provided with this package demonstrate how the various fuzzy logic functions are used. The following is a brief description of the types of examples that can be found in each of the notebooks in the manual.nb Demonstrates the functions used to create fuzzy sets and options associated with each of the functions. . 1_01_CreateFuzzySets. 2 The Manual The manual is a collection of Mathematica notebooks that show the capabilities of Fuzzy Logic package and demonstrate the use of all of the functions. New functions added to this updated version of Fuzzy Logic package are described in 0_02_New_Features. 1_02_CreateFuzzyRelations. For more information on Mathematica. combined with Mathematica.Introduction 1 Fuzzy Logic Package Fuzzy Logic is a collection of notebooks and packages that are designed to introduce fuzzy set theory and fuzzy logic in the Mathematica environment. and graphics. Notebooks are interactive documents combining Mathematica input and output. text. The materials for the manual come from a wide variety of sources. Inc.

including a full range of t-norm (intersection).nb Contains examples of the various package functions for combining two or more fuzzy sets or fuzzy relations.xii Fuzzy Logic 1_03_FuzzyOperations. 1_10_DiscreteFuzzyArithmetic.nb Contains examples demonstrating the use of the digital fuzzy sets and the multivalued logic functions. fuzzy relations. 1_04_FuzzyAggregators. . and averaging operators. These functions are used only with triangular or trapezoidal fuzzy numbers.nb Shows how to apply fuzzy arithmetic operations to fuzzy numbers.nb Demonstrates the Fuzzy C-Means Clustering algorithm and shows an example. or both.nb Shows how to perform fuzzy inferences and demonstrates some applications of fuzzy inferencing for modeling and control. 1_11_Lukasiewicz.nb Shows how to perform a composition between two fuzzy relations.nb Demonstrates the various ways to view fuzzy relations in this package. 1_05_ViewFuzzySets. These arithmetic operations work on any fuzzy sets or fuzzy numbers.nb Contains examples demonstrating the use of the discrete fuzzy arithmetic operations. s-norm (union). Both standard and nonstandard operators are included. 1_08_FuzzyInference. 1_09_FuzzyArithmetic. including a variety plotting methods.nb Contains examples of different operations that can be applied to fuzzy sets. 1_06_ViewFuzzyRelations. 1_07_Compositions.nb Demonstrates the various ways to view fuzzy sets in this package. 1_12_FuzzyClustering. including different plot styles and membership matrices.

1_14_Bibliography. .nb Introduces fuzzy logic control.nb Contains an introduction to fuzzy sets and compares and contrasts fuzzy sets with traditional sets.nb Contains a bibliography list for selected applications areas and theoretical topics. 2_04_FuzzyModeling.nb Introduces fuzzy relations and gives examples of creating.Introduction xiii 1_13_Appendix. 2_02_StandardOperations. operating on. 2_03_FuzzyRelations. This notebook contains a truck-backing control example and a step-by-step description of the design process. If you are just learning fuzzy sets. as well as a number of examples demonstrating the use of fuzzy arithmetic. These notebooks contain information about fuzzy concepts and the mathematics behind fuzzy sets. 3 The Demonstration Notebooks The notebooks contained in the package consist of worked examples of various fuzzy topics that can be studied using Fuzzy Logic package.nb Contains a partial list of the formulas for the various operations in Fuzzy Logic package. 2_06_FuzzyNumbers. 2_05_FuzzyControl. The following is a list describing all of Fuzzy Logic notebooks. the first three notebooks are a good place to start. 2_01_SetVersusFuzzySet.nb Demonstrates how fuzzy sets and fuzzy relations can be used in real-world process modeling.nb Contains an introduction to fuzzy numbers and fuzzy arithmetic.nb Contains examples that demonstrate the use of the various operations that can be performed on fuzzy sets. and using fuzzy relations.

FuzzyLogic`SetToSet` Contains programs that take fuzzy sets or fuzzy relations as arguments and returns new fuzzy sets or fuzzy relations. The following is a list briefly describing the definitions that are contained in each package. The manual is a notebook that can be used either as an introduction to the functions in this package or as a quick reference to look up function names and uses. Fuzzy Logic notebooks make use of the definitions contained in the packages. all of which can be accessed by loading the FuzzyLogic` init file. FuzzyLogic`Creation` Contains definitions that can be used to create fuzzy sets and fuzzy relations. . In addition to the packages. Examples in this notebook are presented in a problem-solution format. FuzzyLogic`SetToList` Contains functions that take fuzzy sets or fuzzy relations as inputs and returns a list of items as output.xiv Fuzzy Logic 2_07_DigitalFuzzySets. The packages contained in Fuzzy Logic package contain definitions that allow Mathematica to work with fuzzy sets and fuzzy relations. 4 The Packages Mathematica packages are files written in the Mathematica programming language. discrete. a manual is included with the code. The packages are found in several files. 2_08_Examples. In Fuzzy Logic package.nb Contains an introduction to analog. FuzzyLogic`Common` Contains definitions that are used within one or more other packages. we attempted to adhere to the conventions of good Mathematica programming.nb Describes a wide variety of practical situations in which fuzzy sets and fuzzy logic can be applied. and digital fuzzy sets. so the packages can be used as models for your own algorithms. The list is provided to allow you to view the code for a particular routine or group of routines. It contains the code that defines fuzzy sets and fuzzy relations. as well as a number of examples demonstrating the different digital fuzzy numbers. FuzzyLogic`SetToValue` Contains definitions that take fuzzy sets or relations as arguments and returns a single value as output. They contain Mathematica definitions that extend Mathematica's capabilities in a particular area.

FuzzyLogic`Lukasiewicz` Contains the digital fuzzy sets and the multivalued logic functions. but if the package is already loaded and you try to reload it with the Get command. The most convenient way is to load the subpackage FuzzyLogic` init. the proper functions must be loaded from Fuzzy Logic package. we recommend using the Needs command. For this reason. Definitions of intersections and unions can be found here. FuzzyLogic`Cluster` Contains the fuzzy clustering functions.Introduction xv FuzzyLogic`Aggregate` Contains definitions that can be used to aggregate two or more fuzzy sets or fuzzy relations. FuzzyLogic`Average` Contains functions that average two or more fuzzy sets or fuzzy relations. There are a number of ways to do this. FuzzyLogic`Composition` Contains functions that perform the composition of fuzzy relations. or you can type the following: . you may see some error messages. The Get command can be used instead of the Needs command. This can be done with the following command: Needs["FuzzyLogic`"] After entering the command above. FuzzyLogic`Inference` Contains the fuzzy logic inferencing functions that are used for fuzzy logic control and modeling. all of the functions from Fuzzy Logic package will be available. The subpackages containing the function will be automatically loaded when needed. 5 Loading the Package After starting a Mathematica session. FuzzyLogic`Arithmetic` Contains the definitions for performing fuzzy arithmetic with fuzzy numbers. If you want to use the Get command. you can replace the word Needs with Get. FuzzyLogic`Visual` Contains functions to display fuzzy sets or fuzzy relations visually.

.xvi Fuzzy Logic << FuzzyLogic` If the package loading command fails.nb notebook in the Notebooks folder. there are many additional books and magazines that are dedicated to providing information about Mathematica. verify that the directory containing Fuzzy Logic directory is on Mathematica's $Path. 6 Getting More Information about Mathematica For information on standard Mathematica operations and packages or for general Mathematica information.nb notebook (in the Notebooks folder). this should be in your init. There are a number of books that describe programming in the Mathematica language. A partial list of the formulas used in this package is provided in the 1_13_Appendix. For a comprehensive list of resources or for further information regarding Mathematica. Mathematica: A System for Doing Mathematics by Computer. Fourth Edition by Stephen Wolfram is the definitive reference. check the Wolfram Research web site at www. For convenience. we found Roman Maeder's programming books to be very helpful.wolfram.m file. In addition to these resources. The sources we used to create this package are listed in the 1_14_Bibliography. "directory"]. We recommend looking at these sources to provide a better understanding of fuzzy concepts and to get ideas for different applications.com 7 Getting More Information about Fuzzy Sets There are a large number of good publications about fuzzy sets and fuzzy logic on the market. You can use the command AppendTo[$Path.

Berkeley. degree in Control and Computer Engineering from LETI. He is a member of the North American Fuzzy Information Processing Society. Finally. who used this package for homework assignments and provided useful comments. and Ben Anderson. who wrote a special package in Basic for graphical interpretation of fuzzy sets and its operations in 1982. Dr. from A G-H. Recently. Pawel P. where he graduated summa cum laude. Soviet Union and both his Ph. University of California. Stachowicz is professor and Jack Rowe Chair at the University of Minnesota Duluth. Thanks to all the members of the Laboratory for Intelligent Systems at the University of Minnesota Duluth for their helpful comments. Thanks to Bei Tang for her beautiful cluster of the fuzzy flowers..Introduction xvii 8 Acknowledgments We would like to thank the following people who have been of great assistance during the development of Fuzzy Logic package.. . Dan Yao. Thanks to Wolfram Research. Maria E.D. which has facilitated applications of the fuzzy set theory to computer engineering. Guangji Shi. we would like to thank Dr. a member of the International Fuzzy Systems Associations. Inc. He is currently working for Medtronic and pursuing a Master's Degree at the University of Minnesota Twin Cities. Stachowicz for his fabulous Fuzzy as Hell-1989 and Robert Walker for his Ann-1992 programs written for fuzzy modeling. Lance E. His work centers on artificial intelligence and soft computing. formerly Director of Applications at Wolfram Research. Inc. in particular John Novak. a Senior Member of IEEE. ECE Department and Control Science and Dynamical Systems UM Twin Cities campus. Leszek Sczaniecki. Thanks to Sister Maria Magdalena for helping with proofreading. Stachowicz's Fuzzy Set Theory and Its Applications classes and students Chaohui Yang. Beall has a Bachelor of Computer Engineering degree from the University of Minnesota Duluth. Dr. and a consultant for large multinational corporations.S. who wrote the educational version of the program. We are grateful to Med. He is also a graduate professor for Computer Science Department UM Duluth campus. 9 About the Authors Marian S. Kochanska. Thanks to Dr. Poland. decision analysis. and Rebecca Bigelow for helping us develop this package. He received his M. He also contributed significantly to the improvements of the present version. D. He heads the Laboratory for Intelligent Systems in the Electrical and Computer Engineering Department.Sc. and control. he had worked for Berkeley Initiative in Soft Computing. Julia Guelfi. Thanks to Dan Holmdahl for his Æukasiewicz logic notebook. and D. A special thanks to Jonathan Andersh. primarily the documentation. Stachowicz received two awards from the Polish Ministry of Higher Education and Science for the introduction of the digital fuzzy sets into the fuzzy set theory. was instrumental in the design and development of the package.

.

The first two numbers specify the start and end of the universal space. Bell-shaped Fuzzy Sets FuzzyBell[c. s. UniversalSpace → 80. w. In[1]:= << FuzzyLogic` In[2]:= SetOptions@FuzzySet. The first thing to note is that originally the universal space for fuzzy sets in Fuzzy Logic package was defined only on the integers. This gives the user more flexibility in choosing the universal space. and the third argument specifies the increment between elements. 1<D.New Features in This Release 1 Introduction This notebook demonstrates the new features that were added to Fuzzy Logic package. Here is a demonstration of the additions. 4D. opts] returns a bell-shaped fuzzy set centered at c with crossover points at c . 20.w and c + w with a slope of s / 2w at the crossover points. In the new version. 2 New Membership Functions A number of new functions and options were added for creating membership functions. . the universal space for fuzzy sets and fuzzy relations is defined with three numbers. 100. In[3]:= FS1 = FuzzyBell@50.

−. and a negative slope gives a fuzzy set.6 0.2D.2 U 0 20 40 60 80 100 In[7]:= FS3 = FuzzySigmoid@50.xx Fuzzy Logic In[4]:= FuzzyPlot@FS1.8 0. A positive slope gives a sigmoidal fuzzy set. Membership Grade 1 0. s. .6 0. which opens to the right. In[6]:= FuzzyPlot@FS2.4 0.2 U 0 20 40 60 80 100 Sigmoidal Fuzzy Sets FuzzySigmoid[c. which opens to the left. .2D. PlotJoined → TrueD.8 0. Membership Grade 1 0.4 0. In[5]:= FS2 = FuzzySigmoid@50. PlotJoined → TrueD. opts] returns a sigmoidal fuzzy set where s controls the slope at the crossover point c.

6 0.New Features in This Release xxi In[8]:= FuzzyPlot@FS3. PlotJoined → TrueD. 50. Between the two mean. mu2.8 0. sigma1. In[10]:= FuzzyPlot@FS4.4 0. sigma2. In[9]:= FS4 = FuzzyTwoGaussian@40. Membership Grade 1 0.4 0.6 0. PlotJoined → TrueD.2 U 0 20 40 60 80 100 .8 0. the fuzzy set has a membership grade of 1. opts] returns a two-sided Gaussian fuzzy set with centers at mu1 and mu2 and widths of sigma1 and sigma2. Membership Grade 1 0.2 U 0 20 40 60 80 100 Double-sided Gaussian Fuzzy Sets FuzzyTwoGaussian[mu1. 8. 25D.

The following example demonstrates the ChopValue option. Membership Grade 1 0. opts] returns a digital fuzzy set with the number of membership grades equal to n. 20. b. you can create a fuzzy set with n set to 5. The values of the membership grades increase linearly from a to b. and d must be in increasing order. This means you will get a L5 fuzzy set or a fuzzy set with five possible membership grades.6 0. When working with Gaussian type functions. In[12]:= FuzzyPlot@D1. and h must be a value between 0 and 1 inclusive. Crisp −> TrueD. FuzzyTwoGaussian. and it is often the case that many of the elements have very small membership grades.4 0. 40. FuzzyBell. b. then are equal to the closest possible value of h from b to c. otherwise the default universal space and default n value will be given. every element will have some membership grade. Arguments a.2 U 0 20 40 60 80 100 ChopValue Option An option was added to the FuzzyGaussian. (h). and linearly decrease from c to d. Levels → 5D. Any membership grades less than this value are taken as zero.8 0. The universal space and the value of n may be defined using the UniversalSpace and the n option. d. It also aids in creating fuzzy graphs. If a value for h is not given. where n is set by an option for this function. 78. FuzzySigmoid. and CreateFuzzySets functions that allows you to specify a Chop value to the function. which are described later.xxii Fuzzy Logic Digital Fuzzy Sets DigitalSet[a. . c. it defaults to 1. c. In[11]:= D1 = DigitalSet@1. In the following example. Chopping off these elements allows fuzzy sets to be more compact and allows calculations to be quicker.

0.0183156<. 0. 825.6 0.367879<. 831. 815. 820. 816. 829.0183156<. 811.367879<.527292<. 835. 0. 823. 0.00115923<. 0.367879<. 0. 82. 0.697676<. 828.5<D.140858<.0391639<. 826. 824. 824. 832.12535 × 10−7 <. 837.<. 1.New Features in This Release xxiii In[13]:= FS5 = FuzzyGaussian Out[13]= FuzzySet@880. 0. 0.000393669<. PM.54016 × 10−6 <.0000357128<.54016 × 10−6 <. NS. 0.0391639<.35535 × 10−7 <.852144<. 9. 819. ChopValue → . 0. 0. 87.852144<. 0. 0. 813. 0. 38.000393669<.0773047<. UniversalSpace → 80.00315111<. 0. 89.0183156<<. PlotJoined Membership Grade 1 0. 0. 0. 823. 822.0773047<.8 0. 812. 825. 40.2 U 0 5 10 15 20 25 30 35 83. UniversalSpace → 80. 0. In[14]:= FS6 = FuzzyGaussian Out[14]= FuzzySet@8810. UniversalSpace → 80.960789<.527292<. 820.0773047<.12535 × 10−7 <<.0391639<.852144<. 0. 0. PS. 0. 840. 0.140858<.236928<. 818.00012341<. 85. NM. 40. 826. 0. 40. 0. 810. 819. 836. 0. 0. 817. 0.697676<. 86. UniversalSpace → 80. 1.527292<. 0. 818. 0.4 0. 0. UniversalSpace → 80. 821. 827. 833.35258 × 10−6 <.0773047<.001 D.960789<. 0.00315111<. In[15]:= Var2 = 8NB. 5. 0. 822. 0. 829. 0. 811. 839. 1. @20. 5.35535 × 10−7 <. 0. 2. 5.236928<. 0.00115923<. 84.00012341<. 1<D → True D. 821. 838.960789<. 0.140858<. 815. 2.0000357128<.0183156<. 0. 0.697676<. 1<.00790705<. 827. 1<D CreateFuzzySets @7. 0. PB< = In[16]:= FuzzyPlot @Var2. 812. 5. 0.01D @20. 88.0391639<.00790705<. 813.960789<. 0. 0. 817.697676<. 0. 816.35258 × 10−6 <. 830. 830. 1<D 814. 0. ChopValue −> 0. 40. 0.<.367879<.140858<. 0. 0. 828. 834. 9. . 0.236928<. 81. 0. 1. ZO. 814. 0. Type → Gaussian @4.527292<.852144<.236928<. 0.

10D. 11. 11. Low. FuzzyTrapezoid@4. 5. 1<D. FuzzyTrapezoid@6. 5. 25. 4D. UniversalSpace → 81. FuzzyTrapezoid@9. 1. which is described in words as a collection of fuzzy if-then rules. UniversalSpace → 82. 3. 3D. High< = 8FuzzyTrapezoid@1. 8. FuzzyTrapezoid@1. 11D<. 2. A fuzzy graph describes a mapping between an input linguistic variable and an output linguistic variable. 1. 2. Medium. ChopValue → . A fuzzy graph can be used to give an idea of what a set of fuzzy rules look like. 8D. FuzzyTrapezoid@8. 11D.8 0. Big. Small. 4. Membership Grade 1 0. 8. 6. a fuzzy graph serves as an approximation to a function. 4. In[18]:= Input1 = 8Tiny. 1<D.001D<. FuzzyGaussian@20. 6. ChopValue → .xxiv Fuzzy Logic 3 Fuzzy Graph Another visualization function in Fuzzy Logic package is a fuzzy graph. Demonstration In[17]:= SetOptions@FuzzySet.2 U 1 2 3 4 5 6 7 8 9 10 11 12 In[20]:= SetOptions@FuzzySet. . FuzzyGaussian@9. Huge< = In[19]:= FuzzyPlot@Input1. 6D. FuzzyTrapezoid@ 2.6 0. VeryBig.001D. VerySmall. Middle. 3.4 0. 10. FuzzyTrapezoid@4. 11. 4. 8D. 10. In essence. PlotJoined → TrueD. 6D. 8FuzzyTrapezoid@2. In[21]:= Output1 = 8VeryLow. 4.

High<. 8VerySmall. 8Big. .4 0.New Features in This Release xxv In[22]:= FuzzyPlot@Output1. 8Small. Low<. VeryLow<. 8Huge.6 0. High<<. Middle<.8 0.2 U 3 5 7 9 11 13 15 17 19 21 23 25 In[23]:= Rules1 = 88Tiny. In[24]:= FuzzyGraph@Rules1D. 8VeryBig. PlotJoined → TrueD. 20 15 10 5 2 4 6 8 10 From the FuzzyGraph. Middle<. 25 8Medium. you can see that the single-input/single-output fuzzy system described by Rules1 will produce a curve that is somewhat parabolic. Membership Grade 1 0. Low<.

6 0. ShowGraph → True. 6.2 U 1 3 5 7 9 11 13 15 17 19 21 Largest of Max (Defuzzification) LargestOfMax[A] returns the largest of maximum defuzzification of fuzzy set A.xxvi Fuzzy Logic 4 Defuzzifications In[25]:= MF1 = FuzzyTrapezoid@1.8 0. This function also has a ShowGraph option for visualizing the defuzzification. Smallest of max is 6. 13. . This function also has a ShowGraph option for visualizing the defuzzification. UniversalSpace → 80. In[26]:= SmallestOfMax@MF1.4 0. 17. Smallest of Max (Defuzzification) SmallestOfMax[A] returns the smallest of maximum defuzzification of fuzzy set A. 20<D. PlotJoined → TrueD. Membership Grade 1 0.

4 0.6 0.8 0.8 0. Membership Grade 1 0. PlotJoined → TrueD.4 0.2 U 1 3 5 7 9 11 13 15 17 19 21 . In[28]:= BisectorOfArea@MF1. ShowGraph → True. Bisector of area is 9. Membership Grade 1 0. Largest of max is 13. ShowGraph → True.2 U 1 3 5 7 9 11 13 15 17 19 21 Bisector of Area (Defuzzification) BisectorOfArea[A] returns the bisector of area defuzzification of fuzzy set A. PlotJoined → TrueD.6 0. This function also has a ShowGraph option for visualizing the defuzzification.New Features in This Release xxvii In[27]:= LargestOfMax@MF1.

xxviii Fuzzy Logic 5 Additional Operators Fuzzy Cardinality FuzzyCardinality[A] returns the fuzzy cardinality of fuzzy set A. 99. 914. In[30]:= Core@FS4D Out[30]= 840. The value returned will be between 0 and 1. In[31]:= Subsethood@FS1. In[29]:= FuzzyCardinality@MF1D Out[29]= 9915. 48. #### =. 50< Subsethood Subsethood[A. #### =. #### =. 49. #### =. #### =. Core[A] returns a list of all elements of fuzzy set A with a membership grade equal to 1. 43. 911.413921 . 41. 47. 88. 1<= 1 5 1 4 2 5 1 2 3 5 3 4 4 5 Core This function was included in the original Fuzzy Logic package. 46. 44. 45. with values closer to 1 indicating that the second fuzzy set/fuzzy relation is closer to being a subset of the first fuzzy set/fuzzy relation.509356 In[32]:= Subsethood@FS2. 912. B] returns the degree of subsethood of fuzzy set/fuzzy relation A in fuzzy set/fuzzy relation B. 910. FS2D Out[31]= 0. 913. #### =. 42. FS1D Out[32]= 0. #### =. but it was named Nucleus.

FS2D Out[33]= 49.96912. 0. Type → Yu@2DD.999934.999345.0831089.318108. 1.0112405.246365. 0.945494.00152012.00127533.0486834. 0. 0.78586.856331. B] returns the Hamming distance from fuzzy set/fuzzy relation A to fuzzy set/fuzzy relation B.0291409. 0.40364. FS2.601171. 0. 0. 0. 0. 0.999775.000907644.999985.188686. 0.00585358. 0.109202.017877. 0.00181898.00723556.00476048. 0.< 6 New Intersections and Unions Yu Type Union and Intersection Yu[l] is an additional value for Type option for the union and intersection operations. 0. 0. .00899284. 0. 0.00389105. In[35]:= YuInt = Intersection@FS1. 0.996109. 0..908998. 0. The parameter l must be greater than -1.0375532. In[33]:= HammingDistance@FS1.000769727. 0.998321.999997.000654931.00263693. 0. 0.New Features in This Release xxix Hamming Distance HammingDistance[A. 0.991696. 0. 0. 0.143669. 0. 0. 0. 0. 0. 0. 0.0141328. 0.0634603. 1.0227533.983481. 0. 1. In[34]:= LevelSet@FS1D Out[34]= 80. 0. 0. 0. 0..00218546.0031958. 0. 0.699072. 0. 0.7321 Level Set LevelSet[A] returns the set of all levels alpha that represent distinct alpha cuts of a fuzzy set/relation A..00107397. 1. 0.5.

PlotJoined → TrueD.5DD. In[37]:= WeUn = Union@FS1.2 U 0 20 40 60 80 100 Weber Type Union and Intersection Weber[l] is an additional new value for Type option for the union and intersection operations.4 0. Membership Grade 1 0. Type −> Weber@0.xxx Fuzzy Logic In[36]:= FuzzyPlot@FS1.2 U 0 20 40 60 80 100 .8 0. YuInt.4 0. In[38]:= FuzzyPlot@FS1. FS2. FS2.8 0. FS2. WeUn. PlotJoined → TrueD. The parameter l must be greater than -1.6 0.6 0. Membership Grade 1 0.

1 0. 20. 3. UniversalSpace → 80. In[39]:= SetOptions@FuzzySet. In[40]:= FS1 = FuzzyTrapezoid@1. In[42]:= rel1 = SetsToRelation@Min. 2D. In[41]:= FS2 = FuzzyBell@5. Strong alpha level set of fuzzy set/fuzzy relation is the crisp set that contains all the elements of universal space whose membership grades in set/relation are greater than the specified value of alpha. The set of all alpha levels that represent distinct alpha cuts of a fuzzy set/fuzzy relation is called a level set of set/relation.5 0. Alpha level set of fuzzy set/fuzzy relation is the crisp set that contains all the elements of universal space whose membership grades in set/relation are greater than or equal to the specified value of alpha.75 Grade 0. 17D. In[43]:= FuzzySurfacePlot@rel1D. a strong alpha level set. 1<D. FS2D. 8. FS1.New Features in This Release xxxi 7 Alpha Cuts for Fuzzy Relations One of the most important concepts of fuzzy sets/fuzzy relations is the concept of an alpha level set and its variant. 12.25 0 0 5 10 V 15 20 0 5 20 15 10 W .

811. 812. 86. 0. 813. 3<. 9<. 89. 5<. 83. 4<. 3<. 3<. 3<. 7<. 2<. 810. 8<. 814. 811. 4<. 812. 83. 816. 814. 2<. 7<. 88. 1<. 5<. 8<. 3<. 0. 8<. 84. 4<. 87. 88. 89. 810. 5<. 811. 4<. 813. . 89. 5<. 813. 4<. 812. 810. 815. 812. 815. 1<. 814. 89. 6<. 1<. 1<. 6<. 1<. 86. 2<. 7<. 84. 0. 85. 4<. 814. 812. 813. 89.5. 85. 84. 87.00159744. 84. #### . 815. 88. 811. 1<. 810. #### . 8<. 0. 89. 3<. 89. 9<. 7<. 814. 4<. 810.0193919. 812. 1<. 83. 8<. 810. 816. 5<. 5<. 83.2D Out[45]= 883. 85. 1<. 89. 4<. 5<. 6<. 3<. 87. 5<. 7<. 7<. 9<. 4<. 86. 815. 815. 88. 4<. 3<. 3<. 7 1 2 2 3 4 3 5 4 6 #### . 7<. 813. 5<. 83. 7<. 4<. 4<. 84. 811. 8<. 83. . 0. 811. 83. 813.00210406. 813. 2<. 6<. 2<. 813. 4<.032635. 2<. 8<. 812. 85. 2<. 85. 89. 811. 88. 3<. 7<. 5<. 8<. 814. 87. 8<. 4<.2D Out[44]= 883. 1<. #### . 816. 4<. 815. 810. 87. 810. 813. 3<. 811.114731. 815. 4<. 85. 815. 9<. 84. 0. 810. 87. 5<. 1<. 814. 814. 2<. 812. 86. 6<. 2<. 9<. 88. 87.00282801. 814. 1<. 7<. 9<. 9<. 815. 6<. 1<. 812.0588235. 8<. #### . 816. 5<. 5<. 86. In[45]:= StrongAlphaLevelSet@rel1. 1<. 0. 816. 2<. 2<. 9<. 83. 4<. 815. 4<. 3<. 816. 7<. 88. 6<. 84. 6<. 0. 815. 86. 89.00550197. 815. 813. 6<. 814. 85. 88. 8<. 86. 811. 88. 8<. 811. 811. 811. 88. 1 0. 83. 87. 813. 6<. 5<. 1<. 812. 3<. 6<. 4<. 84. 4<. 2<. 1<. 89. 814. 85. 5<. 812. 815. 812. 3<. 9<. 6<. 84. 811. 5<. 7<. 810. 815. 7<. #### .0121951. 9<< In[46]:= LevelSet@rel1D Out[46]= 90. 9<. 0. 811. 84. 86. 810. 2<. 812. 85. 1. 88. 89.987805. 7<. 3<. 8<. 8<. 1<.xxxii Fuzzy Logic In[44]:= AlphaLevelSet@rel1. #### . 8<. 2<. 810. 87. 87. 9<. 9<. 1<. 2<. 810. 7<. 4<. 2<. 88. 6<. 4<. 85. 9<. 8<. 5<. 86. 86. 811. 0. 1<. 88. 6<. 8<. 5<. 6<. 9<. 85. 9<. 83. 87. 84. 814. 3<. 812. 8<. 85. 9<. 88. 87. 86.240356. 2<. 814. 86. 87. 7<. 4<. 86. 811. 5<. 812. 816. 8<. 3<. 85. 84. 6<. 5<. 815. 83. 3<. 89.00803492. 816. 85. 7<. 3<. 86. 86. 1<. 9<. 810. 6<. 8<. 813. 89. 84. 86. 8<. 814. 812. 1<. 810. 813. 87. 1<. 5<. 6<. 816. 88. 813. 815. 2<. 8<. 9<. 86. 5<. 1<. 815. 813. 812. 2<. 84. 6<. 4<. 6<. 2<. 813. 1<. 89. 9<. 3<. 811. #### . 6<. 4<. 9<. 87. 0. 8<. 7<. 9<. 810. 5<. 3<. 3<. 4<. 2<. 7<. 5<. 84. 2<. 7<. 811. 84. 7<.00389105. 89. 3<. 6<. 1<. 1<. 88. 8<. 1<. 1<. 5<. 814. 85. 2<. 83. 9<. 5<. 8<. 85. 7<. #### . 813. 83. 2<. 3<. 88. 7<. 83. 2<. 3<. 7<. 3<. 85. 83. 810. 814. 0. 5<. 814. 7<. 812. 4<. 8<. 87. 813. 9<. 87. 8<. 89. 6<. 89.= 5 7 5 7 7 5 7 5 7 . 84. 2<.835052. 85. 810. 9<< 84. #### . 7<. 6<. 3<. 9<. 6<. 6<. 83. 0. 2<. 814. 86. 9<. 88. 87. 815. 6<. 7<.

0. 3<. 1<D FromMembershipMatrix@88.5<. 0. 0. 0.8<. 1<. 1<. 0. 1<D In[49]:= Relat1 = FindFuzzyRelation@A. 0. 1<.6<<. 82. 0. 3<. In[50]:= Rel2 = Out[50]= FuzzyRelation@8881. UniversalSpace → 81. 881. . 1<. . Solve for a Fuzzy Relation In the following example. In[47]:= A = FuzzySet@881. 881.2<. 3<. 3.9<. 0.6. 0. 1<D Out[47]= FuzzySet@881. 82. UniversalSpace → 81.8<. 3. 0. 81. 883. 82. 1<. 1<<D You can view fuzzy relation as a fuzzy system.3<<.8<. 882. Then given its output you can determine the input.8<. 3<. 1<<. 83.8<.5<. . 3<. 3<.4<. UniversalSpace → 81.4<. 881. 82. 1<D In[48]:= B = FuzzySet@881. 8. 3.5<. 2<. BD Out[51]= FuzzySet@881. 882. 0.5<.6<<. 883. 1<. UniversalSpace → 881. 1<<.6<. 883. 0. 1<.6<.8<. 3. UniversalSpace → 881. 3. Out[48]= FuzzySet@881. 3. 82. 0. 1<. 0. 2<. 3<. 1<<D .3<<. 1<<. 2<.2<. 1<.5.6<. 883. . 81. 83. 0. 883. 1.7<. 83.9. 2<. UniversalSpace → 81.2. 83. 2<. . 1<. . you will determine a fuzzy relation Relat1 given the system's input A and output B.7. 881. 1<. 882.2<. apply FindFuzzySet function to determine the input NewA for fuzzy relation Rel2 and output B. 0.New Features in This Release xxxiii 8 Fuzzy Relation Equations The notion of fuzzy relation equations is associated with the concept of the max-min form of composition of binary relations. . 0. 3. 81. 3. 0. 83. 3<<D 882. In[51]:= NewA = FindFuzzySet@Rel2. 1<. 0.5<. 8. 0.6<. 882.5<. 881. . BD Out[49]= FuzzyRelation@8881. UniversalSpace → 81. . . 883.6<<. 1<D Solve for a Fuzzy Set 882. 3. In the following example. 1<. 2<.

Type → GaussianD. or Complete random fuzzy set.8 0. . In[52]:= FS1 = RandomFuzzySet@80. In[53]:= FuzzyPlot@FS1D. 30<. 30<D.2 U 0 5 10 15 20 25 30 In[54]:= FS2 = RandomFuzzySet@80. This type of operation might be valuable to test new functions. when set to True. this function will create a random trapezoidal fuzzy set. try reevaluating the function a number of times with different parameters. Random Fuzzy Set RandomFuzzySet[{a. b}] creates a random fuzzy set with universal space from a to b. Just as with normal random numbers you can seed the random number generator to produce the same random fuzzy numbers each time.xxxiv Fuzzy Logic 9 Random Fuzzy Sets and Fuzzy Relations These functions are used to create a random fuzzy set or fuzzy relation.4 0. By default.6 0. there is an option called Normal that produces a normal random fuzzy set. Membership Grade 1 0. To test the RandomFuzzySet function. The option Type can be used to create a Gaussian. Triangular. In addition.

30<. Type → Triangular.New Features in This Release xxxv In[55]:= FuzzyPlot@FS2D.4 0. Normal → TrueD. Membership Grade 1 0.4 0.6 0.6 0.2 U 0 5 10 15 20 25 30 In[58]:= FS3 = RandomFuzzySet@80.2 U 0 5 10 15 20 25 30 In[56]:= FS3 = RandomFuzzySet@80. 30<. . Type → CompleteD.8 0. In[57]:= FuzzyPlot@FS3D.8 0. Membership Grade 1 0.

8 0.75 Grade 0. 1 0. this function will create a random trapezoidal fuzzy relation.25 0 0 2 4 V 4 6 8 10 0 2 14 12 10 8 W 6 . In[60]:= fr1 = RandomFuzzyRelation@880.5 0. {a2. In[61]:= FuzzySurfacePlot@fr1D. Membership Grade 1 0. In addition. The option Type can be used to create a Complete random fuzzy relation. By default.2 U 0 5 10 15 20 25 30 Random Fuzzy Relation RandomFuzzySet[{{a1 . 80. {a2. b2}}.xxxvi Fuzzy Logic In[59]:= FuzzyPlot@FS3D. b1}. b2}}] creates a random fuzzy relation with universal space of {{a1. when set to True. 15<<D. there is an option called Normal that produces a normal random fuzzy relation. 10<. b1}.4 0.6 0.

15. An}. . For an example. Sp}} represent linguistic input variables.. b2. .. UniversalSpace → 8−40. 1<D. Yx}.. 2. .Yk} is the linguistic output variable. .. Yx}. . . 15.. 81. 4. and the crisp values for the inputs are given in a list {a. . Sx. d1}. c1.. . . {a2. In[62]:= SetOptions@FuzzySet. use the ReleaseHold function.New Features in This Release xxxvii 10 Fuzzy Inferencing Rule-based Inference RuleBasedInference[{{A1. 12. The fuzzy product is returned as an unevaluated FuzzyTrapezoid.nb notebook. .. 11 Fuzzy Arithmetic Fuzzy Multiplication and Division FuzzyMultiply[{a1.Yk}. opts] returns a fuzzy set that is the result of performing rule based inference for multiple-input/single-output systems where {{A1. 3<. d2}] returns the product of the fuzzy numbers represented by the two lists. . see the 1_08_FuzzyInference. 4. Model. .s}. To evaluate the Fuzzy$ Trapezoid. {a..An}. .. 2.. . UniversalSpace → 8−40. 2.. {Y1.. . Sx. . . 2.. ...s}..Sp}}. UniversalSpace −> 8−40. 1<D Out[63]= FuzzyTrapezoid@−36. . . 15. {S1.. . b1. In[63]:= Multi1 = FuzzyMultiply@8−9. rules are given in a list like{Ax.. c2.... . 4<. .. The values for option Type are Mamdani.. {S1. {Y1. . {Ax. 1<D . and Scaled..

6 0. To evaluate the FuzzyTrape$ zoid. UniversalSpace −> 8−10. The fuzzy division is returned as an unevaluated FuzzyTrapezoid. d1}. 2.8 0.2 U -40 -30 -20 -10 0 10 FuzzyDivide[{a1.4 0. c2. 10. 3<. Membership Grade 1 0. c1. 3. you can plot an approximate result of the fuzzy product. 81.2 U -9 -7 -5 -3 -1 1 3 5 7 9 11 You can plot the approximate result of the fuzzy division. Notice the use of the ReleaseHold command. 2. In[65]:= Div1 = FuzzyDivide@8−9. use the ReleaseHold function. In[64]:= FuzzyPlot@ReleaseHold@Multi1DD. 1<D In[66]:= FuzzyPlot@ReleaseHold@Div1DD. Notice the use of the ReleaseHold command.xxxviii Fuzzy Logic In the following. b1. Membership Grade 1 0. 1. 2. d2}] returns the division of the fuzzy numbers represented by the two lists.4 0. 1. b2.8 0. 10<D Out[65]= FuzzyTrapezoid@−9. {a2.6 0. . 2. 4<. UniversalSpace → 8−10.

2<<. 9<. 8<. 9. The arguments to the function are the data set (data). 88. The parameter mu is called the exponential weight and controls the degree of fuzziness of the clusters. 7. epsilon] returns a list of cluster centers. 2. the fuzzy clusters become crisp clusters. 82.5. 1<. 5. 9. 2. 87. 3<. 7<. 88.New Features in This Release xxxix 12 Fuzzy Clustering Fuzzy C-Means Clustering FCMCluster[data. and a value which determines when the algorithm will terminate (epsilon). 2<. 5. is probably the most commonly used value for mu. the function terminates. 9. 89. 82. 810. 89. 4<. the clusters become completely fuzzy. 84. 5<. When this value is less than the parameter epsilon. a value determining the degree of fuzziness of the clustering (mu). mu = 2. 85. 2. 1. Studies have been done on selecting the value for mu. 2. where the midpoint. 3. To demonstrate the FCM clustering algorithm. 8<. 8. and a list containing the progression of cluster centers found during the run. an initial partition matrix (partmat). 3<. In[67]:= TrainData3D = 881. a partition matrix indicating the degree to which each data point belongs to a particular cluster center. 4. While running. 84. where each data point belongs to only one cluster. 1. As mu approaches infinity. 7<. 83. 7<. 1<. This function runs recursively until the terminating criteria is met. . 88.5]. the function prints a value which indicates the accuracy of the fuzzy clustering. 2<. and each point will belong to each cluster to the same degree (1/c) regardless of the data. 8. partmat. As mu approaches 1. 810. you can create a data set which consists of four group of data. 4<. 2. and it appears that the best choice for mu is usually in the interval [1. mu. 89.

TrainData3DDD. 8 6 4 2 0 8 6 4 2 0 0 2.02D.5 5 7. PointSize@. Point@#D< &.5 10 . Axes −> TrueD.xl Fuzzy Logic In[68]:= g1 = Show@Graphics3D@ Map@8Hue@0D.

45625.28611<. 0.New Features in This Release xli In[69]:= Res1a = FCMCluster@TrainData3D.23674. 2.0079704.82262<. you could do the following: 81. 88.390469 0. 8. 6. 84.92328. 0. 1.9852.39454. 0. 4. 84.0162631. 4.03581.30485.00755412.86212<.033649. 1.60842.010978<.15306. 888.0318645<<.91922.01D 0. 4. 0. InitializeU@TrainData3D.3974. The clustering function also provides the degrees to which each data point belongs to each cluster and the cluster center progression. 3.0239293. 0.00790454.9161.59628. 0.0162238.72496<.613<. 81.34704. 1.32733<<.0138087.0141819. 0. 80. 8887.057455. 4.890057. 0. 8. 7. 0. 0. 2.0244519.71421<. Because there are problems showing the cluster centers for data of higher dimensions. 4.51549<.13574<. 1.80257. 0.30536. 888.5844.53901<. 1.0195252.69922.70315. 2. 0.0263162. 88.0178313. 0. 0. 0.00691018. 2.83272.29263.38123<. 0. 0.84949<. 0. 83. 4.70331<. 0. 0. 7. 1.732182. 2.92331. 0.36615.36615. 4.53991. 0. 87.22325. 4D. 1. 0. 83.54958<<.0323038.5207<.73341. 2.0200401.0661418.76901.36545. 82. 0. 0.70241.974613.5358<. 3. 3. 2. 8.0105433. 85.93933. 1.50898. 0. If you want to see the 3D cluster centers with the original data.924364.00310599. 3. 88. 1.54342. 0. 0. 888. 0.580971 0.34509<. 0. 0. 0.924737.4866<.0465132.00819179 The last line shows coordinates for four centers. 0. 2. 0.66307.02478. 80.34927<.0193489.35416<. 88.00855686. 1.42984.0429.0176218. 3. 2.00414031. 0.936261.48377<.73997.83761.42384. 3.64636.77279<<. 0.77792. 8. 1.00638034.60842.9794.93877. 0.0556566. 3.32764.62504. 4. 0.48257.935038<. 2.92443<<.0221196<. 0. 888.0153974. 85.675572. . 0.5597.94406. 8.90297.965732. 5.70953. 7. 0. 2.31657<<. 4. 4.0636494.33459 0.68528. 7. 0.72315<.0136039. 1.00670802.80257. 2. 7. 88.29497.00245483. 0. 0. 1.57858<<. 7. 7. 0. 8.72496<.957304. the ShowCenters function only works for 2D clustering. 0. 0.77124.159146 0. 0.9161. 80. 4. 0.53901<.961731. 4. 3. 0. 84. 888. 4. 0.0408375. 87. 880. 81. 3.966124.0235959.205122.941884.0208705. 0.34927<.57599. 0. 0. 0.0179912.927363.45625.31657<<<< .0271684 Out[69]= 8888.91922.31832<<. 82. 84.45028.0484691. 4.70315. 888.00787974.79512. 0.0177126.70241. 84. 0. 0. 0.0225436.036309.05767.190323. 84. 84. 0.76241. 87.00637423.00973579. 0. 4.859596 0. 7.07821<.

Res1a@@1DDDDD.xlii Fuzzy Logic In[70]:= g2 = Show@g1. PointSize@. Graphics3D@Map@8Hue@0. 8 6 4 2 0 8 6 4 2 0 0 2. Point@#D< &.5 10 The clustering function should work for data of any dimension. . but it is hard to visualize the results for higher order data.7D.5 5 7.03D.

Part 1 Manual .

.

object representing a fuzzy set FuzzySet is one of the fundamental objects used in the package. UniversalSpace → 80. 1<D Out[2]= 8UniversalSpace → 80. b. . UniversalSpace→{a.. Here is its full form: FuzzySet[{{u1. option name default value UniversalSpace Option for FuzzySet.... un are elements of the universal space and X(u1). This chapter demonstrates these functions and the options associated with each function.1 Creating Fuzzy Sets 1.{un. . 1<< 80.. X(un) are the grades of membership of the elements in a fuzzy set. 1< universal space for FuzzySet object . X(un)}}. 20. This loads the package. . . 20.. In[2]:= SetOptions@FuzzySet. X(u1)}. c}] where u1.1 Introduction Fuzzy Logic package provides a number of convenient ways to create fuzzy sets.2 Basic Objects FuzzySet Fuzzy set object. . . In[1]:= << FuzzyLogic` 1. 20.

if an explicit universal space is not given. In[6]:= FuzzyPlot@FS1D. 0.5<D Out[4]= 8UniversalSpace → 80.. Universal spaces for fuzzy sets and fuzzy relations are defined with three numbers.3<.. 83.8 0. A built-in Mathematica function gives the list of default options assigned to a symbol. In[3]:= Options@FuzzySetD Out[3]= 8UniversalSpace → 80. . 100. 84. 0.. 0. 10.8<. 0.2<<. 82. In[5]:= FS1 = FuzzySet@881. 83. 100.8<.5<< Fuzzy sets can be created manually by entering a list of element and membership grade pairs surrounded by the FuzzySet head. but you can use one of the graphing functions here to look at your newly created fuzzy set FS1. . When creating fuzzy sets. it is often instructive to look at fuzzy sets graphically. A description of the graphing functions and how to use them appears later in Chapter 5 Fuzzy Set Visualization.2<<.6<.6 0. UniversalSpace → 80. 1<< You can change the default value for UniversalSpace globally.3<.4 Fuzzy Logic By default the universal space is set to 0. . 1<D Out[5]= FuzzySet@881.2 U 0 1 2 3 4 5 6 7 8 9 10 11 . this default value will be used. 2. 20. . 0. Membership Grade 1 0. The first two numbers specify the start and end of the universal space. 0.4 0. 1<D When studying fuzzy sets. . UniversalSpace → 80. 82. 1. In[4]:= SetOptions@FuzzySet. 10. 20. UniversalSpace → 80.6<. and the third argument specifies the increment between discrete elements. 84. Here is a simple example.

b. mu2. sigma2D return a two-sided Gaussian fuzzy set with centers at mu1 and mu2 and widths of sigma1 and sigma2. If a value for h is not specified. inclusive. d. create a random fuzzy set with universal space from a to b We will now show a number of examples on how to create fuzzy sets. Arguments a. the function will use h = 1. w. the fuzzy set has a membership grade of 1 FuzzySigmoid@c. The option Type specifies either triangular or Gaussian fuzzy sets RandomFuzzySet@8a. d. d. the default universal space is used. FuzzyTrapezoid@a. b. b<D Functions for creating fuzzy sets. sigma1. sD return a sigmoidal fuzzy set where s controls the slope at the crossover point c CreateFuzzySet@func. c<D return a fuzzy set with membership grades defined byfunc in the range a to b inclusive. are equal to h in the range b to c. c. sigmaD FuzzyBell@c. 8a. opts] returns a fuzzy set with membership grades that linearly increase from 0 to h in the range a to b. b. Fuzzy Logic package provides a number of functions to create special types of fuzzy sets. and h return a fuzzy set whose membership grades represent a normalized Gaussian function with a mean of mu and a width of sigma return a bell-shaped fuzzy set centered at c with crossover points at c ≤ w with a slope of s ê H2 wL at the crossover points FuzzyGaussian@mu. between the two mean. . b.Chapter 1: Creating Fuzzy Sets 5 1. c. hD return a fuzzy set whose membership grades represent a trapezoid defined by parameters a. or if a universal space is not specified. and increment c CreateFuzzySets@numD return a list of num overlapping fuzzy sets that span the universal space.3 Functions for Creating Fuzzy Sets This way of creating fuzzy set objects might be quite tedious. and h must be a value between 0 and 1. and linearly decrease from h to 0 in the range c to d. and d must be in increasing order.b. c. c. FuzzyTrapezoid[a. h. sD FuzzyTwoGaussian@mu1. The universal space may be explicitly defined using the UniversalSpace option.

UniversalSpace → 80. 814. 0. """" =.7<. UniversalSpace −> 80.291667<. 830.233333<.8 0. """" =. 0. 98. """" =. 0.7<. 0. 25. 50. 913. 820. 0.641667<.116667<<. """" ==. """" =. 840. In[7]:= FS2 = FuzzyTrapezoid@12. 816. """" =. 1<E 8 2 8 4 8 1 6 1 3 1 2 2 3 5 6 7 8 3 4 . """" =. 838.7. This time we give the vertices of the trapezoid and allow the function to provide a default setting for the height. 95. 45. 844. 0. 1<D Out[7]= FuzzySet@ After evaluating this command. 0. 824. """" =.4 0.7<. 829. 823. 17.7<. 914. 0. 1<. 818. 9. we receive a fuzzy set containing a list of the element and membership grade pairs followed by a universal space.7<. 0. 0.7<. 0. In[8]:= FuzzyPlot@FS2D. 0. Membership Grade 1 0. Another thing to note about this example is that the second and third parameters for specifying the trapezoid are the same. 0. In[9]:= FS3 = FuzzyTrapezoid@3.35<. 89.583333<.6 Fuzzy Logic This example shows how to create a trapezoidal fuzzy set with height 0. 821.116667<. 0. 833. 0. """" =. 825. 828. 911. 9.7<. 0. 819. 24.408333<. """" =.7<. 822.7<.0583333<. 0. 50. 827.2 U 0 10 20 30 40 50 8813. 817. 831.35<. 0.7<. 910. UniversalSpace → 80.466667<.175<. """" =. 837. 916.583333<.7<. 841. UniversalSpace → 80.6 0. 835. 0. 834. 0. 0. This technique is used to create triangular fuzzy sets. 0. 836. Note that universal space for this fuzzy set is explicitly set. Here we use the function FuzzyPlot to look at our newly created fuzzy set. 843.7<. 842. 0. 0. 0.525<.7<. 832. 0.7<. 96.7. 5 1 3 1 1 912.7<. 0. 0.233333<. 915. 826. 0. 0.466667<.7<. 0. 815. 0. 1<D The following is another example of creating a trapezoidal fuzzy set. """" =. 97. 39. 839. 0. 25<D Out[9]= FuzzySetA994.

778801<. 0.0346967<. 822. 0. PlotJoined → TrueD. 0.499352<. 827. 819. 829. 86. 0. 0. 0.000326272<.0621765<. 817. 0. we create a Gaussian fuzzy set centered at 17 with a width of 6.0183156<.2 U 1 3 5 7 9 11 13 15 17 19 21 23 25 FuzzyGaussian[mu. 1<D . 814. 813. 0.972604<. 0. 0. 0.4 0. 82.8 0. 828.0621765<.894839<.00193045<. 0. 0.894839<. UniversalSpace → 80. 818. 832.0346967<.00432024<. 824. 834. 1<D Out[11]= FuzzySet@880. 1.256376<. 0.367879<. 0. 0.00914595<. 0.367879<. 0. Membership Grade 1 0. 0. 825.00012341<<. 0.169013<. 0. 0. 0.169013<. 810.105399<. sigma. 89.000815988<. 823.256376<. 0. 0. UniversalSpace → 80.<. 35. 820. 0.778801<. 6.64118<. 0.105399<. opts] returns a new fuzzy set whose membership grades represent a normalized Gaussian function with a mean of mu and a width of sigma. 85.000815988<. 0. 830. 0.00914595<.972604<. 835. 816.0183156<. In[11]:= FS4 = FuzzyGaussian@17. 0. 826.00193045<. 0. 0. 87. 815.64118<. 88. 35. 0. 821. 811. 0.000326272<. 833.499352<. 84. 0.00432024<. Note that we chose to specify our own universal space instead of accepting the default setting.Chapter 1: Creating Fuzzy Sets 7 In[10]:= FuzzyPlot@FS3. In this example. 81. 812. 83. 831.6 0.

778801<. 1<D Out[13]= FuzzySet@885. 35. 0. 818. Membership Grade 1 0. ChopValue → . 817. In[13]:= FS5 = FuzzyGaussian@17. 88. 1. 823. 0.0621765<.0183156<<. 0. 0.256376<. and FuzzySigmoid functions. 821.894839<. 0.64118<.01.64118<. 815. UniversalSpace → 80. 1<D . 820.0346967<. 86.8 Fuzzy Logic In[12]:= FuzzyPlot@FS4. 810.499352<. 824.169013<. 6.6 0. 0.105399<. FuzzyTwoGaussian. 813. 0. UniversalSpace → 80.0183156<.01 from the previous example are now set to zero. 0. 827.0621765<.8 0.4 0. 819.0346967<. 0. 822.894839<. 811. 816. PlotJoined → TrueD. 35.972604<. 0.<. 812. 0. 0. 814. 0.499352<. It allows you to specify a value for which all membership grades less than that value are set to zero. The option ChopValue works with the FuzzyGaussian.2 U 0 5 10 15 20 25 30 35 Note that in the example. 0. 0. 0. 0. 0. Notice that all the membership grades that were less than 0. 0. 0.256376<.778801<. 828.367879<. the membership grades for some of the elements are very small. 0. 829. 0.169013<. 0. 87. 825. FuzzyBell. 89. We demonstrate this option in the following example.105399<.972604<. 0.367879<. 826.

opts] returns a bell-shaped fuzzy set centered at c with crossover points at c ± w with a slope s / (2 w) at the crossover points. Membership Grade 1 0.8 0.4 0.2 U 0 20 40 60 80 100 The function FuzzyTwoGaussian[mu1. sigma2. 20. In[16]:= FuzzyPlot@FS6. Between the two mean. Here is an example of creating a bell-shaped fuzzy set centered at 50 with crossover points at 50 ± 20 and slope of 4 / (2 * 20) at the crossover points. PlotJoined → TrueD. mu2. the fuzzy set has a membership grade of 1. 4D. w.2 U 0 5 10 15 20 25 30 35 FuzzyBell[c. sigma1. PlotJoined → TrueD. Membership Grade 1 0. s. Here we create a two-sided Gaussian fuzzy set with centers at 40 and 50 and widths of 8 and 25.4 0. and widths of sigma1 and sigma2. .8 0. respectively. the fuzzy set has a membership grade of 1. In[15]:= FS6 = FuzzyBell@50.6 0.Chapter 1: Creating Fuzzy Sets 9 In[14]:= FuzzyPlot@FS5. opts] creates a two-sided Gaussian fuzzy set with centers at mu1 and mu2. between the two mean.6 0.

25D. In[20]:= FS9 = FuzzySigmoid@50. The function CreateFuzzySet[func. 8. −0.2D. the fuzzy set opens to the left. Membership Grade 1 0. 0.2 is positive. opts] creates a sigmoidal fuzzy set where s controls the slope at the crossover point c. Note that the function must . the fuzzy set opens to the right. b.2 U 0 20 40 60 80 100 We can create a fuzzy set by specifying a membership function. c}] returns a fuzzy set with membership grades defined by func in the range a to b. Because now the slope of -0. {a. the function is applied to all of the elements in the universal space.10 Fuzzy Logic In[17]:= FS7 = FuzzyTwoGaussian@40. Because the slope of 0. Here we create a sigmoidal fuzzy set with the slope at the crossover point 50.6 0. Here we create a sigmoidal fuzzy set with the slope at the crossover point 50. In[19]:= FS8 = FuzzySigmoid@50. PlotJoined → TrueD. 50.6 0. inclusive.4 0. Membership Grade 1 0. PlotJoined → TrueD. In[18]:= FuzzyPlot@FS7.8 0.4 0. FS9. s.2D. In[21]:= FuzzyPlot@FS8.8 0.2 U 0 20 40 60 80 100 FuzzySigmoid[c. If no range is given.2 is negative.

0. In[22]:= myfunction@x_D := WhichAx ≤ 5. Triangular shape of fuzzy set collection In this example.5<D. In[24]:= FuzzyPlot@FS10.2 U 0 10 20 30 40 50 60 70 x−5 15 20 x Sometimes we need to create a collection of FuzzySet objects that span a given universal space. This is an example of creating a fuzzy set using a piecewise function.5<. We use an extra option with the FuzzyPlot command to show a continuous representation of the fuzzy sets.8 0. . 50. $$$$$$$$$$$ .4 0. In[25]:= Options@CreateFuzzySetsD Out[25]= 8Type → Triangular< option name default value Type Option for CreateFuzzySets.Chapter 1: Creating Fuzzy Sets 11 return values between 0 and 1 over the range provided to create a valid fuzzy set. $$$$$$$ . 0. 70.6 0.5E $ In[23]:= FS10 = CreateFuzzySet@myfunction. . Membership Grade 1 0. . The first definition defines the function to use to create the fuzzy set. 20 ≤ x ≤ 40. PlotJoined → TrueD. opts] returns a list of num overlapping fuzzy sets that span the universal space. 5 < x < 20. we divide the universal space into six triangular fuzzy sets. 80. x > 40. The fuzzy sets can be either Triangular or Gaussian. Create# FuzzySets[num. UniversalSpace −> 80. The Type option specifies the shape of the new fuzzy sets. and Triangular membership functions are the default setting.

12 Fuzzy Logic In[26]:= Var1 = CreateFuzzySets@6. . PM.4 0. To show that we indeed can access the individual fuzzy sets. NM. we graph a couple of the fuzzy sets here. In[27]:= FuzzyPlot@Var1. If no width is specified. PS.4 0. UniversalSpace → 80. 40. we create a set of seven Gaussian fuzzy sets. NS. Membership Grade 1 0.2 U 0 10 20 30 40 As a final example of fuzzy set creation.5<D. ZO.8 0.2 U 0 5 10 15 20 25 30 35 Type → Gaussian@4. PlotJoined → TrueD.8 0. Membership Grade 1 0.001D. 0. UniversalSpace → 80. ChopValue −> 0. The option ChopValue works with the CreateFuzzySets function for specified width. a width of 1 is used. In[29]:= FuzzyPlot@Var2. 1<D. we should provide a width with the Type option. In[28]:= Var2 = 8NB.6 0. 38. It allows you to specify a value for which all membership grades less than that value are set to zero. When specifying the Gaussian type of fuzzy set. PlotJoined → TrueD. we assigned variable names to each of the new fuzzy sets. This enables us to reference each individual fuzzy set.6 0. Note in the previous example. PB< = CreateFuzzySets@7. This technique is important for the fuzzy inferencing commands that we will talk about later in Chapter 8 Fuzzy Inferencing.

which produces a normal Triangular random fuzzy set. To test the RandomFuzzySet function. b}] creates a random fuzzy set with universal space from a to b. or Complete random fuzzy set. this function will create a random trapezoidal fuzzy set. .8 0. By default. PM. admissible values are Gaussian. Membership Grade 1 0. when set to True.2 U 0 5 10 15 20 25 30 35 RandomFuzzySet[{a. PlotJoined → TrueD.4 0. there is an option called Normal.Chapter 1: Creating Fuzzy Sets 13 In[30]:= FuzzyPlot@NM. Triangular. Triangular. option name default value Type Triangular shape of random fuzzy set. The option Type can be used to create a Gaussian. In addition.6 0. try reevaluating the function a number of times with different parameters. Just as with normal random numbers we can seed the random number generator to produce the same random fuzzy numbers each time. or Complete an option that controls whether or not a random set is a normal one Normal True Options for RandomFuzzySet.

30<.2 U 0 5 10 15 20 25 30 In[33]:= RS2 = RandomFuzzySet@80.4 0. In[32]:= FuzzyPlot@RS1D. .14 Fuzzy Logic In[31]:= RS1 = RandomFuzzySet@80. In[34]:= FuzzyPlot@RS2D.6 0. Membership Grade 1 0. Membership Grade 1 0.8 0.8 0. 30<D.6 0. 30<. Type → GaussianD.4 0. Normal → TrueD.2 U 0 5 10 15 20 25 30 In[35]:= RS3 = RandomFuzzySet@80. Type → Triangular.

Membership Grade 1 0. 20. In[38]:= FuzzyPlot@RS4D. In[39]:= SetOptions@FuzzySet. 30<.4 0.6 0.2 U 0 5 10 15 20 25 30 In[37]:= RS4 = RandomFuzzySet@80.Chapter 1: Creating Fuzzy Sets 15 In[36]:= FuzzyPlot@RS3D. 20.4 0.8 0. Membership Grade 1 0. 1<D Out[39] 8UniversalSpace → 80.6 0. UniversalSpace → 80.8 0.2 U 0 5 10 15 20 25 30 You can use a built-in function SetOptions to restore the default setting for the FuzzySet object. 1<< . Type → CompleteD.

.

.. Rnm}}. w2). 880. . b2. {a2. In this chapter. 80. wm}. . (vn. option name default value UniversalSpace Option for FuzzyRelation.1<.10.. This loads the package. }.1 Introduction Fuzzy Logic package provides a number of convenient ways to create fuzzy relations.. an object representing a fuzzy relation FuzzyRelation is one of the fundamental objects used in the package. w1). {{vn.2 Creating Fuzzy Relations 2..1<< universal space for FuzzyRelation object . Here is its full form: FuzzyRelation[{{(v1.. UniversalSpace→{{a1. we will demonstrate these functions and the options associated with each function. c1}. The values are the grade of membership of the elements in a fuzzy relation. b1. Rnm are the values of the function fuzzy relation for these elements. (v2. . .. In[1]:= << FuzzyLogic` 2.10. c2}}] where (v1. . R11}. wm) are elements of the universal space and R11.2 Basic Objects FuzzyRelation Fuzzy relation object.

2 0 0 1 2 V 1 3 4 5 0 4 3 2 W .5<. 1<<D 1 0. 0.4<<. The first two numbers specify the start and end of the universal space. 4. 0. 0. 4. 0. 1}.8 Grade 0.4}}. 0. 10. 1<. 10.6 0. 1}}] UniversalSpace → 880. 80. 1<. if an explicit universal space is not given. In[3]:= FuzzyPlot3D[Rel1]. 882. 1<. {0. Universal spaces for fuzzy sets and fuzzy relations are defined with three numbers.4 0. 883. this default value will be used. 5. {{2. 0. Out[2]= FuzzyRelation@8881. 1}. 1}. UniversalSpace -> {{0. 2<.8<. Like fuzzy sets. In[2]:= Rel1 = FuzzyRelation[{{{1.5}. Here we create a simple fuzzy relation. {{3. 2}. 1}. 5.8}. 1}}. and the third argument specifies the increment between discrete elements . {0. fuzzy relations can also be created manually by surrounding the appropriate descriptors with the FuzzyRelation head. When creating fuzzy relations.18 Fuzzy Logic By default the universal space is set to {{0.

mat. b2<<D create a random fuzzy relation with universal space of 88a1. If h is not explicitly given. bx. c<.1}. with the elements specified by the ranges 8va. the function uses h = 1. As with fuzzy sets.8. Fuzzy Logic package provides functions for the most commonly used in practice techniques of creating fuzzy relations. vb. 8wa. equal h from b to c.wb< CreateFuzzyRelation@func. 5.{ay. UniversalSpace -> {{0. b1<. FuzzyTrapezoid@8ax. hD SetsToRelation@func. 7}. by. cx. 6. dy<. dy}. b1<.3 Functions for Creating Fuzzy Relations Creating fuzzy relations using the basic definition can be quite tedious. 88va. cx. and linearly decrease from h to 0 from c to d. dx<. b2<< and increments c1 = c2 = 1 FuzzyTrapezoid[{ax. 8wa. 3.opts] returns a new trapezoidal fuzzy relation with membership grades that linearly increase from 0 to h in both the x and y directions from a to b. 8. 8wa. 8a2. wb. BD return a fuzzy relation with elements from the Cartesian product of the universal spaces of fuzzy sets A and B and membership grades defined by func return a trapezoidal fuzzy relation with membership grades that linearly increase from 0 to h in both the x and y directions from a to b.Chapter 1: Creating Fuzzy Relations 19 2. 8ay. 0. Here are number of examples on how to create fuzzy relations.1}}]. equal h from b to c. 8}. d<< Functions for creating fuzzy relations. . bx. {0. A. c<.h. wb<<D return a fuzzy relation by combining the matrix of membership grades. d<<D return a fuzzy relation with membership grades that are the result of applyingfunc to all the elements in the specified range. vb<. wb. it is possible to explicitly define the universal space or to accept the default setting for fuzzy relations.vb< and 8wa. dx}. vb. 88va. 7. cy. {0. and linearly decrease from h to 0 from c to d FromMembershipMatrix@mat. 3. 8a2. In[4]:= Rel2 = FuzzyTrapezoid[{1. 88va. RandomFuzzyRelation@88a1. by. cy.

we use Mathematica's Max function to combine the fuzzy sets. In this example. UniversalSpace -> {1. 86. In[7]:= FS2 = FuzzyTrapezoid[1.20 Fuzzy Logic Here we use function FuzzySurfacePlot to look at our newly created fuzzy relation.5}] Out[7]= FuzzySet@881. 84. 83.5<D 85. 82. 0. In[5]:= FuzzySurfacePlot[Rel2]. 0.. 83. 1<.75<. 0. 1<. We use a couple of the fuzzy set creation functions described earlier in this manual to create two fuzzy sets. 8.25 0 0 1 3 2 3 V 2 4 5 1 6 7 0 8 7 6 5 4 W SetsToRelation[func.5. 0. 85.. 0.367879<. 87. 0.778801<. A. 84. 87. 1<.. we can now use the SetsToRelation command to create a fuzzy relation. 7.105399<.5.367879<.25<. 1<D Here we use function FuzzySurfacePlot to look at our newly created fuzzy relation. 82.333333<. FS1. 82. . 0.5<. 0. 0.5 0. 0. 86.5. In[8]:= Rel3 = SetsToRelation[Max.5<.666667<. 0.. FS2]. 0. 8.5. 1. 0. 87. 8. With two fuzzy sets. B] returns a new fuzzy relation with elements from the Cartesian product of the universal spaces of fuzzy sets A and B. 83. 85. The membership grades for the elements are arrived at by applying func to the corresponding membership grades of A and B.0. In[6]:= FS1 = FuzzyGaussian[4. 0. UniversalSpace → 81. 3.105399<<. we first need to create some fuzzy sets.<.833333<.166667<<. 0. 84.75 Grade 0. 1<. To demonstrate this function. 2.5.5.778801<.. UniversalSpace → 81. 1 0. 5.5. 86.. 1<. 7}] Out[6]= FuzzySet@881. UniversalSpace -> {1.

1 0. If no ranges are given.75 Grade 0. 0. with the elements specified by the ranges {va. vb}. . wb}. 0. 0.4. wb}}] returns a new fuzzy relation by combining the matrix of membership grades.6.7}. {wa. 0. 0. 0.6.7. {0. 0. We then call our function with the matrix as the argument. 0. we first create a membership matrix that contains the membership grades that will be used in the relation. 0. 0. mat.10}}].3.4. 0.7}.25 0 1 2 3 3 4 V 5 2 6 7 1 5 4 8 7 6 W FromMembershipMatrix[mat.{{va. 0. 0.{{4.6}.Chapter 1: Creating Fuzzy Relations 21 In[9]:= FuzzySurfacePlot[Rel3].{6.4.1.4.5. In[10]:= MyMembMat := {{0. vb} and {wa. Here we use function FuzzySurfacePlot to look at our newly created fuzzy relation.2. {0.2.5. mat. 0.5. 0. To demonstrate the FromMembershipMatrix function. 0.5}.5 0.8}} In[11]:= Rel4 = FromMembershipMatrix[MyMembMat.3. the function assumes the membership grades are for the elements starting at 1 with a size corresponding to the dimension of the matrix.3. {0.

22 Fuzzy Logic In[12]:= FuzzySurfacePlot[Rel4]. y_]:=1/2*(Sin[x + y]+1) In[14]:= Rel5 = CreateFuzzyRelation[MyFunction2. c1}. we use one of the Fuzzy Logic package's graphing functions. To examine the relation.{0.25 0 4 5 V 6 7 6 7 9 8 W 10 CreateFuzzyRelation[func.0. Because fuzzy relations are quite large. {wa.{{va. wb. and the second command creates the fuzzy relation. wb.0. If no range is given. vb. {{va. 0 to 1. You can use function FuzzySurfacePlot to look at newly created fuzzy relation.75 Grade 0.opts] returns a new fuzzy relation with membership grades that are the result of applying func to all the elements in the specified range. The following is an example of creating a fuzzy relation from a function.6. The first command defines the function. c2}}. In[13]:= MyFunction2[x_. c2}}. vb. 8. .5}}]. we suppress the output by putting a semicolon at the end of the function. We explicitly declare a universal space in this function rather that accept the default setting.0.7. 1 0.5}.7.{1. UniversalSpace -> {{0. the function is applied to all of the elements in the universal space.{{1.5}}.0. {wa. Be sure the function provided causes membership grades to be in the correct range. More information about graphing fuzzy relations can be found in Chapter 6 Fuzzy Relation Visualization.5 0.5}. c1}.

In addition. Normal −> TrueD. 81. In[16]:= RR1 = RandomFuzzyRelation@880. 81. when set to True. By default. 9<<. . 1 0. option name default value Type Trapezoid shape of random fuzzy set. b2}} and increments c1 = c2 = 1. 5<. there is an option called Normal that produces a normal random fuzzy relation.75 Grade 0. admissible values are Trapezoid or Complete an option that controls whether or not a random fuzzy relation is a normal one Normal True Options for RandomFuzzyRelation. b2}}] creates a random fuzzy relation with universal space of {{a1. {a2. 5<.Chapter 1: Creating Fuzzy Relations 23 In[15]:= FuzzySurfacePlot[Rel5]. b1}. this function will create a random trapezoidal fuzzy relation. b1}. The option Type can be used to create a Complete random fuzzy relation. In[17]:= GlobalProjection@RR1D Out[17]= 1 In[18]:= RR2 = RandomFuzzyRelation@880.25 0 0 1 3 2 3 V 2 4 5 1 6 7 0 8 7 6 5 4 W RandomFuzzyRelation[{{a1.5 0. {a2. Type −> CompleteD. 9<<.

2 0 0 1 4 2 V 3 3 4 5 1 2 9 8 7 6 5 W .8 Grade 0.4 0.24 Fuzzy Logic In[19]:= FuzzyPlot3D@RR2D.6 0. 1 0.

and those that apply to both fuzzy sets and fuzzy relations.1 Introduction Fuzzy Logic package contains a wide variety of operations that can be performed on fuzzy sets and fuzzy relations. Height@AD Cardinality@AD RelativeCardinality@AD FuzzyCardinality@AD CenterOfArea@AD MeanOfMax@AD SmallestOfMax@AD LargestOfMax@AD return the value of the largest membership grade in fuzzy set A return the sum of all of the membership grades in fuzzy set A return the cardinality of fuzzy set A divided by the total number of elements in the universal space of A return the fuzzy cardinality of fuzzy set A return the center of area defuzzification of fuzzy set A return the mean of maximum defuzzification of fuzzy set A return the smallest of maximum defuzzification of fuzzy set A return the largest of maximum defuzzification of fuzzy set A . In[1]:= << FuzzyLogic` There are three groups of fuzzy operations. 3.2 Fuzzy Set Operations This section describes operations that can be performed on individual fuzzy sets. This chapter introduces these functions and demonstrates how to use them. This loads the package.3 Fuzzy Operations 3. those that apply to fuzzy sets only. those that apply to fuzzy relations only.

5. 812. respectively. described earlier in this manual. The graphing functions are described in Chapter 5 Fuzzy Set Visualization. To demonstrate the various operations. In[3]:= FS2 = FuzzyTrapezoid@0. 13. 1<.2 U 1 3 5 7 9 11 13 15 17 19 21 In this graph. 1<. 916. In[4]:= FuzzyPlot@FS1. 88. to create the fuzzy sets. UniversalSpace → 80. !!!! =.5 Operations that apply to fuzzy sets only. 1<. 93. 1<. 89. we first create two fuzzy sets.8 0.6 0.8D. .26 Fuzzy Logic BisectorOfArea@AD Support@AD Core@AD EquilibriumSet@AD return the bisector of area defuzzification of fuzzy set A return a list of all elements of fuzzy set A with nonzero membership grades return a list of all elements of fuzzy set A with a membership grade equal to 1 return a list of all elements of fuzzy set A with membership grades equal to 0. !!!! =. in a Mathematica session. !!!! ==. 1<E 4 2 4 1 5 2 5 3 5 4 5 To examine the fuzzy sets we created. !!!! =. 914. 86. We use the FuzzyTrapezoid function. 87. 95. 810. and the triangular fuzzy set represents FS2. 20. !!!! =. 15. 5. !!!! =. Membership Grade 1 0. 6. 94. 813. 1<. 1<.4 0. we use the FuzzyPlot graphing function. !!!! =. In[2]:= FS1 = FuzzyTrapezoid@1. . 915. These fuzzy sets are plotted in red and blue. 17D Out[2]= FuzzySetA992. 1<. FS2D. 3 1 1 811. 1<. the trapezoid-shaped fuzzy set represents FS1.

0. 0.< RelativeCardinality[A] returns the cardinality of fuzzy set A divided by the total number of elements in the universal space of A. 0. !!!! =. A fuzzy set with a height of 1 is called a normal fuzzy set. 0.64<.32<.Chapter 3: Fuzzy Operations 27 The function Height[A] returns the value of the largest membership grade in fuzzy set A. FS2<D êê N Out[10]= 89.285714< FuzzyCardinality[A] returns the fuzzy cardinality of fuzzy set A. In[8]:= FuzzyCardinality@FS1D Out[8]= 9915. In[7]:= Map@RelativeCardinality. FS2<D êê N Out[7]= 80. !!!! =. 0. 8FS1. FS2<D êê N Out[6]= 811. 8FS1. 811.66667< CenterOfArea[A] returns the center of area defuzzification of fuzzy set A. !!!! =. 0. 84.32<.8<< . 84. 0. 913. 8FS1. 0. !!!! =.5. 0.4<. 87. Cardinality[A] returns the sum of all of the membership grades in fuzzy set A. 813. 88.21739. 0. 81.24<. In[5]:= Map@Height. !!!! =.48<.72<.08<. 0.16<. 910. while FS2 is a subnormal fuzzy set. 911.64<. 1<= 1 5 1 4 2 5 1 2 3 5 3 4 4 5 In[9]:= FuzzyCardinality@FS2D Out[9]= 8814. 85. 0. 0.547619. 813. In[6]:= Map@Cardinality.8< We see that FS1 is a normal fuzzy set. 0.56<. 82. 810. 810. In[10]:= Map@CenterOfArea. FS2<D Out[5]= 81. 8FS1. Here we compute the fuzzy cardinalities for FS1 and FS2. 912. 88. !!!! =. !!!! =. 914. 6. 6.16<. We first find the centers of area of for FS1 and FS2. 99. 0.

PlotLabel → "COA"D. ShowGraph → True.21739.4 0.2 U 1 3 5 7 9 11 13 15 17 19 21 COA Center of area is 6.6 0. MeanOfMax. Center of area is 6. CenterOfArea has an option ShowGraph that by default is set to False.66667. this function returns a plot of fuzzy set with a dot along the base axis indicating where the center of area is located.8 0. In[12]:= CenterOfArea@FS2. Center of area is 9.6 0. SmallestOfMax. If the option ShowGraph is set to True. .66667. In[11]:= CenterOfArea@FS1. To demonstrate this. we give the plot a label with the PlotLabel option.21739.28 Fuzzy Logic option name default value ShowGraph False an option to control whether to display a plot Option for CenterOfArea.2 U 1 3 5 7 9 11 13 15 17 19 21 COA Center of area is 9. Membership Grade 1 0.4 0. and BisectorOfArea. ShowGraph → True.8 0. The graph produced by the ShowGraph option can be customized using any of the options available with Mathematica's standard Plot function. Membership Grade 1 0. PlotLabel → "COA"D. LargestOfMax.

5.2 U 1 3 5 7 9 11 13 15 17 19 21 MOM Mean of max is 9. Mean of max is 9. In[13]:= MeanOfMax@FS1. Membership Grade 1 0.2 U 1 3 5 7 9 11 13 15 17 19 21 MOM SmallestOfMax[A] returns the smallest of maximum defuzzification of fuzzy set A. This function also has a ShowGraph option for visualizing the defuzzification (see CenterOfArea above). ShowGraph → True. In[14]:= MeanOfMax@FS2.5. Membership Grade 1 0.6 0. Mean of max is 5.4 0.8 0. PlotLabel → "MOM"D.8 0..Chapter 3: Fuzzy Operations 29 MeanOfMax[A] returns the mean of maximum defuzzification of fuzzy set A. ShowGraph → True.6 0.4 0. This function also has a ShowGraph option for visualizing the defuzzification similarly to CenterOfArea. . PlotLabel → "MOM"D.

In[16]:= LargestOfMax@FS2. Largest of max is 5. This function also has a ShowGraph option for visualizing the defuzzification (see CenterOfArea above).2 U 1 3 5 7 9 11 13 15 17 19 21 BisectorOfArea[A] returns the bisector of area defuzzification of fuzzy set A. This function also has a ShowGraph option for visualizing the defuzzification (see CenterOfArea above). Smallest of max is 6.4 0. PlotJoined → TrueD. Membership Grade 1 0.4 0. Membership Grade 1 0. .8 0.6 0.6 0.8 0. ShowGraph → True. PlotJoined → TrueD.30 Fuzzy Logic In[15]:= SmallestOfMax@FS1.2 U 1 3 5 7 9 11 13 15 17 19 21 LargestOfMax[A] returns the largest of maximum defuzzification of fuzzy set A.. ShowGraph → True..

ShowGraph → True. 8. 3. 7. 16< In[19]:= Core@FS1D Out[19]= 86. 13. 5. 15. 8. 9.2 U 1 3 5 7 9 11 13 15 17 19 21 Support[A] returns a list of all elements of fuzzy set A with nonzero membership grades. 6. Membership Grade 1 0. Bisector of area is 9. 13< In[20]:= EquilibriumSet@FS1D Out[20]= 815< Core[A] returns a list of all elements of fuzzy set A with a membership grade equal to 1. 12. 11.5.8 0. 10. .. 12. 9. 10. 14. 11.6 0. PlotJoined → TrueD. 4.Chapter 3: Fuzzy Operations 31 In[17]:= BisectorOfArea@FS1. 7. In[18]:= Support@FS1D Out[18]= 82. EquilibriumSet[A] returns a list of all elements of fuzzy set A with membership grades equal to 0.4 0.

1 0. 83. 3.32 Fuzzy Logic 3. 80. 84. !!!! ==. We use the FuzzySurface# Plot function to show the new fuzzy relation. 96. .25 0 1 2 3 4 V 2 5 1 6 7 0 9 8 7 6 5 4 W 3 FirstProjection@AD SecondProjection@AD GlobalProjection@AD return a fuzzy set that is the projection of fuzzy relation A onto the first space of the relation return fuzzy set that is the projection of fuzzy relation A onto the second space of the relation return a value that represents the maximum membership grade in fuzzy relation A Operations that apply to fuzzy relations only. In[21]:= Rel1 = FuzzyTrapezoid@81. 9<.3 Fuzzy Relation Operations This section describes operations that can be performed on individual fuzzy relations. 7. 6. !!!! =. 81. 1<. UniversalSpace → 81. 5. 7<. 1<E 1 2 1 2 We can plot the first projection using FuzzyPlot. 1<. To demonstrate these operations. 1<. FirstProjection[A] returns a fuzzy set that is the projection of fuzzy relation A onto the first space of the relation. 3. 85. In[22]:= FuzzySurfacePlot@Rel1D. UniversalSpace → 881. we create a new fuzzy relation with the FuzzyTrapezoid function.75 Grade 0. 7<.5 0. In[23]:= Proj1 = FirstProjection@Rel1D Out[23]= FuzzySetA992. 9<<D.

!!!! ==. In[27]:= GlobalProjection@Rel1D Out[27]= 1 . In[26]:= FuzzyPlot@Proj2D. 86. 97.4 0. 9. This is analogous to the Height function for fuzzy sets.4 0. !!!! =. !!!! =.2 U 1 2 3 4 5 6 7 8 SecondProjection[A] returns a fuzzy set that is the projection of fuzzy relation A onto the second space of the relation. 98.2 U 0 1 2 3 4 5 6 7 8 9 10 1 2 UniversalSpace → 80. 1<. 1<. 84.Chapter 3: Fuzzy Operations 33 In[24]:= FuzzyPlot@Proj1D. In[25]:= Proj2 = SecondProjection@Rel1D Out[25]= FuzzySetA992. 85. 1<. 1<. 83.6 0.8 0. Membership Grade 1 0. 1<E 2 3 1 3 GlobalProjection[A] returns a value that represents the maximum membership grade in fuzzy relation A.6 0.8 0. Membership Grade 1 0.

1 0. 13.4 0.6 0.2 U 1 In[30]:= Rel = 3 5 7 9 11 13 15 17 19 21 In[31]:= FuzzySurfacePlot@RelD.5 0. 8. 2. In some of the examples that follow. 80.25 0 1 2 3 2 4 V 5 1 6 7 0 4 3 7 6 5 W .34 Fuzzy Logic 3. To demonstrate these operations. 80. 7<. 5. we first create one new fuzzy set and one new fuzzy relation. but keep in mind that all the operators in this section work for both fuzzy sets and fuzzy relations. Membership Grade 1 0. we demonstrate functions operating on just a fuzzy set or just a fuzzy relation. FuzzyTrapezoid@81. UniversalSpace → 881. 5. In[29]:= FuzzyPlot@FS3D. 7<. 3. In[28]:= FS3 = FuzzyTrapezoid@1. 0. 7<.4 Fuzzy Set or Fuzzy Relation Operations This section describes operations that can be performed on either individual fuzzy sets or individual fuzzy relations.8 0.8. 7<<D.75 Grade 0. 19D.

where A and B are fuzzy sets or fuzzy relations return the Hamming distance from A to B. 6. 7. 7. alphaD return a list of all elements of A with membership grades greater than or equal to alpha. Out[33]= 85. 14< . 12. 10. 6. where A is a fuzzy set or a fuzzy relation return a list of all alpha levels of A . 13. 8. 5. where A and B are fuzzy sets or fuzzy relations concentrate the membership grades of A. BD Concentrate@AD Dilate@AD IntensifyContrast@AD Normalize@AD Complement@AD FuzzyModify@func. AlphaLevelSet[A.6D Out[32]= 84. where A is a fuzzy set or a fuzzy relation dilate the membership grades of A. where A is a fuzzy set or fuzzy relation return the degree of subsethood of A in B.6D StrongAlphaLevelSet[A. 11. 13. BD HammingDistance@A. where A is a fuzzy set or fuzzy relation intensify the contrast between the membership grades of A adjust the membership grades of A to create a normalized fuzzy set or fuzzy relation with a height of 1 return the complement of A.Chapter 3: Fuzzy Operations 35 AlphaLevelSet@A. 9. 12. 14< In[33]:= StrongAlphaLevelSet@FS1. 9. In[32]:= AlphaLevelSet@FS1. 0. 10. alphaD LevelSet@AD Subsethood@A. alpha] returns a list of all elements of fuzzy set A with membership grades greater than or equal to alpha. AD Operations that apply to both fuzzy sets and fuzzy relations. where A is a fuzzy set or a fuzzy relation return a list of all elements of A with membership grades greater than alpha. 11. where A can be a fuzzy set or a fuzzy relation modify the membership grades of A according to the supplied functionfunc StrongAlphaLevelSet@A. alpha] returns a list of all elements of fuzzy set A with membership grades greater than alpha. 0. 8.

where A is a fuzzy set .933333 HammingDistance[A. In[34]:= LevelSet@FS1D Out[34]= 9 !!!! . !!!! . where A is a fuzzy set or a fuzzy relation. FS2D Out[37]= 6.36 Fuzzy Logic LevelSet[A] returns a list of all alpha of A. with values closer to 1 indicating that the second fuzzy set/fuzzy relation is closer to being a subset of the first fuzzy set/fuzzy relation. In[37]:= HammingDistance@FS1. 1= 1 5 1 4 2 5 1 2 3 5 3 4 4 5 Subsethood[A. !!!! . In[35]:= Subsethood@FS1. !!!! .3 Concentrate[A] concentrates the membership grades of A. The concentration function squares the membership grades for each element of A. We find the concentration of our newly created fuzzy set here. !!!! . !!!! . FS2D Out[35]= 0. B] returns the Hamming distance from fuzzy set/fuzzy relation A to fuzzy set/fuzzy relation B. !!!! . and plot the original fuzzy set with its concentration on the same graph to show the effects of the operation. The value returned will be between 0 and 1. .486957 In[36]:= Subsethood@FS2. FS1D Out[36]= 0. B] returns the degree of subsethood of fuzzy set/fuzzy relation A in fuzzy set/fuzzy relation B.

Membership Grade 1 0.4 0. Con. ShowDots −> TrueD. In[40]:= Dil = Dilate@RelD. and it looks like a concentrated version of the original fuzzy set. where A is a fuzzy set or fuzzy relation.25 0 1 2 3 2 4 V 5 1 6 7 0 4 3 7 6 5 W From the graph we can clearly see that the new fuzzy relation is a dilated version of the original fuzzy relation. In[41]:= FuzzySurfacePlot@DilD. the concentrated fuzzy set is included in the original fuzzy set.5 0.Chapter 3: Fuzzy Operations 37 In[38]:= Con = Concentrate@FS3D. In[39]:= FuzzyPlot@FS3. 1 0. .75 Grade 0.8 0. The dilation function takes the square root of the membership grades for each element in A.2 U 1 3 5 7 9 11 13 15 17 19 21 In the graph.6 0. Dilate[A] dilates the membership grades of A.

In[44]:= Norm = Normalize@RelD. In[42]:= IC = IntensifyContrast@FS3D.8 0. where xn . .original membership grade. The new membership grades are calculated as follows: 1 .38 Fuzzy Logic IntensifyContrast[A] intensifies the contrast between the membership grades of A. General::spell1 : Possible spelling error: new symbol name "Norm" is similar to existing symbol "Nor".2 H 1 .2 U 1 3 5 7 9 11 13 15 17 19 21 Normalize[A] adjusts the membership grades of A to create a normalized fuzzy set or fuzzy relation with a height of 1. In[43]:= FuzzyPlot@FS3. Membership Grade 1 0.5 .4 0. ShowDots −> TrueD.xn L2 2 xn 2 if xn § 0. otherwise.6 0. IC.

The Standard complement is the default. where A can be a fuzzy set or a fuzzy relation. 1 0. We find the Complement of our fuzzy set.75 Grade 0. the function performs the Standard complement. but the following parameterized complements are also available. option name default value Type An option for Complement.5 0. Standard specifies the type of complement The Type option specifies the type of complement to be performed.25 0 1 2 3 2 4 V 5 1 6 7 0 4 3 7 6 5 W Complement[A] returns the complement (standard or nonstandard) of A. Type Sugeno@alphaD Yager@wD parameter alpha in the range -1 to infinity w in the range 0 to infinity Admissible values for Type for Complement for nonstandard cases. Since we have not specified a Type.Chapter 3: Fuzzy Operations 39 In[45]:= FuzzySurfacePlot@NormD. .

we first define a function that cubes its input.2 U 1 3 5 7 9 11 13 15 17 19 21 Here we use a Yager complement of our fuzzy relation with the parameter w set to 2. FuzzyModify[func. In[49]:= FuzzySurfacePlot@Compl2D. A] modifies the membership grades of A according to the supplied function func. A may be either a fuzzy set or a fuzzy relation. We then perform the FuzzyModify operation using the cubing function to modify the membership grades of our original fuzzy set. 1 0.5 0. In[48]:= Compl2 = Complement@Rel.8 0. .6 0.75 Grade 0.40 Fuzzy Logic In[46]:= Compl1 = Complement@FS3D. In this example. Compl1D. Type → Yager@2DD.4 0.25 0 1 2 3 2 4 V 5 1 6 7 0 4 3 7 6 5 W You can define your own operations with the help of FuzzyModify. In[47]:= FuzzyPlot@FS3. Membership Grade 1 0.

1<E 27 8 27 216 1 343 8 343 27 343 64 343 125 343 U 1 3 5 7 9 11 13 15 17 19 21 Equality@A. !!!!!!!!!! =. 914. and False otherwise.4 0. 343 216 8 1 1 1 915. 918. 1<. 812. !!!!!!!!!! =. 1<. FS3D Out[51]= FuzzySetA992. B] returns True if A is included in B and False otherwise. FS3D Out[53]= True Included[A. !!!!!!!!!! =. 813. 20. B] returns True if A and B are equal.2 216 125 97. Membership Grade 1 0. In[52]:= FuzzyPlot@FM. the membership grades of A must be less than or equal to the membership grades of B for all elements. !!!! =. !!!!!!!!!! =. !!!!!!!!!! =. 1<. !!!!!!! =. BD Distinctions for fuzzy sets and fuzzy relations. FS3. 1<.8 0. In[53]:= Equality@FS3. !!!!!!! =. In[54]:= Included@FS3. BD Included@A. and False otherwise return True if A is included in B and False otherwise Equality[A. 810. UniversalSpace → 80. 1<. 916. 88. To be included. 1<. 94. ShowDots −> TrueD.6 0.Chapter 3: Fuzzy Operations 41 In[50]:= MyModFun@x_D := x3 In[51]:= FM = FuzzyModify@MyModFun. !!!!!!!!!! ==. return True if A and B are equal. 93. 811. 89. !!!!!!!!!! =. 96. 917. FS3D Out[54]= True . !!!!!!!!!! =. 95.

.

This loads the package. however. We create two fuzzy sets to use in our demonstrations with the FuzzyTrapezoid and FuzzyGaussian functions that were described earlier in Chapter 1 Creating Fuzzy Sets. that the aggregation operations will also work with two or more fuzzy sets or fuzzy relations. the fuzzy sets or fuzzy relations being combined must be defined on the same universal space. In[4]:= FS2 = FuzzyGaussian@15. In this chapter. UniversalSpace → 80. For convenience. we demonstrate the aggregation operations in this chapter using a pair of fuzzy sets. In[1]:= << FuzzyLogic` To use the various aggregation operations. 1<D. 8. 32. 2. FS2 is the Gaussian fuzzy set. . we use the FuzzyPlot command. In[3]:= FS1 = FuzzyTrapezoid@0. In[2]:= SetOptions@FuzzySet. we need a few fuzzy sets or fuzzy relations. 1D. On the graph. It does not make sense to combine items defined on different universal spaces. Keep in mind. 18.1 Introduction Fuzzy Logic package provides a number of functions for aggregating two or more fuzzy sets or fuzzy relations. To look at these two fuzzy sets. 7D.4 Aggregation Operations 4. we will introduce these functions and demonstrate how to use them. When using the aggregation operations. FS1 is represented by the trapezoidal fuzzy set with a height of 1.

4 0.. .A2. A2. .. . . . An.. where the A's are either fuzzy sets or fuzzy relations. An. .AnD return the union of A1. This function has a Type option for specifying what kind of intersection should be taken.. An.6 0. AxesLabel → NoneD.AnD return the intersection of A1. A2.. . A2..2 Intersection (t-norm) and Union (s-norm) Operations Intersection@A1.44 Fuzzy Logic In[5]:= plot1 = FuzzyPlot@FS1.2 0 5 10 15 20 25 30 4. where the A' s are either fuzzy sets or fuzzy relations Union@A1. . The default setting is the Standard or Min intersection.A2. where the A' s are either fuzzy sets or fuzzy relations Basic aggregation operations.. Other valid types of intersections are shown in the following table. A2.8 0. . FS2. .. . 1 0.... PlotJoined → True. Intersection[A1. . . An] returns the intersection of A1..

1 0. For the standard case. FS2D. .2 0 5 1015202530 0 5 10 15 20 25 30 We now experiment with some of the nonstandard intersections by changing the Type option.6 0. PlotJoined → True.6<. We also could have used the FuzzyPlot command to plot all of these fuzzy sets on one graph. In[7]:= FuzzyPlot@Int1.4 0. We can plot the original fuzzy sets. The PlotJoined option is set to True to produce a continuous representation of the discrete fuzzy sets. plot1D.Chapter 4: Aggregation Operations 45 Type Hamacher@vD Frank@sD Yager@wD DuboisPrade@aD Dombi@alphaD Values of Type option for Intersection. AxesLabel → NoneD. This produces the Standard or Min intersection of the two fuzzy sets. except 1 w in the range 0 to infinity a in the range 0 to 1 alpha in the range 0 to infinity For our first example.4 0. the intersection takes the minimum of FS1 and FS2. . 1 0. we use the default intersection to combine the two fuzzy sets that we created earlier. 840. along with their intersection using the FuzzyPlot function.6 0.8 0. 1<. Here we take the Hamacher intersection of the two fuzzy sets where the parameter w is set to 2.8 0.2 Epilog → Rectangle@812. parameter v in the range 0 to infinity s in the range 0 to infinity. We use Mathematica's Epilog function to show the plot of the original fuzzy sets with the plot of the intersection. and we use that technique below. FS1 and FS2. In[6]:= Int1 = Intersection@FS1.

89. 815. 0.270868<.387226<. 0.192843<.0846367<. As an example. you may use the appropriate value for the option Type of union from the following table. 87. 0. we see that our Hamacher intersection returns values slightly less than the standard Min intersection. 0.444751<. When we do this.467919<. 813. 0. 83. 0. FS2. product type equivalent Intersection type Drastic Product Bounded Product Einstein Product Algebraic Product Hamacher Product Hamacher@InfinityD. so we have not included explicit functions for these operations. 86. Type → Hamacher@2DD Out[8]= FuzzySet@881. this is true for all nonstandard intersections.0529305<. 0. 816. if you wanted to find the bounded product of FS1 and FS2.46 Fuzzy Logic In[8]:= Int2 = Intersection@FS1.8 0. If you desire to use one of these operators. 0. 817. DuboisPrade@1D Hamacher@0D Relation between types of products and option Type for Intersection. 84.129923<. Yager@0D Yager@1D Hamacher@2D Hamacher@1D. 0. Each of these operations is simply a specific case of one of the intersections listed before. ShowDots −> TrueD. 810. 0. 0.3<.0860875<<. 814. 0.443425<. 811. 812. Membership Grade 1 0. In general. you could use a Yager intersection like this. We compare this intersection with the Standard intersection by plotting the two results on the same graph. 82. In[9]:= FuzzyPlot@Int1.367879<. 0. UniversalSpace → 80.031778<. 32. 0.00614272<.466047<. 0.6 0.191463<. . 1<D There is a group of t-norm operators that are collectively called products. 88.4 0. 0. Int2. however.410335<.2 U 0 5 10 15 20 25 30 85. 0.

815. plot1D.8 0. 88. This function has a Type option for specifying what type of union should be taken.Chapter 4: Aggregation Operations 47 In[10]:= BP = Intersection@FS1.6 0. 0. .0529305<.432208<.. parameter v in the range 0 to infinity s in the range 0 to infinity. 0. 0.270868<. FS2.A2. 1<D 0 5 10 15 20 25 30 Union[A1.8 0.031778<.400373<. An. 1 0. . 814. 0. 0. 0. 0. The default is the Standard or Max union.. 0. Type → Yager@1DD Out[10]= FuzzySet@882.0846367<.6 0.4 0. PlotJoined → True.2 0 5 1015202530 86. 87. 0. . 1 0. In[11]:= FuzzyPlot@BP. 811. 0. 0. AxesLabel → NoneD.179799<. ...379799<. 0. 0..367879<.42161<. 813. 840. where the A's can be fuzzy sets or fuzzy relations. Other valid union types are shown in the following table. 812. 810. 89. 816.3<. 817.379652<. A2. 32. Type Hamacher@vD Frank@sD Yager@wD DuboisPrade@aD Dombi@alphaD Values of Type option for Union. 84. 1<.0216104<<.129923<.2 Epilog → Rectangle@814.191463<. except 1 w in the range 0 to infinity a in the range 0 to 1 alpha in the range 0 to infinity For our first Union example. 0.opts] returns the union of A1.421422<.4 0. 83. 0.6<. 85. we use the default Standard union to combine our two fuzzy sets.. UniversalSpace → 80. 0.An.

00538311<.0183156<. 0.600373<. 827. 0. 810. 32. . 83. 0. 0. 0. 0. 1. 91.990518<. 820. 828. 0.8 0. 812. """"""" =.721422<. 0. 0. 86.92161<.950529<. 0. AxesLabel → NoneD. 821.970518<.721422<.4 0.0529305<. 813.0846367<. 0. 0. 831. FS2D Out[12]= FuzzySetA980.832208<.00274504<<. PlotJoined → True. 823. We look at the results by plotting the original fuzzy sets along with the union. 0.00274504<=. 813. 1. 84. 0.4 0. 817. 826.832208<. 0. 826. 825. 811.721422<.979799<. 85.129923<. 0. 0. 87. since the union is graphed last. 832. 819. 83. 814.0101342<.129923<. 0. 831.933408<.979799<. 822. 1.48 Fuzzy Logic In[12]:= Un1 = Union@FS1.0101342<.511569<. 0.938509<.<.6 0. it covers the original fuzzy sets in certain areas. """" =. 32. 1.0529305<. 818. 818. 0. 1 0.985729<. UniversalSpace → 80.<.270868<. In[14]:= Un2 = Union@FS1. 88. 0. 0. 820. FS2. 84. 0.2 9 4 88. 0. 0.<. 0.8 0.031778<. 819. 832. 0. 0. 823. 0. 811. 1<. 0. 824. 1<. 910. 81. 82.<. 1<.<. 0. 10 5 814. 1<.92161<. 824.<. 1.479652<. 840. 821. plot1D. 0.367879<.<. Type → Frank@3DD Out[14]= FuzzySet@880. 829. 1<.191463<.6 0. 825.031778<. If you remember what our original fuzzy sets looked like. On the graph. 0.191463<. 99. 0. 830. 0.6<. 87.0101342<. 85. 816. 1.0846367<.0183156<. 1<.<. 830. This time we use the Frank union with parameter s set to 3. 89. 1.0101342<. 829. 828. 817. 815. 0. 0. 0. 0.479652<. UniversalSpace → 80. 827. 0. 82. 812. 86. 0.270868<. you can see that the standard union takes the maximum membership grade of the two fuzzy sets for each element. however. 1. 815. 1.940352<.2 0 5 1015202530 0 5 10 15 20 25 30 Now let's look at a nonstandard union. 0. 822. The formulas for all the aggregation operations can be found in the appendix. 1<E 1 2 Epilog → Rectangle@814.832208<. 0. 0.960128<. 1<D . 816. """" =. 1<. 0.367879<.<.600373<.00538311<. 1<. 0. In[13]:= FuzzyPlot@Un1. 0. 1 0.

Hamacher@InfinityD. This condition is true for all of the nonstandard unions. you would enter the following.Chapter 4: Aggregation Operations 49 We compare this latest union with the Standard union from the first example by plotting the two results together. Membership Grade 1 0. Un2.4 0. you may use the appropriate value for the option Type of union from the following table. sum type equivalent Union type Drastic Sum Bounded Sum Einstein Sum Algebraic Sum Hamacher Sum Relation between types of sums and option Type for Union. DuboisPrade@1D Hamacher@0D As an example. Yager@0D Yager@1D Hamacher@2D Hamacher@1D. however. ShowDots −> TrueD. so we do not include explicit functions for these operations. There is a group of s-norm operators.8 0.6 0. If you desire to use one of these operators. .2 U 0 5 10 15 20 25 30 From the graph. you see that the Frank union returns membership grades greater than or equal to the membership grades returned by the Standard union. Each of these operations is simply a specific case of one of the unions listed before. to find the drastic sum of FS1 and FS2. which are collectively called sums. In[15]:= FuzzyPlot@Un1.

832. 89.129923<. 824. An. FuzzyArithmeticMean[A1. 1<. 830. we examine some of the common averaging operations. 88. 0. 827. . . 815.0101342<.. 814. An] returns the arithmetic mean of A1. . 83.. . . . .600373<. where the A' s are fuzzy sets or fuzzy relations FuzzyHarmonicMean@A1.832208<. 1<. 811. AnD return the geometric mean of A1. . 85. 823. 87. 0. 86. 817. 84.00274504<<. 820.50 Fuzzy Logic In[16]:= DS = Union@FS1. 828. A2... 1<. 1<.0183156<.00538311<. FuzzyArithmeticMean@A1.. A2.0846367<. .479652<. where the A' s are fuzzy sets or fuzzy relations FuzzyGeometricMean@A1. 829. AnD return the harmonic mean of A1. 816. 0.. A2. where the A's are fuzzy sets or fuzzy relations. An. where the A' s are fuzzy sets or fuzzy relations GeneralizedMean@A1. 0. A2.. where the A' s are fuzzy sets or fuzzy relations Averaging aggregate operations. 1<.. 1<.. 82. . 0. 810.. 0.. An. . 818. . . 1<. 813.. alphaD return the generalized mean of A1. . 825.270868<. An. In this section.. A2.. 819.. 0. 1<.0529305<.191463<. 0... An. 1<. A2. 0.0101342<. 1<. A2.. 1<. 826.. 812.. A2. UniversalSpace → 80.721422<. A2. 0. 32. 0. . 1<.. 821.. FS2. AnD return the arithmetic mean of A1.3 Averaging Operations Averaging operators are aggregation operators that fall in the region between intersections and unions. 0. 0. 1<. .031778<. 0. 1<.. 1<. 0. An. A2. Type → Hamacher@InfinityDD Out[16]= FuzzySet@880. 831. 0. . . 1<. 822. 1<. 1<D 4.367879<. 81.

0. 0. 0. 815. UniversalSpace → 80. 1<D FuzzyGeometricMean[A1. 818. 88. 0. An. 0.689899<.68394<. 0. 0. 831.00506711<. Membership Grade 1 0. An] returns the geometric mean of A1. PlotJoined → TrueD. 0.657029<. 87. 0. 827. 0. 0.2 U 0 5 10 15 20 25 30 84. 83. .542318<. 813. 84. 83. 0. 820.65<.0423183<.18394<. 832. 82.589899<.626035<. 0. 0. 0.526465<. 86. FS2D Out[19]= FuzzySet@881. A2. 0. 32. 0. 0.416104<.230066<. The membership grades for the average fuzzy set falls between the membership grades of the two original fuzzy sets. 0. 87.678826<.259158<. 89.689826<.. 824. . 814.6 0.8 0. 0.547723<.360711<. 32.700187<.30358<<. 0. 0.0956965<. 811. 0. 810. 0. 815. 817. 0.300187<.606531<.437565<. 0. 0.360448<. 0. 0. 0. In[18]:= FuzzyPlot@FS1.00506711<.135434<.716104<.. 0. FS2D Out[17]= FuzzySet@880. 0. .00269155<. . 1<D .442673<.595731<. 817.. 829. 0.0957314<. 0. where the A's are fuzzy sets or fuzzy relations.710805<.Chapter 4: Aggregation Operations 51 In[17]:= AM = FuzzyArithmeticMean@FS1. 0. FS2. 814.4 0. 812. 85. 0.510805<. UniversalSpace → 80. 816. 816.290924<. 812. 0.178264<.710711<. 0. 810. 822. In[19]:= GM = FuzzyGeometricMean@FS1. 830.515889<. 0. 0. 828. 0.00915782<. 0.015889<. 813. 0. 0. 821. 826.0264653<. 0. 89.0649613<. 86. 85..706629<. 825.52045<. 823. 0. A2. 82.239826<. 811. 81. 0.635434<. 0. 88.71063<. 0.564961<.00137252<<. 819. 0. We look at how this averaging operation behaves by plotting the original fuzzy sets with their average. AM.693036<.

PlotJoined → TrueD.426273<. 32. 0. 0. .321391<. 86. 0. In[21]:= HM = FuzzyHarmonicMean@FS1.2 U 0 5 10 15 20 25 30 85. 816. HM.461538<.332192<.568082<. 812. PlotJoined → TrueD. Membership Grade 1 0.0615986<.8 0. where the A's are fuzzy sets or fuzzy relations. GM. .71055<. A2. 0.625791<. 82. 0. 1<D Now we compare the various averaging operations by plotting all the results of the averaging operations on the same graph. 815. FS2D Out[21]= FuzzySet@881.An] returns the harmonic mean of A1.4 0.229967<.6 0. 0. 89.156065<.4 0.A2. FS2. 814. . .69728<.6 0. UniversalSpace → 80. 0.648286<.52 Fuzzy Logic In[20]:= FuzzyPlot@FS1.. 84. 0. 817.180423<<. 88. 0. 813.685958<.. 0.2 U 0 5 10 15 20 25 30 FuzzyHarmonicMean[A1. 87. Membership Grade 1 0. 0.8 0. . 0. 0. In[22]:= FuzzyPlot@FS1. 811. 0.0353368<. 0. 83. 0.537883<. An. 810... 0. FS2.100539<.

In[24]:= GenM = GeneralizedMean@FS1.2 U 0 5 10 15 20 25 30 GeneralizedMean[A1. 829. 0. 0. 0. Here is an example where the parameter alpha is 2. 0..719951<.510123<. 813. . 0. FS2. 0. 814. 0. 0. 823. 820.655502<.0224705<.A2.00194104<<.4 0. 81.6 0.753437<.alpha] returns the generalized mean of A1.26013<.725455<. 812. 85. 2D Out[24]= FuzzySet@880. 83.00380643<.707109<. This function takes a parameter alpha. 0.721133<. 819.0129511<.8 0. where the A's are fuzzy sets or fuzzy relations. A2. 0.709635<.An.710792<.353791<. . 828. .0374275<.738241<. 826. 0. 0.00716598<.58846<. 84. PlotJoined → TrueD. 0. 817. 0. This function provides you with a great deal of flexibility when choosing how to average fuzzy sets. 89.0918692<. 0. 0. 832. 0. 0.732588<.. 0. 0. 87. 0. 0. 824. An. 815.708097<.424528<. HM. 811.191533<.748333<.741406<.71305<.00716598<. 0.. 0. 0.339165<.707265<. Membership Grade 1 0. 0. 0. GM. 32. 88.0598472<. 821. UniversalSpace → 80. 0. . 86. 825.. 830.707464<. 82. 818. 827. 0. 831. 816. This function is a general averaging function which encompasses the full range of averaging operations. 0. 0.135385<. 0. 810. The averaging operations shown earlier are specific cases of the generalized mean. 822.Chapter 4: Aggregation Operations 53 In[23]:= FuzzyPlot@AM. 1<D . 0.

89. BD return the symmetric difference between A and B. BD return the absolute difference between A and B. 1 2 86. 84.0202013<. 810.0783896<=.6 0. 816. where A and B are fuzzy sets or fuzzy relations Difference[A. 0. 0. 0. 1<E . return the general difference between A and B. FS2D Out[26]= FuzzySetA991. 32. PlotJoined → TrueD. In[26]:= Diff = Difference@FS1. 0. 0. 0.0202013<. 0.968222<. 82. 85.947069<. 0. 0. BD AbsoluteDifference@A.4 Difference Operations Difference@A.632121<.0783896<. GenM.870077<. 811.399627<. Membership Grade 1 0. 814. 0.167792<. where A and B are fuzzy sets or fuzzy relations SymmetricDifference@A. 87.54 Fuzzy Logic In[25]:= FuzzyPlot@FS1.915363<. UniversalSpace → 80. 83.4 0. 88. 0.520348<.8 0. 0. where A and B are fuzzy sets or fuzzy relations.808537<. B] returns the general difference between A and B.2 U 0 5 10 15 20 25 30 4. 817. 813. 0. where A and B are fuzzy sets or fuzzy relations Difference aggregate operations. 0. FS2. 0.729132<.278578<. 812. """" =.

0.579799<. PlotJoined → TrueD.4 0. 0.270868<. 830. B] returns the absolute difference between A and B.721422<. 0.632121<. 0. 84. 0. 82. 81. 0. 0. 0. 0. 0. 0.0529305<.832208<. 0.2 U 0 5 10 15 20 25 30 AbsoluteDifference[A.129923<. 824. 814. 829. FS2.031778<.479652<. 0. 0.0214223<. 0. 0. 83.808537<.367879<. 826. 85. 812. 815. 0.6 0. 0. In[27]:= FuzzyPlot@FS1.0183156<. In[28]:= AD = AbsoluteDifference@FS1. 828.600373<. 821. 822. 831.42161<. where A and B are fuzzy sets or fuzzy relations.0846367<.420348<. 818. 0. 0. 87. 825. 1<D .00274504<<.82161<. 819.199627<.947069<. 0. 88.7<. 32.00538311<. 0. FS2D Out[28]= FuzzySet@880. 0. 0. 0. UniversalSpace → 80.481684<. 832.0101342<. 0. 810. 0.0101342<.915363<. 816. 0.779799<. 0.8 0.729132<.968222<. 811.232208<. 823. We again look at the results with the FuzzyPlot function. 827. Membership Grade 1 0.Chapter 4: Aggregation Operations 55 To get a feel of what kind of result the differences produce. we plot the original fuzzy sets along with the difference on the same plot. 0. 0.870077<. 813. 820. 89. 0.191463<. 0. Diff. 817. 86.

947069<. """" =. 82.632121<. 83. """" =. UniversalSpace → 80. 0. 0. SD. 0.031778<. 915. 823. """" =. where A and B are fuzzy sets or fuzzy relations. 32.8 0. 830. 0. 913. 829.832208<. 914.600373<. 10 5 2 5 10 5 9 917. 1<E . 86.520348<. 0. 0. FS2. 821. 0.4 0. 828.808537<. 0. In[30]:= SD = SymmetricDifference@FS1.2 U 0 5 10 15 20 25 30 1 2 85. """"""" =. 0. PlotJoined → TrueD.915363<. 827.0529305<. AD. 0. """"""" =. 818. 87.2 U 0 5 10 15 20 25 30 SymmetricDifference[A. 3 2 1 3 7 4 810. 0.870077<.8 0. 88. FS2D Out[30]= FuzzySetA980. PlotJoined → TrueD.0101342<.0101342<.367879<.968222<. 0. 0.479652<. 825.00274504<=.270868<.4 0. 0. 84. 91. 916. 89. 0.129923<.721422<. 0.399627<.6 0. Membership Grade 1 0. 0. """" =. 10 822. 832.191463<. 0. B] returns the symmetric difference between A and B. """"""" =. 820. """" =. Membership Grade 1 0.0846367<. 0. 826. FS2. 0. 0. 824. In[31]:= FuzzyPlot@FS1. 819. 0. 0. 912.6 0. 0.729132<.00538311<.0183156<. 0. 831. 911.56 Fuzzy Logic In[29]:= FuzzyPlot@FS1.

0957314<. 2 2 20 5 813. 0. .239826<. 820.00506711<. 831. A1..00506711<.0423183<. 0. 818. UniversalSpace → 80. """" =.300187<.5<. In[32]:= MyAgg@x_. 0. 822.460805<. yD 1 2 In[33]:= GA = GeneralAggregator@MyAgg.. """" =. 832. 0. 827. . 0. An using function fun General aggregation operation. An] uses the function fun to combine the membership grades of A1. 32. where the A's are either fuzzy sets or fuzzy relations.00269155<. 98.0649613<. 811. 94. 93. 95.489899<.. """" =. 817. AnD return combined membership grades of fuzzy sets or relations A1. """" =. An. 828. Here we demonstrate this function by first creating a function for combining the membership grades of the elements and then calling GeneralAggregator with this function and our two fuzzy sets. A2.360711<.00915782<. """"""" =.00137252<=.489899<. . 824.135434<. 99. A2. 0. """" =. 0.416104<.416104<. 0. 910.Chapter 4: Aggregation Operations 57 4. 0. 815. FS1. . 816. This is the most general aggregate operation and virtually every other aggregation operation can be expressed in its terms. 0. 0. 0.18394<. 0. 819. A2.015889<. 96. 0. 92. 91.. """" =. . GeneralAggregator[fun. """" =. 829. A1. y_D := #### Max@x.... 830. 0. FS2D Out[33]= FuzzySetA980. . 0. 821. 0. 814. 0.. 823. 0.0264653<. 0. .460805<. . 1 1 9 2 97. 825. we look at a plot of the results from the previous calculation. 812. 0.5 User-Defined Aggregators GeneralAggregator@fun. 0. """" =. 826.360711<. """" =. 0. A2. To see how our new aggregator behaves. 1<E 1 4 1 2 1 2 1 2 1 2 1 2 .

1<< . UniversalSpace → 80. In[35]:= SetOptions@FuzzySet. Membership Grade 1 0.58 Fuzzy Logic In[34]:= FuzzyPlot@FS1. 20. FS2. 20. 1<D Out[35]= 8UniversalSpace → 80. GA. PlotJoined → TrueD.4 0.8 0.6 0.2 U 0 5 10 15 20 25 30 You can use a built-in function SetOptions to restore the default setting for the FuzzySet object.

. In[2]:= FS1 = FuzzyTrapezoid@1. . 17.1 Introduction Fuzzy Logic package provides a number of functions that can be used to visualize fuzzy sets. An plot a fuzzy graph for a set of control rules A FuzzyPlot[A1... A2. 12D. 5D. In[3]:= FS2 = FuzzyGaussian@11. We use some of the fuzzy set creation functions from the Fuzzy Logic package to accomplish this. . . The following functions create a trapezoidal fuzzy set. In[4]:= FS3 = FuzzyTrapezoid@4. In[1]:= << FuzzyLogic` 5. and a crisp set in that order. a Gaussian fuzzy set. we must first create some fuzzy sets to view.. A2. An] plots fuzzy sets A1. 0.5 Fuzzy Set Visualization 5. . A2. 12. . This loads the package. .2 Visualization Functions To demonstrate the various fuzzy set graphing functions. This function is only for use with fuzzy sets. In this chapter... 6. 4. . . AnD FuzzyGraph@AD Functions to visualize fuzzy sets. 12. plot fuzzy sets A1.. and the fuzzy sets it graphs must by defined on the same universal space. FuzzyPlot@A1. A2. we demonstrate these functions and the options associated with each function. An..9D. .

Now let us look at some examples. even though a line representing the membership grade is offset to the right of the discrete point on the graph. which we will demonstrate in the following examples.2 U 1 3 5 7 9 11 13 15 17 19 21 .8 0. Membership Grade 1 0. the line corresponds to the discrete point to the left of the plotted line. Therefore. each successive fuzzy set is graphed in a new color and shifted slightly to the right to avoid overwriting a previous fuzzy set. There are numerous options for this function.4 0. the function will return a plot of vertical lines with heights representing the membership grades of the corresponding elements.60 Fuzzy Logic option name default value ShowDots False plot a dot at the top of each vertical line when this option is set to True plot a continuous line when this option is set to True plot a crisp set when this option is set to True PlotJoined Crisp False False Options for FuzzyPlot. In[5]:= FuzzyPlot@FS1D. When more than one fuzzy set is graphed at a time. If the FuzzyPlot function is called with one or more fuzzy sets and no options.6 0.

turquoise. dark pink. As more and more fuzzy sets are plotted on the same graph. light blue. orange. click the graph and drag one of the dark squares to a new position.Chapter 5: Fuzzy Set Visualization 61 In[6]:= FuzzyPlot@FS1. green. if the universal space of the fuzzy sets you are plotting is large. and the fuzzy sets become increasingly difficult to distinguish from one another. setting the PlotJoined option to True . so the eleventh fuzzy set will again be red. FS2D. the graph becomes more and more cluttered. This option sometimes makes it easier to distinguish fuzzy sets in a cluttered graph. ShowDots → TrueD. purple.6 0. some graphs with multiple fuzzy sets still become too cluttered to easily interpret. For more than ten fuzzy sets plotted on the same graph. FS2. Furthermore. the FuzzyPlot command uses the following order of colors: red.8 0.2 U 1 3 5 7 9 11 13 15 17 19 21 Even with the ShowDots option set to True. the color pattern above repeats. If this is the case.2 U 1 3 5 7 9 11 13 15 17 19 21 To resize a graph. In[7]:= FuzzyPlot@FS1. and yellow-green. yellow.4 0. Membership Grade 1 0. Membership Grade 1 0.6 0. the vertical line-plotting method does not work well. blue. Setting the ShowDots option to True causes a dot to be placed at the top of each of the vertical lines representing the membership grades.4 0.8 0. When plotting more than one fuzzy set on the same graph.

Therefore. In[8]:= FuzzyPlot@FS1. or if you want the graphs presented in a different way. and successive fuzzy sets are not offset to the right as is the case for the discrete plots talked about earlier in this section.4 0.8 0. . We demonstrate this option by plotting a fuzzy set that is also a crisp set (all membership grades are either 1 or 0). Fuzzy Logic package includes a graphing option that allows crisp sets to be plotted in an accurate manner. Membership Grade 1 0.6 0. set the Crisp option to True.4 0. A linear interpolation is used for the points between the integer elements. FS2. Here is a list of the options for Mathematica's Plot function.62 Fuzzy Logic is often your best bet. To use the crisp plotting option. This will cause the fuzzy sets to be plotted as a continuous line. Membership Grade 1 0. If the default options for the fuzzy plotting functions do not produce a readable graph.6 0. Crisp → TrueD.2 U 1 3 5 7 9 11 13 15 17 19 21 In addition to the options mentioned above. In[9]:= FuzzyPlot@FS3. the FuzzyPlot function also accepts any of the options that Mathematica's standard Plot function accepts. PlotJoined → TrueD.2 U 1 3 5 7 9 11 13 15 17 19 21 It is often instructive to work with fuzzy sets along with crisp or classical sets. these additional options can be used.8 0.

Membership Grade 1 0. 1<D. Big. Medium.2 GridLines → 8None.Chapter 5: Fuzzy Set Visualization 63 AspectRatio Axes AxesLabel AxesOrigin AxesStyle Background ColorOutput Compiled DefaultColor DefaultFont DisplayFunction Epilog FormatType Frame FrameLabel FrameStyle FrameTicks GridLines ImageSize MaxBend PlotDivision PlotLabel PlotPoints PlotRange PlotRegion PlotStyle Prolog RotateLabel TextStyle Ticks Here is one example that uses some of the standard Mathematica plotting options. VerySmall.6 0. Automatic<. Let's look at an example to see how the FuzzyGraph function works. PlotLabel → "Numbers Near 11"D. Enormous< = CreateFuzzySets@7D. Frame → True. The first thing we need is a set of rules that relate fuzzy inputs to fuzzy outputs. 20. In[12]:= Input1 = 8Tiny. In[11]:= SetOptions@FuzzySet.8 0. In[10]:= FuzzyPlot@FS2. . We start by creating the fuzzy sets that are used to represent the input and output variables. UniversalSpace → 80.4 0. Small. VeryBig. A fuzzy graph can be used to give an idea of what a set of fuzzy rules look like. Numbers Near 11 U 0 5 10 15 20 Another visualization function in the Fuzzy Logic package is a fuzzy graph.

High<. 1<D.8 0. In[15]:= Output1 = 8VeryLow.4 0. High} is referred to as a Cartesian granule. Now we can use the fuzzy graph function to get a general idea of what the system we created will look like. FuzzyTrapezoid@4. 8Big.64 Fuzzy Logic In[13]:= FuzzyPlot@Input1. 5.8 0. FuzzyGaussian@9. Low<. High< = In[16]:= FuzzyPlot@Output1. ChopValue → . 8Enormous. High<<.2 U 3 5 7 9 11 13 15 17 19 21 23 25 8FuzzyTrapezoid@2. 25. Low. 6D.2 U 1 3 5 7 9 11 13 15 17 19 21 In[14]:= SetOptions@FuzzySet. 8Medium.6 0. In this sense. UniversalSpace → 82.001D. 8VeryBig. VeryLow<. FuzzyGaussian@20. . 5. Next we create a set of fuzzy rules relating the inputs to the outputs. Middle<. Membership Grade 1 0.4 0. 8Small. An expression of the form {Tiny. Membership Grade 1 0.6 0. 4. 8VerySmall. 8D. Middle<. Low<. In[17]:= Rules1 = 88Tiny. a fuzzy graph may be viewed as a disjunction of Cartesian granules. PlotJoined → TrueD. 3. 4. ChopValue → . PlotJoined → TrueD.001D<. 3. Middle.

5 20 In this case. 25 20 15 10 5 2. which is described in words as a collection of fuzzy if-then rules.5 15 17. .Chapter 5: Fuzzy Set Visualization 65 In[18]:= FuzzyGraph@Rules1D.5 5 7. In essence.5 10 12. a fuzzy graph serves as an approximation to a function. we see that the rules we created map to a function that is parabolic in shape.

.

1. . 7<.6 Fuzzy Relation Visualization 6.. In this chapter. .. AnD plot the fuzzy relations A1. we demonstrate these functions and the options associated with each function. We use the FuzzyTrapezoid function here to create two fuzzy relations. 81.1 Introduction Fuzzy Logic package provides a number of functions that can be used to visualize fuzzy relations. we need first to create some fuzzy relations. An ToMembershipMatrix@AD return the membership matrix of fuzzy relation A Functions to visualize fuzzy relations. An. AnD plot a surface plot of fuzzy relations A1. A2. 7<. 7<.. 81.. 4. A2. . A2. FuzzyPlot3D@A1. 1.. In[1]:= << FuzzyLogic` 6. UniversalSpace → 881. 4.. . 6. . 81.2 Visualization Functions To demonstrate the various functions for visualizing fuzzy relations.. 8<. 7<. 81. A2. 8<<D. This loads the package. . 5. In[2]:= Rel1 = FuzzyTrapezoid@81. . 8<. . In[3]:= Rel2 = FuzzyTrapezoid@81. as a collection of vertical lines with heights representing the membership grades of the elements FuzzySurfacePlot@A1. 8<<D. 5. UniversalSpace → 881.. . 3.

the graph of each successive fuzzy relation is shifted a little to the right along the V axis.8 Grade 0. . when multiple fuzzy relations are shown on the same graph.6 0.2 0 1 2 3 3 4 V 5 2 6 7 1 8 7 6 5 4 W . 1 0. Rel2D. Rel1 and Rel2.2 0 1 2 3 3 4 V 5 2 6 7 1 8 7 6 5 4 W As with fuzzy sets. Even though there is a shift in the location of each line. Here we demonstrate the function with our two fuzzy relations.6 0.4 0. A2. ... the line still corresponds to the discrete point to the left of the plotted line. 1 0. A2. In[4]:= FuzzyPlot3D@Rel1D. In[5]:= FuzzyPlot3D@Rel1.4 0. . An must be defined on the same universal space... .68 Fuzzy Logic Fuzzy Plot 3D FuzzyPlot3D[A1. An. . . An as a collection of vertical lines with heights representing the membership grades of the elements.8 Grade 0. and all of the fuzzy relations A1. opts] plots the fuzzy relations A1... We can see this in the next example. A2. This function is only for fuzzy relations.

2 0 1 2 3 3 4 V 5 2 6 7 1 8 7 6 5 4 W Fuzzy Surface Plot FuzzySurfacePlot[A1. this option plots a dot at the top of each vertical line.. In[6]:= FuzzyPlot3D@Rel1.4 0.. An alternative graphing solution is to plot fuzzy relations as surfaces. 1 0. When set to True. One option. Let's replot the first fuzzy relation as a surface now with the FuzzySurfacePlot function.8 Grade 0. ShowDots → TrueD. which may help clear up the graph.. As with fuzzy sets. The discrete plots shown earlier are fairly messy for plotting large fuzzy relations or for plotting multiple fuzzy relations. . This is shown in the following example. . An. Rel2. A2. An.Chapter 6: Fuzzy Relation Visualization 69 option name default value ShowDots False plot a dot at the top of each vertical line when this option is set to True Option for FuzzyPlot3D. and it becomes difficult to visualize the different fuzzy relations. A2. opts] displays a surface plot of fuzzy relations A1. is the ShowDots option.. . . graphs of multiple fuzzy relations tend to become cluttered.6 0. .

25 0 1 2 3 3 4 V 5 2 6 7 1 5 4 8 7 6 W The FuzzySurfacePlot function plots a fuzzy relation as a solid object. Therefore.25 0 1 2 3 3 4 V 5 2 6 7 1 5 4 8 7 6 W In addition to the options described in this chapter. To demonstrate. . To get around this problem. we will replot the first fuzzy relation with the second fuzzy relation. this time with the Hide! Surfaces option set to True. the FuzzySurfacePlot function comes with an option that plots the surfaces as meshes rather than solid objects.75 Grade 0.5 0. HideSurfaces → TrueD.70 Fuzzy Logic In[7]:= FuzzySurfacePlot@Rel1D. In[8]:= FuzzySurfacePlot@Rel1. Here is a list of these additional options.75 Grade 0.5 0. the FuzzyPlot3D and FuzzySurfacePlot functions also accept any of the options that Mathematica's standard Plot3D function accepts. 1 0. 1 0. Rel2. Setting the HideSurfaces option to True produces a mesh plot. plotting multiple fuzzy relations on the same surface plot causes some fuzzy relations to block out regions of other fuzzy relations.

1<. We demonstrate a few of these options in the following example.006D. A membership matrix is a matrix that shows the membership grades of all the elements of a fuzzy relation. see The Mathematica Book by Stephen Wolfram. MeshStyle → 8Thickness@.25 5 0 1 2 3 4 W 5 6 1 2 3 4 V 5 6 7 7 8 Membership Matrix One last technique for visualizing a fuzzy relation is to look at its membership matrix. 81. We demonstrate this function on our first fuzzy relation. 81. 0. Hue@.7D<.Chapter 6: Fuzzy Relation Visualization 71 AmbientLight AspectRatio Axes AxesEdge AxesLabel AxesStyle Background Boxed BoxRatios BoxStyle ClipFill ColorOutput Compiled DefaultColor DefaultFont DisplayFunction Epilog FaceGrids HiddenSurface Lighting LightSources MeshStyle PlotLabel PlotPoints PlotRange PlotRegion Plot3Matrix Prolog Shading SphericalRegion Ticks ViewCenter ViewPoint ViewVertical For more information on these options.9D.75 Grade 0. In[9]:= FuzzySurfacePlot@Rel2.5 5 0. PlotLabel → "Rel2"D. ViewPoint → 82. Background → GrayLevel@. −1<<. ToMembership! Matrix[A] displays the membership matrix of fuzzy relation A. This is a convenient way to view fuzzy relations. Rel2 AxesEdge → 881. . 1 0. −1<. −1<.

72 Fuzzy Logic In[10]:= ToMembershipMatrix@Rel1D êê MatrixForm Out[10]//MatrixForm= i0 j j j0 j j j j j j j0 j j j j j0 j j j j j j0 j j j j j j0 j j j j k0 0 1 """ 3" 1 """ 3" 1 """ 3" 1 """ 3" 1 """ 3" 0 1 """ 2" 2 """ 3" 2 """ 3" 2 """ 3" 1 """ 2" 0 1 """ 2" 1 1 1 1 """ 2" 0 0 1 """ 2" 1 1 1 1 """ 2" 0 0 1 """ 2" 1 1 1 1 """ 2" 0 0 1 """ 2" 1 """ 2" 1 """ 2" 1 """ 2" 1 """ 2" 0 0 0 0y z z z 0z z z z z z 0z z z z z z 0z z z z z z 0z z z z z z 0z z z z 0{ .

9. 4. UniversalSpace → 880. the second range of the first fuzzy relation's universal space must be the same as the first range in the second fuzzy relation's universal space. This loads the package. 8<. 7<. 8<. 8<. 1. 2. 82. 82. 7<<D. 5. UniversalSpace → 881. In[2]:= Rel1 = FuzzyTrapezoid@80. . we must first create some fuzzy relations. We use the FuzzyTrapezoid function here to create two fuzzy relations.2 Composition Function To demonstrate the various composition functions. FuzzyTrapezoid@81. 0. 2. 8<<D. 2. we introduce and demonstrate these functions and the options associated with them. 81. This is a necessary condition to perform a composition of two fuzzy relations. To take the composition of two fuzzy relations. We must be careful to create two fuzzy relations that can be combined by a composition operation. 7<. 7<. 6.1 Introduction The Fuzzy Logic package provides a few different ways to perform compositions between two fuzzy relations. 81. In[3]:= Rel2 = We can view the two fuzzy relations we created using one of the Fuzzy Logic package's plotting functions.7 Compositions 7. In this chapter. Here we use the FuzzySurfacePlot function to look at the fuzzy relations. 5. In[1]:= << FuzzyLogic` 7. 3.

1 0.5 0.25 0 0 1 2 3 3 4 V 5 2 6 7 8 1 7 6 5 4 W In[5]:= FuzzySurfacePlot@Rel2D. Other types available are MaxProduct and MaxStar[func].5 0. There is a Type option with this function that defaults to a MaxMin composition. .25 0 1 2 4 3 4 V 5 3 6 7 2 8 7 6 5 W Composition@A. BD return a fuzzy relation that is the result of performing a composition between fuzzy relations A and B Function Composition. which allows you to define your own function for combining the relations.75 Grade 0. 1 0. opts] returns a fuzzy relation that is the result of performing a composition between fuzzy relations A and B. B.75 Grade 0. Composition[A.74 Fuzzy Logic In[4]:= FuzzySurfacePlot@Rel1D.

and MaxStar Option for fuzzy set Composition. MaxProduct. The MaxMin composition performs an operation similar to matrix multiplication. Let's see how this function performs. the membership grades are combined by finding the maximum of the minimums of the corresponding membership grades in the rows of the first fuzzy relation and the columns of the second fuzzy relation.25 0 0 1 2 4 3 4 V 5 3 6 7 8 2 8 7 6 5 W In the MaxProduct composition. 1 0. In the MaxMin composition. Rel2D. In[7]:= FuzzySurfacePlot@Com11D.Chapter 7: Compositions 75 option name default value Type MaxMin an option for fuzzy Composition with admissible values MaxMin. In[6]:= Com11 = Composition@Rel1.5 0. Let's see how this function behaves. . The membership grades of the new fuzzy relation created by this operation are found by combining the membership grades from each row of the first fuzzy relation with the membership grades of each column of the second fuzzy relation. the membership grades are found by taking the maximum of the products of corresponding membership grades in the rows of the first fuzzy relation and the columns of the second fuzzy relation.75 Grade 0.

76

Fuzzy Logic

In[8]:= Com22 = Composition@Rel1, Rel2, Type → MaxProductD; In[9]:= FuzzySurfacePlot@Com22D;

1 0.75 Grade 0.5 0.25 0 0 1 2 4 3 4 V 5 3 6 7 8 2 6 5 W 8 7

For the MaxStar composition, the membership grades are found by taking the maximum of the result of applying a user-defined function to corresponding membership grades in the rows of the first fuzzy relation and the columns of the second fuzzy relation. Let's see how to use this function. First we create a function of our own for combining membership grades. We create a function that combines membership grades by taking half of the Min of the membership grades.

In[10]:= MyFun@x__D := """""""""""""""" " "

Min@xD 2

Now we call the Composition function with Type set to MaxStar with our function, MyFun, as a parameter.

Chapter 7: Compositions

77

In[11]:= Com33 = Composition@Rel1, Rel2, Type → MaxStar@MyFunDD; In[12]:= FuzzySurfacePlot@Com33D;

1 0.75 Grade 0.5 0.25 0 0 1 2 4 3 4 V 5 3 6 7 8 2 6 5 W 8 7

8 Fuzzy Inferencing

8.1 Introduction

Fuzzy Logic package provides three different functions for performing fuzzy inferencing. The inferencing functions are a little more involved than the other functions in this package, and consequently they need a little more setup. In this chapter, we demonstrate how to set up and use the inferencing functions. This loads the package.

In[1]:= << FuzzyLogic`

8.2 Inference Functions

CompositionBasedInference@A, BD return a fuzzy set that is the result of performing a maxmin composition between a fuzzy set A and a fuzzy relation B RuleBasedInference@8A1, ... , An<, 8B1, ... , Bm<, 8C1, ... , Ck<, 88Ax, Bx, Cx<, ... <, a, bD return a fuzzy set that is the result of performing rule based inference for two-inputêsingle-output systems, where 8A1, ... , An< and 8B1, ... , Bm< represent linguistic input variables, 8C1, ... ,Ck< is the linguistic output variable, rules are given in a list of triples like 8Ax, Bx, Cx<, and the crisp values for the inputs are a and b

80

Fuzzy Logic

Functions for fuzzy inferencing.

RuleBasedInference@ 88A1, ... , An<,... ,8S1, ... , Sp<<, 8Y1, ... ,Yk<, 8Ax, ... , Sx, Yx<, 8a, ... , s<D return a fuzzy set that is the result of performing rule based inference for multiple-inputêsingle-output systems, where 88A1, ... , An<, ... , 8S1, ... , Sp<< represent linguistic input variables,8Y1, ... ,Yk< is the linguistic output variable, rules are given in a list like 8Ax, ... , Sx, Yx< and the crisp values for the inputs are given in a list 8a, ... ,s<

option name default value

Type

Mamdani

set the type of rule based fuzzy inference; the admissible values are Mamdani, Model, and Scaled

Option for RuleBasedInference.

**8.3 Composition-Based Inference
**

The CompositionBasedInference function works for single-input/single-output systems. To use the CompositionBasedInference function, a fuzzy relation must be created which models a system's input-output response. The fuzzy inference function then takes a fuzzy set as input and performs a composition to arrive at the output. What follows is a description of what is needed to perform a Composition! BasedInference and a demonstration of the inferencing operation.

Defining Inputs

To create the fuzzy relation needed to perform a CompositionBasedInference, we first need to define our collection of input fuzzy sets. Each fuzzy set used to define the collection of input fuzzy sets can be created individually using one of the techniques discussed in the Chapter 1 Creating Fuzzy Sets, or the entire collection of fuzzy sets can be created all at once using the CreateFuzzySets function as shown here. We look at our input fuzzy sets with the FuzzyPlot function.

In[2]:= INPUT = 8NegBig, NegSmall, Zero, PosSmall, PosBig< =

CreateFuzzySets@5, UniversalSpace → 80, 10<D;

In[4]:= OUTPUT = 8NBO. PBO< = CreateFuzzySets@5D. we must create a set of output fuzzy sets. Defining Outputs With the input membership functions defined.2 U 1 3 5 7 9 11 13 15 17 19 21 . we have created five fuzzy sets which are named NegBig.Chapter 8: Fuzzy Inferencing 81 In[3]:= FuzzyPlot@INPUT.8 0.6 0. and PosBig.4 0. Notice that these fuzzy sets are labeled with linguistic terms that describe the input's universal space. ZO. PSO. NegSmall.6 0. We again use the CreateFuzzySets function for convenience. NSO. PosSmall. Membership Grade 1 0. Zero. In[5]:= FuzzyPlot@OUTPUT.2 U 0 1 2 3 4 5 6 7 8 9 10 11 In this example.8 0. PlotJoined → TrueD. PlotJoined → TrueD. Membership Grade 1 0.4 0.

we call the BuildModel function with a set of rules. there can be a rule corresponding to each input membership function. 8PosBig. 8NegSmall. PBO}. 8PosSmall. NBO<<. NSO<. PBO<.82 Fuzzy Logic Defining Rules The final item we need. Building the Model To create the fuzzy relation that will serve as our fuzzy model. This function works by applying the SetsToRelation function to each of the rule pairs and performing a union with the resulting fuzzy relations to form one universal relation describing the set of rules. In[6]:= TheRules = The rules shown above constitute an if-then pair. In[7]:= FuzzyGraph@TheRulesD. {NegBig. 20 17. to create the fuzzy relation that will define our system model. and the output response is the second element. For example.5 15 12. where the input condition is the first element of the pair.5 10 7. Let's create a fuzzy model to represent our system. We can view the fuzzy model we created with the FuzzySurfacePlot function. the first rule. 8Zero. The BuildModel function creates a fuzzy relation that can serve as a system model. These rules are formed as a list of if-then pairs. Here is an example of a set of rules for the input and output we defined above. PSO<. ZO<. . In general.5 5 2. would be translated as follows: if the input is NegBig (Negative Big). then the output should be PBO (Positive Big). but there should not be more than one rule for any one input condition.5 2 4 6 8 10 88NegBig. is a set of rules relating the input conditions to the output responses.

5. UniversalSpace → 80.75 Grade 0. 1<D Now we can use the CompositionBasedInference function to evaluate the model response to the input. 10<D Out[10]= FuzzySet@885. The output fuzzy set that can be defuzzified using either the CenterOfArea or MeanOfMax function. B] returns a fuzzy set that is the result of performing a MaxMin composition-based inference. Here we use the MeanOfMax defuzzification to find a crisp output for our inferencing operation. CompositionBasedInference[A.5 0. In[10]:= MyModelInp = FuzzyTrapezoid@5. 5. In[9]:= FuzzySurfacePlot@FuzzyModelD. 10. 1<<. The universal space of our input fuzzy set must be equal to the universal space of the input used to build the model. where A is the input fuzzy set. Here we create a fuzzy set that will serve as input to the inferencing function. Inferencing To perform a fuzzy inference using the model just created. 5.25 0 0 2 4 V 5 6 8 10 0 20 15 10 W Note that the input and output fuzzy sets to which the rules refer must have been created prior to using the BuildModel function. and B is the model fuzzy relation.Chapter 8: Fuzzy Inferencing 83 In[8]:= FuzzyModel = BuildModel@TheRulesD. we need to provide a fuzzy set input. 1 0. UniversalSpace → 80. .

4 Rule-Based Inference The RuleBasedInference functions work with two-input/one-output systems and with multipleinput/one-output systems.5 Membership Grade 1 0. Mean of max is 7. Unlike the CompositionBasedInference. The following is a description of what is needed to perform a RuleBasedInfer! ence and a demonstration of the inferencing operation using a two-input/one-output system.4 0. and we use the FuzzyPlot function to look at the fuzzy sets. we receive an output response of 7. the first thing we need to do to perform a RuleBasedInfer! ence is define our input fuzzy sets.8 0. we see that for an input fuzzy set centered around 5. ShowGraph −> TrueD. We again use the CreateFuzzySets function to define our input fuzzy sets.2 U 1 3 5 7 9 11 13 15 17 19 21 For this example. Defining Inputs As with the CompositionBasedInference.5. we need to create two sets of input fuzzy sets.6 0. . 8. FuzzyModelD.84 Fuzzy Logic In[11]:= MeanOfMax@CompositionBasedInference@MyModelInp.

Membership Grade 1 0. LU. UniversalSpace → 8−90. LC. CE.4 0.6 0.6 0. UniversalSpace → 80. LV. LB< = CreateFuzzySets@7. Notice how we divided our two inputs into different numbers of membership functions. . RV. PlotJoined → TrueD.Chapter 8: Fuzzy Inferencing 85 In[12]:= FirstInput = 8LE.8 0. PlotJoined → TrueD. RU. Membership Grade 1 0. 270<D. RI< = CreateFuzzySets@5.4 0.2 U -50 0 50 100 150 200 250 8RB. It is important that all of the input and output membership functions have distinct names for the inferencing to work correctly. Notice also that the names of the membership functions are different. 100<D.2 U 0 20 40 60 80 100 In[14]:= SecondInput = In[15]:= FuzzyPlot@SecondInput. The choice for the number of membership functions used to define an input is entirely up to the designer. RC. In[13]:= FuzzyPlot@FirstInput.8 0. VE.

86

Fuzzy Logic

Defining Outputs

Again we need to define a collection of output fuzzy sets. We define these just as we did the input, making sure that we use distinct names for the individual fuzzy sets.

In[16]:= TheOutput =

In[17]:= FuzzyPlot@TheOutput, PlotJoined → TrueD; Membership Grade 1 0.8 0.6 0.4 0.2

8NB, NM, NS, ZE, PS, PM, PB< = CreateFuzzySets@7, UniversalSpace → 8−30, 30<D;

U -30 -20 -10 0 10 20 30

Defining Rules

The final piece needed to perform a RuleBasedInference is a list of rules. The RuleBasedInference function expects the rules to be a list of triplets. The first two items in the triplet correspond to the input conditions, and the third item corresponds to the output. Here is an example.

In[18]:= ControlRules = 88LE, RB, PS<, 8LC, RB, PM<, 8CE, RB, PM<, 8RC, RB, PB<, 8RI, RB, PB<,

The list of rules we just created can again be interpreted as an if-then statement. For example, the first rule, {LE, RB, PS}, could be interpreted in the following manner: if the FirstInput is LE and the SecondInput is RB, then TheOutput response should be PS. The order of the inputs should be the same throughout the list because the order does matter when performing the fuzzy inference.

8LE, 8LC, 8CE, 8RC, 8RI,

RU, RV, VE, LV, LU,

NS<, NS<, ZE<, PS<, PS<,

8LC, 8CE, 8RC, 8RI, 8LE,

RU, RV, VE, LV, LB,

PS<, PS<, PM<, PM<, NB<,

8CE, 8RC, 8RI, 8LE, 8LC,

RU, RV, VE, LU, LB,

PM<, PM<, PM<, NB<, NB<,

8RC, 8RI, 8LE, 8LC, 8CE,

RU, RV, LV, LU, LB,

PB<, PB<, NB<, NB<, NM<,

8RI, 8LE, 8LC, 8CE, 8RC,

RU, VE, LV, LU, LB,

PB<, NM<, NM<, NM<, NM<,

8LE, 8LC, 8CE, 8RC, 8RI,

RV, VE, LV, LU, LB,

NM<, NM<, NS<, NS<, NS<<;

Chapter 8: Fuzzy Inferencing

87

Inferencing

RuleBasedInference[{A1, ... , An}, {B1, ... ,Bn}, {C1, ... ,Cn}, {{Ai, Bj, Ck}, ...}, a, b] returns a fuzzy set that is the result of performing a rule based inference Mamdani (MaxMin) type, where {A1, ... , An} and {B1, ... , Bn} represent the collections of two input membership functions; {C1, ... , Cn} represent the collection of output membership functions; the {Ai, Bj, Ck} triplets represent rules relating the two inputs to the one output; and a and b represent the crisp inputs. Here we use the CenterOfArea defuzzification to come up with a crisp output. Crisp inputs of 70 and 210 give a crisp output of -12.4138.

In[19]:= CenterOfArea@RuleBasedInference@FirstInput,

**SecondInput, TheOutput, ControlRules, 70, 210D, ShowGraph −> TrueD; Center of area is −12.4138.
**

Membership Grade 1 0.8 0.6 0.4 0.2 U -30 -20 -10 0 10 20 30

The RuleBasedInference example shown in this section contains the specifications for a fuzzy logic controller, which can be used to back a truck up to a loading dock. To see a complete simulation of the truck-backer example, see the FuzzyControl notebook. The scaled inference is like the Mamdani except instead of clipping the output membership functions, the output membership functions are scaled to have a height equivalent to the input fuzzification value. Here is an example.

88

Fuzzy Logic

In[20]:= CenterOfArea@RuleBasedInference@8FirstInput, SecondInput<,

**Center of area is −11.6522.
**

Membership Grade 1 0.8 0.6 0.4 0.2

TheOutput, ControlRules, 870, 210<, Type −> ScaledD, ShowGraph −> TrueD;

U -30 -20 -10 0 10 20 30

The Model inference, instead of clipping the output membership functions, raises the membership function values to 1 for all elements of the output membership function greater than the input fuzzification value. Also, instead of Max-Union the Min-Intersection is taken for all of the output membership functions. Here is an example.

In[21]:= CenterOfArea@RuleBasedInference@8FirstInput, SecondInput<,

**Center of area is −14.1282.
**

Membership Grade 1 0.8 0.6 0.4 0.2

TheOutput, ControlRules, 870, 210<, Type → GoedelD, ShowGraph −> TrueD;

U -30 -20 -10 0 10 20 30

9 Fuzzy Arithmetic

9.1 Introduction

Fuzzy Logic package provides a number of functions for performing fuzzy arithmetic. In this chapter, we will demonstrate these functions and the options associated with each function. This loads the package.

In[1]:= << FuzzyLogic`

The arithmetic operations described in this chapter are designed to work with triangular or trapezoidal fuzzy numbers. The arithmetic functions are a little different than the rest of the Fuzzy Logic package's functions in that they operate on lists of numbers that represent vertices of fuzzy sets, rather than fuzzy sets themselves. This makes working with these operations a little awkward, but we show a convenient way to work with these functions in this section. For fuzzy arithmetic operations that work on actual fuzzy sets, see Chapter 10 Discrete Fuzzy Arithmetic. First we need to set up an appropriate universal space. Since we are working with fuzzy numbers, and since they can be positive or negative, our universal space should be semiotic around zero. The universal space should also be big enough so that the results of the arithmetic operations will still fall within the universal space. We change the default setting for universal space using the SetOptions command.

In[2]:= SetOptions@FuzzySet, UniversalSpace → 8−30, 30<D; In[3]:= num1 := 8−2, 3, 3, 8<

Now that the universal space is defined, we need some fuzzy numbers. As mentioned earlier, these operations work on lists of vertices, so we create two lists now, which represent two triangular fuzzy numbers.

In[4]:= num2 := 87, 10, 10, 13<

We can convert the list of vertices, num1 and num2, into actual fuzzy sets using the FuzzyTrapezoid function. You can look at the results with the FuzzyPlot function.

In[5]:= A1 = FuzzyTrapezoid@num1D;

90

Fuzzy Logic

In[6]:= A2 = FuzzyTrapezoid@num2D; In[7]:= FuzzyPlot@A1, A2, PlotJoined → TrueD; Membership Grade 1 0.8 0.6 0.4 0.2 U -30 -20 -10 0 10 20 30

**9.2 Fuzzy Arithmetic Functions
**

FuzzyPlus@8a1, b1, c1, d1<, 8a2, b2, c2, d2<D

FuzzyMinus@8a1, b1, c1, d1<, 8a2, b2, c2, d2<D return the fuzzy difference between the two fuzzy numbers represented by the two lists FuzzyConstantTimes@8a, b, c, d<, kD return the fuzzy number that is the result of the multiplication of constant k by the fuzzy number represented by the list 8a, b, c, d< FuzzyImage@8a, b, c, d<D return the image of the fuzzy number represented by the list 8a, b, c, d<

return the sum of the fuzzy numbers represented by the two lists

c2. b1. 8a2. b1. d1<. use the ReleaseHold function. In[8]:= Sum1 = FuzzyPlus@num1. c1. b2. c1. d1}. you must use Mathematica's ReleaseHold function. 21. To evaluate the FuzzyTrapezoid. b2. c1. c1. d2<D return the division of the fuzzy numbers represented by the two lists Fuzzy arithmetic operations. {a2. In[9]:= FuzzyPlot@A1. Fuzzy Addition FuzzyPlus[{a1.8 0. d2<D return the product of the fuzzy numbers represented by the two lists FuzzyDivide@8a1. 8a2. UniversalSpace → 8−30.6 0. num2D Out[8]= FuzzyTrapezoid@5. d1}. A2. The fuzzy sum is returned as an unevaluated FuzzyTrapezoid. Membership Grade 1 0. b1. . d1<. 13. 13. use ReleaseHold. {a2.Chapter 9: Fuzzy Arithmetic 91 FuzzyMultiply@8a1. d2}] returns the fuzzy difference between the two fuzzy numbers represented by the two lists. 1<D The result of the fuzzy addition of the two fuzzy numbers is an unevaluated fuzzy trapezoid.2 U -30 -20 -10 0 10 20 30 Fuzzy Subtraction FuzzyMinus[{a1. b2. 30. b1. To evaluate the FuzzyTrapezoid. c2. To evaluate the result as a normal fuzzy set. Below we plot our two original fuzzy sets with their sum. Notice the use of the ReleaseHold function. ReleaseHold@Sum1D. d2}] returns the sum of the fuzzy numbers represented by the two lists.4 0. b2. The fuzzy difference is returned as an unevaluated FuzzyTrapezoid. PlotJoined → TrueD. c2. c2.

UniversalSpace → 8−30. ReleaseHold@Prod1D. UniversalSpace → 8−30. Membership Grade 1 0. To evaluate the FuzzyTrapezoid. num2D Out[10]= FuzzyTrapezoid@−15.2 U -30 -20 -10 0 10 20 30 . PlotJoined → TrueD. b.6 0. The result is returned as an unevaluated FuzzyTrapezoid.92 Fuzzy Logic In[10]:= Diff1 = FuzzyMinus@num1. d}. −9. −3D Out[12]= FuzzyTrapezoid@−24. ReleaseHold@Diff1D. use ReleaseHold. −9. 30.8 0. 1. d}.6 0.4 0.8 0. 30. k] returns the fuzzy number that is the result of the multiplication of constant k by the fuzzy number represented by the list. 1<D In[11]:= FuzzyPlot@A1. c. −7. 6. Membership Grade 1 0. 1<D In[13]:= FuzzyPlot@A1. b. {a. A2. Multiplication by a Constant FuzzyConstantTimes[{a. −7. c. Here we plot the original fuzzy sets with their fuzzy difference.4 0. In[12]:= Prod1 = FuzzyConstantTimes@num1.2 U -30 -20 -10 0 10 20 30 The fuzzy difference between the two fuzzy numbers is returned in the same form as the fuzzy sum. PlotJoined → TrueD.

{a2.2 U -30 -20 -10 0 10 20 30 The image of a fuzzy set is a new fuzzy set that is a mirror image of the first one flipped around zero. d}. To evaluate the result as a normal fuzzy set. 3<. ReleaseHold@Im1D. 2.8 0. 2. In[14]:= Im1 = FuzzyImage@num1D Out[14]= FuzzyTrapezoid@−8. 4<. use the ReleaseHold function. Fuzzy Multiplication FuzzyMultiply[{a1. UniversalSpace → 8−40. d1}. 15. 4. c. d}] returns the image of the fuzzy number represented by the list {a. To evaluate the Fuzzy# Trapezoid. d2}] returns the product of the fuzzy numbers represented by the two lists. . 2. c2. use ReleaseHold. 2. b1. we must use the ReleaseHold function. 2. Membership Grade 1 0. In[16]:= Multi1 = FuzzyMultiply@8−9.6 0. b. UniversalSpace → 8−30. 1<D Out[16]= FuzzyTrapezoid@−36.Chapter 9: Fuzzy Arithmetic 93 Fuzzy Image FuzzyImage[{a. Next we plot the approximate result of the fuzzy product. 1<D The result of the fuzzy multiplication of the two fuzzy numbers is an unevaluated fuzzy trapezoid. b. 81. 4. 12. PlotJoined → TrueD. UniversalSpace −> 8−40. 30. −3. c1. 15. b2. To evaluate the FuzzyTrapezoid.4 0. 1<D In[15]:= FuzzyPlot@A1. −3. The fuzzy product is returned as an unevaluated FuzzyTrapezoid. Here is a plot of our first fuzzy set and its image. The result is returned as an unevaluated FuzzyTrapezoid. c.

2. d2}] returns the division of the fuzzy numbers represented by the two lists.4 0. 10.6 0. 3. b2.4 0. To evaluate the FuzzyTrape# zoid. 2. use the ReleaseHold function. c2. d1}. 1. To evaluate the result as a normal fuzzy set. 4<. UniversalSpace −> 8−10. 1.2 U -9 -7 -5 -3 -1 1 3 5 7 9 11 . 1<D The result of the fuzzy division of the two fuzzy numbers is an unevaluated fuzzy trapezoid. UniversalSpace → 8−10. 2.94 Fuzzy Logic In[17]:= FuzzyPlot@ReleaseHold@Multi1DD. b1. In[18]:= Div1 = FuzzyDivide@8−9.8 0. {a2.2 U -40 -30 -20 -10 0 10 Fuzzy Division FuzzyDivide[{a1. Membership Grade 1 0. Next we plot the approximate result of the fuzzy division. we must use the ReleaseHold function.6 0. 3<. The fuzzy division is returned as an unevaluated FuzzyTrapezoid. 81. 2. 10<D Out[18]= FuzzyTrapezoid@−9. c1. Membership Grade 1 0.8 0. In[19]:= FuzzyPlot@ReleaseHold@Div1DD.

This is because fuzzy arithmetic operations often involve working with the image of the fuzzy set. see the Chapter 1 Creating Fuzzy Sets. In this chapter. A general rule for setting the universal space is to find the smallest universal space that is still big enough to represent all possible results. For more information on creating fuzzy sets. which are well-defined in real space. By choosing a large universal space. and the graphs may be difficult to read. we must create some fuzzy sets. we examine a couple of arithmetic operations. Another consideration is that the result of an arithmetic operation should be contained in the same universal space as the numbers used in the calculation. These two types of fuzzy sets are both commonly used to represent fuzzy numbers. but the calculations can take longer. and compare the discrete results with the real space results. you can ensure that the results will fall in the universal space. We will do this later. This enables us to perform some quick. .1 Introduction Fuzzy Logic package provides a number of functions for performing fuzzy arithmetic. all of the fuzzy sets are defined in the discrete space. In[2]:= SetOptions@FuzzySet. In[1]:= << FuzzyLogic` In this package. The first two fuzzy sets we create are triangular fuzzy sets and the second two are Gaussian fuzzy sets. but first let's extend the default universal space. a fuzzy set flipped around zero. When working with the fuzzy arithmetic operations in this package. discrete fuzzy arithmetic operations on fuzzy sets. The universal space should range from a negative value to the corresponding positive value. Now we create some fuzzy sets. it is important to choose a proper universal space. In this chapter.10 Discrete Fuzzy Arithmetic 10. we will demonstrate these functions and the options associated with each function. This loads the package. To begin. so we have more room to work. 40<D. UniversalSpace → 8−40.

In[7]:= FuzzyPlot@TriFS1.6 0.6 0.96 Fuzzy Logic In[3]:= TriFS1 = FuzzyTrapezoid@1.8 0.4 0.01D. ChopValue −> 0.2 U -40 -20 0 20 40 In[8]:= FuzzyPlot@GausFS3. In[6]:= GausFS4 = FuzzyGaussian@9. 5. GausFS4.2 U -40 -20 0 20 40 .4 0. 5. In[5]:= GausFS3 = FuzzyGaussian@5. 3. We use the FuzzyPlot function to see what our initial fuzzy sets look like.01D. Membership Grade 1 0.8 0. TriFS2. 10. Membership Grade 1 0. ChopValue −> 0. PlotJoined → TrueD. 5. 16D. 9D. 10. PlotJoined → TrueD. In[4]:= TriFS2 = FuzzyTrapezoid@4.

As mentioned earlier. BD return a fuzzy set that is the result of applying fuzzy subtraction to fuzzy set A and B DiscreteFuzzyMultiply@A. BD DiscreteFuzzyMinus@A. Triangular fuzzy numbers are convenient to work with because in real space. BD return a fuzzy set that is the result of performing a discrete fuzzy multiplication of fuzzy sets A and B DiscreteFuzzyImage@AD MAX@A. Similar simple formulas can be used to subtract or find the image of triangular fuzzy numbers. . Because of these properties. BD MIN@A. adding two triangular fuzzy numbers involves adding the corresponding vertices used to define the triangular fuzzy numbers. triangular fuzzy sets are common representations of fuzzy numbers. BD return a fuzzy set that is the image of fuzzy set A return the MAX operation of the fuzzy numbers A and B return the MIN operation of the fuzzy numbers A and B return a fuzzy set that is the result of applying fuzzy addition to fuzzy sets A and B Discrete arithmetic functions for triangular fuzzy numbers.2 Discrete Arithmetic on Triangular Fuzzy Numbers DiscreteFuzzyPlus@A.Chapter 10: Discrete Fuzzy Arithmetic 97 10. we demonstrate the discrete arithmetic operations with triangular fuzzy numbers and compare the results with the expected results if the fuzzy sets were defined in real space.

In[13]:= FuzzyPlot@Sum1. To evaluate the results of the discrete fuzzy addition. we plot the expected real space result with our discrete result. In[9]:= Sum1 = DiscreteFuzzyPlus@TriFS1. 5 + 10. PlotJoined → TrueD.8 0. 15. B] returns a fuzzy set that is the result of applying fuzzy addition to fuzzy sets A and B. Membership Grade 1 0.2 U -40 -20 0 20 40 Based on earlier discussion. Membership Grade 1 0. 15. We add our first two fuzzy sets and plot the results. In[10]:= Sum111 = TriFS1∼ FP ∼ TriFS2. TriFS2. ExpectedSum. In[12]:= ExpectedSum = FuzzyTrapezoid@5. the sum of the two triangular fuzzy sets in real space should be a triangular fuzzy set with vertices at {1 + 4. 5 + 10.6 0. TriFS2D.6 0. 15.98 Fuzzy Logic Fuzzy Addition DiscreteFuzzyPlus[A.4 0. 9 + 16} or {5.4 0. In[11]:= FuzzyPlot@TriFS1.2 U -40 -20 0 20 40 . 15. 25}. 25D. Sum1D.8 0.

To evaluate the results of the discrete fuzzy subtraction. 5 . Membership Grade 1 0. Fuzzy Subtraction DiscreteFuzzyMinus[A.2 U -40 -20 0 20 40 . 9 . TriFS2. −5. Membership Grade 1 0.6 0. This is the case for all of the discrete fuzzy arithmetic operations. ExpectedDiff. TriFS2D. B] returns a fuzzy set that is the result of applying fuzzy subtraction to fuzzy set A and B.16.10.8 0. In[14]:= Diff1 = DiscreteFuzzyMinus@TriFS1. We will subtract our first fuzzy set from the second one and plot the results.4 0.10. we plot this expected result with the discrete result.6 0.Chapter 10: Discrete Fuzzy Arithmetic 99 From the graph we see that the discrete fuzzy sum. -5.4 0. 5D.4} or {-15. Diff1D. is bounded above by the expected fuzzy set for real space. In[16]:= ExpectedDiff = FuzzyTrapezoid@−15.2 U -40 -20 0 20 40 In real space the difference between the two triangular fuzzy sets would be a triangular fuzzy set with vertices at {1 . 5}. PlotJoined → TrueD. In[17]:= FuzzyPlot@Diff1. In[15]:= FuzzyPlot@TriFS1. 5 . -5. −5.8 0.

2 U -40 -20 0 20 40 In[21]:= FuzzyPlot@Prod1D.8 0. B] returns a fuzzy set that is the result of performing a discrete fuzzy multiplication of fuzzy sets A and B. In[20]:= FuzzyPlot@TriFS1.8 0.2 U -40 -20 0 20 40 . TriFS3D.6 0. In[19]:= Prod1 = DiscreteFuzzyMultiply@TriFS1. TriFS3D. we use a smaller fuzzy number. 5D.4 0. 3. TriFS3. Membership Grade 1 0. In[18]:= TriFS3 = FuzzyTrapezoid@1.100 Fuzzy Logic Fuzzy Multiplication DiscreteFuzzyMultiply[A.4 0. Since fuzzy multiplication causes a fuzzy number to be quite spread out. 3. Membership Grade 1 0. to demonstrate the fuzzy multiplication.6 0.

Membership Grade 1 0. In[25]:= fs2 = FuzzyTrapezoid@0. In[22]:= Im1 = DiscreteFuzzyImage@TriFS1D. the fuzzy set to the right is our original fuzzy set. 2. UniversalSpace → 8−3. . 6. 4. 6. the image of a fuzzy set will look the same as it would in real space. 1. we may extend the lattice operations min and max on real numbers to corresponding operations on fuzzy numbers. B) = A or.4 0.2 U -40 -20 0 20 40 In the graph. . MIN and MAX. MAX and MIN Functions To introduce a meaningful ordering of fuzzy numbers. In[24]:= fs1 = FuzzyTrapezoid@−2. Im1D. and the fuzzy set to the left is the image of the original fuzzy set. 1. In the discrete case. B] returns the fuzzy maximum of the fuzzy numbers A and B. 2. 4.Chapter 10: Discrete Fuzzy Arithmetic 101 Fuzzy Image DiscreteFuzzyImage[A] returns a fuzzy set that is the image of fuzzy set A. B) = B. UniversalSpace → 8−3.8 0.6 0. A partial ordering for comparable fuzzy numbers is defined as A ! B iff MIN(A.5<D. MAX[A. We will find the image of our first fuzzy set and plot the results here. .5<D. alternatively A ! B iff MAX( A. In[23]:= FuzzyPlot@TriFS1.

fs2D. Membership Grade 1 0. Membership Grade 1 0. fs2D Out[29]= True MIN[A. .2 U -3 -2 -1 0 1 2 3 4 5 6 7 In[27]:= mx1 = MAX@fs1. In[30]:= mn1 = MIN@fs1. fs2. PlotJoined → TrueD.4 0.8 0. B] returns the fuzzy minimum of the fuzzy numbers A and B. fs2D.4 0. In[28]:= FuzzyPlot@mx1.102 Fuzzy Logic In[26]:= FuzzyPlot@fs1.2 U -3 -2 -1 0 1 2 3 4 5 6 7 In[29]:= Equality@mx1.6 0. PlotJoined → TrueD.8 0.6 0.

. To subtract two Gaussian fuzzy numbers. Because of these properties. respectively.4 0.2 U -3 -2 -1 0 1 2 3 4 5 6 7 In[32]:= Equality@mn1. PlotJoined → TrueD. 10. subtract the means and add the standard deviations.Chapter 10: Discrete Fuzzy Arithmetic 103 In[31]:= FuzzyPlot@mn1. which denote the operations of minimum and maximum on real numbers. adding two Gaussian fuzzy numbers involves adding the means and standard deviations used to define the original Gaussian fuzzy numbers. Membership Grade 1 0. which denote the introduced operations on fuzzy numbers.3 Discrete Arithmetic on Gaussian Fuzzy Numbers Using Gaussian fuzzy sets is another common way to represent fuzzy numbers. Note that the symbols MIN and MAX. we further demonstrate the discrete arithmetic operations using Gaussian fuzzy numbers. fs1D Out[32]= True In our example fs1 Ä fs2.8 0.6 0. Gaussian fuzzy numbers are convenient to work with because in real space. must be distinguished from the symbols min and max.

. BD DiscreteFuzzyMinus@A.2 U -40 -20 0 20 40 Notice that when two Gaussian fuzzy numbers are added. and we plot the results. In our example. Fuzzy Addition We start by adding the two Gaussian fuzzy numbers created earlier.8 0. As discussed above.4 0. GausFS4D. the result is a Gaussian fuzzy set with mean and standard deviation equal to the sum of the means and standard deviations of the original fuzzy sets. BD return a fuzzy set that is the result of performing a discrete fuzzy multiplication of fuzzy sets A and B DiscreteFuzzyImage@AD return a fuzzy set that is the image of fuzzy set A Discrete arithmetic functions for Gaussian fuzzy numbers. BD return a fuzzy set that is the result of applying fuzzy addition to fuzzy sets A and B return a fuzzy set that is the result of applying fuzzy subtraction to fuzzy set A and B DiscreteFuzzyMultiply@A. we expect to get a result with mean of 5 + 9 = 14 and a standard deviation of 3 + 5 = 8.104 Fuzzy Logic DiscreteFuzzyPlus@A. In[33]:= Sum2 = DiscreteFuzzyPlus@GausFS3. Membership Grade 1 0. after adding two Gaussian fuzzy sets defined in real space. We can examine the results of our discrete fuzzy addition by plotting it with the expected results. In[34]:= FuzzyPlot@Sum2D.6 0. the universal space is doubled.

. Membership Grade 1 0. In[36]:= FuzzyPlot@Sum2. In[37]:= Diff2 = DiscreteFuzzyMinus@GausFS3.8 0.4 0. 8. 40<D. ExpectedSum2. This will be true for all fuzzy arithmetic operations. Fuzzy Subtraction Here we subtract the two Gaussian fuzzy numbers and plot the result.Chapter 10: Discrete Fuzzy Arithmetic 105 In[35]:= ExpectedSum2 = FuzzyGaussian@14.2 U -40 -20 0 20 40 The expected fuzzy difference for our example would be a Gaussian fuzzy set with a mean of 5 .8 0.01. PlotJoined → TrueD. Membership Grade 1 0. UniversalSpace −> 8−40. the discrete fuzzy sum is bounded above by the expected result in real space.9 = -4 and a standard deviation of 3 + 5 = 8. We plot the discrete result with this expected result below. GausFS4D. ChopValue −> 0. In[38]:= FuzzyPlot@Diff2D.2 U -40 -20 0 20 40 Again.6 0. as with triangular fuzzy numbers.6 0.4 0.

Im2D. and the calculations would take a long time. we will not demonstrate here the DiscreteFuzzyMultiply function on the Gaussian fuzzy sets. If we multiplied our two Gaussian fuzzy sets from this notebook. In[42]:= FuzzyPlot@GausFS4. In[41]:= Im2 = DiscreteFuzzyImage@GausFS4D.6 0.2 U -40 -20 0 20 40 The image is a fuzzy set that is the mirror image of the original fuzzy set. ExpectedDiff2.4 0. Membership Grade 1 0. ChopValue −> 0. Membership Grade 1 0.106 Fuzzy Logic In[39]:= ExpectedDiff2 = FuzzyGaussian@−4. 8. .8 0. the universal space would extend from -1600 to 1600.6 0.8 0.2 U -40 -20 0 20 40 Fuzzy Multiplication We can perform a discrete fuzzy multiplication with Gaussian fuzzy numbers. flipped about zero. but since Gaussian fuzzy sets are defined for every element in the universal space.4 0. In[40]:= FuzzyPlot@Diff2. the result would be defined on a large universal space. PlotJoined → TrueD. For this reason. Fuzzy Image Here we find the image of our last fuzzy set and we plot the results.01D.

Chapter 10: Discrete Fuzzy Arithmetic 107 You can use a built-in function SetOptions to restore the default setting for the FuzzySet object. 1<D Out[43]= 8UniversalSpace → 80. UniversalSpace → 80. 20. In[43]:= SetOptions@FuzzySet. 1<< . 20.

.

**11 Æukasiewicz Sets and Logic
**

11.1 Introduction

The goal of this notebook is to demonstrate how the Fuzzy Logic package can be used to perform Æukasiewicz logic. Æukasiewicz sets are very similar to fuzzy sets, but elements in Æukasiewicz sets take on one of n-values, where n is a natural number greater than or equal to 2. Æukasiewicz fuzzy sets are often referred to as Ln sets, where n represents the number of values allowed for membership grades. For performing three valued logic, you would be using L3 sets. In this notebook we will demonstrate the functions contained in the Fuzzy Logic package that deal with Æukasiewicz sets and n-valued logic. This loads the package.

In[1]:= << FuzzyLogic`

**11.2 Creating Æukasiewicz Sets
**

DigitalSet@a, b, c, d, h, Levels −> nD return a Æukasiewicz set with membership grades that linearly increase from zero to h in the range a to b, equals h in the range b to c, and linearly decrease from h to zero in the range c to d ToDigital@A, nD take a fuzzy set and an integer as input and returns a Æukasiewicz set using n-valued logic

Functions for creating Æukasiewicz sets.

DigitalSet[a, b, c, d, h, Levels -> n] returns a digital fuzzy set with the number of levels equal to n. The universal space and the value of n may be defined using the UniversalSpace and the n option, otherwise the default universal space and default n will be given. The values of the membership grades increase linearly from a to b, then are equal to the closest possible value of h from b to c, and linearly decrease from c to d. Arguments a, b, c, and d should be in increasing order, and h must be a value between 0

110

Fuzzy Logic

and 1, inclusive. If a value for h is not given, it defaults to 1. In the following example, we create a fuzzy set with defaults universal space and n. This means we will get a L3 fuzzy set or a digital fuzzy set with three possible membership grades.

In[2]:= L1 = DigitalSet@1, 8, 12, 17, UniversalSpace −> 80, 20, 1<D Out[2]= FuzzySetA993, """" =, 94, """" =, 95, """" =, 96, """" =, 87, 1<, 88, 1<, 89, 1<, 810, 1<,

In[3]:= FuzzyPlot@L1D; Membership Grade 1 0.8 0.6 0.4 0.2

1 1 811, 1<, 812, 1<, 813, 1<, 914, """" =, 915, """" ==, UniversalSpace → 80, 20, 1<E 2 2

1 2

1 2

1 2

1 2

U 1 3 5 7 9 11 13 15 17 19 21

We see from the plot that the fuzzy set above contains only three membership grades 0, 0.5, or 1. As another example, we can use the same specifications as the previous example, but this time let's set n to be 6.

In[4]:= L2 = DigitalSet@1, 17, 17, 19, Levels → 6D Out[4]= FuzzySetA993, """" =, 94, """" =, 95, """" =, 96, """" =, 97, """" =,

1 1 1 2 2 5 5 5 5 5 2 2 3 3 3 4 4 98, """" =, 99, """" =, 910, """" =, 911, """" =, 912, """" =, 913, """" =, 914, """" =, 5 5 5 5 5 5 5 4 2 915, """" =, 816, 1<, 817, 1<, 918, """" ==, UniversalSpace → 80, 20, 1<E 5 5

Chapter 11: Æukasiewicz Sets and Logic

111

In[5]:= FuzzyPlot@L2, Crisp −> TrueD; Membership Grade 1 0.8 0.6 0.4 0.2 U 1 3 5 7 9 11 13 15 17 19 21

This time we see that there are six membership grade levels. From this example, you can see that as n gets larger, the Æukasiewicz sets look more and more like typical fuzzy sets. As you might expect, as n goes to infinity, Æukasiewicz logic becomes fuzzy logic. ToDigitalSet[A, n] takes a fuzzy set and an integer as input, and it returns a Æukasiewicz set using n-valued logic. Let's look at an example.

In[6]:= FS1=FuzzyGaussian[5,3,ChopValue->0.01, UniversalSpace->{0,15,0.5}];

Here we create a digital fuzzy set with four membership level grades from a discrete fuzzy set and plot two sets together.

In[7]:= LS1=ToDigital[FS1,4]; In[8]:= FuzzyPlot[FS1,LS1,ShowDots->True]; Membership Grade 1 0.8 0.6 0.4 0.2 U 1 3 5 7 9 11 13 15

112

Fuzzy Logic

**11.3 Operations on Ln Sets
**

Union@A1, A2, ... , AnD Intersection@A1, A2, ... , AnD Implication@A, BD Complement@AD PrimitiveMatrix@n, opD return a Ln set that is the intersection of Ln sets A1, A2, ... , An return a Ln set that is the implication of Ln sets A and B return a Ln set that is the complement of Ln set A return a logic table that shows the results of the operation op for n valued logic sets return a Ln set that is the union of Ln sets A1, A2, ... , An

Operations on Ln sets.

Æukasiewicz logic is a form of n-valued logic. We demonstrate some of the logic operations using four valued logic in the following examples. Since the Ln set is created as a fuzzy set with n membership values, operations may be performed using the standard operations defined in the Fuzzy Logic manual. One additional function, which has been added to the package, is the implication function. Original Æukasiewicz Logic operations were all based on the operations of the negation and implication primitives. To demonstrate some of the operations, we start by creating two L4 sets.

In[9]:= Luk1 := DigitalSet@1, 5, 8, 13, Levels → 4D In[10]:= Luk2 := DigitalSet@2, 7, 15, 19, Levels → 4D In[11]:= FuzzyPlot@Luk1, Luk2, ShowDots −> TrueD; Membership Grade 1 0.8 0.6 0.4 0.2 U 1 3 5 7 9 11 13 15 17 19 21

We can now perform some of the various logic operations on our Æukasiewicz sets. The Union operation takes the max(a, b), where a and b are the membership grades of corresponding elements of two n-valued sets. The result will also be a n-valued set.

Chapter 11: Æukasiewicz Sets and Logic

113

In[12]:= Un1 := Union@Luk1, Luk2D In[13]:= FuzzyPlot@Un1D; Membership Grade 1 0.8 0.6 0.4 0.2 U 1 3 5 7 9 11 13 15 17 19 21

The Intersection operation takes the min(a, b), where a and b are the membership grades of corresponding elements of two n-valued sets. The result will also be a n-valued set.

In[14]:= Int1 := Intersection@Luk1, Luk2D In[15]:= FuzzyPlot@Int1D; Membership Grade 1 0.8 0.6 0.4 0.2 U 1 3 5 7 9 11 13 15 17 19 21

The Implication operation is defined as min(1, 1 + b - a), where a and b are the membership grades of corresponding elements of two n-valued sets.

In[16]:= Imp1 = Implication@Luk1, Luk2D Out[16]= FuzzySetA980, 1<, 81, 1<, 92, """" =, 93, """" =, 94, """" =, 95, """" =, 96, """" =,

2 2 2 2 2 3 3 3 3 3 87, 1<, 88, 1<, 89, 1<, 810, 1<, 811, 1<, 812, 1<, 813, 1<, 814, 1<, 815, 1<, 816, 1<, 817, 1<, 818, 1<, 819, 1<, 820, 1<=, UniversalSpace → 80, 20, 1<E

2 U 1 3 5 7 9 11 13 15 17 19 21 The Complement operation returns the complement of an n-valued set.6 0. op] returns a logic table that shows the results of the operation op for n-valued logic sets.8 0.114 Fuzzy Logic In[17]:= FuzzyPlot@Imp1D. Luk1D.8 0.2 U 1 3 5 7 9 11 13 15 17 19 21 PrimitiveMatrix[n.4 0.4 0. Membership Grade 1 0. which is also an n-valued set. In[18]:= Comp1 := Complement@Luk1D In[19]:= FuzzyPlot@Comp1.6 0. Membership Grade 1 0. .

Chapter 11: Æukasiewicz Sets and Logic 115 In[20]:= PrimitiveMatrix[3] Out[20]//DisplayForm= a 0 0 0 1 """ 2" 1 """ 2" 1 """ 2" b 0 1 """ 2" Implication Bicondition Intersection Union 1 1 0 0 1 1 1 """ 2" 1 """ 2" 0 0 0 1 """" 2 1 """" 2 1 """" 2 1 0 1 """ 2" 0 1 """ 2" 1 1 """" 2 1 """" 2 1 1 0 1 """ 2" 1 1 """ 2" 1 0 1 """ 2" 1 1 1 1 1 1 1 0 1 """ 2" 0 1 """" 2 1 1 1 1 .

.

the algorithm returns a list of c cluster centers V. This technique was originally introduced by Professor Jim Bezdek in 1981. This chapter demonstrates the fuzzy c-means clustering algorithm.. In[1]:= << FuzzyLogic` 12. data is divided into crisp clusters. This loads the package.12 Fuzzy Clustering 12. c and a partition matrix U such that . different types of similarity measures may be used to identify classes. where a large number of samples are converted into a small number of representative prototypes or clusters. . Clustering can also be thought of as a form of data compression. and intensity. the data points can belong to more than one cluster.2 Fuzzy C-Means Clustering (FCM) The FCM algorithm is one of the most widely used fuzzy clustering algorithms.. Given a finite set of data. In fuzzy clustering. connectivity.. 2. xn } into a collection of c fuzzy clusters with respect to some given criterion. .1 Introduction Clustering involves the task of dividing data points into homogeneous classes or clusters so that items in the same class are as similar as possible and items in different classes are as dissimilar as possible. In non-fuzzy or hard clustering. such that V = vi .. where each data point belongs to exactly one cluster. Depending on the data and the application. Some examples of values that can be used as similarity measures include distance. The FCM algorithm attempts to partition a finite collection of elements X={x1 . where the similarity measure controls how the clusters are formed. i =1. and associated with each of the points are membership grades which indicate the degree to which the data points belong to the different clusters. x2 . . .

The functions that implement this algorithm can be found in the Clustering. Also. We will demonstrate here how to set up and use the clustering functions... Step 2: Calculate the fuzzy cluster centers {vi l | i=1. resD display a 2 D plot showing a graph of a set of data points along with a plot of how the cluster centers migrated during the application of the FCMCluster function Function for cluster analysis. exponential weight m (1 < m < ¶). then stop. .. c}. If D § e.Ul || = maxi. and a list containing the progression of cluster centers found during the run InitializeU@data. . and the termination criterion e. which is implemented in Fuzzy Logic package. .. Step 3: Calculate the new partition matrix Ul+1 by using {vi l | i=1. If D > e. Step 1: Select the number of clusters c (2 § c § n).. epsilonD return a list of cluster centers. j =1.... 1] that tells the degree to which the element xj belongs to the i-th cluster. n where uij is a numerical value in [0.j |uij l+1 ..uij l |. 2. FCMCluster@data... mu. partmat. c} by using Ul ..118 Fuzzy Logic U = uij . c. The following is a linguistic description of the FCM algorithm. . Step 4: Calculate the new partition matrix D = ||Ul+1 . nD return a random initial partition matrix for use with the FCMCluster function where n is the number of cluster centers desired ShowCenters@graph. a partition matrix indicating the degree to which each data point belongs to a particular cluster center.. initial partition matrix U0 .m file. then set l = l + 1 and go to step 2. 2. i =1. resD display a 2 D plot showing a graph of a set of data points along with large dots indicating the cluster centers found by the FCMCluster function ShowCentersProgression@graph. set the iteration index l to 0.

20< + e1@@iDD. 19. 85. 85. 21.4497<. 810.0675<.9799<. 20} and the other is centered around {10. 0<. we will create a 2D data set that consists of two groups of data.4551<.0219<.9128<. 80. 19. 84. 810. each of has two features F1 and F2. 21. 84. 0<. 810. 19.3151<.6922.6238<. 89. 810. 85. 85. 18.2991<. 810. 17. 20.73233.1538.3109<. 19.9551. 20.8192<.77241.5085<. 88. 85. 21. 20. 89.61372. 20<DD Out[6]= 885.5<<D. 85.Chapter 12: Fuzzy Clustering 119 12.58993. 19. 85.5.7079. 89.00223. 811.4986. 19. 19. 84. 20}.9454<.85273.08281.4027. 20D. which we will use to test the FCM clustering algorithm. . 19. 810.35949.6404<. 85. 19.5939<. 20.76696.6019<. 20. 0<.6785<.8239<. 88. 810. 20. 19. 0<.0309<. 20.08249. 810. 811. 84.6845<. 21. 21. 84. 8i.3493<.3 Example To demonstrate the FCM clustering algorithm. 20.7178<. 85. Table@810.9573<. In[5]:= e2 = RandomArray@MultinormalDistribution@80. 20. 810. 19.1679<< .3346.37737. 20. 8i.2807<. In[4]:= e1 = RandomArray@MultinormalDistribution@80.9785.79065. 20D.54482.1996<. In[2]:= SeedRandom@1234D In[3]:= Needs@"Statistics`MultinormalDistribution`"D.9669<. 88. 20. Below are the functions used to create the data set of 40 points.7287<. 20.8628<.1309<.6882.92963.61325.3851<.074<. 86. 19.0859<. 84.4553<.3741.19668.4909<.0844.8826<. . 20.5<<D. 84. 810. 20.1744.76799. 89. 85.66351. 20< + e2@@iDD.7716<.3058.3215<. In[6]:= TrainData1 = Join@Table@85.48769.0519. 20<D.0233.5. 89.42941.9941. One group of data is centered around the point {5. The following is a plot of the data set. 19.2844<. 85.12723. 20.22536.66011. 20. 20. 80. 19.20106. 19. 21. 89. 810.4807<.

a partition matrix indicating the degree to which each data point belongs to a particular cluster center. 14<. We can use the FCMCluster function to find clusters in the data set created earlier.01. mu = 2. we will use the InitializeU function described below.5]. the function terminates. 2. FCMCluster[data. InitializeU[data. and a value which determines when the algorithm will terminate (epsilon). The following is an example using the FCMCluster function to find two cluster centers in the data set created earlier. 812. The parameter mu is called the exponential weight and controls the degree of fuzziness of the clusters. When this value is less than the parameter epsilon. and a list containing the progression of cluster centers found during the run.5. the clusters become completely fuzzy. In order to create the initial partition matrix that will be used by the FCMCluster function. "F2"<. and it appears that the best choice for mu is usually in the interval [1. The arguments to the function are the data set (data). which is the value specified for epsilon.120 Fuzzy Logic In[7]:= g1 = ListPlot@TrainData1. where the midpoint. This function runs recursively until the terminating criteria is met. a value determining the degree of fuzziness of the clustering (mu). epsilon] returns a list of cluster centers. partmat. PlotStyle −> 8AbsolutePointSize@2D<. While running. . As mu approaches 1. As mu approaches infinity. Notice that the function runs until the terminating criteria goes under 0. AspectRatio −> 1D. PlotRange −> 882. the fuzzy clusters become crisp clusters. where each data point belongs to only one cluster. Studies have been done on selecting the value for mu. and each point will belong to each cluster to the same degree (1/c) regardless of the data. where n is the number of cluster centers desired. is probably the most commonly used value for mu. an initial partition matrix (partmat). mu. the function prints a value that indicates the accuracy of the fuzzy clustering. F2 24 22 20 18 16 14 F1 4 6 8 10 12 14 AxesLabel −> 8"F1". 25<<. n] returns a random initial partition matrix for use with the FCMCluster function.

20. 0.63886.000313873.998528.47023.00656587. 0.2694<<. 0.0000440822. 0. 87. 0.0000434256. 0. 1.00135735.2151<.999757.2143<. 0. 20. ShowCenters[graph.000299415.998643.997024.2236<<.16427. 1. 2D. 20. 0.Chapter 12: Fuzzy Clustering 121 In[8]:= Res1a = FCMCluster@TrainData1.16335. 20. .0000647235. 0. 0.999787.0128432. 0. 0.000079949.89488. 0.000295259. 880. 20.000447395. 0. 85.999956.0604338. 0. 0.987157. 0. 0.0119194 Out[8]= 88810. 0.2151<. 0. 887.52867. 0. 0.2204. 0.999782. and they are described below. 0. 0.00383382.998902.0782754. The following is an example showing the cluster centers found from the previous example. 0. 87. InitializeU@TrainData1.00196828<<. 0. 0. 0.999977.999828. 0.993923. 0. 0. 0. 0. 80. 0.999999.2004<. 0.00389807. The variable graph is a plot of the data points and res is the results from the FCMCluster function.987671.998032<. 0. 0.000415074.00297573.1132<<. 0.0000228615.999553.00195332.999701. 0. 888. 85.16241 0.9944.998047. 0.39357.835.999585. 0.1792<<. Notice that the cluster centers are located where you would expect near the centers of the two clusters of data. 0. 0.0333<.991388.0014715.000172122.0123289.99462.000218114.2204.999304. 0. 0.503451 0.99985.999686.996166. 0.05662 × 10−6 . 0.999929. 889.000242704.1134<<<< There are two functions in Fuzzy Logic package that are useful in visualizing the results of the FCMCluster algorithm.000397518. 0. 20.333521 0. 20.000275437. 0. 0. 0. 0. 8810.999725.999935.999705. 0. 0. 20. 0.939566. 20. but it is hard to visualize the results for higher order data.999491.57786.000221595.16335. 20.000142399.995415.1148<<. 0.00458459. 0. 0. 8887.01D 0.1361<. 0. 0. 0. 0. 0. 20.999957. 0. 0.993434.0056.000213201. 0. 0. 0. 85. 0.921725.1134<<.0000705869.000282141 The clustering function should work for data of any dimension.00607655. 0.0010978.0932<. 0. 0.999602.000149924.5. 0. 0. 0.99992.999778. 86.179176 0.2179.999858. 20.000696407. 0.00861153. 85. 0.00050857. 0. 20. 8810.996102. res] displays a 2D plot showing a graph of a set of data points along with large dots indicating the cluster centers found by the FCMCluster function. 20.

Notice that the cluster centers start near the center of the data and move to their final spots near the centers of the two data clusters. Res1aD. res] displays a 2D plot showing a graph of a set of data points along with a plot of how the cluster centers migrated during the application of the FCMCluster function. The variable graph is a plot of the data points and res is the results from the FCMCluster function.122 Fuzzy Logic In[9]:= p1 = ShowCenters@g1. The following is the result of the previous example. ShowCentersProgression[graph. In[10]:= ShowCenterProgression@g1. F2 24 22 20 18 16 14 F1 4 6 8 10 12 14 . F2 24 22 20 18 16 14 F1 4 6 8 10 12 14 Another similar function in Fuzzy Logic package is the ShowCenterProgression function. Res1aD.

Chapter 12: Fuzzy Clustering 123 The clustering function just returns cluster centers and the degrees to which the different data points belong to each cluster center. There are different ways we could turn the cluster centers into membership functions. They don't translate directly into membership functions. . such as taking the projection of the membership grades of the points onto one of the axis or by just placing fuzzy sets at the cluster centers or some other way.

.

xn represents the new membership grades after applying the operators. In the following formulas.Appendix Fuzzy Operator Formulas The following is a list of formulas used to operate on the membership grades of fuzzy set A for selected general operations on fuzzy sets. and yn represents the original membership grades for the elements of fuzzy set A. Concentrate xn = yn 2 Dilate xn = Intensify Contrast xn = 9 2 yn 2 1 − 2 H1 − yn L2 è!!!!!! yn if yn ≤ 1 ê 2 = otherwise Normalize yn xn = ################ ### ######## Height@AD Complement Standard xn = 1 − yn .

s ∈ (0. v ∈ (0. In the formulas. and b represents the membership grade for an element in fuzzy set B. ∞) 1 − yn xn = ################ ##### 1 − α yn Yager[w]. bL = ################################ ################ ### ######## v − H1 − vL Ha + b − a ∗ bL i Ha. ∞) ﬂ s ≠ 1. w ∈ (0. Yager[w]. bL = 1 − Min@1. w ∈ (0. HH1 − aLw + H1 − bLw L1êw D . bL = Min@a. The following formulas indicate how the membership grades for corresponding elements in fuzzy sets A and B should be combined. ∞) ab i Ha. a represent the membership grade for an element in fuzzy set A. Standard Hamacher[v]. A and B. bL = Logs A1 + ################ s−1 i Ha. ∞) Hsa − 1L Hsb − 1L ################ # E ######## i Ha. ∞) xn = H1 − yn w L1êw Intersection Formulas The following is a list of the formulas used for various intersections between two fuzzy sets.126 Fuzzy Logic Sugeno[α]. w ∈ (-1. bD Frank[s].

λ ∈ (-1 . ∞) Yu[λ]. α ∈ [0. bL = ################################ ## ######## 1 − H1 − vL a b .Appendix 127 DuboisPrade[α]. bL = MaxA0. and b represents the membership grade for the corresponding element in fuzzy set B. α ∈ (0. bL = ################################ ################ ################ ####### α α 1êα 1 1 1 + HH ### − 1L + H #### − 1L L a# b a + b + λab − 1 i Ha. v ∈ (0. The following formulas indicate how the membership grades for corresponding elements in fuzzy sets A and B should be combined. H1 + λL Ha + b − 1L − λ a b D Dombi[α]. In the formulas. bD a + b − H2 − vL a b u Ha. ∞) u Ha. ∞) Weber[λ]. A and B. a represent the membership grade for an element in fuzzy set A. ################################ #### E ######## 1 + λ i Ha. bL = Max@a. bL = Max@ 0 . ∞ ) Union Formulas The following is a list of the formulas used for various unions between two fuzzy sets. 1] ab i Ha. b. bL = ################ ########### ######## # Max@a. λ ∈ (-1. Standard Hamacher[v]. αD 1 i Ha.

1 − b. bL = 1 − Logs A1 + ################################ ######### E s−1 DuboisPrade[α]. 1] Dombi[α]. λ ∈ (-1 .128 Fuzzy Logic Frank[s]. ∞) Yu[λ]. bL = Min@ 1 . w ∈ (0. a + b + λ a b D Weber[λ]. bL = ################################ ################################ 1êα# ########### # −α −α − 1 1 1 + IH ### − 1L + H ### − 1L M # # a b λ u Ha. ∞) . α ∈ (0. Haw + bw L1êw D Hs1−a − 1L Hs1−b − 1L ######## u Ha. ∞) u Ha. α ∈ [0. s ∈ (0. bL = MinA 1 . bL = 1 − ################################ ########## ######## Max@1 − a. ∞) H1 − aL H1 − bL u Ha. λ ∈ (-1 . a + b − ########### a bE # 1−λ u Ha. αD 1 u Ha. ∞) ﬂ s ≠ 1 Yager[w]. bL = Min@1.

... α ∈ (-∞ .... an L = ################################ n ######### n h Ha1 ... a2 ... an L = ################################ #1 ############# 1 1 ##### + ##### + . an L = H a1 a2 . an L = J ################################ ######## N ######## n Miscellaneous Formulas Gaussian Fuzzy Sets *−HHx − mLêsL 2 where m is the mean.. and a1 .Appendix 129 Averaging Formulas Following is a list of the formulas for taking the various averages used in this package. a2 . an represent the membership grades for corresponding elements in the n fuzzy sets being averaged. + ##### a1 a2 an a1 α + a2 α + . ∞) n h Ha1 .. a2 .... + an α 1êα hα Ha1 . an L1ên Geometric Mean Harmonic Mean Generalized Mean[α].. Arithmetic Mean a1 + a2 + . a2 . . . The averaging operations are denoted by the letter h. and x is the element. s is the width.. ... ... . + a h Ha1 .. ..

a slope at the crossover points of s/2w.130 Fuzzy Logic Bell Fuzzy Sets 1 ################################ ###### ######## x−c 1 + Abs@ ######### D2 s w where c is the center. Sigmoid Fuzzy Sets 1 ################ Hx−cL ############# # 1 + *−s where s controls the slope at crossover point c. . and x is the element. crossover points are at c ± w. and x is the element.

Verlag TUV Reinland. D. Boca Raton. Gupta. 1. North-Holland. Springer-Verlag. A. Prentice Hall. Koeln. Kandel. Fuzzy Sets and Systems: Theory and Applications. Hirota. Amsterdam. Reinfrank. Hellendoorn. 3. New York. M. Mizutani. K. Possibility Theory. eds. L-fuzzy sets. 1993. Pattern Recognition with Fuzzy Objective Function Algorithms. Gupta. D. Analysis of Fuzzy Information. Cambridge. Appl. New York. 1980. 1977. G. H. Bezdek. 1997. CRC Press. New York. pp. . The Mathematica Journal. C. Fuzzy systems for control applications: the truck backer-upper. Neuro-Fuzzy and Soft Computing. North-Holland. 64-69. 1988. 1988. Verlag TUV Reinland. Anal. J. Springer-Verlag. 1994. Berlin Heidelberg. vol. Plenum Press. Combining Fuzzy Imprecision with Probabilistic Uncertainty in Decision Making. A. 1987. Academic Press. M. Bezdek. Upper Saddle River. and M. Jang.. D. Dubois and H.. Saridis. Berlin. ed. Multistage Decision Making under Fuzziness. 1967. Vol. 1981. Advances in Fuzzy Set Theory and Application..N. Fedrizzi. John Wiley. New York. M. Driankov. Czogala. Goguen. Gaines. R. J. Freeman. FL. 1984. pp. Tokyo. Fuzzy Automata and Decision Processes. J. C. Kacprzyk. An Introduction to Fuzzy Control. eds. 1987. Prade. 1983. Industrial Applications of Fuzzy Technology. M. vol.. J.. A. 1993. Probabilistic Sets in Decision Making and Control. J. Sun.-S. and E. Koeln. Fuzzy Techniques in Pattern Recognition. 2. NJ. Dubois and H.Bibliography J. Prade. R. Springer-Verlag. Plenum Press. J. C. Math. 18. MA. 145-174. 4. 1982. Kacprzyk and M. ed. E. J. and B.-T.

Prentice Hall. New York. Lowen. 1992. Kandel. and Information. vol. Kosko. NJ. 61-75. 1991. Amsterdam. Fuzzy Control Systems. 3. and Bo Yuan . New York. 1994. R. Englewood Cliffs. R. FL. 1-15. Applications of Fuzzy Set Theory in Human Factors. Boca Raton. 1990. Upper Saddle River. eds. pp. Elsevier Science Publishing Company. 1991. Inc. eds. pp. and T. 1995. C. vol. W. Man. Klir. Fuzzy logic in control systems: fuzzy logic controller. Lee. no. Fuzzy Mathematical Models in Engineering and Management Science. 1997. 20. Kwakernaak. Folger. Van Nostrand Reinhold. Kaufmann and M. M. Ute H. C. J. 1960. CRC Press. Kandel and G. Amsterdam. Kubinski. Prentice Hall. B. 1978. 20. 404-418. C. Fuzzy Thinking. Studia Logica.. 1986. J. 1991. Kosko. Prentice Hall. 1958. Maeder. Clair. vol. Gupta. FL. Upper Saddle River. IEEE Trans. Fuzzy random variables. part II. Man. An attempt to bring logic near to colloquial language. Fuzzy Sets. M. St. Englewood Cliffs. A. Nazwy nieostre. Cybernerics. NJ. Lee. pp. Fuzzy Sets and Fuzzy Logic: Theory and Applications.System.System. vol. Uncertainty. Programming in Mathematica. Karwowski and A. vol. 419-435. part I. no. Redwood City.. 2. 10.132 Fuzzy Logic A. Information Science. . Klir. 1983. and Bo Yuan. Kaufmann and M. Fuzzy Expert Systems. California. Gupta. Prentice Hall. 41-53. Klir. Part I: Definitions and Theorems.. A. IEEE Trans. H. B. 115-179. T. G. pp. G. Langholz.. vol. Fuzzy logic in control systems: fuzzy logic controller. Hyperion. Kubinski. A. 1988. 1988. 1990. A. Neural Networks and Fuzzy Systems: A Dynamical Systems Approach to Machine Intelligence. 2. The relation between filter and net convergence in topological spaces. Introduction to Fuzzy Arithmetic Theory and Application. 7. Fuzzy Set Theory. 15. NJ. North-Holland. CRC Press. J. NJ. pp. Fuzzy Math. Mital. 4. G. the New Science of Fuzzy Logic. Second Edition. Boca Raton. 1993. no. pp. Studia Logica. T. C. Cybernerics.

Trillas. Ross. Edited by V. A First Course in Fuzzy Logic. G. Pedrycz. S. R. A. Fuzzy Control. W. Negoita and D. vol. Spain. FL. 1976. 30. Interpretation of fuzzy relations. NJ. 1981. J. Tokyo. 1998. Stachowicz and M. Thomas. S. and E. Metals & Materials Society.. July 1-6. Graphic interpretation of fuzzy sets and fuzzy relations. S. T. D. Findeisen. Stachowicz. Resolution of composite fuzzy relation equations. pp. John Wiley & Sons. Inc. E. .of Second International Fuzzy Systems Association Congress. based on materials of Second World Conf. 1985. E. Universidad Politecnica Las Palmas. Knowledge-Based Computing and Fuzzy Statistics. Fuzzy. C. Holographic. J.. Kochanska. A fuzzy rule-based method of controlling dynamic processes. Voller. Stachowicz and K. Yurkovich. 1998. Hightstown. 1985.. New York. S. M. Boca Baton. et al. M. Fuzzy Logic Technology and Applications. Matrials Processing in the Computer Age. Graphic interpretation of fuzzy knowledge. s. Ralescu. Soucek and The IRIS Group. The MIT Press. Stachowicz and M. 1995. Information and Control. M. Proc. 1992. M. Palma de Mallorca. Wroclaw. Mamdani.Bibliography 133 E. Robotyka i Maszynowa Inteligencja. Van Nostrand Reinhold Company Inc.. Pedrycz and F. San Diego. 1982. Passino and S. R. A. vol. E. 1987. 1. 24. Touchstone–Simon and Schuster. Edited by A. W. K. Reid. Marks II. Stachowicz and M. Simulation. 1994. M. M. and Parallel Intelligence. Gomide. Proc. ed. D. M. W. 20th IEEE Conf. Kochanska. CRC Press. WPW. Proc. An Introduction to Fuzzy Sets: Analysis and Design. S. Morecki.: Konferencje nr. McNeil and P. Fuzzy sets and intelligent control. The Mineral. Freiberger.. Cardus.. New York. B. z.E. 65. P. New York. 1995. and B. McGraw-Hill. J. Fuzzy modeling of the process. 1994. Fuzzy Logic. First International Fuzzy Systems Association Congress. Kochanska. IEEE Press. 1997. 1991. E. Kochanska. C. 1987. Stachowicz and M. Ballester. H. CA. Mathematics at the Service of Man. Sanchez. T. Edited by W. Fuzzy Sets Engineering. FuzzyLogic with Engineering Applications. New York. on Decision and Control. Addison-Wesley. eds. H. Walker. 38-48. CRC Press. Prace Naukowe I.. Nguyen and E. T. Menlo Park. S.

Asai. L. Tanaka. Wang and G. Int. 1997. Integrales de Lebesque.. NJ. 1978. J. pp. 22-44. . R. Yager. IEEE Trans. Essentials of Fuzzy Modeling and Control. An Introduction to Fuzzy Logic for Practical Applications. San Diego. New York. Man-Machine Studies. D. Z. R. Gauthier-Villars. Sugeno. Yager. eds. Li-Xin Wang. Wiley & Sons. J. L.. vol. J. L. vol. eds. 4. J. Ch. Sugeno. K.. 8.. NJ.Intelligence. Yen and R. Systems. Probability measure of fuzzy events. Zadeh. MA. Prentice Hall. Appl. vol. vol. Cybernetics. 13. vol. Wolfram.. J. 1994. K. NJ. 1968. Academic Press. 3. classes de Baire . Klir. Filev. 1980. Sugeno. 12. Applied Fuzzy Systems. Springer-Verlag. 1997. 323-338. Adaptive Fuzzy Systems and Control. 1950. Fuzzy sets. Terano. 1999 L. Tong. M. Information and Control. Mathematica: A System for Doing Mathematics by Computer. de la Valle Poussin. A. Similarity relations and fuzzy ordering. Upper Saddle River. New York. T. pp. pp. 1992. A. Li-Xin Wang. Int. and M. An approach to inference in approximate reasoning. AP Professional. 1971. Fuzzy Logic . R. A. and M. and Information. 1991. Paris. Prentice-Hall. Anal. 143-162. 421-427. New York. Addison-Wesley. 1994. Langari . Zadeh. A Course in Fuzzy Systems and Control. 1985. fonction d'ensemble. Zadeh. Asai. ed. Man . Fuzzy Measure Theory. North-Holland.134 Fuzzy Logic M. Second Edition. 3. T. New York. pp. 2-e ed. Math. Information Science. A. J. 171-200. 1994. Outline of a new approach to the analysis of complex systems and decision processes. Industrial Application of Fuzzy Control. pp. P. General Systems. 1992. 1965. Synthesis of fuzzy models for industrial processes. Terano. Inc. Cambridge. Englewood Cliffs. Englewood Cliffs. R. 338-353.. Prentice-Hall. MA. Plenum Press. Inc.. Fuzzy Systems Theory and Its Applications. vol. R. Reading. 1973. pp. Control. K. S. Zadeh.

H. 1975. 8. 1975. Zadeh. Zimmermann.. 1996. 1984. pp. Koln. 301-357. 149-184. 1. H. Kluwer Academic Publishers. vol. . Comput. A. Information Sciences. 199-249. 9. A. A. J. and Math. A computational approach to fuzzy quantifiers in natural languages. L. A Fuzzy Relational Data Bases – A Key to Expert Systems. Boston. pp..Bibliography 135 L. Kandel. vol. The concept of a linguistic variable and its applications to approximate reasoning – III. Boston. Kluwer Academic Publishers. MA.. pp. Zimmermann. 2nd ed. The concept of a linguistic variable and its applications to approximate reasoning – I. 43-80. MA. 1991. Information Sciences. vol. vol. 1983. Fuzzy Set Theory and Its Applications. Zadeh. Verlag TUV Reinland. Zemankova-Leech and A. A. 9. Fuzzy Set Theory and Its Applications. L. The concept of a linguistic variable and its applications to approximate reasoning – II. M. Zadeh. Zadeh. pp. J. no. 8. L. 1975. Information Sciences. 3rd ed.

.

Part 2 Demonstration Notebooks .

.

the language of set theory and extensional logic is sometimes insufficient. the basic properties are illustrated by the same graphical method using the Fuzzy Logic package. Apart from presentation of crisp sets and fuzzy sets. Mathematical language should be the best tool to express such descriptions. A vertical lines are drawn. we use many functions from the Fuzzy Logic package. In[1]:= << FuzzyLogic` 1. Based on the structure of the membership function's value. Let's recall that in classical set theory.2 Characteristic Function and Membership Function For a long time humankind has endeavored to understand the laws of the surrounding world and has made continuous attempts to describe the phenomena occurring in the world. you can define crisp sets and fuzzy sets. along with standard Mathematica functions. which originated in the work of George Cantor during the years 1871-1883. sets are defined by a simple statement describing whether a particular element having a certain property . the notions "element" and "set" and the relation "is an element of" are undefined concepts. Naturally we want to achieve the most adequate descriptions by means of exact and precise terms. along with standard Mathematica functions. This loads the package.1 Introduction This notebook deals with fuzzy sets defined as functions that relate values from the membership function space to the elements from the object space. An attempt is made to perform a uniform graphical interpretation of the above mentioned types of sets. Thus. however. It is assumed that each of these sets is a finite set. whose lengths correspond to the value of the membership function. The elements from the objects space are arranged in sequence. this notebook demonstrates only a few of the functions that it contains.1 Sets Versus Fuzzy Sets 1. The Fuzzy Logic package contains numerous functions for working with fuzzy sets and fuzzy logic. To demonstrate fuzzy set theory.

also referred to as the universe of discourse. we have to deal with "unsharp" phenomena–imprecise situations in which it is difficult to find a boundary between truth and falsehood. PRIME = {u contained in U | u is a prime number} The elements of set PRIME are defined unequivocally in the following manner. 9. 1960]. say that 4 is less than 5. Kubinski used the notion of a vague term and the notion of an unsharp set [Kubinski 1958. of course. U = {1.. When we consider set X contained in an universal space U. we can state unequivocally whether each element u of space U is or is not an element of X. 3. the same set of objects U as previously.g. In[2]:= PRIME = 82. and within it let us distinguish the set of small numbers SMALL. Such sets had no sharp boundaries. 6. 10. . space U consisting of natural numbers less than or equal to 12. situations in which there is no doubt as to what is true and what is false. This notion was applied to sets in which transition from full membership to non-membership was gradual. Set X is well described by the so-called characteristic function X. 11< Out[2]= 82. the transition from full membership (e. the set of prime numbers could be described as follows. In the case of the considered set SMALL. then we can imagine how difficult it is to describe complex systems involving human linguistic descriptions. 7. 11. This function. but does that mean that 4 is small and 5 is not? If there are any difficulties with assigning membership in such a simple case. In the 1950s. for example. u is a member of X X(u) = 0. 3. Let us consider. and value of 0 for those elements u that do not belong to set X .g. 12} Then. Thus SMALL can not be described by the characteristic function assuming values in the set {0. 12 is not a member of SMALL) is smooth. Aristotelian two-valued logic is ineffective in such cases. in which there is a sharp boundary between elements having a certain property and other elements of the universal space. 7. we can describe only "sharp" situations.140 Fuzzy Logic belongs to a particular set. 2. 11< Frequently. Consider. 5.1} X(u) = 1.. that is. 1 is a member of SMALL) to the lack of membership (e. 8. 5. for example. 5. assumes a value of 1 for those elements u that belong to set X. defined on the universal space U. How can we do it? We can. 7. u is not a member of X By using mathematical apparatus based on classical set theory. 4. introduced by Charles de la ValleePoussin [Poussin 1950]. 3.1}. X:UØ{0.

Presenting set U in the form we just described. The value X(u) is the grade of membership of the element u in a fuzzy set X.2 SMALL(8) = . Empty Set = {{u . Assume: SMALL(1) = 1 SMALL (2) = 1 SMALL(5) = . introduced by Professor Lotfi Zadeh in 1965 and called a membership function [Zadeh 1965]. X(u)}}." J. "a fuzzy set X characterized by the membership function X. like SMALL. A (a subset of U treated as a fuzzy set). X(u)}: X = {{u . and X(u) is the value of the function X for this element. U = {{u . we shall now resume the presentation of set SMALL of small numbers in set U consisting of natural numbers less than or equal to 12. describes to what degree an element u belongs to set X. 1]. is a function assuming the values 0 for u not contained in A and 1 for u contained in A. we can write this set in the following way. is a function equal to 1. treated as a fuzzy set. Set A is thus identified with its characteristic function. An empty fuzzy set is a function that for every u in the set U assumes the value of zero. Bearing in mind the concept of a fuzzy set. this is called a fuzzy set. u in the set U Space U. u in the set U A classical "sharp" set. we have the following. Using the notation just described. which have unsharp boundaries. A fuzzy set X will be written as a set of pairs {u.4 SMALL(6) = . To avoid a complex description like. X:UØ[0. 0}}.3 SMALL(u) = 0 for u >= 9 According to notion described earlier: SMALL(3) = .1] This function.9 SMALL(4) = . Goguen [Goguen 1967] proposed to identify a fuzzy set with a function that characterizes it and introduced the following definition: A fuzzy set X defined in the universal space U is a function defined in U which assumes values in the range [0.6 SMALL(7) = . 1}}. are well characterized by a function that assigns a real number from the closed interval from 0 to 1 to each element u in the set U.Chapter 1: Sets Versus Fuzzy Sets 141 Sets X.1 . u in the set U where u is an element of the universal space U.

. The elements of the collection of objects of space U. {10. can be arranged in a sequence. {11. .3}. {8.6}.1}. This is a starting point for developing a method for solving such problems. 1}. 0}} The important point to note is that such a fuzzy set can be defined precisely by associating with each u its grade of membership in SMALL. {7. The second type of indeterminacy. An assumption of denumerability of the universal space permits a very simple graphic interpretation of the fuzzy sets defined in U. It enables you to take into account the human experience and intelligence by translating imprecise natural language and human reasoning into a mathematical model for a system. . A membership function describes to what degree element u belongs to set X. You can plot for each element a segment of height corresponding to the value of the membership function of the given element in the fuzzy set under consideration. randomness. so we may say that everything is a matter of degree. i = 1.142 Fuzzy Logic SMALL = {{1. 0}. {9. 0}.4}. Randomness is thus a result of cognitive indetermination. .3 Graphic Interpretation of Sets Let's restrict our consideration to a case when the universal space U is at the very most a countable set. it is not meaningful to speak of an object as belonging to or not belonging to that set. 0}. except for elements whose grades of membership in the set are unity or zero. In most applications. {3. {2. Lack of precision in determining data is sometimes caused by a lack of clearly defined criteria for classifying variables or parameters. From the standpoint of practical applications. Thus. . {6. This subjectivity in the evaluation of the grade of membership of particular elements in the set is characteristic of fuzzy sets.. {12. this restriction will not be troublesome. Note also that the above assignment defining set SMALL is wholly subjective. U = { ui }. {4. but it is not possibly to determine which of these situations applies. especially when using computational techniques. we are dealing with a situation in which we admit the possibility that element u from space U fulfills the condition imposed only to a certain degree.. a finite number of the elements of set U is taken into consideration. In spite of allegations that such descriptions are subjective. . 2. it has an important advantage. 1}.9}.2}. we can repeat what Kwakernaak [Kwakernaak 1978] said: "with indeterminacy of a fuzzy type. 1. . due to its denumerability. occurs when a given element u in the set U either fully fulfills the condition or does not fulfill it at all. {5. It is important to note that in the case of a fuzzy set. . Subjectivity is also a feature distinguishing otherwise similar probability from membership functions.

6<. 6.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 In[5]:= SMALL = FuzzySet@881.4 0. 4. 82. AxesLabel → 8"U". . "SMALL"<D. 0<. . 87. . 0<<D. For example. 84. In[3]:= SetOptions@FuzzySet. SMALL 1 0. .3<. 83.9<.Chapter 1: Sets Versus Fuzzy Sets 143 Universal spaces for fuzzy sets and fuzzy relations are defined with three numbers in this package. fuzzy set SMALL of small numbers. 85. . 9.2<.1<. 1<.8 0. ShowDots → True< In[6]:= FuzzyPlot@SMALL. 0<. . . 86. the set considered earlier. which is a classical subset of U. 811. may be presented in the following way. and the third argument specifies the increment between discrete elements . 0<. 89. 12. 8. The first two numbers specify the start and end of the universal space. 810. the prime numbers. 1<. 5. 12} may be presented in the following way. PlotJoined −> False. 7. defined in the space U = { ui } = {1. ShowDots → TrueD Out[4]= 8PlotJoined → False.4<. 10. Set PRIME. 1<D Out[3]= 8UniversalSpace → 81.6 0. 11. 1<< In[4]:= SetOptions@FuzzyPlot. UniversalSpace → 81. 3. 2. 12. Crisp → False. 812. 88.

0<. 83. PRIME 1 0. 1<. 1<.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 85. 89.8 0. . 1<.4 0. 86. 1<. "UNIVERSAL SPACE"<D. We denote this set by U.6 0. 86. In[8]:= FuzzyPlot@PRIME. 812.6 0. 810. 1<. 1<<D. 82. 1<. Universal Set In any application of the theory of sets or fuzzy sets. 0<. 1<. 82. In[9]:= UNIVERSALSPACE = FuzzySet@881. all sets under investigation will likely be subsets of a fixed set. 0<. 84. 84. 0<. 1<. 89. 1<. 1<.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 In[10]:= FuzzyPlot@UNIVERSALSPACE. 1<. Universal space U. 1<. 812. 87. 0<. 88. 1<. 1<. 810. 1<. 811. AxesLabel → 8"U". AxesLabel → 8"U". 0<. 85.144 Fuzzy Logic In[7]:= PRIME = FuzzySet@881. We call this set the universal space or universe of discourse.8 0. 0<<D. "PRIME"<D. 1<. 88.4 0. UNIVERSAL SPACE 1 0. 811. treated as a fuzzy set. 87. is a function equal to 1 for all elements. 83.

2. Let N be the universal space of the days of the week. We. EMPTY is an empty set.4 0. that is. 1<D. Sa.Chapter 1: Sets Versus Fuzzy Sets 145 Finite and Infinite Universal Space Universal sets can be finite or infinite. 9.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 You can restore the default settings of the Fuzzy Logic package for FuzzySet and FuzzyPlot. UniversalSpace → 80. if in counting the different elements of the set. 7. Any universal set is finite if it consists of a specific number of different elements. M is infinite. 3. Although it may be difficult to count the number of lakes in Minnesota. Let L = {u | u is a lake in Minnesota}. Fr. Examples: 1. N is finite. PlotJoined → False. 5. 20. This set is sometimes called the null set. N = {Mo. 3. Su}. Tu.6 0.. Th.}. "EMPTY"<D. otherwise a set is infinite. In[12]:= FuzzyPlot@EMPTY. AxesLabel → 8"U". EMPTY 1 0. Let M = {1. a set that contains only elements with a grade of membership equal to 0. ShowDots → FalseD. In[13]:= SetOptions@FuzzySet. According to known statistics. . that is. In[11]:= EMPTY = FuzzySet@8<D. L is still a finite universal set.. Empty Set It is convenient to introduce the concept of the empty set.8 0. let EMPTY be a set of people in Minnesota who are older than 120. . For example. the counting can come to an end. In[14]:= SetOptions@FuzzyPlot.

1973. vol. Fuzzy sets. A. A.. Gauthier-Villars. vol. 1991. 1-15. D. Paris. Studia Logica. E. H. Zadeh. Nazwy nieostre. NJ. pp. Ballester. Graphic interpretation of fuzzy sets and fuzzy relations. L. pp. Math. vol. Zadeh. Mathematics at the Service of Man. vol. Appl. vol. 115-179. Information Sciences. 1967. 1965. 10. pp. Fuzzy random variables. A. Information Science. 1975. J. 2-e ed. L-fuzzy sets. 338-353. L. based on materials of Second World Conf. pp. MA. Kwakernaak. Kubinski. G. Fuzzy Set Theory and Its Applications. 1988. A. Stachowicz and M. 9. pp. vol. 8. 61-75. Math. 3. vol. pp. classes de Baire. de la Valle Poussin. An attempt to bring logic near to colloquial language.. Zadeh. Folger. S. vol. A. 18. Fuzzy Sets.146 Fuzzy Logic References J. Information and Control. and Information. M. Kluwer Academic Publishers. Man . Outline of a new approach to the analysis of complex systems and decision processes. Information Sciences. The concept of a linguistic variable and its applications to approximate reasoning – III. Ch. 22-44. IEEE Transactions on Systems. 1978. Uncertainty. pp. 8.. Goguen. J. L. Klir. Universidad Politecnica Las Palmas. fonction d'ensemble. 145-174. vol. Zadeh.. T. 1982. The concept of a linguistic variable and its applications to approximate reasoning – II. 421-427. Information Sciences. Probability measure of fuzzy events. Zadeh. Part I: Definitions and Theorems. Spain. 1968. 1958. Anal. 301-357. L. J. Zadeh. Prentice Hall. 1975. Kochanska. Edited by A. and E. A. J. 2nd ed. 1975. L. 199-249. pp. 8. Cybernetics. A. 1950. Kubinski. and T. Englewood Cliffs. 7. Zimmermann. 1960. Integrales de Lebesque. Cardus. vol. 15. L.. Boston. A. T. . pp. The concept of a linguistic variable and its applications to approximate reasoning – I. 12. Appl. H. Anal. pp. Studia Logica. Trillas. 43-80.

2 Fuzzy Operations Inclusion Let X and Y be fuzzy sets defined in the same universal space U. intersection. we present a graphical interpretation [Stachowicz and Kochanska. In[2]:= SetOptions@FuzzySet. 12<D Out[2]= 8UniversalSpace → 81. UniversalSpace → 81. Professor Lotfi A. union. We demonstrate this property in the following example.2 Standard Operations 2. This loads the package. and difference. 12. 2. In this notebook. we consider the space U and fuzzy sets defined in U. In[1]:= << FuzzyLogic` With the necessary routines loaded. Zadeh [Zadeh 1965] formulated a fuzzy set theory in the terms of the standard operations: complement. we are ready to investigate fuzzy set theory. 1<< . We say that the fuzzy set X is included in the fuzzy set Y if and only if: For every u in the set U we have X(u) § Y(u) To illustrate inclusion of fuzzy sets. 1982] of the standard fuzzy set terms using standard Mathematica functions and functions from the Fuzzy Logic package.1 Introduction This notebook deals with fuzzy operations defined in the same universal space.

87. VERYSMALL is included in SMALL as defined by the previous definition of inclusion. ShowDots → TrueD Out[3]= 8PlotJoined → False. and X(u) is contained in the interval [0. 86. . Crisp → False. 0<. 87. . 83. 88. 1<. 87. SMALLD Out[6]= True In[7]:= FuzzyPlot@SMALL. In[6]:= Included@VERYSMALL. 89. 85.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 85. 0<. Membership Grade 1 0. In[8]:= UNIVERSALSPACE = FuzzySet@881. 1<. In[5]:= VERYSMALL = FuzzySet@881. .4<. . 86. . . 0<. 83. 1<. 89. . In[9]:= EMPTY = FuzzySet@8<D. . 0<. 812. . 0<<D.8<. 811. 82. 84.4<. 811.1<. .9<. 810. 810. 812.2<. 83. 1] for each element u in the set U.1<. UNIVERSALSPACED Out[10]= True 85. 84.8 0. 0<. 812. 1<. Similarly the empty set is a fuzzy subset of all other fuzzy sets. 1<. . We have U(u) = 1.4 0. 89.6<. 84. This inclusion will be directly seen in the next figure. 88. 82. 1<. 810. 0<.6 0. 1<.148 Fuzzy Logic In[3]:= SetOptions@FuzzyPlot. . It should also be noted that each fuzzy set X defined in the universal space U is a fuzzy subset of the fuzzy set U. 1<. 1<. 82. In[10]:= Included@SMALL. 1<. 1<. 1<. 1<. 1<<D. 1<. hence X(u) § U(u). 811. 88. 0<<D. VERYSMALLD.3<. 86. 0<.2<. 0<. ShowDots → True< In[4]:= SMALL = FuzzySet@881.7<.

Two sets A and B are said to be incomparable in the following case. Example 2. Theorem: If A Õ B and B Õ C then A Õ C. {b. {c. 0. 0. if one of the fuzzy sets is a subset of the other set. {c.Chapter 2: Standard Operations 149 In[11]:= Included@VERYSMALL. 1}. many statements can be proven to be true by the use of previous definitions or assumptions. they are comparable. Proof: Notice that we must show that A(u) § C(u) for all u in the set U. . Property Related to Inclusion In mathematics. 1}. {b. UNIVERSALSPACED Out[11]= True In[12]:= Included@EMPTY.2 Let C = {{a. 1}. SMALLD Out[12]= True Comparability Two fuzzy sets A and B are said to be comparable if the following condition holds: A Õ B or B Õ A That is. {b. 1}. {c. A Ã B and B Ã A Example 2. 0}} and B = {{a. 0.9}.6}}. since A is a subset of B. 1}. Then C and D are not comparable since C is not a subset of D and D is not a subset of C. 1}}. {c. 1}. {b.5}} and D = {{a. Here we prove a theorem of fuzzy sets using the definition of inclusion. 1}.1 Let A = {{a. Then A is comparable to B.

.3<. 0<<D. 1<. if A(u) Õ B(u) Õ C(u). 88. In[15]:= FuzzyPlot@SMALL. .8 0.6 0. So. 0<<D. 810. 86.1<. . 811.9<.4 0.150 Fuzzy Logic Since A Õ B then A(u) § B(u) By hypothesis. In[13]:= SMALL = FuzzySet@881. 89.2<. which is denoted X = Y if and only if for all u in the set U. we have shown that for all u in the set U.9<. . 85. 810. 0<. 87. 0<. 88. 89. 1<. . 0<.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 86. . 82. for all u in the set U. . 0<. B Õ C. SMALL = STILLSMALL. 1<. Membership Grade 1 0. If equality X(u) = Y(u) is not satisfied even for one element u in the set U. .1<. We demonstrate this property in the following example. We see that by definition.6<. .4<. In[14]:= STILLSMALL = FuzzySet@881. We say that sets X and Y are equal. then accordingly A Õ C. . 84. 83. 85. Equality Let X and Y be fuzzy sets defined in the same space U. hence B(u) § C(u) for all u in the set U. . 1<. 83. 812. X(u) = Y(u). 0<. STILLSMALLD. then we say that X is not equal to Y. 87.2<. 84. 812. 811. .4<. 82. 0<. .3<.6<.

810. 86. 1<. The complement of the fuzzy set X is often denoted by X'. 84.8 0.9<. 811.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 88. the complement of the fuzzy set SMALL in the space U is a fuzzy set NOTSMALL. 1<. 12. In[17]:= FuzzyPlot@SMALL. treated as fuzzy sets.X(u). SMALL.4 0. 85. NOTSMALL. NOTSMALLD. 1<D We see that there are many elements that can have some nonzero grades of membership in both a fuzzy set.8<. Y(u) = 1 . We say that the fuzzy set Y is a complement of the fuzzy set X. 812. for all u in the set U. In[16]:= NOTSMALL = Complement@SMALLD Out[16]= FuzzySet@883. 1<<.Chapter 2: Standard Operations 151 Complementation Let X be a fuzzy set defined in the space U. UniversalSpace → 81.1<. «' = U U' = « . 0. We show both SMALL and NOTSMALL in the following graph. The empty set and the universal set. if and only if.7<. 0.6<. 0. 0. 89.4<. and its complement. Membership Grade 1 0.6 0. 87. 1<. 0. For example. are complements of one another. 0.

0<. 82. .4<. for fuzzy sets SMALL and MEDIUM. 0. 0. 0<<D. 88.7<. 0. the Union returns the following. 1<.7<. 89.4 0. FuzzyPlot@EMPTY. For all u in the set U. UniversalSpace → 81.6 0. 1<. 85. 89. 12.5<.1<.5<. 88. In[21]:= UNION = SMALL ‹ MEDIUM Out[21]= FuzzySet@881.8<. 810. 811. . In[20]:= MEDIUM = FuzzySet@881.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 Union Let X and Y be fuzzy sets defined in the space U.4<.9<. 1<. 1<. 83. . 0. . 810. . Thus the following relation must be satisfied for the union operation. For example. 87.1<<. UNIVERSALSPACED.6<. Y(u)) . which we define here. 812. 82.2<. 86. (X ‹ Y)(u) = Max(X(u). 0. 811. 1<.8<. 1<. 1<D 86. 83. 0<. 85. 0.8 0. 0. 84. 0<. 84.152 Fuzzy Logic In[18]:= EMPTY = Complement@UNIVERSALSPACED. 87. The union of X and Y will be denoted by X ‹ Y. . We define the union of those sets as the smallest (in the sense of the inclusion) fuzzy set that contains both X and Y. Membership Grade 1 0.

if A is a class of "Young" men. Membership Grade 1 0.8 Properties Related to Union A collection of the properties related to union follow. the following is true SMALL(6) = 0.6 0. if at a point u = 6. In[23]:= Equality@SMALL ‹ EMPTY." Thus.Chapter 2: Standard Operations 153 In[22]:= FuzzyPlot@UNIOND.4 0." then David is associated with the union of A and B.8 0. and MEDIUM(6) = 0. As in the case of non-fuzzy sets. the notion of the union is closely related to that of the connective "or.8. Identity: X‹«=X David is a member of set A or David is a member of set B implies David is a member of A ‹ B. the union is 0. and "David is Young" or "David is Bald. We demonstrate each property using some of the fuzzy sets we have created in this notebook and with functions from the Fuzzy Logic package. B is a class of "Bald" men.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 Example Thus. SMALLD Out[23]= True .3 then at u = 6.

2<.6<. MEDIUM ‹ SMALLD Out[26]= True Associativity: X ‹ (Y ‹ Z) = (X ‹ Y) ‹ Z In[27]:= BIG = FuzzySet@881.154 Fuzzy Logic Identity: X‹U=U In[24]:= Equality@SMALL ‹ UNIVERSALSPACE.4<. . . 1<<D. HSMALL ‹ MEDIUML ‹ BIGD 86. The intersection of those sets. . 0<. denoted by X › Y. 812. 88. 83. (X › Y)(u) = Min(X(u).8<. For all u in the set U. 89.1<. 87. SMALLD Out[25]= True Commutativity: X ‹ Y= Y ‹ X In[26]:= Equality@SMALL ‹ MEDIUM. 1<. . is defined as the greatest (in the sense of the inclusion) fuzzy set included both in X and Y. Y(u)). Thus the relation the intersection must satisfy the following property. Intersection Let X and Y be fuzzy sets in the space U. 0<. 810. 82. Out[28]= True In[28]:= Equality@SMALL ‹ HMEDIUM ‹ BIGL. 811. . 0<. 84. 0<. . UNIVERSALSPACED Out[24]= True Idempotence: X‹X=X In[25]:= Equality@SMALL ‹ SMALL. 0<. 85.

85. Absorption by Empty Set: X›«=« In[31]:= Equality @SMALL › EMPTY. 87. 0. 0.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 UniversalSpace → 81.2<.4<. 12. 0.6 0. we find the intersection is the following manner. 0. 86. Membership Grade 1 0.2<.1<<. EMPTYD Out[31]= True Identity: X›U =X In[32]:= Equality @SMALL › UNIVERSALSPACE. 1<D = SMALL › MEDIUM Additional Properties Related to Intersection and Union This section contains a collection of additional properties related to fuzzy intersection and union. In[29]:= INTERSECTION Out[29]= FuzzySet@884. 88.4 0.Chapter 2: Standard Operations 155 For the sets SMALL and MEDIUM from the previous example.3<.8 0. 0. SMALL D Out[32]= True . In[30]:= FuzzyPlot@INTERSECTIOND.

BIG › SMALLD Out[34]= True Associativity: X › (Y › Z) = (X › Y) › Z In[35]:= Equality @SMALL › HMEDIUM › BIGL. SMALL D Out[33]= True Commutativity: X›Y=Y›X In[34]:= Equality @SMALL › BIG. we have the following properties. HSMALL ‹ MEDIUML › HSMALL ‹ BIGLD Out[37]= True For crisp sets. SMALL › MEDIUM ‹ SMALL › BIGD Out[36]= True Distributivity: X ‹ (Y › Z) = (X ‹ Y) › (X ‹ Z) In[37]:= Equality@SMALL ‹ MEDIUM › BIG. HSMALL › MEDIUML › BIGD Out[35]= True Distributivity: X › (Y ‹ Z) = (X › Y) ‹ (X › Z) In[36]:= Equality @SMALL › HMEDIUM ‹ BIGL. .156 Fuzzy Logic Idempotence: X›X=X In[33]:= Equality @SMALL › SMALL.

. In[38]:= MYUNION = MEDIUM ‹ Complement@MEDIUMD.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 In[40]:= MYINTERSECTION = MEDIUM › HComplement @MEDIUM DL.Chapter 2: Standard Operations 157 Law of excluded middle: A ‹ A' = U Law of contradiction: In fuzzy logic these properties do not apply. In[39]:= FuzzyPlot @MYUNION D.4 0. X ‹ X' ∫ U X › X' ∫ « A › A' = « This is demonstrated in the following graphs. Membership Grade 1 0.8 0.6 0.

0.6 0. we have the following results. 811. X . 1<D = Difference @MEDIUM. 0. then the maximum error associated with the grade of membership of u in A'. 86. 1 . UniversalSpace → 81. each of the elements u in the set U satisfies the following relation. 810.4<. 88. For all u in the set U.4 0.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 The theory of fuzzy sets was formulated in terms of the standard complement.1<<.Y(u)) For our sets SMALL and MEDIUM.7<. These original operators possess particular significance. When the range of grade of membership is restricted to the set {0. these functions perform like the corresponding operators for Cantor's sets.2<. 85.158 Fuzzy Logic In[41]:= FuzzyPlot @MYINTERSECTION D.8<. 0. 0. and A › B remains e. and intersection operators.7<. 0.5<. Difference The difference of two fuzzy sets is defined as the intersection of the minuend and the complement of the subtrahend. union. Membership Grade 1 0. 89. 0.9<. 0. SMALLD .1}. 0. In[42]:= MYDIFFERENCE Out[42]= FuzzySet@884. A ‹ B.8 0. If any error e is associated with the grade of membership A(u) and B(u). 87.Y)(u) = Min(X(u). (X . 12.Y = X › Y' For the difference.

Y) ‹ (X . Out[45]= True Difference@SMALL. BIGDDD .Z) X . BIGDLD In[45]:= Equality@Difference@SMALL. Properties are demonstrated using previously defined fuzzy sets and functions from the Fuzzy Logic package.Y ‹ Z = (X . MEDIUM ‹ BIGD. MEDIUMD ‹ Difference@SMALL.Y ‹ Z = (X . MEDIUMDL › HDifference@SMALL.6 0. MEDIUM ‹ BIGD. X . MEDIUM › BIGD. Out[44]= True HDifference@SMALL.Chapter 2: Standard Operations 159 In[43]:= FuzzyPlot @MYDIFFERENCE D.2 U 1 2 3 4 5 6 7 8 9 10 11 12 13 Properties Related to Difference This section contains properties related to the fuzzy difference.Z In[46]:= Equality@Difference@SMALL. Out[46]= True Union@Difference@Difference@SMALL. Membership Grade 1 0. BIGDD X .Z) In[44]:= Equality@Difference@SMALL.Y) ‹ (X . MEDIUMD.8 0.Y ‹ Z = (X .4 0.Y) .

Y) = X ‹ Y You can restore the default settings of the Fuzzy Logic for FuzzySet and FuzzyPlot. based on materials of Second World Conference. Folger. Uncertainty.(X . we have these properties. vol. L. Englewood Cliffs. 1965.X › Y' = X › (X ‹ Y')' = X › (X ‹ Y) = (X ‹ X') › (X ‹ Y) References G. Klir and T. Fuzzy Set Theory and Its Applications. 2nd ed. S. ShowDots → FalseD.X) = X ‹ (Y › X') = (X ‹ Y) › (X ‹ X') X . Information and Control. E. Edited by A. J. Fuzzy Sets. Zimmermann. Ballester. X ‹ (Y . Prentice Hall. Cardus. For fuzzy sets. and E. Fuzzy sets. X . pp. Graphic interpretation of fuzzy sets and fuzzy relations. M. UniversalSpace → 80. Boston. Mathematics at the Service of Man. In[48]:= SetOptions@FuzzyPlot. NJ. Kluwer Academic Publishers. X ‹ (Y . Zadeh. 8.Y) = X . A. Spain. J. A. and Information. In[47]:= SetOptions@FuzzySet.X) = X ‹ Y With fuzzy sets. D. 338-353. Kochanska. Trillas.. this is not the case. Universidad Politecnica Las Palmas. 1988. 1991. . MA. 20<D.(X . H.160 Fuzzy Logic For crisp sets we have the following properties. Stachowicz and M. 1982.

and sociology.. These elements are again grouped with their membership grades. Note that the elements of the relation are defined as ordered pairs. Rnm }}. fuzzy diagnosis. we then talk about expressing fuzzy relations in terms of matrices and graphical visualizations. {v1 . {{v1 . For relations. Vmax . inclusive. {{v1 . and the second pair defines the universal space for the second set. The following is an example showing how fuzzy relations are represented in this package.. {v1 . medicine. Universal spaces for fuzzy sets and fuzzy relations are defined with three numbers in this package. {Wmin .3 Fuzzy Relations 3. Beginning with a definition of fuzzy relations. and fuzzy control. . . the universal space consists of a pair of ordered pairs. They also have applications in fields such as psychology. w2 }. {{vn . c1 }. w2 }. {{Vmin . Rnm }. The first two numbers specify the start and end of the universal space. w1 }. Here is an example. Wmax . {vn . First is a list containing element and membership grade pairs. . R12 }.. This loads the package..1 Introduction Fuzzy relations play an important role in fuzzy modeling. The second item characterizing fuzzy relations is the universal space. R11 }. << FuzzyLogic` 3. economics. The first pair defines the universal space to be used for the first set under consideration in the relation. . . . which are values that range from 0 to 1. w1 }. along with standard Mathematica functions.. wm }. . c2 }}. R12 . and the third argument specifies the increment between discrete elements.. In this notebook we define and discuss fuzzy relations.2 Fuzzy Relation Form A fuzzy relation is characterized by the same two items as a fuzzy set. We illustrate the basic properties of fuzzy relations using the graphical functions of the Fuzzy Logic package. Later we discuss the various properties of fuzzy relations and operations that can be performed with fuzzy relations. {R11 . wm }.

UniversalSpace→{{0. 1<. 1<. 0. R = FuzzyRelation@8881. . {0. 2. {{2. UniversalSpace → 881. 2.5<<.3 0. j = 1.3<. i = 1. A fuzzy relation R can be represented in the following way: R = {{{vi .7<. Let V = {1. 882. 882. 2<. wj }. A fuzzy relation R in VxW has the following definition. 1}..1}. W = {wj }. . defined in the Cartesian product VxW. 3<.5}. 81. . 3} and W = {1. 883. 1<. 0. 0. 4<. .4}. 3. . 881.7 j 1 0. {{3. 883. ToMembershipMatrix@RD êê MatrixForm y z z z z z z { This relation can be represented in the following two forms: as a membership matrix 0. 882. 2<.9}. 2}. wj )}}. . 4<. 3<. 4<. {{3.8<. 883. .5 k 0 . R is thus a function defined in the space VxW. 1]. 882. an arbitrary fuzzy set R. which takes values from the interval [0. We can start our discussion by considering a countable collection of objects.. j = 1.6 0. {{2.8 j j j 0. 4}. 1}. 1}}.7}.2 0. 881. 2.2<. i = 1. 1] In the case where V = W. 4<<D..4 0.162 Fuzzy Logic FuzzyRelation[{{{1.. 3<. We examine fuzzy relations in this notebook in a manner analogous to that introduced earlier for fuzzy sets.. we have a binary fuzzy relation on single set V. . 1}. . 1}}] Assuming that V and W are two collections of objects. 1}.. 0. 3<. . . 1<. 2<. 2.. 883. V = {vi }. A matrix or graphic interpretation is a more convenient way to study fuzzy relations. 0. 2}. .7 0 i 1 j j 0. 881. 2. 0<.4<.6<. . 2.7<. R : V x W Ø [0. 3. R(vi . {{1. 2. 0<. 1<.. will be called a fuzzy relation in the space VxW. 2}.

4 3 W Note that the elements of the fuzzy relation are defined as ordered pairs. wj }. Boxed → FalseD. w)).8 R 0. the relation is called subnormal. For all w in the set W.6 0. If h(R) < 1. w)). 3. w))). for all v in the set V and all w in the set W The fuzzy relation R: h(R) = 1 is called normal. .2 0 1 2 V 3 1 2 "<. "R 1 0.3 Projection of a Fuzzy Relation Let R be a fuzzy relation in the Cartesian product VxW. For all v in the set V. R(1)(v) = Max(R(v. AxesLabel → 8"V". The fuzzy set R(1) defined in V by the following expression is called the first projection of fuzzy relation R. for all w in the set W The fuzzy set R(2) defined in W in the following expression is called the second projection of fuzzy relation R. "W". h(R) = Max(Max(R(v.Chapter 3: Fuzzy Relations 163 as a graph FuzzyPlot3D@R.4 0. vi is the first and wj the second element of an ordered pair {vi . for all v in the set V The number defined by the following expression is called the global projection of fuzzy relation R. The membership grades of the elements are represented by the heights of the vertical lines at the corresponding elements. R(1)(w) = Max(R(v.

4 0.164 Fuzzy Logic For the fuzzy relation we defined earlier.2 FuzzyPlot@R2. 0.8 0. "Second Projection"<D. .6 0. First Projection 1 Second Projection 1 0.4 0.6 0. the projections are shown here. AxesLabel → 8"V". "First Projection"<D.8 0. AxesLabel → 8"W". R2 = SecondProjection@RD.2 V 1 2 3 4 R1 = FirstProjection@RD. W 1 2 3 4 5 h = GlobalProjection@RD 1 We see that this relation is normal since its global projection is 1. FuzzyPlot@R1.

3<. We begin with operations defined for fuzzy relations in the same universal space–the same Cartesian product of two collections of objects.8 R. w) § S(v. 4<<D.6<<.4. RMat = 88. . Envelope of a Fuzzy Relation If R and S are two fuzzy relations of VxW such that for all v and w in VxW. S = FromMembershipMatrix@SMat. .3<.7.8. . "R. Boxed → FalseD. fuzzy relations R and S are defined in VxW where sets V and W were defined earlier.8. R(v.5. 3<. 0. "W". FuzzyPlot3D@R. .8. AxesLabel → 8"V". SMat = 88.8. . . R = FromMembershipMatrix@RMat. .7<<. .2 0 1 2 V 3 1 2 4 3 W . . 8.8.3.7. . 8.6 0. . 8. "<.4 0. . . we say that fuzzy relation S is an envelope of fuzzy relation R or that fuzzy relation R is an enclosure of fuzzy relation S. 8.Chapter 3: Fuzzy Relations 165 3.4 Fuzzy Operations Here we present the basic properties of fuzzy relations and the basic operations that can be performed on fuzzy relations. In the example that follows.S 0. 881. 1<. so we can say that fuzzy relation R is an enclosure of S. 881. .5. 81.2<. w). S.6. .5<. 81.7. Relations R and S satisfy the envelope condition stated here.S 1 0.9.4. ShowDots → True. .6.2. 4<<D.

1. 1 0.6 0.6 0.8<. 4<<D. 80. . . such that for all (v. The union of two fuzzy relations R and S.5. .7<<. FuzzyPlot3D@R.3.166 Fuzzy Logic Union of Fuzzy Relations Let R and S be fuzzy relations in VxW. is a fuzzy relation in V x W . "R (R ‹ S)(v. RMATRIX = 88.5<. 0. S(v. 881.2. . .4 0. . AxesLabel → 8"V". "<.7. 3<. 1<. w)).4.4 0. .6. Then We demonstrate this operator in the following example.2 0 1 2 V 3 1 2 4 3 W . 81.2 0 1 2 V 3 1 2 4 3 W SMATRIX = 88. 4<<D.2. 81. AxesLabel → 8"V". . 8. . w) = Max(R(v. 1 0. w). w) in V x W.8. R = FromMembershipMatrix@RMATRIX.8 S 0. . FuzzyPlot3D@S. .1.3.3<. .6. Boxed → FalseD. "W". denoted by R ‹ S.5<<. . "W". S = FromMembershipMatrix@SMATRIX.2. 3<. Boxed → FalseD. "S "<. .8. . 8.8 R 0. 881.2. 81.

SD.1 0. "Union@R.7 0.3 z j z j z j z k 0.6 0.8 Union@R. .SD 0.5 { INTERSECTION = Intersection@R. w)).2 0 1 2 V 2 1 4 3 W 3 The operation of the union of fuzzy relations can be generalized to n relations. . . w).3 0.2 0.8 y j z j 0 j z 0.3 0. SD. Boxed → FalseD. Intersection of Fuzzy Relations The intersection of two fuzzy relations.5 0 0.8 j j 0..5 z z j z j z j z j z 1 0. R and S.. w) in VxW. The intersection of the fuzzy relations from the previous example is shown here.6 0. 1 0. w) = Max(Ri (v.SD"<. R(v. ToMembershipMatrix@INTERSECTIOND êê MatrixForm i 0.4 0. UNION = Union@R. Rn are fuzzy relations in VxW then their union is a relation defined in VxW such that for all (v.2 0. w) in VxW. (R › S)(v. ToMembershipMatrix@UNIOND êê MatrixForm 1 y i 0.8 1 0.Chapter 3: Fuzzy Relations 167 The union of fuzzy relations R and S is the following relation. AxesLabel → 8"V". w)). If R1 . R2 . "W".2 0. in VxW is the fuzzy relation in VxW such that for all (v.6 0. w) = Min(R(v. S(v.2 0.7 { k FuzzyPlot3D@UNION.4 0.

For the relations R and S presented earlier.6 0.8 Int@R.4 0.48 0. w) in VxW. Type → Hamacher@1DD.35 { AlgProduct = Intersection@R. the algebraic product is the following fuzzy relation. ToMembershipMatrix@AlgProductD êê MatrixForm i 0. "W". AxesLabel → 8"V". S)(v. w) = R(v. "Int@R.06 0. AlgProduct(R.3 0 0. 4 3 W The intersection of the fuzzy relation can also be generalized to the intersection of n relations in the same way it was generalized for the union operation.2 0. whose elements satisfy the relation.SD 1 0. Algebraic Product of Fuzzy Relations The algebraic product of the two fuzzy relations R and S in the space VxW is defined as a fuzzy set in VxW.24 0.SD 0. .2 0 1 2 V 3 1 2 "<. S.168 Fuzzy Logic FuzzyPlot3D@INTERSECTION.8 y j z j 0 j z 0.2 0. w) * S(v. Boxed → FalseD.15 z j z j z j z k 0. w).04 0. for all (v.

R' "<.8 R.6 0. ShowDots → True.2 j z j 0. 1 0. " R.Chapter 3: Fuzzy Relations 169 Complement of a Fuzzy Relation The complement of the fuzzy relation R is denoted by R'.R(v. We shall present two ways of composing such relations. COMPLEMENT.8 0. for all (v. AxesLabel → 8"V". The complement of fuzzy relation R is shown in the following graph. w). R'(v. It is defined as.4 0. Boxed → FalseD.4 0 0.R' 0. 0 y i 0. Now we shall consider the composition of two fuzzy relations. COMPLEMENT = Complement@RD. . the relation R' is defined in the same space as R.5 Composition of Two Fuzzy Relations So far we have considered operations on fuzzy relations defined in the same space as the Cartesian product of two collections of objects.8 0.3 { k ToMembershipMatrix@COMPLEMENTD êê MatrixForm FuzzyPlot3D@R.6 0. w) = 1 .2 0 1 2 V 3 1 2 4 3 W 3. "W". Let R1 be a fuzzy relation in UxV and R2 a fuzzy relation in VxW.5 j z 1 0. w) in VxW.7 z j z j z j z 0.3 0.

W = {1.7. R1 = FromMembershipMatrix@R1MAT.5.2.4. . 81.3.6<<.8 R1 0. and the following fuzzy relations. . 8. R2 ) is a fuzzy relation in UxW. 2. w))) over all v in the set V. R2 = FromMembershipMatrix@R2MAT. R1MAT = 88. . R2 )(u.8. . .1. 2. 0.2<. 881. 0. 4}. . such that for all (u. 81. 81. . . 4<<D. 8. w) = Max(Min(R1 (u. 5}. "R1 "<. 1. 8.7. 3<. 881. . R2 (v.2<.3<<. v).170 Fuzzy Logic Max-Min Composition The max-min composition of relations R1 and R2 denoted by MaxMin(R1 .4. "V". 3}. 1 0. w) in UxW.3<. 0<.2 0 1 2 3 U 4 5 1 3 2 V R2MAT = 88. 81. .1<. AxesLabel → 8"U". 3<<D. MaxMin(R1 . 2.5. Consider for example U = {1. . V = {1. . 4. 3. 81. 3. . FuzzyPlot3D@R1.3.4. 0<. 5<.8. . .6 0.4 0. Boxed → FalseD.

3 0.2 0. MAXMIN = Composition@R1.2 0.2 0.3 0.6 0. "R2 1 0.R2D "<.3 0. "W".2 0 1 2 2 3 U 4 5 1 4 3 W Note that the new fuzzy relation.Chapter 3: Fuzzy Relations 171 FuzzyPlot3D@R2. Type → MaxMinD.1 0.5 0. "W". MAXMIN. R2.1 0.4 0. . Boxed → FalseD. 1 0. AxesLabel → 8"V".2 0 1 2 V 3 1 2 "<. Boxed → FalseD. is defined on the space UxW.R2D 0.7 0.4 j j j j k 0.7 0.4 ToMembershipMatrix@MAXMIND êê MatrixForm 0. AxesLabel → 8"U".3 0.3 0. 4 3 W We can now find the composition of fuzzy relations R1 and R2.8 0.4 0.2 j j 0.8 MaxMin@R1.4 j j j j j 0. i 0.8 R2 0.3 y z z z z z z z z z z z z z z z z { FuzzyPlot3D@MAXMIN. "MaxMin@R1.4 j j j j j 0.6 0.

The max-star composition of such relations is the composition created by replacing the min operation in the previous composition definition by any other operation that is associative and monotonic non-decreasing in each argument. MaxStar(R1 .3 0. w) in UxW.02 y j j 0. The max-star composition is defined such that for all (u.6 0.4 0. R2.12 z z j z j z j z j j 0.2 z z j z j z j z j z k 0. For relation R1 and R2 from previous example.2 0.3 0. which is defined in the following way: For all (u.15 0. then we will obtain a composition referred to as the max-product.8 Max* 0. 4 3 W Again the new fuzzy relation is defined on the space UxW.2 0.7 0. w) = Max(R1 (u. w) in UxW. w)) over all v in the set V.3 0. Type → MaxProductD. MAXSTAR = Composition@R1.7 0.2 { FuzzyPlot3D@MAXSTAR. "Max∗ 1 0.4 0. v) ä R2 (v. w) = Max(R1 (u.03 0. R2 )(u.35 0. MaxProduct(R1 . hence the name of the composition. w)) over all v in the set V.8 0. If we take the algebraic product for the star operation.06 0. v)*R2 (v. ShowDots → True. Boxed → FalseD. "W".2 z z j z j z j z j j 0. In the definition of composition. R2 )(u. this operation is denoted by a star. AxesLabel → 8"U".2 0 1 2 3 U 4 5 1 2 "<.172 Fuzzy Logic Max-Star Composition We continue by considering the two fuzzy relations.4 0. R1 in UxV and R2 in VxW. ToMembershipMatrix@MAXSTARD êê MatrixForm i 0. . we obtain the fuzzy relation.4 0.

2 0 1 2 U 3 4 1 2 4 3 U Note that the membership grades are symmetric about the main diagonal. 881. . 881. . Boxed → FalseD. 81. 1. . 80.3. "R "<.3<.4 0. An example of a symmetric. . u) = a). 81. 0. . . RMATRIX = 88. .6<.3. R = FromMembershipMatrix@RMATRIX. . .4. "U". 8.Chapter 3: Fuzzy Relations 173 3. v) = a) ﬂ (R(v. . .2. u) =1.2. .5.4.6 Binary Relations We now consider binary fuzzy relations in U. u3 . . (R(u.3. . 8. FuzzyPlot3D@R.5. 4<<D. 1. The following relation is a reflexive relation. AxesLabel → 8"U".6.5<<. 1<<.8<. 8. RMATRIX = 881. Reflexivity A binary fuzzy relation R in U is reflexive if for all u in the set U. that is.6. . . .8 R 0.5. binary fuzzy relation in U = {u1 .8. 4<. 8. .5<. 8. u4 } is shown here. R = FromMembershipMatrix@RMATRIX.6 0.2.8. u2 . 4<<D. 1 0. . Symmetry We say that a binary fuzzy relation R in U is symmetric if for all (u.1<.2. 4<. 0. fuzzy relations defined in the Cartesian product UxU. 0.1. v) in UxU. R(u.5<.

FuzzyPlot3D@R.2 0 1 2 U 3 1 3 2 U . v) ¥ Max(Min(R(u.8<<. . R(w. v))) for all w in the set U. . AxesLabel → 8"U". 3<<D. 80. AxesLabel → 8"U".5. Transitivity If a binary fuzzy relation R in U satisfies the condition that for all (u. w). .8 R 0. R(u. RMATRIX = 88. 1. 4 3 U Note that the membership grades of the main diagonal all have a height of 1.4 0.4 0.3. 3<.9. 80. Boxed → FalseD.6 0. Boxed → FalseD.2 0 1 2 U 3 4 1 2 "<. A transitive relation is shown in the following example.5<. "R R = FromMembershipMatrix@RMATRIX. "<. "R 1 0. "U". . . 81.174 Fuzzy Logic FuzzyPlot3D@R. v) in UxU. "U". 1 0. then we say that the relation is transitive.6 0. 881.8 R 0.4<.

v) in UxU.8 TRAN 0.4 z j z j z j z 0.6 0.2 0 1 2 U 3 1 TRAN = Composition@R. v) ¥ Composition(R. "TRAN 1 0.4 0. This proves that this binary fuzzy relation is indeed transitive.8 0. R.5 0. R. where we show both the composition and the original fuzzy relation.5 0. "U". R) must be a subset of R For the binary fuzzy relation we used earlier. AxesLabel → 8"U". v) From this condition.5 y j z j 0 j z 0. R(u. we see that the composition is indeed a subset of the original fuzzy relation. . "<. 3 2 U From the following graph. is the following fuzzy relation. ToMembershipMatrix@TRAND êê MatrixForm i 0. we can formulate that a binary fuzzy relation R in U is transitive if the following condition is true: Composition(R.3 0.8 { k 0 FuzzyPlot3D@TRAN.Chapter 3: Fuzzy Relations 175 Before we check that this is really a transitive relation. Boxed → FalseD. Type → MaxMinD. R)(u. note that the condition for transitivity can be written as follows: For all (u. the composition.

6. . . . .2 0 1 2 U 3 4 1 2 4 3 U . . . 8. R(u. It is a fuzzy relation in U = {u1 .2. "U". RMATRIX = 880. "R R = FromMembershipMatrix@RMATRIXD.4<. u) = 0.8<.4. AxesLabel → 8"U".4. u2 . 3 2 U 1 Antisymmetry A fuzzy binary relation R in U is antisymmetric if for all (u. 0.7. AxesLabel → 8"U".6. v) in UxU.176 Fuzzy Logic FuzzyPlot3D@R.4 0. "<. u4 }. 1<<. 1 0.5. .4.8 R. .TRAN 0.2 0 1 2 U 3 "<. FuzzyPlot3D@R. "R. 0<. u3 .TRAN 1 0. u) or if R(u. ShowDots → True.6 0. 8. v) does not equal R(v.8 R 0. .3. "U".4 0. v) = R(v.6 0. TRAN. An example of an antisymmetric relation is shown here. Boxed → FalseD. Boxed → FalseD. 8.2.

8. based on materials of Second World Conf. H. S. 338-353. L. 2nd ed. Uncertainty. Edited by A. 1991. Fuzzy Sets. Information and Control. J. A. Spain. Zadeh. Prentice Hall. Fuzzy sets. J.Chapter 3: Fuzzy Relations 177 References G. 1988. Trillas. Englewood Cliffs. MA. A. Fuzzy Set Theory and Its Applications. vol. Boston. Stachowicz and M. Klir. NJ. and Information. Zimmermann. E. Universidad Politecnica Las Palmas. 1982. pp. . 1965. Kochanska.. Kluwer Academic Publishers. and T. and E.. Ballester. Graphic interpretation of fuzzy sets and fuzzy relations. Cardus. M. Folger. Mathematics at the Service of Man. D.

.

We start with a list of the input-output pairs for the process. This loads the package. this notebook demonstrates only a few of those functions.1 Introduction The goal of this notebook is to demonstrate how the Fuzzy Logic package can be used for modeling. .2 Representing the Model Input The Process In this notebook. In this example. we will be modeling a theoretical relationship between a set of input and a set of output. and the second item is the system output. so if their output was 400. We only look at one example from the paper. To demonstrate fuzzy modeling. 20}. it could be thought of in the following way: if the input is approximately one then the output is around twenty. 1987]. ours will be 4. but it may be instructive to try to duplicate some of the other models with different operators. We plan to show how fuzzy sets can be used to represent a real system or process. In[1]:= << FuzzyLogic` 4. we use many functions from the Fuzzy Logic package. refer to the Introduction and Manual.4 Fuzzy Modeling 4. we start with a list of specific points. In this demonstration. exact points are not required. The first number in each pair represents the input to the system. It is this input-output relationship that we intend to model. along with standard Mathematica functions. The Fuzzy Logic package contains numerous functions for working with fuzzy sets and fuzzy logic. We scaled the input and output numbers used in the original paper by 100. For specific information on the functions used in this notebook. we use modeling data from a paper in which the authors investigate the effects of using various fuzzy operators for constructing models [Stachowicz and Kochanska . but for fuzzy modeling. Instead of the first input being exactly {1.

4<. 6<.180 Fuzzy Logic In[2]:= OriginalData = 881. Ismall. Izero. PlotLabel → "INPUT"D. Notice in this example how we use one of Mathematica's standard plotting options. so you can customize the look of your plots. Ibig. From the original data. Notice how we assign linguistically significant names to the six membership functions. Imedium. One of the first things to consider when designing a model is the range for the input variables. 811. Once we have a reasonable range. 11<D. we use this range as the universal space for our input variable. We can take a look at our membership functions with the FuzzyPlot command.2 U 1 2 3 4 5 6 7 8 9 10 11 12 INPUT . UniversalSpace → 81. Remember. PlotLabel. 20<. we can consider how to divide that range into descriptive linguistic terms. In[4]:= FuzzyPlot@INPUT. 20<<. Isuperbig< = Viewing the Membership Functions CreateFuzzySets@6. Membership Grade 1 0. 810. 86. 83. For this model. 88. We will repeat that using the CreateFuzzySets function. 82. In[3]:= INPUT = 8Inull. The following command divides the universal space into six even triangular fuzzy sets. 12<. with our fuzzy plotting function. PlotJoined → True.4 0. 84. 12<. 89.6 0. all of Mathematica's standard plotting options can be used with the FuzzyPlot function. we see that the input ranges from 1 to 11. 5<. 5<. 87.8 0. we are using 6 membership functions to divide up the input universal space. Dividing the Input Range 85. 6<. 9<. 9<.

looking at the list of rules that follow. we need only specify a set of rules to create a model. we see that the first pair in the list is {In! ull. The first item in the pair represents the input condition or the if part of the implication. NSmall. Looking at our original data. This rule would be equivalent to the verbal statement: .2 U 5 7 9 11 13 15 17 19 21 OUTPUT 4.4 0. 20<D. For this example. For example. we see that the output ranges from 4 to 20 over the input range. NSuperbig}.Chapter 4: Fuzzy Modeling 181 4. It is important when naming membership functions to use distinct names. Membership Grade 1 0. In this package. The second item in the pair represents the output condition or the then part of the implication. NBig.6 0. In[6]:= FuzzyPlot@OUTPUT. NMedium. PlotJoined → True. the range of the output variable must be divided up into various membership functions. Notice how we give the five fuzzy sets linguistically significant names from NZero to NSuperbig. In[5]:= OUTPUT = 8NZero.8 0. We will do the same thing by again using the CreateFuzzySets function. UniversalSpace → 84. we use this as our universal space. the authors of the original paper chose to use five fuzzy sets to represent the output. We plot the output membership functions using the FuzzyPlot function.3 Representing the Model Output Dividing the Output Range Like the input. PlotLabel → "OUTPUT"D.4 Creating Linguistic Control Rules With our inputs and outputs defined. NSuperbig< = Viewing the Membership Functions CreateFuzzySets@5. rules are organized as a list of ordered pairs.

The BuildModel function creates a fuzzy relation from each of the rules we specified using the SetsToRelation function. The end result of the BuildModel function is a single fuzzy relation. we call BuildModel with our list of rules. and that is the subject of the paper we are following [Stachowicz and Kochanska. NSmall<. The first data point is {1. NZero<. We plot the linguistic rules using the FuzzyGraph function. 20}. The specified rules may be based on test data or simply on observations. In[7]:= TheRules = 88Inull.5 Building the Model With all the necessary ingredients defined. NSuperbig<. NZero<. Note that there is a rule associated with each of the input membership functions. 20 18 16 14 12 10 8 6 2 4 6 8 10 4. we can see the basis for the first rule. 1987]. Here is the complete list of rules that were used in the paper [Stachowicz and Kochanska. 1987]. It is possible to use other operators to combine the rules. 8Ibig. To do that. which should give a good representation of the process we are modeling. . NSuperbig<<. which corresponds to a very small input (Inull) and a very large output (NSuperbig) . By examining our original data. It then combines all of the fuzzy relations using the Union operator.182 Fuzzy Logic if the input is Inull then the output is NSuperbig You see that this type of modeling is intuitively easy. we can create our model. 8Isuperbig. 8Izero. NSmall<. 8Ismall. In[8]:= FuzzyGraph@TheRulesD. Viewing the Linguistic Rules 8Imedium.

which represents the input.Chapter 4: Fuzzy Modeling 183 Creating the Model Fuzzy Relation This statement creates a fuzzy relation that will model our process. we use a MeanOf! Max defuzzification to get a crisp value.6 Using the Model Inferencing To use our model to evaluate inputs. 1 0. Displaying the Model Fuzzy Relation We look at the fuzzy relation that will serve as the model for our process using the FuzzySurfacePlot function. In[9]:= ModelRel = BuildModel@TheRulesD.5 0. In this example. We need only provide this function an integer in the range 1 to 11. which is our model. In[10]:= FuzzySurfacePlot@ModelRelD. It performs a MaxMin type Composition with them to come up with fuzzy output. . we use the CompositionBasedInference function. It takes as arguments a fuzzy set.25 0 1 3 5 V 8 7 9 11 4 6 20 18 16 14 12 W 10 4.75 Grade 0. and a fuzzy relation. We use a singleton fuzzy set as input to the inferencing function. Here we set up a function that calls the inferencing function with the proper input. and MyModeler will provide the crisp output of the model.

1<<. 12. 7. 12. we make a table of input-output pairs for the entire range of inputs.125 20. . 1. 11<D. 8i. We accomplish this with Mathematica's Table function. In[12]:= ModelResults = Table@8i. 4. 5. ModelRelDD Table of Results To see what kind of results the model provides. and we will look at the results in TableForm. "ModelOutput"<DD Input 1 2 3 4 5 6 7 8 9 10 11 ModelOutput 20. 11<D. Out[13]//TableForm= In[13]:= TableForm@Prepend@ModelResults. N@MyModeler@iDD<.125 8. 8. 4. 7. UniversalSpace → 81.184 Fuzzy Logic In[11]:= MyModeler@inp_D := MeanOfMax@CompositionBasedInference@ Model Results FuzzySet@88inp. 8"Input".

5 10 7. original output. Abs@OriginalDataPi. ModelResultsPi. 21<<. In[14]:= ListPlot@Transpose@ModelResultsDP2T. PlotStyle → 8Hue@0D. . model output. 4. 3<D. 11<D.Chapter 4: Fuzzy Modeling 185 Graph of Results We plot these results to see how well our model performs. 2TD<. 2T.5 15 12. and absolute error. OriginalDataPi.7 Evaluating the Model To see how well our model performed. 8i. In[15]:= CompareTable = Table@8i. We can compare the results in table form and with a graph. we compare the original data with the results from our model. 1. 2T. Model Results 20 17.02D<. 2T − ModelResultsPi.5 5 2 4 6 8 10 PlotLabel → "Model Results". 11<. Table Comparison Here we create a table showing input. PointSize@. PlotRange → 880. AxesOrigin → 80. We do this with the ListPlot function. 83.

4. "Model". This function will plot the original process data as large blue dots and our model data as smaller red dots. 11. AxesOrigin → 80. PointSize@.186 Fuzzy Logic In[16]:= TableForm@Prepend@CompareTable. 83.5<<.5<. or membership functions. PlotRange → 880. PointSize@.125 8. 4. "AbsErr"<DD Out[16]//TableForm= Input 1 2 3 4 5 6 7 8 9 10 11 Process 20 12 9 6 5 4 5 6 9 12 20 Model 20. 20. PlotRange → 880. 7. 1. PlotStyle → 8Hue@0D. 1. DisplayFunction → Identity. AbsErr 0.5 15 12. Feel free to create a different model and compare your results to this one.015D<. 12. 20 17. 3<D. 0. 83. 5.5 10 7. In[17]:= Show@ListPlot@Transpose@OriginalDataDP2T. defuzzification strategies.125 0. 8"Input". 7. 3<D. DisplayFunction → $DisplayFunctionD. 12. rules. Graphical Comparison We again use ListPlot to show the results.5<<. 1. 1. 1. ListPlot@Transpose@ModelResultsDP2T.6D. PlotStyle → 8Hue@0. 11.5 5 DisplayFunction → Identity. "Process". 1. 20. 2 4 6 8 10 .125 1.5<.125 20. It is possible to create entirely different models by changing operators. You can see that the model performs quite well for its simple design.03D<. 8. AxesOrigin → 80. 0.

M. L. Proc. vol. S. 1986. S. 8. pp. 1975. Zadeh.North American Fuzzy Information Society '86. L. The concept of a linguistic variable and its applications to approximate reasoning–II. A. Zadeh. vol. L. Information Sciences. vol. E. 301-357. Stachowicz and M. pp. A. E. 8. New Orleans.of Second International Fuzzy Systems Association Congress. A. 1975. Kochanska. 9. 199-249. Zadeh. Fuzzy modeling of the process. . 43-80.Chapter 4: Fuzzy Modeling 187 References M. Tokyo. pp. 1987. 1975. Stachowicz and M. The concept of a linguistic variable and its applications to approximate reasoning–I. Analysis of the application of fuzzy relations in modeling. Kochanska. Proc. Information Sciences. The concept of a linguistic variable and its applications to approximate reasoning–III. Information Sciences.

.

To model this scenario. we use many of the commands from Fuzzy Logic package as well as a few additional routines to model the truck [Freeman 1994]. the next item to address is the range of the inputs and outputs.5 Fuzzy Logic Control 5.2 Defining Input Membership Functions Truck Position Set Universal Space One of the first questions to ask when designing a fuzzy logic controller is the following: What are my inputs and outputs? Once this question is answered. we assume our parking lot is a graph that is 100 units wide and 100 units tall. The truck may start at any initial position and orientation in the parking lot. When talking about fuzzy sets. Our loading dock is located at the top-center of the graph at position {50. In[1]:= << FuzzyLogic` 5. 100}. This loads the package. To implement our fuzzy logic controller. this range is referred to as the universal space. Our controller decides what steering angle is needed at each stage to back the truck up correctly. we look at how to design a fuzzy logic control strategy to back a truck up to a loading dock. The goal of the controller is to come up with a steering strategy to back-up a truck so that it arrives perpendicular to a dock.1 Introduction In this notebook. . We limit the steering angle to be between -30 and 30 degrees.

Plot the Membership Functions Next. To simplify the later construction of our membership functions. We do not worry about that here. RI = FuzzyTrapezoid@65. 100D. LC = FuzzyTrapezoid@30. LC. In[3]:= LE = FuzzyTrapezoid@0. 0 to 100.6 0. These variables are used to describe the truck's x-position on the graph. we need a universal space that ranges from 0 to 100. we change the default universal space now to be the desired range. The PlotJoined option is set to True to produce the line graph shown. 100. the first input we use is the truck's x-position on the graph. 40. 50. 60.2 U 0 20 40 60 80 100 TruckPos . RC = FuzzyTrapezoid@50. 100<D. we plot the membership functions for our first input with the FuzzyPlot function. PlotLabel → "TruckPos"D. PlotJoined → True. and RI– Right. 55D. The names of our fuzzy sets have the following linguistic meanings: LE–Left .8 0. 70D. with the following command. Membership Grade 1 0. UniversalSpace → 80. CE = FuzzyTrapezoid@45. 50D. We collect all the membership functions together under the heading TruckPos. 10. 35D. We use the FuzzyTrapezoid function to construct our membership functions.190 Fuzzy Logic In our example. RI<. In[8]:= TruckPos = 8LE. 60. Since we decided on a parking lot 100 units wide.4 0. In[2]:= SetOptions@FuzzySet. only guidelines. we simply follow the example used by Kosko [Kosko 1992]. 0. There is no optimal solution for choosing membership functions. which is the first input to our controller. 50. CE. In[9]:= FuzzyPlot@TruckPos. CE–Center . 90. RC. Define Linguistic Variables We next need to decide on the number and shape of the membership functions to use. 40. RC–RightCenter. LC–LeftCenter.

LB = FuzzyTrapezoid@171. 23. LU = FuzzyTrapezoid@126. In[18]:= Angle = 8RB. to 270 degrees. 157. 144D. LB<. We group all of the membership functions under the name Angle. LV = FuzzyTrapezoid@90. LU–Left Upper. 90. the back of the truck will face the left side of the graph. 108D. 90. In[10]:= SetOptions@FuzzySet. VE. 63.1<<D. UniversalSpace → 8−90. VE–Vertical. 225. . 189D. For this input. 270<D. We set the universal space for our second input just as we did for our first input. the back of the truck will be facing toward the right of the graph.1<<D. 23. 63. 54D. 270D ‹ FuzzySet@88270. and LB–Left Below. 90D. Plot Membership Functions Here is a plot of the second input's membership functions. For angles between -90 and 90 degrees. 225. 9D ‹ FuzzySet@88−90. VE = FuzzyTrapezoid@72. where it is again facing away. LV–Left Vertical. RV. . −45. −45. RU–Right Upper. . RU. RV–Right Vertical. LU. Define Linguistic Variables We again use Kosko's membership functions [Kosko 1992] for this input. which indicates that the back is facing the dock and the truck is perpendicular to the dock. which is the second input to our controller. The truck angle should end up near 90 degrees. 117. the universal space ranges from -90 degree. LV. where the back of the truck is facing away from the dock. and for angles between 90 and 270 degrees. 157. In[11]:= RB = FuzzyTrapezoid@−90. 117.Chapter 5: Fuzzy Logic Control 191 Truck Angle Set Universal Space The second input is the truck's orientation or the angle between a line down the center of the truck and a line horizontal to the parking lot. RV = FuzzyTrapezoid@36. The linguistic variables have the following meanings: RB–Right Below. RU = FuzzyTrapezoid@−9.

NS–Negative Small. Membership Grade 1 0. −6.6 0. PS–Positive Small. In[20]:= SetOptions@FuzzySet. NS = FuzzyTrapezoid@−12. NM–Negative Medium. NM. In[28]:= SteeringAngle = 8NB. which is our single output. PB<. −6. PS = FuzzyTrapezoid@0. NM = FuzzyTrapezoid@−25. 0. 30<D. In[21]:= NB = FuzzyTrapezoid@−30. 6. PM = FuzzyTrapezoid@5. −5D. PB–Positive Big. 6.4 0. . 12D. −30. UniversalSpace → 8−30. We group all the output membership functions under the name SteeringAngle. PM. 25D. NS. 15. This then is the universal space we need for our output membership functions. PS.3 Defining Output Membership Functions Set Universal Space The output of our controller is a steering angle limited to the range -30 to 30 degrees. −15D. 30. PB = FuzzyTrapezoid@15. 0D. ZE = FuzzyTrapezoid@−5. 0.2 U -50 0 50 100 150 200 250 Angle 5. 5D. PM–Positive Medium. 30D. PlotJoined → True. Defining Linguistic Variables We again use the membership function definitions from the Kosko book [Kosko 1992] to define our output membership functions. These names are used frequently in defining fuzzy logic controllers. This time we name our membership functions : NB–Negative Big.8 0.192 Fuzzy Logic In[19]:= FuzzyPlot@Angle. −15. PlotLabel → "Angle"D. 15. −15. ZE–Zero. −30. 30. ZE.

The rules are formed with linguistic terms. PB<. RU. PS<. NS<<. PM<. RB. 8RC. NS<. The first two item in each triplet are the input conditions and the third item is the output condition. RV. LB. then output = #3. NM<. PlotLabel → "SteeringAngle"D. 8LC. 8RI. In[30]:= ControlRules = 88LE. LV. which follow human intuition. PS<. 8RI. PM<. PB<. VE. PS<. 8LE. 8LC. RV. NM<. LV. NB<. 8RC.RB. PS<. PM<. PB<. PM<. NM<. 8LE. NB<. 8CE. 8CE. Our fuzzy inference system accepts rules as a list of triplets.Chapter 5: Fuzzy Logic Control 193 Plot Membership Functions Here we see how our output membership functions looks. LU. VE. . RU. This list represents rules of the form: if input1 = #1 and input2 = #2. 8CE. NM<. 8RC. RB. LB. 8RI. LB. RB. RV. 8LC. 8LC. 8CE. NM<. LV. PB<. RU. 8RI. PB<. PM<. In[29]:= FuzzyPlot@SteeringAngle. ZE<. NB<. PS<. VE. NB<. NB<. NS<. 8RI. LB. 8RC. PM<. the first rule. 8RC. 8RC. 8LE. 8LE. LU. 8RI. Membership Grade 1 0. then SteeringAngle should be PS (Positive Small). 8CE. For example. NM<.PS}. 8LC. LU. 8RI. RV. LV. PlotJoined → True. LV. Typically rules for fuzzy logic controllers appear in if-then form. 8LE. RB. RB. 8CE.4 Defining Control Rules The final item needed for a fuzzy logic controller is a set of rules or a rule base. NM<. 8CE.6 0. PM<. 8LC.8 0. RU. LB. RU. LU. NS<. NS<. 8RC. LU. {LE. looking at the following control rules. represents the linguistic rule: if TruckPos is LE (Left) and Angle is RB (Right Below). VE. 8LC.4 0.2 U -30 -20 -10 0 10 20 30 SteeringAngle 5. VE. RV. 8LE.

Line@8850.2 s l. In[32]:= simulateTruck@x0_. c = NACosA %%%%%%%%%%%%% EE=. . Axes → True. Line@880. 80. newPhi. newPhi=EE. 100<. 8100. 100<<. %%%%%%%% − c l. − %%%%%%%% =. − %%%%%%%% . newPhi = phi + Steer@phi. y = y0. 8100. − %%%%%%%% − c l. Line@88100. AxesOrigin → 80. the angle and truck position. %%%%%%%% − s l.2 s l. % % % % % % % 4 4 2 2 2 2 2 cw cw cw cw cw cw − %%%%%%%% − s l. phiDD These next two functions are for modeling the truck-backing. resultE %%%%%%% %%%%%% 180 180 phi π phi π ModuleA9s = NASinA %%%%%%%%%%%%% EE. 9 %%%%%%%% . % % % % % % 4 4 4 4 2 2 GrayLevel@0D. AppendToAresult. y. 8l_. 100<. PlotRange → 880. y + 4 SinA %%%%%%%%%%%%%%%% % E.2 c l. 100<. %%%%%%%% . 100<<D. phi0_D := ModuleA8x = x0. 0<EEE. y0_. The two inputs to this function. The function will return a crisp output that is the controller's recommended steering angle. %%%%%%%% ==EE.2 c l. y< + 99− %%%%%%%% . w_<D := WhileAy ≤ 95. %%%%%%%% − 1. phi_<. − %%%%%%%% − 1. %%%%%%%% − 1. 850. %%%%%%%% − s l. In[31]:= Steer@phi_. AspectRatio → Automatic.194 Fuzzy Logic 5. SteeringAngle. phi = phi0. − %%%%%%%% − c l. ControlRules. phi and x represent the two inputs to the controller. result = 8<<.5 Simulation Functions This section contains functions that will allow us to simulate the truck backing. Angle. %%%%%%%% − c l. % % 180 180 sw sw sw sw sw LineATransposeA8x. 95<<D=. In[33]:= showTruck@8x_. xD. % % % % % 2 2 2 4 4 sw sw sw sw cw cw cw − %%%%%%%% − 1. x_D := CenterOfArea@ RuleBasedInference@TruckPos. newPhi π newPhi π 8x. phi< = NA9x + 4 CosA %%%%%%%%%%%%%%%% E. This first function is essentially the fuzzy logic controller.7D.E. They contain functions that model the movement of the truck and draw the parking lot and truck graphics. 0<<D. − %%%%%%%% − s l. These functions are from a Mathematica Journal article by James Freeman [Freeman 1994]. y_. ShowAGraphicsA9Hue@0. x. 100<.

100 80 60 40 20 20 40 60 80 100 . In[34]:= simlist = simulateTruck@85. In[35]:= graph1 = HshowTruck@#1. we start the truck at position {85. To see an animation of the truck backing. click the cell bracket containing all of the truck graphics. and truck angle.6 Test Run 1 Run Simulation We provide the function simulateTruck with an initial x-position. The buttons that appear at the bottom border during animations can be used to control the speed and direction of the animation. 190D. 810. Now select Animate Selected Graphics from the Graph pull down menu. 20} with an initial angle of 190 degrees.Chapter 5: Fuzzy Logic Control 195 5. 20. For the first simulation. Model Results The function below will draw a graph showing the location and angle of the truck in the parking lot. y-position. To stop the animation click anywhere in the notebook. 5<D &L ê@ simlist. This will cause the truck to appear to move in one of the graphs. this will highlight the bracket.

7 Test Run 2 Run Simulation We can run another simulation from a different starting position and angle. 100 80 60 40 20 20 40 60 80 100 5. and phi.196 Fuzzy Logic Show Complete Trajectory The complete trajectory of the truck can be seen using the Show command. In[37]:= test2 = simulateTruck@30. . y. 18. You can test this program with your own initial values for x. The controller should work if there is enough room from any position and angle. In[36]:= Show@graph1D. 260D.

5<D &L ê@ test2. 810. 100 80 60 40 20 20 40 60 80 100 . In[39]:= Show@graph2D. we show the complete trajectory of our second test run. In[38]:= graph2 = HshowTruck@#1. You can again animate the graphic cells in this section using the animation option.Chapter 5: Fuzzy Logic Control 197 Model Results We again model the results. 100 80 60 40 20 20 40 60 80 100 Complete Trajectory Again.

SteeringAngle.198 Fuzzy Logic 5. . 270. Angle. 20 SteerAngle 0 -20 2 4 6 Angle 8 10 2 4 10 8 6 Position References J. −90. 10<. Fuzzy systems for control applications: the truck backer-upper. NJ. 11<. In[40]:= ControlTable = In[41]:= ListPlot3D@ControlTable. 1992. 4. "SteerAngle"<. vol. 81. We have constructed such a surface here. A. 1994. CONTROL SURFACE PlotRange → 881. and the output is represented by the height of the graph above each input pair. AxesLabel → 8"Angle". 36<D. 8−30. pp. 0. PlotLabel → "CONTROL SURFACE"D. Table@CenterOfArea@RuleBasedInference@TruckPos. 64-69. i. The Mathematica Journal. 11<. This is a 3D graph in which the inputs form the base of the graph. Englewood Cliffs. B. 8i.8 Control Surface A convenient way to examine a two-input/one-output control strategy is to look at a control surface. ControlRules. Freeman. 8j. 30<<. 100. Prentice Hall. Kosko. jDD. Neural Networks and Fuzzy Systems: A Dynamical Systems Approach to Machine Intelligence. "Position".

In[1]:= << FuzzyLogic` 6. This is a common representation of a fuzzy number. Here we create fuzzy numbers ranging from NegSIX (Negative Six) to SIX. The following function is used to create fuzzy numbers. . we investigate fuzzy arithmetic with a universal space from -100 to 100. UniversalSpace → 8−100. we should use a large universal space because the intervals over which fuzzy numbers are defined widen as arithmetic operations are performed.2 Creating Fuzzy Numbers When working with fuzzy numbers and performing fuzzy arithmetic. −6. In[2]:= SetOptions@FuzzySet. NegFOUR. x. In[4]:= 8NegSIX. 100<D. NegONE. 8k. 6<D. like traditional numbers. The function accepts an integer as its argument and returns a triangular fuzzy set centered around the integer. fuzzy numbers can be negative or positive. THREE.1 Introduction This notebook deals with discrete fuzzy arithmetic operations. FOUR. SIX< = Table@FuzzyNumber@kD. We'll be using the Fuzzy Logic package. In[3]:= FuzzyNumber@x_ ? IntegerQD := FuzzyTrapezoid@x − 3. NegTWO. NegFIVE. ZERO. We change the default universal space to this range with the following command. along with standard Mathematica functions. NegTHREE. TWO. ONE.6 Fuzzy Numbers 6. so the universal space should be symmetric around zero. x. This loads the package. FIVE. Taking this into consideration. x + 3D We can create a set of fuzzy numbers by using the function we just defined and Mathematica's Table function. Also.

200 Fuzzy Logic 6. it is traditional to write out the operation from left to right. """" ==. 9−3. In[9]:= Sum1 = NegFOUR∼ FP ∼ THREE Out[9]= FuzzySetA99−5.g. To simulate the traditional form. we use Mathematica's infix form in the following examples. Instead of surrounding the operands with square brackets and the function name (e. B]). UniversalSpace → 8−100. """" =. 1<. we perform fuzzy addition on the fuzzy numbers NegFOUR and THREE. 1 1 2 2 3 3 3 3 2 2 1 1 90. 1<E 3 3 3 3 . """" =. 9−4. Func[A. but the names of these functions are quite long. we see that the result is a fuzzy number centered around -1. A~Func~B). To save some typing. """" =. """" =. the infix form locates the function name between the operands and surrounds the operand with tildes (e. """" =. we rename the functions here to shorten their names. 9−2. This is the answer we would expect to get when performing the operation -4 + 3.. 100.g. In[5]:= FP := DiscreteFuzzyPlus FM := DiscreteFuzzyMinus FX := DiscreteFuzzyMultiply FI := DiscreteFuzzyImage Using Infix Form When performing arithmetic operations.. with the sign for the operation to be performed located between the two numbers on which it is to be performed. 91.3 Fuzzy Arithmetic Shortening Arithmetic Names The Fuzzy Logic package comes with a number of convenient functions for performing discrete arithmetic. In this example. 93. """" =. 92. After defuzzifying the result with the MeanOfMax method. 8−1. """" =. Let's look at the following example to see how this works.

ShowGraph → TrueD. which would be the solution to the equivalent nonvisual operation.8 0.8 0. By using the MeanOfMax defuzzification.6 0. ShowGraph → TrueD.2 U 100 -100 -50 0 50 Example 1 The following example demonstrates the fuzzy equivalent of the operation: (5 . Mean of max is −18. Mean of max is −1. Membership Grade 1 0. In[12]:= MeanOfMax@Tot2.Chapter 6: Fuzzy Numbers 201 In[10]:= MeanOfMax@Sum1. Membership Grade 1 0.2 U 100 -100 -50 0 50 .(-1)) * (-3) In[11]:= Tot2 = HFIVE ∼ FM ∼ NegONEL ∼ FX ∼ NegTHREE.4 0.6 0.4 0. we receive -18.

New York. M. Introduction to Fuzzy Arithmetic Theory and Application. Kaufmann and M.4).2 U 100 -100 -50 0 50 References A. Mean of max is −4. In[14]:= MeanOfMax@Tot2. Wang and G.8 0. Van Nostrand Reinhold.202 Fuzzy Logic Example 2 In this example.4 0. . ShowGraph → TrueD. we perform the fuzzy equivalent of the operation: -(5 + 3 . THREED. Z. Membership Grade 1 0. Plenum Press. Gupta. After defuzzification. FOURDD. New York. 1991. Klir. Fuzzy Measure Theory. we receive the expected result of -4. In[13]:= Tot2 = FI@FM@FP@FIVE.6 0. J. 1992.

In engineering practice. along with standard Mathematica functions.2 Creating Digital Fuzzy Sets One of the ways by which fuzzy membership functions and fuzzy systems may be categorized is according to whether the membership functions are continuous or discrete.7 Digital Fuzzy Sets and Multivalued Logic 7. We'll be using the Fuzzy Logic package. 1]. A : U Ø [ 0. 1] Numerical processing using digital computers requires finite data with finite precision. This loads the package. then the continuous-universal space membership function A(u) is called an analog fuzzy sets. system complexity .1 Introduction This notebook deals with digital fuzzy sets and Æukasiewicz multivalued logic arithmetic operations. No matter how elegant the theory. If a continuous-universal space membership function A(u) can take on any value (the grade of membership) in the continuous interval [ 0. In[1]:= << FuzzyLogic` 7. Definition 1 A continuous-universal space membership function has a value defined for each point in universal space and a continuous-universal space system operates on and produces continuous-universal space membership functions. we are often forced to make compromises.

A : {u1.. then we call this fuzzy set a digital fuzzy set. n . . can be arranged in a sequence. 1}). a finite number of the elements of set U and the grade of membership A(u) is taken into consideration. an analog fuzzy set's membership function is discretized along both the universal space and membership-value dimensions. . u2. Let U = !+ be the set of possible ages for teens. these approximations will not be troublesome. while membership-values can take n = 2 3 distinct values (that is. . Assume that universal space is quantized into 32 discrete values with increment equal 1 ( Universal! Space → {0. 1985).. From the standpoint of practical applications. . n . Example 1 Fuzzy set with continuous U. they are encoded in three bits).204 Fuzzy Logic often demands a numerical approach to analysis. Then the fuzzy set A = " about 10 years old" may be expressed as In[2]:= AAnalog[u_]=1/(1+((u-10)/4)^4). us } Ø [ 0.2/n-1. An assumption of denumerability of the universal space U permits a very simple graphic interpretation of the fuzzy sets defined in U (Stachowicz and Kochanska. u3. .. 31.1/n . In most applications. u3. A : {u1. n¥2 of distinct values.1. especially when using computational techniques. 1/n . One can plot for each element a segment of the length corresponding to the value of the membership function of the given element in the fuzzy set under consideration.1} For digital implementation. ..1.. . us } Ø {0/n .. 1] If a discrete-universal membership function can take only a finite number.1. 2/n . u2. The elements of the collection of objects of space U. So we dedicated 32 x 3 = 96 bits for each linguistic value. due to it denumerability. Definition 2 A discrete-universal space membership function has a value (the grade of membership) only at discrete points in universal space and a discrete-universal space system operates on and produces discrete-universal space membership functions.

2 Age 0 5 10 15 20 25 30 Discrete Fuzzy Set Finally.6 0.8 0. 31. 1} then the discrete fuzzy set A has a form : In[4]:= ADiscrete=CreateFuzzySet[AAnalog. AxesLabel->{"Age"."A"}.Chapter 7: Digital Fuzzy Sets and Multivalued Logic 205 In[3]:= Plot[ AAnalog[u].UniversalSpace->{0. a digital fuzzy set A (Æukasiewicz Set) with discrete universal space and n = 8 levels has the following form: . let UniversalSpace -> {0. A 1 0.31}.PlotLabel->" Discrete Fuzzy Set".0.6 0.{u.PlotLabel->" Analog A 1 0.31. AxesLabel->{"Age"."A"}. Now.1}]. GridLines->Automatic].8 0. In[5]:= FuzzyPlot[ADiscrete.2 Age 5 10 15 20 25 30 Analog Fuzzy Set Fuzzy Set"].4 0.4 0.

4 0.812772 0. #### .941176. 1<. 89. #### =. 1<. 9 #### . 0. GridLines->Automatic]. 1. 0. 0.00888365.290579.00196053. #### =.<. 0.00243272. 1 2 4 5 0. 0.024961.00131459.00661978. 0. #### .ADigital}] Out[8]= 980. Let's compare the discrete and digital form of the fuzzy set A using the concept of the Hamming distance. 0. 0. 0.759644. 0.PlotLabel->" Digital Fuzzy Set".8 0. 0. 916.0963493. 1<.0588235. 810. 0. 1<.206 Fuzzy Logic In[6]:= ADigital=ToDigital[ADiscrete. #### =.996109. 811.0171847.ADigital] Out[9]= 0. AxesLabel->{"Age". 1<. 31. 95. #### =. 0. 94. 914. UniversalSpace → 80. #### =. #### =. 7 7 7 7 7 5 4 2 1 1 913.00305573. #### ==. 97.6 0. 0. #### .5.2 Age 0 5 10 15 20 25 30 Digital Fuzzy Set 1 1 2 4 5 993. 0. 915. 88.164948."A"}. 812.00389105. #### =.0375532. In[9]:= HammingDistance[ADiscrete. 1== 7 7 7 7 . 1<E 7 7 7 7 7 Let's compare the level sets for discrete and digital form of the fuzzy set A. 0.00503135. In[8]:= Map[LevelSet.00159744. #### =.8] Out[6]= FuzzySetA In[7]:= FuzzyPlot[ADigital. 0. 917. 0. #### =. A 1 0.0121951. 96.{ADiscrete.

3. Jan Æukasiewicz used only negation and implication as primitives and defined the other logic operations in terms of these two primitives. These values are obtained by evenly dividing the interval between 0 and 1. Æukasiewicz. The sequence ( L2.3. . p ﬂ q = min ( 1. . These values can also be interpreted as degrees of truth.UniversalSpace->{0. In[12]:= Luk1=DigitalSet[1. The first series of n-valued logic was proposed by the great Polish logician Jan Æukasiewicz in the early 1930s as a generalization of his three-valued logic.5. p ñ q = 1 .Chapter 7: Digital Fuzzy Sets and Multivalued Logic 207 7. L3. p ﬂ q = ( p' ﬁ q' )' . used negation and implication as primitives and defined the other logic operations using these two primitives as follows: p ﬁ q = ( p ﬂ q ) ﬂ q. and union on fuzzy sets. p ﬁ q = max ( p. q ). conjunction.» p . operations of negation. In[13]:= Luk2=DigitalSet[3. He defines logical connectives by the following equations: p' = 1 . and disjunction on fuzzy propositions are defined in the same way as the operations of complementation. In[10]:= SetOptions[FuzzySet. 1]. exclusive. Linf) of these logics contains two extreme cases L2 and Linf.3 Æukasiewicz Multivalued logic For any given n.q p ﬂ q = min ( p. q ). .p + q ).1}]. Logic L2 is the classical two-valued logic. SetOptions[FuzzyPlot..5]. 1 .ShowDots->True]. the truth values in a multivalued logic are labeled by rational numbers in the unit [0.. Under this correspondence.3.7]. intersection.q ». Example 2 The introduction of new intermediate truth value in three-valued logic naturally affects the truth-table definitions of the five connectives of classical logic.7. Logic Linf is an infinite-valued logic and is isomorphic to fuzzy set theory based on the standard fuzzy operators. pñ q = ( p ﬂ q ) ﬂ ( qﬂp ). in fact.

4 0.4 0. In[17]:= FuzzyPlot[Luk1.Complement[Luk2]].2 U 0 1 2 3 4 5 6 7 8 Let's perform the standard min intersection: In[18]:= IntA=Intersection[Luk1.Luk2. .8 0.Impl].Luk2].Complement[Luk1]].6 0. In[19]:= IntB=Complement[Implication[Implication[Complement[Luk1]. Membership Grade 1 0.Comple ment[Luk2]]].6 0.2 U 0 1 2 3 4 5 6 7 8 In[16]:= Impl= Implication[Luk1. This operation can also be performed using the Implication and Complement primitives. Luk2]. Membership Grade 1 0.208 Fuzzy Logic In[14]:= Complement[Luk1].8 0. FuzzyPlot[Luk1.

. J. S. Ballester. Upper Saddle River. Graphic interpretation of fuzzy sets and fuzzy relations. Trillas.. Kluwer Academic Publishers.Luk2. Clair. 1996. Uncertainty. . Englewood Cliffs. Fuzzy Sets. M. H. A. 1997. D. Prentice Hall. G.Luk1].2 U 0 1 2 3 4 5 6 7 8 References G. MA. and Bo Yuan . NJ.Chapter 7: Digital Fuzzy Sets and Multivalued Logic 209 In[21]:= Equality[IntA. St. NJ. J. 3rd ed. 1995. Edited by A. Fuzzy Sets and Fuzzy Logic: Theory and Applications. Ute H. G. may be expressed as the following proposition: [( p ﬂ q ) ﬂ p ] ﬂ q In[22]:= Modusponens=Implication[Intersection[Implication[Luk1. for example.Modusponens].8 0. based on materials of Second World Conf. Prentice Hall. and T. Cardus. Zimmermann. Mathematics at the Service of Man. Kochanska. Stachowicz and M. Universidad Politecnica Las Palmas. In[23]:= FuzzyPlot[Luk1. Klir. Klir. Fuzzy Set Theory and Its Applications. and E. 1982. Folger. Boston. Upper Saddle River. E. Spain.Luk2]. and Bo Yuan. J. 1988. Klir.IntB] Out[21]= True Modus ponens. J. Fuzzy Set Theory.4 0. NJ. Prentice Hall. and Information.Luk2].6 0. Membership Grade 1 0.

.

82. If the Fuzzy Logic package isn't already loaded. Let the available types of houses be represented by the following set.8<.' using a fuzzy set. 4.2 Example 1: Classifying Houses Problem. 10<D. 6. 2. U = {1. One indicator of comfort of these houses is the number of bedrooms in it.8 Additional Examples 8.3<<. 3. We provide a solution for each problem. 84. UniversalSpace → 81. 7.1 Introduction This notebook contains a number of simple problems. 8. . . 1<. 9. The realtor wants to describe a 'comfortable house for a 4-person family. 83. 85. but encourage you to try to come up with your own solutions to some of the problems. 10} The houses in this set are described by u number of bedrooms in a house. This loads the package. which can be dealt with using fuzzy sets. . . 5. . A realtor wants to classify the houses he offers to his clients. The fuzzy set "comfortable type of house for a 4-person family " may be described using a fuzzy set in the following manner. Solution. In[2]:= HouseForFour = FuzzySet@ 881.2<. it should be loaded before beginning the problems in this notebook. . In[1]:= << FuzzyLogic` 8.5<. 86.7<.

100} Solution 2-1. UniversalSpace → 80. 100<D. ShowDots → TrueD. whose membership function is given by the following fuzzy set.8 0. Assume that the concept of "young" is represented by a fuzzy set Young. 40D. Let U be a reasonable age interval of human beings.. 1. We define the concept of middle-aged to be neither young nor old. In[6]:= Old = FuzzyTrapezoid@50. This interval can be interpreted with fuzzy sets by setting the universal space for age to range from 0 to 100. U = {0. 100. 2. In[4]:= SetOptions@FuzzySet. 0. Fuzzy sets can be used to represent fuzzy concepts. Membership Grade 1 0. . We do this by using fuzzy operators from the Fuzzy Logic package.2 U 1 2 3 4 5 6 7 8 9 10 11 8. Problem 2-2..6 0. The concept of "old' can also be represented by a fuzzy set. .4 0. . 65.3 Example 2: Representing Age Problem 2-1. In[5]:= Young = FuzzyTrapezoid@0. whose membership function could be defined in the following way. 25. 100D.212 Fuzzy Logic In[3]:= FuzzyPlot@HouseForFour. 3. Old.

. .4.6 0. . Old." 8.5. 8. . 8. .8 0.5<. .Chapter 8: Additional Examples 213 Solution 2-2. 1<. 8. . . .7.9. . Find the disjunctive sum of the two fuzzy relations defined here.2.6.5.4 0. In[10]:= Smat = 88.2<. you can see that the intersection of "not young" and "not old" gives a reasonable definition for the concept of "middle-aged.3.7.2 U 0 20 40 60 80 100 From the graph.7. We can now see a graphical interpretation of our age descriptors by using the FuzzyPlot command. . . In[12]:= S = FromMembershipMatrix@SmatD. 8.3<. 0. Complement@OldDD. PlotJoined → TrueD.6<<.4 Example 3: Finding the Disjunctive Sum Problem. We can find a fuzzy set to represent the concept of middle-aged by taking the intersection of the complements of our Young and Old fuzzy sets. In[9]:= RMat = 88.6.8. MiddleAged.7<<. . . Membership Grade 1 0.8. In[11]:= R = FromMembershipMatrix@RMatD. In[8]:= FuzzyPlot@Young.8. .8.8. . . In[7]:= MiddleAged = Intersection@Complement@YoungD.4.

R(v. DisSum(v.6 0. DisSum = (R › S') ‹ (R' › S) The disjunctive sum is thus a relation in VxW that has the following property: For all (v.8 Grade 0.214 Fuzzy Logic In[13]:= FuzzyPlot3D@R.S(v.4 0. w) in VxW. w) = Max(Min(R(v. w). ShowDots → TrueD. w)). 1 0. S(v. Min(1 . w). can be found with the following formula. S.2 0 1 2 V 3 1 2 4 3 W The disjunctive sum of fuzzy relations R and S in the universal space VxW. w))) . 1 .

5 0. .6<.8 0. SDD. 87. . . 1.3<.6 0. UniversalSpace → 80. .1<.5 Example 4: Natural Numbers Problem. In[14]:= DisSum = Union@Intersection@R. 89. We can find disjunctive sum of the two fuzzy relations R and S by using the formula derived earlier and some of the functions from the Fuzzy Logic package. In[18]:= Six1 = FuzzySet@883.6 0.4 0.2 0 1 2 V 3 1 2 4 3 W In[16]:= ToMembershipMatrix@DisSumD êê MatrixForm Out[16]//MatrixForm= i 0. There are a number of different ways in which you could accomplish this using fuzzy sets. 20<D.3 0. This can be done as follows: In[17]:= SetOptions@FuzzySet. 85. One solution would be to manually create a fuzzy set describing the numbers near 6. Solution 1. Complement@SDD. .4 0. Suppose you are asked to define the set of natural numbers close to 6.8 j j 0.1<<D.4 0.Chapter 8: Additional Examples 215 Solution. .8 Grade 0.4 y z z z z z z { 8. 86. 1 0.5 0.0<. In[15]:= FuzzyPlot3D@DisSumD.2 0. 84. Intersection@Complement@RD.5 j j j j k 0.6<. 88. .2 0.3<.

6. 10D.6 0. a triangular fuzzy set would probably be better than a trapezoid.4 0. In[20]:= Six2 = FuzzyTrapezoid@2. Membership Grade 1 0. In[23]:= Six3 = CreateFuzzySet@CloseTo@6DD.2 U 1 3 5 7 9 11 13 15 17 19 21 Solution 2. Another solution would be to use a function to create a fuzzy set representing numbers near 6. For a case such as this.6 0. In[22]:= CloseTo@x_D := """""""""""""""" """"""" & """""""" We can use this function to create a fuzzy set for numbers near 6.8 0. so we set the middle two parameters of the FuzzyTrapezoid function to 6. Membership Grade 1 0.216 Fuzzy Logic In[19]:= FuzzyPlot@Six1D. In[21]:= FuzzyPlot@Six2D.4 0. 6.8 0.2 U 1 3 5 7 9 11 13 15 17 19 21 Solution 3. A second solution would be to use the FuzzyTrapezoid function to create the fuzzy set. 1 + H#1 − xL2 1 .

In[25]:= NearSix@x_D := WhichAx == 6.4 0. """""""""""""""""" . We do this by plotting them all on the same graph with the FuzzyPlot function. Membership Grade 1 0. 0E " " " " In[26]:= Six4 = CreateFuzzySet@NearSixD. Solution 4. """""""""""""""""" .2 U 1 3 5 7 9 11 13 15 17 19 21 Hx − 5L2 1 H7 − xL2 1 Now.6 0.2 U 1 3 5 7 9 11 13 15 17 19 21 Note that this is a convenient method because the function CloseTo can be called with any integer argument to produce a fuzzy set close to that number. x > 6 && x < 12. In[27]:= FuzzyPlot@Six4D. Still another solution is to use a piecewise function to describe the fuzzy set. True. 1.Chapter 8: Additional Examples 217 In[24]:= FuzzyPlot@Six3D. . Membership Grade 1 0. x < 6 && x > 0.6 0.8 0. we can view all four of our fuzzy representations of the number six to see how they compare.8 0.4 0.

4 0. .218 Fuzzy Logic In[28]:= FuzzyPlot@Six1.6 Example 5: Fuzzy Hedges Problem. Six2.8 0. Membership Grade 1 0. PlotJoined → TrueD. Solution. In[30]:= FuzzyPlot@Hot. suppose we want to talk about the degree to which something is hot.2 U 1 3 5 7 9 11 13 15 17 19 21 8. can be used to define our two hedges.8 0. 20<D. We can start by defining how a fuzzy set should be modified to represent the hedges "Very" and "Fairly. Six4.6 0.4 0. Suppose you had already defined a fuzzy set to describe a hot temperature." Two functions in the Fuzzy Logic package. PlotJoined → TrueD. Look at how we can accomplish this. Concentrate and Dilate. Six3. Membership Grade 1 0.2 U 1 3 5 7 9 11 13 15 17 19 21 Now. We need some sort of fuzzy modifier or a hedge to change our fuzzy set. UniversalSpace → 80. In[29]:= Hot = FuzzyGaussian@20. 7.6 0.

.8 0. and VeryHot. Very@HotD. the VeryVeryHot fuzzy set is even more concentrated than the VeryHot fuzzy set. Membership Grade 1 0.8 0. The VeryHot fuzzy set is a more focused. Hot. VeryHot. We can also apply more than one modifier to a fuzzy set. Very@Very@HotDD. In[33]:= FuzzyPlot@Fairly@HotD. For instance. In[34]:= FuzzyPlot@Hot.2 U 1 3 5 7 9 11 13 15 17 19 21 Note that the FairlyHot membership function is a more general.Chapter 8: Additional Examples 219 In[31]:= Very := Concentrate Fairly := Dilate Now we can look at a graph of the fuzzy sets FairlyHot.6 0. concentrated fuzzy set. spread-out fuzzy set. let us compare Hot.2 U 1 3 5 7 9 11 13 15 17 19 21 As we might expect. Membership Grade 1 0.6 0. and VeryVeryHot. PlotJoined → TrueD. Hot.4 0. PlotJoined → TrueD.4 0. Very@HotD.

7/Paris. 0. 0. 81. Beijing + 0. Paris} and Y = {Beijing.0/NYC. 0. 3<<D Out[36]= FuzzyRelation@ We can plot this relation using the FuzzyPlot3D function. UniversalSpace → 881.6<. 2<. the relation could be represented as follows [Klir & Folger.7.7<. Let R be a fuzzy relation between the sets.6/NYC. NYC be 2. 3<. 1<. 0.7 Example 6: Distance Relation Problem. In[35]:= DistMat = 881. 2<. NYC + 0.9. and London be 3.3/Paris. We can start by creating the membership matrix to represent the relation. 80. 1<<D .Y) = 1. London + 0. 0. 1<.6<. Now we can create the relation using the FromMembershipMa! trix function. for set Y. In[36]:= DistRel = FromMembershipMatrix@DistMat. 882." In list notation. 0. 881. that represents the idea of "very far. 0. NYC + 0. 0. For set X. let NYC be 1. 3<. and Paris be 2.3<< Out[35]= 881. 2. NYC. 0.3<< We need to represent the cities in each set with numbers. We will use some of Mathematica's Plot3D options to put the graph in a form that lines up with the membership matrix so that you can see the correlation.3<<. 3. 882. 0.9/Paris. 1<.7. 0. 2<. let Beijing be 1.220 Fuzzy Logic 8. 0<. We can represent this fuzzy relation in Mathematica in the following way. 881. London Solution. 8881. London}. Beijing + 0/NYC.9<.6<. 0. 882. 80. 1<. X = {NYC. R(X. 81. 1988].9. 881.

AxesEdge → 88−1. We illustrate this with an example from Klir and Folger [Klir and Folger. Fuzzy sets can be used to aid in decision making or management. 83. 0. Given four jobs (Jobs 1. 0. meaning that Job 3 is the most interesting of the four jobs. . "Grade "<.8<. since it has a membership grade of only 0. given the constraints that the job should be interesting and close to our home. 0. UniversalSpace → 81. 0.3 8. 1<. 0. 1 1 0. .4 0 0.6<. which makes understanding the fuzzy relation easier. Solution.8 0. AxesLabel → 8" X". "Y". 4<D Out[39]= FuzzySet@881. 1<<D.4<.4. ViewPoint → 82. you can get it to match the membership matrix. Job 1 on the other hand is the least interesting. J 1 0 0. 4. our task is to choose the job that will give us the highest salary. 82.6<. . In[39]:= Interest = FuzzySet@881. −1<.Chapter 8: Additional Examples 221 In[37]:= FuzzyPlot3D@DistRel. 2. 83. 1<D We can see that Job 3 has the highest membership grade.6<<. The first constraint of job interest can be represented with the following fuzzy set. 84. 84. . 1988]. 3. .8 Example 7: Choosing a Job Problem.4<. −1<.8<.6<<. 82. 81.6 0 0.7 0.9 0. UniversalSpace → 81.2 0 3 Grade X 2 1 In[38]:= ToMembershipMatrix@DistRelD êê MatrixForm Out[38]//MatrixForm= 2 Y By customizing the graph. 81. and 4).6 N 0.

UniversalSpace → 81. In[40]:= Drive = FuzzySet@881. 84. UniversalSpace → 81. 0. 1988].1<. . . 82. 0. 84. 4. the membership grades indicate the length of the drive to work. so we figure in the worth of the salary the same way we did for the previous constraints. and Job 4 pays the lowest.1<. 4. 83. In[41]:= Salary = FuzzySet@881. UniversalSpace → 81. 0. we need to decide on a function to make the decision. SalaryD Out[42]= FuzzySet@881.2<<.875<.7<. 1<D We can plot the decision fuzzy set to see the results graphically. we see that Job 1 pays the highest salary.875<.7<. 0. 84. From the fuzzy set above.a good thing. A small membership grade indicates an undesirable. long drive to work.7<. Here is a fuzzy set used to represent the driving distance to the four jobs.7<. 4<D Out[40]= FuzzySet@881.2<<. but to stay with the tradition of our previous constraints. . 83. . 0. Applying the Intersection operation can be thought of as adding the constraints and goals to come up with the best overall decision. 0. 4<D Out[41]= FuzzySet@881. 83. Now that all of our criteria is represented as fuzzy sets.1<. A high membership grade indicates that it is a short drive to work . 82. . UniversalSpace → 81.2<<. we need to figure in the goal of a good salary. 4. 1<D In the fuzzy set above. In[42]:= Decision = Intersection@Interest.6<. 0.5<. 0. we arbitrarily assign a membership grade to each job based on salary.9<.222 Fuzzy Logic We can form a fuzzy set for our second constraint in a similar manner. Finally. we can see that Job 4 is located near our home. 0. 83. 1<<. . We will use the standard Intersection to make the fuzzy decision. UniversalSpace → 81. Drive. 0. . We could use a formula to convert a salary into a membership grade for each job [Klir & Folger. while Job 1 is a long way from our home.9<.5<. 0. 1<<. 84. There is no real difference between a constraint and a goal in this problem. 84.5<. 1<D From this fuzzy set. 82. 82. 82. . 83.

In[47]:= DSet2 = ToDigital@Fset1. or we could have used different functions to arrive at the membership grades. maybe a product operator. 8. 3D. UniversalSpace → 80. 2D.4 0. to make our decision. we see that Job 2 appears to be the best job for us.2 U 1 2 3 4 5 At last.6 0. 20. As an exercise. 6D.8 0. try using a different method and see which job your method selects as the best. ShowDots → TrueD. Membership Grade 1 0. In[44]:= SetOptions@FuzzySet. Solution. DSet6 = ToDigital@Fset1. 5D. SetOptions@FuzzyPlot. In[46]:= Fset1 = FuzzyTrapezoid@2. Below is an example of a set with 6 digital membership functions defined over the range from 0 to 20. In this example. 12.Chapter 8: Additional Examples 223 In[43]:= FuzzyPlot@DecisionD. DSet4 = ToDigital@Fset1.9 Example 8: Digital Fuzzy Sets Problem. DSet3 = ToDigital@Fset1. DSet5 = ToDigital@Fset1. Suppose you are asked to compare fuzzy sets to digital fuzzy sets. 18D. For example. . There are a number of different ways that the decision in this example could have been made. 4D. we could have used a different operator. 12. 1<D. we can look for the maximum membership grade to decide which job best satisfies our goals and constraints. we could have weighted different constraints more heavily than others.

graphic4<. graphic6<<D.2 U 1 3 5 7 9 111315171921 U 1 3 5 7 9 111315171921 Membership Grade 1 0. execute the following fuzzy plot command.6 0. DSet5D. DSet3D. In[53]:= Show@GraphicsArray@ Membership Grade 1 0. graphic5 = FuzzyPlot@Fset1. graphic2 = FuzzyPlot@Fset1.224 Fuzzy Logic Æukasiewicz sets can be viewed and manipulated in the same manner as infinite valued fuzzy sets. In[52]:= Block@8$DisplayFunction = Identity<. DSet6DD.6 0.2 U 1 3 5 7 9 111315171921 Let us compare the discrete and digital form of our fuzzy sets using the concept of the Hamming distance.8 0.8 0. graphic2<. graphic = FuzzyPlot@Fset1D.6 0.4 0.4 0. DSet4D.6 0. Membership Grade 1 0.4 0.4 0. Frame → TrueD.4 0.2 88graphic. graphic4 = FuzzyPlot@Fset1. 8graphic5.6 0.6 0. graphic3 = FuzzyPlot@Fset1.2 U 1 3 5 7 9 111315171921 Membership Grade 1 0.8 0.8 0.4 0. For a graphic representation of the above set. DSet2D.2 U 1 3 5 7 9 111315171921 Membership Grade 1 0.8 0. 8graphic3. . graphic6 = FuzzyPlot@Fset1.2 U 1 3 5 7 9 111315171921 Membership Grade 1 0.8 0.

55<. 0. 881. 0. HammingDistance@Fset1. DSet6D< êê N 8. opts___D. Frame → True. 0. 1. 0. 5. Flatten@8opts<D ê.46.55. 0. In[56]:= Needs@"Graphics`Colors`"D.0<. HammingDistance@Fset1.41. 81. 80. GridLines −> AutomaticDDD . Æukasiewicz sets become fuzzy set.57. 0.55.42<. 8col< = 8Hue< ê. First.6. 0. Solution. 80. 0. each with a value of membership denoting the gray level in the image. The table shows the gray levels values for 8-bit image associated with an array of 25 pixels. 0. 0.8< As you might expect. Use the enhancement function on this image to recognize the pattern in the image. 0. In[59]:= fuzzyimage := FromMembershipMatrix@image. In[58]:= DensePlot@FuzzyRelation@elems_. 80. In[57]:= Options@DensePlotD = 8Hue → . DSet2D. . 0. col<. FrameLabel −> 8v. Flatten@8opts1<D ê. DSet4D. 2DDD. 0. In[55]:= image = 880. 0. 0. HammingDistance@Fset1.. w<. as n goes to infinity.53.57.41.933333. 80. 0.41<.10 Example 9: Image Processing Problem.45.43.43.54. Show@Graphics@RasterArray@ Transpose@Map@HHue@col. GradeMatrix@elems.86667. HammingDistance@Fset1. 1. 0. Options@DensePlotD.33333. Now.45. 0. spaceD.44<.52. An image R of m ä n dimensions can be considered as an array of fuzzy singletons.53.43<<. let's add a function to the Fuzzy Logic package. DSet5D. 0. Out[54]= 84.59. 0. 0. DSet3D.44.75D &L ê@ #1 &.41. opts1___? OptionQD := Module@8space. 5<<D 8space< = 8UniversalSpace< ê. #1. Options@FuzzyRelationD. The object of contrast enhancement is to process a given image so that the result is more suitable than the original for a specific application in pattern recognition We will demonstrate enhancement of the image shown in next figure.Chapter 8: Additional Examples 225 In[54]:= 8HammingDistance@Fset1. we can plot the image.58. 0.75<.

2 0 . 1<<D. AxesOrigin → 80. The IntensifyContrast operator applies a Contrast function and intensifies the contrast between the gray levels in the image.5. In[61]:= Contrast@t_D = Which@t ≤ 0. 80. 1 0. t > 0. 2 ∗ t ^ 2.226 Fuzzy Logic In[60]:= DensePlot@fuzzyimageD. 5 4 3 w 2 1 0 0 1 2 v 3 4 5 In general.5 && t ≤ 1.5. 1 − 2 H1 − tL ^ 2D. the slop of the curve gets steeper. Contrast@Contrast@Contrast@Contrast@tDDDD<.8 1 0.6 0. 0. In[62]:= Plot@8Contrast@tD.5. 1<. AspectRatio → 1. 0.8 0.4 0. 0. Contrast@Contrast@tDD. 0.4 0. As the number of successive applications of the IntensityContrast increases. each membership value in fuzzyimage will be modified to a new membership value to enhance the image by transformation function Contrast.6 0 0.5. 8t. Contrast@Contrast@Contrast@tDDD.2 0. 1<.5<. GridLines → 880.

In[63]:= image1 := IntensifyContrast@fuzzyimageD In[64]:= image2 := IntensifyContrast@image1D In[65]:= image3 := IntensifyContrast@image2D In[66]:= image4 := IntensifyContrast@image3D In[67]:= DensePlot@image4D. Gupta. NJ. Fuzzy Sets and Fuzzy Logic: Theory and Applications. and Bo Yuan. 1988. 1991. Clair. G. 1997. J. Uncertainty. and Information. Prentice Hall. Klir. J. Prentice Hall. Fuzzy Set Theory. Englewood Cliffs. Van Nostrand Reinhold. A. G. Introduction to Fuzzy Arithmetic Theory and Application. New York. We hope you recognize the pattern in the image. M. Klir. Kaufmann and M. NJ. and T. Fuzzy Sets. Klir. it is undoubtedly more suitable for the subsequent pattern recognition and classification. References A. Upper Saddle River. St. This is a letter A. Folger. NJ. and Bo Yuan . . Upper Saddle River.Chapter 8: Additional Examples 227 The graphical effect of this recursive transformation for typical membership function is shown in next figure where the number of successive applications of the IntensifyContrast function increases from one to three. Prentice Hall. J. Ute H. 1995. 5 4 3 w 2 1 0 0 1 2 v 3 4 5 After the original image is processed by the IntensityContrast operator several times. G.

M. Graphic interpretation of fuzzy sets and fuzzy relations. Ballester. Hightstown. Edited by A. Kluwer Academic Publishers. . J. FuzzyLogic with Engineering Applications.. E. Fuzzy Set Theory and Its Applications. Universidad Politecnica Las Palmas. Boston. J. and E. 3rd ed. McGraw-Hill. D. Stachowicz and M. 1995. Zimmermann. MA. H. based on materials of Second World Conf. Spain. Mathematics at the Service of Man. Trillas. Ross. NJ. 1996.228 Fuzzy Logic T. S. Cardus.. 1982. Kochanska.

‡ CartesianProduct CartesianProduct[space] returns the cartesian product of the sets represented by space. Bx}.B] returns the fuzzy set/relation representing the absolute difference between fuzzy sets/relations A and B. B1}.Reference Guide ‡ AbsoluteDifference AbsoluteDifference[A. . ‡ Cardinality Cardinality[A] returns the sum of all of the membership grades in fuzzy set A. . . ‡ BisectorOfArea BisectorOfArea[A] returns the defuzzified value of fuzzy set A using the bisector of area defuzzification strategy.b] returns a list of the elements of fuzzy set A that have membership grades greater than or equal to b. ‡ BuildModel BuildModel[{{A1.. Bn}}] creates a model fuzzy relation using the pairs of fuzzy sets {Ax. ‡ AlphaLevelSet AlphaLevelSet[A. {An..

This function has a Type option that can be set to Standard (default). opts] returns a crisp value that is the result of performing a maxmin composition between fuzzy set A and fuzzy relation B and defuzzifying the result. Sugeno[a]. or Yager[w]. ‡ Complete Complete is an option for RandomFuzzyNumber and RandomFuzzyRelation. ‡ Complement Complement[A.230 Fuzzy Logic ‡ CenterOfArea CenterOfArea[A] returns the defuzzified value of fuzzy set A using the center of area (COA) defuzzification strategy. B. ‡ Core Core[A] returns a list of all elements of fuzzy set A which have a membership grade of 1." ‡ Concentrate Concentrate[A] returns a concentrated version of fuzzy set/relation A. opts] returns the complement of fuzzy set/relation A. . ‡ CompositionBasedInference CompositionBasedInference[A.

. The universal space can be set with an option. ({a. opts] returns a fuzzy set with membership grades that are the result of applying func to all of the elements in the specified range a to b. which is defined as the intersection between A and the complement of B. ‡ CreateFuzzySets CreateFuzzySets[num. which can be set as an option.B] return the fuzzy set/relation representing the difference between fuzzy sets/relations A and B. the function is applied to all elements in the universal space.({{a. If no range is specified all elements in the universal space are used. If no range is specified. d}}). b}). b}. ‡ Difference Difference[A. {c. opts] returns a fuzzy relation with membership grades that are the result of applying func to all of the elements within the specified range (rows a to b. ‡ Defuzzify Defuzzify is an option for CompositionBasedInference.Function Index 231 ‡ CreateFuzzyRelation CreateFuzzyRelation[func. columns c to d). ‡ Crisp Crisp is an option for FuzzyPlot. The type of membership functions can be specified as an option and may be either Triangular or Gaussian[sigma]. ‡ CreateFuzzySet CreateFuzzySet[func. opts] returns a list with num evenly spaced fuzzy sets.

c. b. h and all other membership values will be assigned the closest possible membership value for the n-valued logic. d. and d must be integers in increasing order. n must be greater than or equal to 2. A universal space and the n value may be specified as an option. ‡ Dilate Dilate[A] returns a dilated version of fuzzy set/relation A. ‡ DiscreteFuzzyMultiply DiscreteFuzzyMultiply[A. c. B] returns a fuzzy set that is the result of applying fuzzy subtraction to fuzzy set A and B. opts] returns a Lukasiewicz set with membership grades which linearly increase from zero to h in the range a to b.232 Fuzzy Logic ‡ DigitalSet DigitalSet[a. B] returns a fuzzy set that is the result of applying fuzzy addition to fuzzy sets A and B. (h). . b. ‡ DiscreteFuzzyPlus DiscreteFuzzyPlus[A. If h isn't specified a value of 1 is assumed. is h in the range b to c. ‡ DiscreteFuzzyImage DiscreteFuzzyImage[A] returns a fuzzy set that is the image of fuzzy set A. B] returns a fuzzy set that is the result of applying fuzzy multiplication to fuzzy sets A and B. and linearly decrease from h to zero in the range c to d. Arguments a. and h must be a value between 0 and 1. ‡ DiscreteFuzzyMinus DiscreteFuzzyMinus[A.

and a value which determines when the algorithm will terminate (epsilon). a partition matrix indicating the degree to which each data point belongs to a particular cluster center. ‡ DuboisPrade DuboisPrade[a] is an option choice for the union and intersection operations. ‡ EquilibriumSet EquilibriumSet[A] returns a list of the elements of fuzzy set A for which the membership grade is equal to (1 . The parameter a can range from 0 to 1. ‡ Equality Equality[A. . and a list containing the progression of cluster centers found during the run. B] returns true if two fuzzy sets/relations are equal and false otherwise. partmat. B] returns a fuzzy relation that is the cylindrical extension of fuzzy set A over the range B. ‡ Extend Extend[A. The arguments to the function are the data set (data).membership grade). epsilon] returns a list of cluster centers.Function Index 233 ‡ Dombi Dombi[a] is an option choice for the union and intersection operations. a partition matrix (partmat). mu. a value determining the degree of fuzziness of the clustering (mu). ‡ FCMCluster FCMCluster[data. The parameter a can range from 0 to infinity.

. {wa. wb}})] returns a fuzzy relation using the matrix of membership grades for the elements in the range of rows from va to vb and columns from wa to wb. B] find the relation which gives fuzzy set B as a result of performing a composition based inference with input fuzzy set A. If no range is specified.An] returns a fuzzy set/relation that is the arithmetic mean of fuzzy sets/relations A1. ..234 Fuzzy Logic ‡ FindFuzzyRelation FindFuzzyRelation[A.. it uses the elements from 1 through the dimension of the matrix.B] finds the fuzzy set. . An. . ‡ FindFuzzySet FindFuzzySet[A. . which when composed with fuzzy relation A gives fuzzy set B. ‡ Frank Frank[s] is an option choice for the union and intersection operations.. . A2. vb}. ‡ FuzzyArithmeticMean FuzzyArithmeticMean[A1. ‡ FromMembershipMatrix FromMembershipMatrix[mat. ({{va. ‡ FirstProjection FirstProjection[A] returns a fuzzy set which is the first projection of fuzzy relation A. The parameter s can range from 0 to infinity.

. The universal space may be specified as an option. The universal space may be specified as an option. ‡ FuzzyCardinality FuzzyCardinality[A] returns the fuzzy cardinality of fuzzy set A... s] returns a bell-shaped fuzzy set centered at c with crossover points at c . ‡ FuzzyConstantTimes FuzzyConstantTimes[{a. b. b1. An. c2. d} by k. b. w. ‡ FuzzyGeometricMean FuzzyGeometricMean[A1. {a2. d}.Function Index 235 ‡ FuzzyBell FuzzyBell[c. A2. . . ‡ FuzzyDivide FuzzyDivide[{a1. c. d2}] returns an unevaluated FuzzyTrapezoid representing the division of the fuzzy numbers represented by the two lists. c1. . c. d1}. .. sigma] returns a gaussian fuzzy set with center mu and width sigma. b2. ‡ FuzzyGaussian FuzzyGaussian[mu.k] returns an unevaluated FuzzyTrapezoid representing the fuzzy number which is the result of multiplying the fuzzy number {a.w and c + w with a slope of s / 2w at the crossover points. An] returns a fuzzy set/relation that is the geometric mean of fuzzy sets/relations A1..

To evaluate the Fuzzy! Trapezoid use ReleaseHold. d1}. c1.. b1.236 Fuzzy Logic ‡ FuzzyGraph FuzzyGraph[A] returns a fuzzy graph for a set of control rules A. b. c2. c1. b. . ‡ FuzzyHarmonicMean FuzzyHarmonicMean[A1.. d1}. . {a2. ‡ FuzzyMinus FuzzyMinus[{a1. d2}] returns an unevaluated FuzzyTrapezoid representing the product of the fuzzy numbers represented by the two lists. c.. b2. . b2. ‡ FuzzyModify FuzzyModify[func. {a2. A] returns a fuzzy set that is the result of applying func to all the membership grades of fuzzy set A. b1. d}] returns an unevaluated FuzzyTrapezoid representing the image of the fuzzy number represented by the list {a. ‡ FuzzyMultiply FuzzyMultiply[{a1. An] returns a fuzzy set/relation which is the harmonic mean of fuzzy sets/relations A1. c2. c. . d2}] returns an unevaluated FuzzyTrapezoid representing fuzzy difference between the two fuzzy numbers represented by the two lists. . To evaluate the FuzzyTrapezoid use ReleaseHold. A2. d}. An. ‡ FuzzyImage FuzzyImage[{a..

An] will plot a fuzzy set(s) as a series of vertical lines that correspond to membership grade. Crisp for plotting crisp sets.UniversalSpace->{{xmin. Standard plot option will work with this function. y1}. A2.. {ymin.b1.. ymax}}].{a2. {{x2. ..}.Function Index 237 ‡ FuzzyPlot FuzzyPlot[A1.. . Options include PlotJoined for producing a linear plot..An] will plot a fuzzy relation(s) as a collection of vertical lines corresponding to membership grades. ‡ FuzzyPlus FuzzyPlus[{a1. and ShowDots for plotting a dot on each vertical line.c2. . To evaluate the FuzzyTrape! zoid use ReleaseHold.b2.c1. A2. Standard plot options will still work with this function. . z1}. .d2}] returns an unevaluated FuzzyTrapezoid that represents the sum of the fuzzy numbers represented by the two lists. ‡ FuzzyRelation FuzzyRelation is an object of form FuzzyRelation[{{{x1. ‡ FuzzyPlot3D FuzzyPlot3D[A1.. y2}.d1}. Options include ShowDots for plotting a dot on top of each vertical line.. z2}. ‡ FuzzyRelationQ FuzzyRelationQ[A] tests if object A is a valid fuzzy relation. xmax}.

. cy. by. d.. ‡ FuzzySurfacePlot FuzzySurfacePlot[A1. max}]. ‡ FuzzySetQ FuzzySetQ[A] tests if object A is a valid fuzzy set. is h from b to c. Options for this function include HideSurfaces for plotting a wire mesh without the polygon surfaces filled in. b. and the default height is 1. {x2. . The universal space can optionally be set with this function. Standard plotting options will also apply. cx.. c.y1}. .{xn. If h isn't explicitly given the function uses h = 1. The points a. opts] returns a sigmoidal fuzzy set where s controls the slope at the crossover point c.. UniversalSpace->{min. and linearly decreases from h to zero from c to d. c. opts] returns a trapezoidal fuzzy relation with membership grades which linearly increases from zero to h in both the x and y directions from a to b. bx. (h). The universal space may be specified as an option.. ‡ FuzzyTrapezoid FuzzyTrapezoid[a. A2.. FuzzyTrapezoid[{ax. dx}. and d are the vertices of the trapezoid in increasing order. y2}. ‡ FuzzySigmoid FuzzySigmoid[c. which is must be between 0 and 1. dy}. opts] returns a trapezoidal fuzzy set of height h. An] will display a surface plot of fuzzy relation A. b. (h). yn}}. {ay.238 Fuzzy Logic ‡ FuzzySet FuzzySet is an object of form FuzzySet[{{x1 . s. .

Infinity). alpha] returns a fuzzy set/relation that is the generalized mean of fuzzy sets/relations A1. A.. ‡ GlobalProjection GlobalProjection[A] returns the max membership grade of fuzzy relation A. An.Function Index 239 ‡ FuzzyTwoGaussian FuzzyTwoGaussian[mu1.. sigma1.. B] returns a new fuzzy set/relation that is the result of applying the user defined func to the membership grades of the fuzzy sets/relations A and B. A2.. A2. . ‡ Gaussian Gaussian[sigma] is an option choice for CreateFuzzySets that specifies that Gaussian fuzzy sets with width sigma should be created ‡ GeneralAggregator GeneralAggregator[func. . ‡ Goedel Goedel is a Type option for the RuleBasedInference function. . . . sigma2] returns a two-sided gaussian fuzzy set with centers at mu1 and mu2 and widths of sigma1 and sigma2. ‡ GeneralizedMean GeneralizedMean[A1. An with parameter alpha in the range (0. The universal space may be specified as an option. mu2.

240 Fuzzy Logic ‡ GradeMatrix GradeMatrix returns the membership grades of a relation in matrix form. ‡ HammingDistance HammingDistance[A. The parameter v can range from 0 to infinity. hedges. rules] returns the fuzzy term and hedge which is closest to the fuzzy object. ‡ HideSurfaces HideSurfaces is an option for FuzzySurfacePlot. ‡ Height Height[A] returns the largest membership grade among the elements in fuzzy set/relation A. ‡ Hamacher Hamacher[v] is an option choice for the union and intersection operations. B] returns the implication of two fuzzy sets A and B. terms. ‡ Implication Implication[A. . B] returns the Hamming distance between fuzzy sets A and B. ‡ Identify Identify[object.

Function Index

241

‡ Included

Included[A, B] returns true if fuzzy set/relation A is included in fuzzy set/relation B and false if not.

‡ InitializeU

InitializeU[data, n] returns a random initial partition matrix for use with the FCMCluster function, where n is the number of cluster centers desired.

‡ IntensifyContrast

IntensifyContrast[A] modifies fuzzy set/relation A so that there is more of a contrast between membership grades.

‡ Intersection

Intersection[A1, A2, ... , An, opts] returns a fuzzy set/relation that is the intersection of fuzzy sets/relations A1, A2, ... , An. This function has a Type option, which can be Standard (default), Hamacher[v], Yager[w], Frank[s], Dombi[alpha], or DuboisPrade[alpha].

‡ LargestOfMax

LargestOfMax[A] returns the defuzzified value of fuzzy set A using the largest of maximum defuzzification strategy.

‡ Levels

Levels is an option for DigitalSet which specifies the number of different levels or membership values to use.

242

Fuzzy Logic

‡ LevelSet

LevelSet[A] returns the level set of fuzzy set or fuzzy relation A.

‡ Mamdani

Mamdani is a Type option for the RuleBasedInference function.

‡ MAX

MAX[A, B] returns the maximum of the fuzzy numbers A and B.

‡ MaxMin

MaxMin is a Type option for the Composition function.

‡ MaxProduct

MaxProduct is a Type option for the Composition function.

‡ MaxStar

MaxStar[fun] is a Type option for the Composition function, where fun is a user defined function to be used with the composition.

‡ MeanOfMax

MeanOfMax[A] returns the defuzzified value of fuzzy set A using the mean of maximum (MOM) defuzzification strategy.

Function Index

243

‡ MIN

MIN[A, B] returns the minimum of the fuzzy numbers A and B.

‡ NewElements

NewElements performs the functions necessary to take the composition of relations.

‡ Normal

Normal is an option for RandomFuzzySet and RandomFuzzyRelation, which when set to True, returns a normal fuzzy set or fuzzy relation.

‡ Normalize

Normalize[A] returns fuzzy set/relation A with its height normalized to 1.

‡ Opposite

Opposite[A] returns a fuzzy set which is the antonym of fuzzy set A.

‡ PrimitiveMatrix

PrimitiveMatrix[n, operation] returns a logic table which shows the results of the operation for n valued logic sets.

244

Fuzzy Logic

‡ RandomFuzzyRelation

RandomFuzzyRelation[{{a, b}, {c, d}}] returns a random fuzzy relation with a universal space of {{a, b}, {c, d}}. This function has options which allow the user to create Trapezoid or Complete random fuzzy relation. There is also a Normal option, which when set to True returns a normal random fuzzy relation.

‡ RandomFuzzySet

RandomFuzzySet[{a, b}] returns a random fuzzy set with a universal space from a to b. This function has options that allow the user to create Trapezoid, Gaussian, Triangular, or Com! plete random fuzzy sets. There is also a Normal option which when set to True returns a normal random fuzzy set.

‡ RelativeCardinality

RelativeCardinality[A] returns the value of the cardinality of fuzzy set A divided by the number of elements in the universal space.

‡ RuleBasedInference

RuleBasedInference[{A1, ... , An}, {B1, ... , Bn}, {C1, ... , Cn},{{Ax, Bx, Cx}, ...}, a, b] returns a crisp value that is the result of performing rule based inference where {A1, ... , An} and {Bn, ... , Bn} represent linguistic input variables, {C1, ... , Cn} is the linguistic output variable, rules are given in a list of triples like {Ax, Bx, Cx}, and the crisp values for the inputs are a and b.

‡ Scaled

Scaled is a Type option for the RuleBasedInference function.

Function Index

245

‡ SecondProjection

SecondProjection[A] returns a fuzzy set that is the second projection of fuzzy relation A.

‡ SetsToRelation

SetsToRelation[func, A, B] returns a fuzzy relation with elements representing the Cartesian product of the universal spaces of fuzzy sets A and B and membership grades which are the result of applying func to the corresponding membership grades of A and B.

‡ ShowCenters

ShowCenters[graph, res] displays a 2-D plot showing a graph of a set of data points along with large dots indicating the cluster centers found by the FCMCluster function. The variable graph is a plot of the data points and res is the results from the FCMCluster function.

‡ ShowCentersProgression

ShowCentersProgression[graph, res] displays a 2-D plot showing a graph of a set of data points along with a plot of how the cluster centers migrated during the application of the FCMCluster function.

‡ ShowDots

ShowDots is an option for the fuzzy plotting functions.

‡ ShowGraph

ShowGraph is an option for CenterOfArea and MeanOfMax that causes the original fuzzy set and its defuzzification to be shown in graphical form.

‡ Support Support[A] returns a list of the elements of fuzzy set A with nonzero membership grades. and Intersection. ‡ SmallestOfMax SmallestOfMax[A] returns the defuzzified value of fuzzy set A using the smallest of maximum defuzzification strategy. ‡ Sugeno Sugeno[a] is an option choice for the complement operator. Union. b] returns a list of the elements of fuzzy set A that have membership grades greater than b. B] returns the similarity between fuzzy sets A and B. ‡ Subsethood Subsethood[A. ‡ StrongAlphaLevelSet StrongAlphaLevelSet[A. B] returns the degree of subsethood of fuzzy set A in fuzzy set B. The parameter a can range from -1 to infinity. . ‡ Standard Standard is an option choice for Complement.246 Fuzzy Logic ‡ Similarity Similarity[A.

n] takes a fuzzy set and an integer as input. ‡ Union Union[A1. or DuboisPrade[alpha]. . An. and Composition.. Frank[s]. CreateFuzzySets..opts] returns a fuzzy set/relation that is the union of fuzzy sets/relations A1. Intersection.An. ‡ ToDigital ToDigital[A. ‡ Triangular Triangular is an option choice for CreateFuzzySets that specifies that triangular fuzzy sets should be created. Union.A2. . Yager[w].. ‡ ToMembershipMatrix ToMembershipMatrix[A] displays the membership matrix of fuzzy relation A. This function has a Type option. Hamacher[v]. B] returns the fuzzy set/relation representing the symmetric difference between fuzzy sets/relations A and B. ‡ Type Type is an option used with Complement. . Dombi[alpha]. and it returns a Lukasiewicz set using n-valued logic.Function Index 247 ‡ SymmetricDifference SymmetricDifference[A. .. which may be set to Standard (default). A2. .

where w is a parameter ranging from 0 to infinity.248 Fuzzy Logic ‡ UniversalSpace UniversalSpace is an option for FuzzySet and FuzzyRelation. ‡ ZeroPadSetMembers ZeroPadSetMembers[elems. ‡ Yager Yager[w] ia an option choice for complement. ‡ Weber Weber[l] is and options for the union and intersection operations. The parameter l must be greater than -1. ‡ ZeroPadSet ZeroPadSet pads a set with zeros. and intersection operations. The parameter l must be greater than -1. union. ‡ Yu Yu[l] is an option for the union and intersection operations. . space] gets the full set of membership grades with zeros padded. It describes the set of values over which a fuzzy set/relation is valid.

157 contrast intensify. 158 difference operations. 28 Core. 35. 28 characteristic function. 114 options. 109 AbsoluteDifference. 5. 173 antisymmetry. 31. 203 creating fuzzy numbers. 28 BisectorOfArea.Index fuzzy relation. 29 smallest of maximum. 169 Æukasiewicz sets. 109 creatng fuzzy sets. 139–141 Chop. 27 BuildModel. 154. 199 creating fuzzy relations. 39–40 Ln sets. 109 dilate. 26. 173 BisectorOfArea. 37. 11–12 options. 35. 28 fuzzy. 28 CreateFuzzyRelation. 173 symmetry. 26–27. 38 control surface. 54 digital fuzzy sets. 11–12 creating digital fuzzy sets. 114 Æukasiewicz sets. 125 Dilate. 19. 26. 19 Ln sets. max-star. 19 creating fuzzy sets. 156 averaging formula. 31 AlphaLevelSet. 155 addition. 50–51 associativity. 22 clustering. 30–31 options. 54 difference of fuzzy sets. 198 core. 218 . 203 DigitalSet. 112. 19 binary fuzzy relation. 156 comparability. 82 cardinality. 154. 26 Cardinality. 114 Complement. 30 mean of maximum. 79. 11 CreateFuzzySets. 151 composition. 26. 117 commutativity. 139 defuzzification. 39 complementation. user-defined. 3 creating Ln sets. 74. 75 composition of fuzzy relations. second projection. 83–84 compositions of fuzzy relations. 129 averaging operations. 158 properties. 112. 109 creating Æukasiewicz sets. 26–28 options. 5 Crisp. 35 ArithmeticMean. 60 crisp sets. 170 composition of relations. 26–27 largest of maximum. 26 relative. 73 Composition. 112. 125. 9 FuzzyTrapezoid. 149 complement. 54–55 absorption by empty set. creating. 35–37. 171 options. 26. 26–27 CenterOfArea. creating. 5. 172 concentrate. 26. 39 clustering algorithm. 30 center of area. 176 transivity. 22 CreateFuzzySet. 125 Concentrate. law of . 163 FuzzyBell. 117 clustering functions. 57 alpha cuts. 26 bisector of area. 31 Core. max-min. 125 intensifying. 50 bell shaped fuzzy sets. 91 aggregators. 91 Difference. 218 contradiction. 170 CompositionBasedInference. 29 difference. 174 binary fuzzy relations reflexivity.

29 intersection. 163 normalized. 193 defining input membership functions. 200 DiscreteFuzzyImage. 38 operations. 145 equality. 166 universal space. 47–48 FromMembershipMatrix. 125 fuzzy relation. 101. 92 subtraction. 45. law of . 93 multiplication by a contant. 120 first projection of fuzzy relation. 104. 117 fuzzy control. 56 union. 73 creating. 165 fuzzy operator formulas. 173 complement. 57 Hamming distance. 117 FCMCluster. 21 DuboisPrade. 165–166 fuzzy arithmetic. 97–98. 31 fuzzy sets absolute difference. 163 FirstProjection. 27–28 fuzzy clustering. 41 EquilibriumSet. 161 binary. 40 normalized. 200 DiscreteFuzzyPlus. 161 absolute difference. 167 operations. 55 algebraic product. 97. 97. 92 subtraction. 94 Dombi. 33 first projection. 45. 150 Equality. 192 simulation functions. 47 double-sided gaussian fuzzy set. 104. 94 multiplication. 91 fuzzy operations. 25. 198 defining control rules. 47 empty set. 31 excluded middle. 91 division.250 Fuzzy Logic dilation of membership grades. 32. 147 fuzzy operations . 28 symmetric difference. 34 projections. 104. 182 creating linguistic control rules. 181 evaluating the model. 200 fuzzy arithmetic operations addition. 179 representing the model output. 199 addition. 26. 19 difference. 164 Frank. 93 multiplication by a constant. 19. 163 random. 194 fuzzy logic control. 3 . 200 DiscreteFuzzyMinus. 34 fuzzy relations. 36 Hamming distance. 161 visualization. 41 general aggregator. 104. 99. 20 support. 165 equations. 37. 189 control surface. 183 fuzzy numbers. 125 normalize. 39 fuzzy clusters. 168 basic objects. 34 sigmoidal. 31 modifying. 97. 125 fuzzy operators complement. relations. 55 basic objects. 54 disjunctive sum. 157 FCM (fuzzy C-means clustering). 213 distinctions. 125 dilate. 118. 32 subsethood. 181 using the model. 91 division. 17 composition. 169 envelope. 34 random. 200 distributivity. 117 fuzzy cardinality. 27 core. 100. 21. 37. 91 fuzzy C-means clustering. 93 multiplication. 37 discrete fuzzy arithmetic. 67 fuzzy set cardinality. 185 representing the model input. 94 image. 31 equilibrium. 156 division. 125 intensify contrast. 169 compositions. 189 fuzzy modelling building the model. 200 using infix form. 189 defining output membership functions. 38 operations. 200 DiscreteFuzzyMultiply. 45.

44 operations. 86 rule based. 106 GeneralAggregator. 90–91 FuzzyModify. 153–155 image of a fuzzy number. 91. 57 GeometricMean. 112–113 Implication Ln sets. 90. 44. 69 FuzzyPlus. 112–113 options. 37. 32–33 Hamacher. 75 MaxStar. 59 fuzzy sets. 38 IntensityContrast. 125 IntensifyContrast. 5. 94 FuzzyGaussian. 93 FuzzyPlot. 41 double-sided gaussian. 7–8 FuzzyGraph. 112–113 Included. 168 Ln sets. 37 rule based. 26. 8. 207 multivalued. 28 FuzzyConstantTimes. 79 rule based. 52 Height. 26–27 idempotence. 112 properties. 40–41 FuzzyMultiply. 158 distinctions. 156 identity. 41 inclusion. 84 rule based. 207 Æukasiewicz logic. 8–9. 44. 90–91 FuzzyRelation. 35–36 Ln sets. 29. 75 MaxProduct. 17 FuzzySet. 47. 80 composition based. 59–60. 150 general aggregator. 147 intersection. 3–4. 21 gaussian fuzzy numbers. 80 MAX. 79 composition based. 59. 3 options. building model. 26–27 FuzzyCardinality. 162 options. 109 operations on. defining inputs. image. 50 HammingDistance. 112 Mamdani. 17–18. 82 composition based. defining inputs. 57 Hamming distance. 21 equality. 92 FuzzyDivide. 112 logic Æukasiewicz . 29 inclusion. 64 FuzzyImage. 35. 118. 120 intensify contrast. 3 definition. 5–6. 37. 154 LargestOfMax. 50. 28 LevelSet. 87 InitializeU. 5. 29 HarmonicMean. 36 Hamming distance. 86 rule based. 68 options. 112–113 Æukasiewicz sets.Book Index 251 complementation. 82 functions. defining outputs. 50–51 GlobalProjection. 29. 5. 93 FuzzyMinus. 82 composition based. 35 intersection. 15 FuzzySigmoid. 207 Æukasiewicz sets creating. 69 FuzzyTrapezoid. 151 difference. Æukasiewicz sets. defining rules. inferencing. 20 FuzzySurfacePlot. inferencing. 152 visualization. 56 union. 28 symmetric difference. 59–60 FuzzyPlot3D. 147 subsethood. 35–36 HammingDistance. 10. 44 intersetion. 19 FuzzyCardinality. 147 inference. 45 intersection formulas. 90. 19 FuzzyBell. defining outputs. 155 Intersection. 81 composition based. 75–76 . 62 options. 30 options. 93 implication. 44–46 Æukasiewicz sets. 101 MaxMin. defining rules. bell-shaped. 154. operations on. 29. 54. 5. 8–9 FuzzyTwoGaussian. 126 intersection operations. 112–113 Æukasiewicz sets. 45–47. 19 FuzzyTwoGaussian. 91. 97.

97 maximum. 163 RandomFuzzyRelation. 121 ShowDots. 104 multiplication. 26. 26. 127 union operations. 39– 40. 47–48. 97 two-sided gaussian fuzzy set. 112 normalize. 118. 106 subtraction. 46 projections of fuzzy relation. 44. 150 graphic representation. 35–36 Subsethood. 52 MeanOfMax. 5. 125 Normalize. 50 difference. 112 operations on triangular fuzzy numbers addition. 17 user-defined aggregators. 32–33. 153. 46 t-norm operations. 80 s-norm operations. 164 set. 69 ShowGraph. 92 multivalued logic. 145 universal space. 13 RelativeCardinality. 29 options. 112 Æukasiewicz sets. 79–80. 109 ToMembershipMatrix. 57 visualization. 112. 149 equal. 23 options. 112 properties. 49 Support. 35 subsethood. 60 PrimitiveMatrix. 44 s-norm. 54 intersection. 18. 151 sets comparable. 118. 163 SecondProjection. fuzzy sets. 167–169 triangular fuzzy numbers. 49 sum type. 29. 20 SmallestOfMax. 28 subtraction. fuzzy relations. 28 sigmoidal fuzzy sets. 155 Union. 97 multiplication. 23 RandomFuzzySet. 45. 28 StrongAlphaLevel. 93 multiplication by a constant. 50 Ln sets. 3. 26. 35 StrongAlphaLevelSet. 112 options. 162. 44 second projection of fuzzy relation. 21 union. 139. 112 operations on Æukasiewicz sets. 44 universal set. 29–30 options. 19. 122 ShowCenters. 44 t-norm. 29. 97 subtraction. 35. 207 n valued logic. 59 Yager. 203 discrete. 46–47 Æukasiewicz sets. complement. 38 operations averaging. discrete arithmetic. 97. 93 product type. 97 PlotJoined. 71–72. 44. 142 inclusion. 102 multiplication. 140–141. 203 graphical representation. 144 continuous. 114 product. 39 sum. 44 ToDigital.252 Fuzzy Logic mean arithmetic. 91 drastic. 91 Sugeno. 3. 54. 28 Subsethood. 97 minimum. 142 UniversalSpace. 13–14 options. 28 membership function. 67 vizualization. 60. 19–20 ShowCenterProgression. 47 union formulas. 31 SymmetricDifference. 44 union. 56 t-norm. 141–142 membership matrix. 105 operations on Ln sets. 87 options. 44 operations on gaussian fuzzy numbers addition. 47 . 147 SetsToRelation. 26–27 RuleBasedInference. 50 geometric. 71 MIN. 51 harmonic.

- [Young_T.,_Mohlenkamp_M.]_Introduction_to_numerica(BookFi.org).pdf
- Fuzzy logic
- Matlab NumerAnalyis Book
- 10.1.1.46
- parser
- DEPENDENCE FLOW GRAPH FOR ANALYSIS OF ASPECT- ORIENTED PROGRAMS
- 2011 - Towards the Methodology for Development of Fuzzy Relational Database Applications
- Instructor Guide for Introduction
- Elmasri and Navathe DBMS Concepts 16
- Dinh Gia Phan Mem
- Students Notes
- 5 - 1 - Select Project Join (18 Min)
- VBAPrimer
- VBAPrimer
- VBA Primer
- 272048main_AssertionBasedRequirementsValidation
- C Program_ Numerical Computing - Implementing the Newton Raphson Method - The Learning Point
- Microsoft_interview1
- Event Simulation
- 03 Design
- Fuzzy Object-Oriented Databases
- OODPrnciples
- Inheritance Ch11
- 00300036
- 4769-11504-1-PB
- bcom
- Case Western
- A NOVEL APPROACH FOR WORD RETRIEVAL FROM DEVANAGARI DOCUMENT IMAGES
- May2005Classics

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd