Where can I find examples of fuzzy logic applications in ArcGIS?

The last ArcGIS version (10) includes two arctoolbox tools for fuzzy logic (Fuzzy Membership, and Fuzzy Overlay). Does anyone know where can I find some examples showing how they can be applied?

(From Desktop 10 help.)

There's a video example from an esri conference here:

A very good article from esri for ArcGis and Fuzzy logic. With a good example and some bibliography.

Incorporating Expert Knowledge - New fuzzy logic tools in ArcGIS 10

There is a dissertation on:

Watershed water quality modeling using integrated fuzzy modeling approach with HSPF model and radar rainfall data Author: Madhusudhan Narayana

"Watershed water quality modeling is very essential for watershed management activities. These modeling activities and resulting simulations were used as the main resource for several decision making processes. In this research study, uncertainties associated with the watershed water quality modeling were handled with fuzzy modeling approach in three different phases"

Unfortunately there are very few examples of fuzzy logic using ArcGIS 10 on the internet. Youtube will show you this one about bald eagle habitat.

Fuzzy logic can be used in all kinds of different scenarios from mineral exploration, site selection, basically anything that has multiple inputs that each meet a criteria. In site selection you may use slope, distance from water, distance from roads, etc and put it into a fuzzy logic model. Selection of membership will mostly be linear but you can play with those classifications to get a better idea of how they work. The fuzzy membership plays into the fuzzy overlay in how you combine layers with AND, OR, GAMMA (mostly AND/OR). ESRI has a site selection tutorial for $30 which shows how the above youtube video is applied.

Application of fuzzy AHP method to IOCG prospectivity mapping: A case study in Taherabad prospecting area, eastern Iran

We used fuzzy analytical hierarchy process (FAHP) to propose a method for mineral prospectivity mapping.

Mineral prospectivity mapping (MPM) is commonly used for exploration of mineral deposits.

The FAHP is a popular technique which has been applied for multi-criteria decision-making (MCDM) problems.

Knowledge-driven method is appropriate in frontier or less-explored geologically permissive area.

Assignment of proper weights to individual evidential maps is a highly subjective exercise.

Fuzzy Logic Image Processing

This example shows how to use fuzzy logic for image processing. Specifically, this example shows how to detect edges in an image.

An edge is a boundary between two uniform regions. You can detect an edge by comparing the intensity of neighboring pixels. However, because uniform regions are not crisply defined, small intensity differences between two neighboring pixels do not always represent an edge. Instead, the intensity difference might represent a shading effect.

The fuzzy logic approach for image processing allows you to use membership functions to define the degree to which a pixel belongs to an edge or a uniform region.

Import RGB Image and Convert to Grayscale

Irgb is a 384 x 512 x 3 uint8 array. The three channels of Irgb (third array dimension) represent the red, green, and blue intensities of the image.

Convert Irgb to grayscale so that you can work with a 2-D array instead of a 3-D array. To do so, use the rgb2gray function.

Convert Image to Double-Precision Data

The evalfis function for evaluating fuzzy inference systems supports only single-precision and double-precision data. Therefore, convert Igray to a double array using the im2double function.

Obtain Image Gradient

The fuzzy logic edge-detection algorithm for this example relies on the image gradient to locate breaks in uniform regions. Calculate the image gradient along the x -axis and y -axis.

Gx and Gy are simple gradient filters. To obtain a matrix containing the x -axis gradients of I , you convolve I with Gx using the conv2 function. The gradient values are in the [-1 1] range. Similarly, to obtain the y -axis gradients of I , convolve I with Gy .

Generally, fuzzy logic systems can be used for practical and commercial purposes. Also, it can be used in –

  • Consumer products and control machines
  • Dealing with uncertainty in engineering
  • Giving at least acceptable reasoning if not accurate reasoning.

Apart from this, fuzzy logic offers various unique features that make it a perfect choice for controlling many problems:

1) It is intrinsically robust since it does not require fixed, noise-free inputs and can be programmed to fail safely if a feedback sensor quits or is destroyed. Despite a wide range of input variations, output control is the smooth control function.

2) Fuzzy logic controller process user-defined rules and override the target control system. It can be altered easily to improve or boost system performance. By generating appropriate governing rules, new sensors can be easily generated into the system.

3) Fuzzy logic is not limited to only one or two control outputs or few feedback inputs. Also, it’s not necessary to measure change rate parameters before its implementation. Data from sensors that provide some system indication is enough. This will allow the sensors to be inexpensive and keeping the system cost low for the overall setup.

4) Due to the rule-based operation, inputs of reasonable numbers like (1-6 or more) and numerous outputs like (1-4) can be generated. Although, defining the rules may become complex in case too many inputs and outputs are chosen for single implementation, since after defining rules, their interrelations must be defined. Also, it will be a good idea to break the control system in smaller portions and use multiple fuzzy logic controllers distributed on the system, with each one carrying more responsibilities.

5) Fuzzy logic is capable of managing non-linear systems that would be difficult to manage mathematically. This will open the doors for the control system and it would be easy to gauge feasibility for automation.

Where can I find examples of fuzzy logic applications in ArcGIS? - Geographic Information Systems

The point of fuzzy logic is to map an input space to an output space, and the primary mechanism for doing this is a list of if-then statements called rules. All rules are evaluated in parallel, and the order of the rules is unimportant. The rules themselves are useful because they refer to variables and the adjectives that describe those variables. Before you can build a system that interprets rules, you must define all the terms you plan on using and the adjectives that describe them. To say that the water is hot, you need to define the range within which the water temperature can be expected to vary as well as what you mean by the word hot .

In general, fuzzy inference is a method that interprets the values in the input vector and, based on some set of rules, assigns values to the output vector.

This topic guides you through the fuzzy logic process step-by-step by providing an introduction to the theory and practice of fuzzy logic.

Fuzzy Sets

Fuzzy logic starts with the concept of a fuzzy set. A fuzzy set is a set without a crisp, clearly defined boundary. It can contain elements with only a partial degree of membership.

To understand what a fuzzy set is, first consider the definition of a classical set . A classical set is a container that wholly includes or wholly excludes any given element. For example, the set of days of the week unquestionably includes Monday, Thursday, and Saturday. It just as unquestionably excludes butter, liberty, and dorsal fins, and so on.

This type of set is called a classical set because it has been around for a long time. It was Aristotle who first formulated the Law of the Excluded Middle, which says X must either be in set A or in set not-A. Another version of this law is:

Of any subject, one thing must be either asserted or denied.

To restate this law with annotations: "Of any subject (say Monday), one thing (a day of the week) must be either asserted or denied (I assert that Monday is a day of the week)." This law demands that opposites, the two categories A and not-A, should between them contain the entire universe. Everything falls into either one group or the other. There is no thing that is both a day of the week and not a day of the week.

Now, consider the set of days comprising a weekend. The following diagram attempts to classify the weekend days.

Most would agree that Saturday and Sunday belong in the weekend set, but what about Friday? It feels like a part of the weekend, but somehow it seems like it should be technically excluded. Therefore, Friday "straddles the fence." Classical sets do not tolerate this kind of classification. Either something is in a set or it is out of a set. Human experience suggests something different, however, straddling the fence is part of life.

Of course, individual perceptions and cultural background must be taken into account when you define what constitutes the weekend. Even the dictionary is imprecise, defining the weekend as the period from Friday night or Saturday to Monday morning. You are entering the realm where sharp-edged, yes-no logic stops being helpful. Fuzzy reasoning becomes valuable exactly when you work with how people really perceive the concept weekend as opposed to a simple-minded classification useful for accounting purposes only. More than anything else, the following statement lays the foundations for fuzzy logic.

In fuzzy logic, the truth of any statement becomes a matter of degree.

Any statement can be fuzzy. The major advantage that fuzzy reasoning offers is the ability to reply to a yes-no question with a not-quite-yes-or-no answer. Humans do this kind of thing all the time (think how rarely you get a straight answer to a seemingly simple question), but it is a rather new trick for computers.

How does it work? Reasoning in fuzzy logic is just a matter of generalizing the familiar yes-no (Boolean) logic. If you give true the numerical value of 1 and false the numerical value of 0, this value indicates that fuzzy logic also permits in-between values like 0.2 and 0.7453. For instance:

Q: Is Saturday a weekend day?
A: 1 (yes, or true)
Q: Is Tuesday a weekend day?
A: 0 (no, or false)
Q: Is Friday a weekend day?
A: 0.8 (for the most part yes, but not completely)
Q: Is Sunday a weekend day?
A: 0.95 (yes, but not quite as much as Saturday).

The plot on the left shows the truth values for weekend-ness if you are forced to respond with an absolute yes or no response. On the right is a plot that shows the truth value for weekend-ness if you are allowed to respond with fuzzy in-between values.

Technically, the representation on the right is from the domain of multivalued logic (or multivalent logic). If you ask the question "Is X a member of set A?" the answer might be yes, no, or any one of a thousand intermediate values in between. Thus, X might have partial membership in A. Multivalued logic stands in direct contrast to the more familiar concept of two-valued (or bivalent yes-no) logic.

To return to the example, now consider a continuous scale time plot of weekend-ness shown in the following plots.

By making the plot continuous, you are defining the degree to which any given instant belongs in the weekend rather than an entire day. In the plot on the left, notice that at midnight on Friday, just as the second hand sweeps past 12, the weekend-ness truth value jumps discontinuously from 0 to 1. This is one way to define the weekend, and while it may be useful to an accountant, it may not really connect with your own real-world experience of weekend-ness.

The plot on the right shows a smoothly varying curve that accounts for the fact that all of Friday, and, to a small degree, parts of Thursday, partake of the quality of weekend-ness and thus deserve partial membership in the fuzzy set of weekend moments. The curve that defines the weekend-ness of any instant in time is a function that maps the input space (time of the week) to the output space (weekend-ness). Specifically, it is known as a membership function . See Membership Functions for a more detailed discussion.

As another example of fuzzy sets, consider the question of seasons. What season is it right now? In the northern hemisphere, summer officially begins at the exact moment in the earth's orbit when the North Pole is pointed most directly toward the sun. It occurs exactly once a year, in late June. Using the astronomical definitions for the season, you get sharp boundaries as shown on the left in the figure that follows. But what you experience as the seasons vary more or less continuously as shown on the right in the following figure (in temperate northern hemisphere climates).

Membership Functions

A membership function (MF) is a curve that defines how each point in the input space is mapped to a membership value (or degree of membership) between 0 and 1. The input space is sometimes referred to as the universe of discourse , a fancy name for a simple concept.

One of the most commonly used examples of a fuzzy set is the set of tall people. In this case, the universe of discourse is all potential heights, say from three feet to nine feet, and the word tall would correspond to a curve that defines the degree to which any person is tall. If the set of tall people is given the well-defined (crisp) boundary of a classical set, you might say all people taller than six feet are officially considered tall. However, such a distinction is clearly absurd. It may make sense to consider the set of all real numbers greater than six because numbers belong on an abstract plane, but when we want to talk about real people, it is unreasonable to call one person short and another one tall when they differ in height by the width of a hair.

If the kind of distinction shown previously is unworkable, then what is the right way to define the set of tall people? Much as with the plot of weekend days, the figure following shows a smoothly varying curve that passes from not-tall to tall. The output-axis is a number known as the membership value between 0 and 1. The curve is known as a membership function and is often given the designation of µ. For example, the following figure shows both crisp and smooth tall membership functions. In the top plot, the two people are classified as either entirely tall or entirely not-tall. In the bottom plot, the smooth transition allows for different degrees of tallness. Both people are tall to some degree, but one is significantly less tall than the other. The taller person, with a tallness membership of 0.95 is definitely a tall person, but the person with a tallness membership of 0.3 is not very tall.

Subjective interpretations and appropriate units are built right into fuzzy sets. If you say "She's tall," the membership function tall should already take into account whether you are referring to a six-year-old or a grown woman. Similarly, the units are included in the curve. Certainly it makes no sense to say "Is she tall in inches or in meters?"

Membership Functions in Fuzzy Logic Toolbox Software

The only condition a membership function must really satisfy is that it must vary between 0 and 1. The function itself can be an arbitrary curve whose shape we can define as a function that suits us from the point of view of simplicity, convenience, speed, and efficiency.

A classical set might be expressed as

A fuzzy set is an extension of a classical set. If X is the universe of discourse and its elements are denoted by x , then a fuzzy set A in X is defined as a set of ordered pairs.

µA( x ) is called the membership function (or MF) of x in A. The membership function maps each element of X to a membership value between 0 and 1.

The toolbox includes 11 built-in membership function types. These 11 functions are, in turn, built from several basic functions:

Piece-wise linear functions

Gaussian distribution function

Quadratic and cubic polynomial curves

For detailed information on any of the membership functions mentioned next, see the corresponding reference page.

The simplest membership functions are formed using straight lines. Of these, the simplest is the triangular membership function, and it has the function name trimf . This function is nothing more than a collection of three points forming a triangle. The trapezoidal membership function, trapmf , has a flat top and really is just a truncated triangle curve. These straight line membership functions have the advantage of simplicity.

Two membership functions are built on the Gaussian distribution curve: a simple Gaussian curve and a two-sided composite of two different Gaussian curves. The two functions are gaussmf and gauss2mf .

The generalized bell membership function is specified by three parameters and has the function name gbellmf . The bell membership function has one more parameter than the Gaussian membership function, so it can approach a non-fuzzy set if the free parameter is tuned. Because of their smoothness and concise notation, Gaussian and bell membership functions are popular methods for specifying fuzzy sets. Both of these curves have the advantage of being smooth and nonzero at all points.

Although the Gaussian membership functions and bell membership functions achieve smoothness, they are unable to specify asymmetric membership functions, which are important in certain applications. Next, you define the sigmoidal membership function, which is either open left or right. Asymmetric and closed (i.e. not open to the left or right) membership functions can be synthesized using two sigmoidal functions, so in addition to the basic sigmf , you also have the difference between two sigmoidal functions, dsigmf , and the product of two sigmoidal functions psigmf .

Polynomial based curves account for several of the membership functions in the toolbox. Three related membership functions are the Z, S , and Pi curves, all named because of their shape. The function zmf is the asymmetrical polynomial curve open to the left, smf is the mirror-image function that opens to the right, and pimf is zero on both extremes with a rise in the middle.

There is a very wide selection to choose from when you're selecting a membership function. You can also create your own membership functions with the toolbox. However, if a list based on expanded membership functions seems too complicated, just remember that you could probably get along very well with just one or two types of membership functions, for example the triangle and trapezoid functions. The selection is wide for those who want to explore the possibilities, but expansive membership functions are not necessary for good fuzzy inference systems. Finally, remember that more details are available on all these functions in the reference section.

Summary of Membership Functions

Fuzzy sets describe vague concepts (for example, fast runner, hot weather, weekend days).

A fuzzy set admits the possibility of partial membership in it. (for example, Friday is sort of a weekend day, the weather is rather hot).

The degree an object belongs to a fuzzy set is denoted by a membership value between 0 and 1 (for example, Friday is a weekend day to the degree 0.8).

A membership function associated with a given fuzzy set maps an input value to its appropriate membership value.

Logical Operations

Now that you understand the fuzzy inference, you need to see how fuzzy inference connects with logical operations.

The most important thing to realize about fuzzy logical reasoning is the fact that it is a superset of standard Boolean logic. In other words, if you keep the fuzzy values at their extremes of 1 (completely true), and 0 (completely false), standard logical operations will hold. As an example, consider the following standard truth tables.

Considering that, in fuzzy logic, the truth of any statement is a matter of degree, can these truth tables be altered? The input values can be real numbers between 0 and 1. What function preserves the results of the AND truth table (for example) and also extend to all real numbers between 0 and 1?

One answer is the min operation. That is, resolve the statement A AND B , where A and B are limited to the range (0,1), by using the function min ( A , B ). Using the same reasoning, you can replace the OR operation with the max function, so that A OR B becomes equivalent to max ( A,B ). Finally, the operation NOT A becomes equivalent to the operation 1 − A . The previous truth table is completely unchanged by this substitution.

Moreover, because there is a function behind the truth table rather than just the truth table itself, you can now consider values other than 1 and 0.

The next figure uses a graph to show the same information. In this figure, the truth table is converted to a plot of two fuzzy sets applied together to create one fuzzy set. The upper part of the figure displays plots corresponding to the preceding two-valued truth tables, while the lower part of the figure displays how the operations work over a continuously varying range of truth values A and B according to the fuzzy operations you have defined.

Given these three functions, you can resolve any construction using fuzzy sets and the fuzzy logical operation AND, OR, and NOT.

Additional Fuzzy Operators

In this case, you defined only one particular correspondence between two-valued and multivalued logical operations for AND, OR, and NOT. This correspondence is by no means unique.

In more general terms, you are defining what are known as the fuzzy intersection or conjunction (AND), fuzzy union or disjunction (OR), and fuzzy complement (NOT). The classical operators for these functions are: AND = min , OR = max , and NOT = additive complement. Typically, most fuzzy logic applications make use of these operations and leave it at that. In general, however, these functions are arbitrary to a surprising degree. Fuzzy Logic Toolbox™ software uses the classical operator for the fuzzy complement as shown in the previous figure, but also enables you to customize the AND and OR operators.

The intersection of two fuzzy sets A and B is specified in general by a binary mapping T , which aggregates two membership functions as follows:

μ A ∩ B ( x ) = T ( μ A ( x ) , μ B ( x ) )

For example, the binary operator T may represent the multiplication of µA(x) and µB(x). These fuzzy intersection operators, which are usually referred to as T-norm (Triangular norm) operators, meet the following basic requirements:

A T-norm operator is a binary mapping T (. ) with the following properties:

Boundary — T ( 0 , 0 ) = 0 , T ( a , 1 ) = T ( 1 , a ) = a

Monotonicity — T ( a , b ) ≤ T ( c , d ) if a ≤ c and b ≤ d

Commutativity — T ( a , b ) = T ( b , a )

Associativity — T ( a , T ( b , c ) ) = T ( T ( a , b ) , c )

The first requirement imposes the correct generalization to crisp sets. The second requirement implies that a decrease in the membership values in A or B cannot produce an increase in the membership value in A intersection B . The third requirement indicates that the operator is indifferent to the order of the fuzzy sets to be combined. Finally, the fourth requirement allows us to take the intersection of any number of sets in any order of pair-wise groupings.

Like fuzzy intersection, the fuzzy union operator is specified in general by a binary mapping S :

μ A ∪ B ( x ) = S ( μ A ( x ) , μ B ( x ) )

For example, the binary operator S can represent the addition of µA(x) and µB(x). These fuzzy union operators, which are often referred to as T-conorm (or S-norm) operators, must satisfy the following basic requirements:

A T-conorm (or S-norm) operator is a binary mapping S (. ) with the following properties:

Boundary — S ( 1 , 1 ) = 1 , S ( a , 0 ) = S ( 0 , a ) = a

Monotonicity — S ( a , b ) ≤ S ( c , d ) if a ≤ c and b ≤ d

Commutativity — S ( a , b ) = S ( b , a )

Associativity — S ( a , S ( b , c ) ) = S ( S ( a , b ) , c )

Several parameterized T-norms and dual T-conorms have been proposed in the past, such as those of Yager [11], Dubois and Prade [1], Schweizer and Sklar [8], and Sugeno [9]. Each of these provides a way to vary the gain on the function so that it can be very restrictive or very permissive.

If-Then Rules

Fuzzy sets and fuzzy operators are the subjects and verbs of fuzzy logic. These if-then rule statements are used to formulate the conditional statements that comprise fuzzy logic.

A single fuzzy if-then rule assumes the form

where A and B are linguistic values defined by fuzzy sets on the ranges (universes of discourse) X and Y, respectively. The if-part of the rule " x is A " is called the antecedent or premise, while the then-part of the rule " y is B " is called the consequent or conclusion. An example of such a rule might be

If service is good then tip is average

In general, the input to an if-then rule is the current value for the input variable (in this case, service ) and the output is an entire fuzzy set (in this case, average ). This set will later be defuzzified, assigning one value to the output. The concept of defuzzification is described in the next section.

Interpreting an if-then rule involves two steps:

Evaluation of the antecedent — Fuzzifying the inputs and applying any necessary fuzzy operators .

Application of the result to the consequent.

The second step is known as implication . For an if-then rule, the antecedent, p, implies the consequent, q. In binary logic, if p is true, then q is also true ( pq ). In fuzzy logic, if p is true to some degree of membership, then q is also true to the same degree ( 0.5p → 0.5q ). In both cases, if p is false, then the value of q is undetermined.

The antecedent of a rule can have multiple parts.

If sky is gray and wind is strong and barometer is falling, then .

In this case all parts of the antecedent are calculated simultaneously and resolved to a single number using the logical operators described in the preceding section. The consequent of a rule can also have multiple parts.

If temperature is cold, then hot water valve is open and cold water valve is shut

In this case, all consequents are affected equally by the result of the antecedent. How is the consequent affected by the antecedent? The consequent specifies a fuzzy set be assigned to the output. The implication function then modifies that fuzzy set to the degree specified by the antecedent. The most common ways to modify the output fuzzy set are truncation using the min function (where the fuzzy set is truncated as shown in the following figure) or scaling using the prod function (where the output fuzzy set is squashed). Both are supported by the toolbox, but you use truncation for the examples in this section.

Summary of If-Then Rules

Interpreting if-then rules is a three-part process. This process is explained in detail in the next section:

Fuzzify inputs: Resolve all fuzzy statements in the antecedent to a degree of membership between 0 and 1. If there is only one part to the antecedent, then this is the degree of support for the rule.

Apply fuzzy operator to multiple part antecedents: If there are multiple parts to the antecedent, apply fuzzy logic operators and resolve the antecedent to a single number between 0 and 1. This is the degree of support for the rule.

Apply implication method: Use the degree of support for the entire rule to shape the output fuzzy set. The consequent of a fuzzy rule assigns an entire fuzzy set to the output. This fuzzy set is represented by a membership function that is chosen to indicate the qualities of the consequent. If the antecedent is only partially true, (i.e., is assigned a value less than 1), then the output fuzzy set is truncated according to the implication method.

In general, one rule alone is not effective. Two or more rules that can play off one another are needed. The output of each rule is a fuzzy set. The output fuzzy sets for each rule are then aggregated into a single output fuzzy set. Finally the resulting set is defuzzified, or resolved to a single number. Build Fuzzy Systems Using Fuzzy Logic Designer shows how the whole process works from beginning to end for a particular type of fuzzy inference system called a Mamdani type .


[1] Dubois, Didier, and Henri M. Prade. Fuzzy Sets and Systems: Theory and Applications. Mathematics in Science and Engineering, v. 144. New York: Academic Press, 1980.

[2] Kaufmann, A., and Madan M. Gupta. Introduction to Fuzzy Arithmetic: Theory and Applications. Van Nostrand Reinhold Electrical/Computer Science and Engineering Series. New York, N.Y: Van Nostrand Reinhold Co, 1985.

[3] Lee, C.C. ‘Fuzzy Logic in Control Systems: Fuzzy Logic Controller. I’. IEEE Transactions on Systems, Man, and Cybernetics 20, no. 2 (April 1990): 404󈝾.

[4] Lee, C.C. ‘Fuzzy Logic in Control Systems: Fuzzy Logic Controller. II’. IEEE Transactions on Systems, Man, and Cybernetics 20, no. 2 (April 1990): 419󈞏.

[5] Mamdani, E.H., and S. Assilian. ‘An Experiment in Linguistic Synthesis with a Fuzzy Logic Controller’. International Journal of Man-Machine Studies 7, no. 1 (January 1975): 1󈝹.

[6] Mamdani, E.H. ‘Advances in the Linguistic Synthesis of Fuzzy Controllers’. International Journal of Man-Machine Studies 8, no. 6 (November 1976): 669󈞺.

[7] Mamdani, E.H. ‘Application of Fuzzy Logic to Approximate Reasoning Using Linguistic Synthesis’. IEEE Transactions on Computers C󈞆, no. 12 (December 1977): 1182󈟇.

[8] Schweizer, B. and A. Sklar, 'Associative functions and abstract semi-groups'. Publ. Math. Debrecen 10 (1963): 69󈞽.

Where can I find examples of fuzzy logic applications in ArcGIS? - Geographic Information Systems

Fuzzy logic "Fuzzy Associative Memory"

A Fuzzy Associative Memory (FAM for short) is a Fuzzy Logic tool for decision making. Fuzzy logic FAMs have a wide range of practical applications:

  • Control systems, such as governing a fan to keep a room at the "just right" temperature
  • Game AI, such as imbuing bots with human-like decision-making behavior
  • Prediction systems, linking causes with effects

A Fuzzy Associative Memory uses Fuzzy Sets to establish a set of rules that are linguistic in nature examples might include:

  • "If the room is a bit warm, turn the fan up a little bit"
  • "If the orc's hit points are a little low, retreat from the enemy"
  • "If the enemy is distant and my rocket ammo is low, the rocket launcher is a poor choice"
  • "If the enemy is near and my shotgun ammo is okay, the shotgun is a very desirable choice"
  • "If the ship is off course by a little bit, correct just a little to the right"
  • "If the bird is much slower than the flock, speed it up a lot"

The linguistic rules, and the fuzzy sets they contain, are defined by a human "expert" (presumably, you). That is to say, the rules codify intelligence and map this knowledge from the human domain to the digital.

After the rules are defined, a FAM is consulted to help your AI make a descision:

  • The orc retreats, attacks, strafes.
  • The ship launches long range missiles or fires short range guns.
  • The control rods are lowered into the reactor or raised out of it.

As you can see, the fuzzy rules are deliberately vague and use qualifiers like "a little" and "a lot". Furthermore, the lines between fuzzy sets are intentionally blurry. This is the nature of fuzzy sets they capture such human fuzziness in a way that extracts highly natural behavior from the fuzzy rules. When defining these rules, it helps to imagine interviewing a bona fide expert in the domain and writing down the skills necessary to be successful in the domain.

Fuzzy Linguistic Variables can be hard to visualize, especially when they get complex and include triangles and trapezoids in combination. To answer that, this software can now (optionally) shell out to your installed Gnuplot and create PNG or SVG renderings of your FLVs. Here's an example:

This is working, functional software, suitable for use in your own game or application. It currently supports:

  • Triangular & trapezoidal fuzzy sets for input/output
  • Larsen Implication (scaling)
  • Mamdani Implication (clipping)
  • Atomic antecedent propositions ( if A then Z )
  • Composite antecedent propositions ( if A or B, then Z / if A and B, then Z )

To do (in descending importance, roughly):

  • Parameter validations to prevent bad shapes, improper FAM layout, etc.
  • Other shapes for fuzzy sets
  • Hedges ('very' and 'fairly')
  • Additional examples

I recommend you clone the Git repository and browse the examples and source code to fully understand how FAMs work.

But if / when you want to use this in your own project, the easiest way to do so is via the Gem:

The gem is fully namespaced to prevent collisions. See the examples for usage details.

The bin directory contains the following examples:

  • hvac_system_example illustrates how a FAM could govern an HVAC fan unit to maintain a constant, comfortable temperature
  • weapon_choice_example illustrates how a FAM could let a game bot intelligently decide which weapon to use

Plots of the examples' fuzzy linguistic variables have been pre-rendered and are in the bin directory. These will help you visualize the FLVs.

References used in the creation of this software

  • "Fuzzy Thinking: The New Science of Fuzzy Logic" by Bart Kosko (Amazon link)
  • "Fuzzy Logic: The Revolutionary Computer Technology that is Changing the World" by Daniel McNeill & Paul Freiberger (Amazon link)
  • "Fuzzy Logic in Decision Making and Signal Processing" by Sujit Nath Pant & Keith E. Holbert (Link)
  • "Programming Game AI by Example" by Mat Buckland (Amazon link)

Biosignal Processing

11.9.1 Fuzzy Logic

Fuzzy logic is based on the concept of using words rather than numbers for computing, since words tend to be much less precise than numbers. Computing has traditionally involved calculations that use precise numerical values, while human reasoning generally uses words. Fuzzy logic attempts to approximate human reasoning by using linguistic variables. Linguistic variables are words that are used to describe a parameter. For body temperature, linguistic variables that might be used are high fever, above normal, normal, below normal, and frozen. The linguistic variables are more ambiguous than the number of degrees Fahrenheit, such as 105.0, 98.9, 98.6, 97.0, and 27.5.

In classical mathematics, numeric sets called crisp sets are defined, while the basic elements of fuzzy systems are fuzzy sets. An example of a crisp set is A = [0, 20]. Crisp sets have precisely defined, numeric boundaries. Fuzzy sets do not have sharply defined bounds. Consider the categorization of people by age. Using crisp sets, the age groups could be divided as A = [0, 20], B = [30, 50], and C = [60, 80]. Figure 11.37a shows the characteristic function for the sets A, B, and C. The value of the function is either 0 or 1, depending on whether the age of a person is within the bounds of set A, B, or C. The scheme using crisp sets lacks flexibility. If a person is 25 years old or 37 years old, he or she is not categorized.

Figure 11.37 . (a) Crisp sets for the classification of people by age. (b) Fuzzy sets for the classification of people by age.

If the age groups were instead divided into fuzzy sets, the precise divisions between the age groups would no longer exist. Linguistic variables, such as young, middle-aged, and old, could be used to classify the individuals. Figure 11.37b shows the fuzzy sets for age categorization. Note the overlap between the categories. The words are basic descriptors, not precise measurements. A 30-year-old woman may seem old to a 6-year-old boy but quite young to an 80-year-old man. For the fuzzy sets, a value of 1 represents a 100 percent degree of membership to a set. A value of 0 indicates that there is no membership in the set. All numbers between 0 and 1 show the degree of membership to a group. A 35-year-old person, for instance, belongs 50 percent to the young set and 50 percent to the middle-aged set.

As with crisp sets from classical mathematics, operations are also defined for fuzzy sets. The fuzzy set operation of intersection is shown in Figure 11.38a . Figure 11.38b shows the fuzzy union operator, and Figure 11.38c shows the negation operator for fuzzy sets. The solid line indicates the result of the operator in each figure.

Figure 11.38 . (a) Intersection of fuzzy sets: YOUNG AND MIDDLE-AGED. (b) Union of fuzzy sets: MIDDLE-AGED OR OLD. (c) Negation of fuzzy sets: NOT OLD.

Although it is easy to form fuzzy sets for a simple example such as age classification, fuzzy sets for more sophisticated applications are derived by using sophisticated calibration techniques. The linguistic variables are formulated mathematically and then can be processed by computers. Once the fuzzy sets have been established, rules are constructed. Fuzzy logic is a rule-based logic. Fuzzy systems are constructed by using a large number of rules. Most rules used in fuzzy logic computing are if-then statements that use linguistic variables. Two simple rules that use the fuzzy sets for age classification might be the following:

If the patient is YOUNG, then use TREATMENT A.

If the patient is MIDDLE-AGED or OLD, then use TREATMENT B.

The degree of membership in a group helps to determine which rule will be used and, consequently, the type of action that will be taken or, in the preceding example, the sort of treatment that will be used. Defuzzification methods are used to determine which rules will be used to produce the final output of the fuzzy system.

For many applications, fuzzy logic has significant advantages over traditional numeric computing methods. Fuzzy logic is particularly useful when information is too limited or too complex to allow for numeric precision, since it tolerates imprecision. If an accurate mathematical model cannot be constructed, fuzzy logic may prove valuable. However, if a process can be described or modeled mathematically, then fuzzy logic will not generally perform better than traditional methods.

Biomedical engineering applications, which involve the analysis and evaluation of biosignals, often have attributes that confound traditional computing methods but are well suited to fuzzy logic. Biological phenomena are often not precisely understood and can be extremely complex. Biological systems also vary significantly from one individual to the next individual. In addition, many key quantities in biological systems cannot be measured precisely due to limitations in existing sensors and other biomedical measuring devices. Sensors may have the capability to measure biological quantities intermittently or in combination with other parameters but not independently. Blood glucose sensors, for example, are sensitive not only to blood glucose but also to urea and other elements in the blood. Fuzzy logic can be used to help compensate for the limitations of sensors.

Fuzzy logic is being used in a variety of biomedical engineering applications. Closed loop drug delivery systems, which are used to automatically administer drugs to patients, have been developed by using fuzzy logic. In particular, fuzzy logic may prove valuable in the development of drug delivery systems for anesthetic administration, since it is difficult to precisely measure the amount of anesthetic that should be delivered to an individual patient by using conventional computing methods. Fuzzy logic is also being used to develop improved neuroprosthetics for paraplegics. Neuroprosthetics for locomotion use sensors controlled by fuzzy logic systems to electrically stimulate necessary leg muscles and will ideally enable the paraplegic patient to walk.

A fuzzy system is used to categorize people by heart rates. The system is used to help determine which patients have normal resting heart rates, bradycardia, or tachycardia. Bradycardia is a cardiac arrhythmia in which the resting heart rate is less than 60 beats per minute, while tachycardia is defined as a cardiac arrhythmia in which the resting heart rate is greater than 100 beats per minute. A normal heart rate is considered to be in the range of 70–80 beats per minute. What are three linguistic variables that might be used to describe the resting heart rates of the individuals?


A variety of linguistic variables may be used. The names are important only in that they offer a good description of the categories and problem. Slow, normal, and fast might be used. Another possibility is simply bradycardia, normal, and tachycardia.

Fuzzy Logic

Fuzzy(adjective): difficult to perceive indistinct or vague


Fuzzy logic is a form of multi-valued logic that deals with reasoning that is approximate rather than fixed and exact. Fuzzy logic values range between 1 and 0. i.e the value may range from completely true to completely false. In contrast, Boolean Logic is a two-valued logic: true or false usually denoted 1 and 0 respectively, that deals with reasoning that is fixed and exact. Fuzzy logic tends to reflect how people think and attempts to model our decision making hence it is now leading to new intelligent systems(expert systems).

So, if we are comparing two strings using fuzzy logic, we would be trying to answer the question “How similar are string A and string B?”, and rephrasing it as “Are string A and String B the same?” when using the Boolean Logic.

Calculating fuzzy similarity

Jaccard's ( 1901 ) index is one of the most widely used similarity indices in ecology, for example for detecting species distributional associations (Real & Vargas 1996 Sillero et al. 2009 Barbosa et al. 2012 ), comparing regional species compositions (Chao et al. 2004 Anderson, Bolton & Stegenga 2009 Engen, Grøtan & Saether 2011 ), calculating beta diversity patterns (Anderson et al. 2011 ) or assessing temporal species turnover in climate change research (Albouy et al. 2012 ). Sørensen's ( 1948 ) index is widely used for assessing compositional similarity between sites or communities and beta diversity patterns in space or time (Anderson et al. 2011 Baselga, Gómez-Rodríguez & Lobo 2012 Baselga & Orme 2012 Dobrovolski et al. 2012 ). Simpson's ( 1960 ) similarity is the proportion, in the smaller of two samples, of taxa/regions common to both, thereby minimizing the effect of sample size discrepancies. Baroni-Urbani & Buser's ( 1976 ) index (hereafter Baroni for short) is broadly used in species distributional clustering and biotic regionalization (Márquez et al. 1997 Real, Olivero & Vargas 2008 Olivero, Real & Márquez 2011 Moya, Saucède & Manjón-Cabeza 2012 Olivero, Márquez & Real 2013 ). It accounts for both shared presences and shared absences, but gives greater weight to presences.

All these similarity indices vary between zero (no distributional or compositional overlap) and one (identical distributions or compositions). Tables of significant values per sample size are available (e.g. Baroni-Urbani & Buser 1976 Real 1999 ), so these indices can be used for identifying significant associations (Olivero, Real & Márquez 2011 Olivero, Márquez & Real 2013 ). All these indices are calculated on two or more of the following terms: A and B (the numbers of species/localities in each sample), C (the number of shared species/localities) and D (the number of species/localities missing from both samples). All these terms have direct correspondence with Boolean logic expressions and can thus be translated into their fuzzy logical equivalents to assess fuzzy binary similarity (Table 1).

Term Boolean logic Classical sets Fuzzy sets
A sp1 sp1 sum(sp1)
B sp2 sp2 sum(sp2)
C sp1 AND sp2 sp1 ∩ sp2 sum(minimum(sp1, sp2))
D NOT sp1 AND NOT sp2 complement(sp1 U sp2) sum(1 – maximum (sp1, sp2))

CRC Press, Taylor & Francis Group, Boca Raton, FL 2010 ISBN 978-1-4398-0939-6 340 pp.

When addressing a hydrologic problem, the author states in the preface of the book, “basic linguistic knowledge, experience, and expert views help establish the preliminary skeleton of the solution, which may later be supported by the numerical data.” He goes on to say: “In almost every corner, hydrological sciences have gray fore- and backgrounds with verbal information. The big dilemma is how to deal with gray information for arriving at decisive conclusions with crisp and deterministic principles. Fuzzy logic (FL) principles with linguistically valid propositions and vague categorization provide a sound background for the evaluation of such information.” Put another way, for solving any hydrological problem, along with data, expert knowledge in the form of logic or experience-based information is often important, but it is difficult to code this information into mathematical equations fuzzy logic offers a way to make use of this information. Thus, the main focus of the book, as stated by the author, is “to prepare the reader with linguistic (verbal) qualitative data interpretation and treatment procedures on the basis of FL principles.”

The subject matter of book is divided into nine chapters, with the first seven chapters presenting an expository account of the FL principles and the remaining two chapters discussing applications. The first chapter introduces fuzzy logic and discusses the origin thereof, and goes on to explain the concept of fuzziness in hydrology and why fuzzy logic can help solve hydrological questions. The discussion distinguishes between the concepts of “stochastic uncertainty” and “fuzziness” as they apply to real-world hydrologic processes.

Linguistic variables and logic constitute the subject matter of Chapter 2, explaining the fuzzy content of words, adjectives, and sentences in describing human thought or a particular condition or state thereof. It is argued that this state leads to the use of concepts, which if represented on a measuring scale, will not be totally definite and would have gray or fuzzy zones. The fuzziness involved in the thought process and reasoning is then discussed.

Chapter 3 deals with the concept of fuzzy sets, membership functions, and operations. The meaning of crisp and fuzzy sets in hydrology is discussed, using illustrative examples. The examples are based on discharge, drought, drinking water quality, soil types, rainfall measurements, drainage basin, and groundwater. The discussion also sheds light on how fuzziness can be reduced or increased or intensified, and introduces the logical operations employed on fuzzy sets.

Fuzzy numbers and arithmetic are presented in Chapter 4. Included in the arithmetic operations are fuzzy addition, fuzzy subtraction, fuzzy multiplication, fuzzy division, extremes of fuzzy numbers, and extension principle. Each operation is illustrated with examples from hydrology.

Chapter 5 discusses the concept of association and clusters. Differences between logical relationships and fuzzy logic relationships with different sets of variables are clearly made. The importance of the relationship between different variables is also explained and three clustering algorithms—namely, distance measure, k-means, and c-means—are discussed with examples.

Fuzzy logical rules are presented in chapter 6. Explaining the rational and logical difference between classical logic and fuzzy logic, a description of how linguistic input and output variables are identified and decomposed into formal fuzzy subsets is given, followed by the use of “if … then …” rules. The last part of the chapter deals with rule-based establishment and discusses the need for mechanical documentation, when information about the phenomenon studied is not available, expert opinion to refine the modeling exercise, use of data, and degrees of belief.

Chapter 7 discusses fuzzy inference systems (FIS), and highlights the important elements in a fuzzy expert system and explains the merits and differences between the Mamdani FIS, Sugeno FIS, Tsukamoto FIS, and Şen FIS. It also deals with defuzzification, FIS training, triple variable fuzzy systems, and adaptive network-based FIS and its drawbacks.

Chapters 8 and 9 deal with the application of fuzzy modeling of hydrological processes and water resources system operations, respectively. They present examples of applications to virtually every component of the hydrological cycle, including evaporation, infiltration, rainfall prediction, and groundwater recharge. A section on river traffic modeling is also included. In the discussion of water resources system operation are included water budget, prediction of drinking water consumption, and reservoir management and operation rules.

To summarize, chapters 1–7 include a set of problems and exercises that may help the reader with the comprehension of concepts. The author makes extensive use of examples throughout the different chapters to illustrate concepts and their application in the field of hydrology and water resources. Although relevant, the list of references does not seem to be exhaustive. Early works done on this subject are well represented, while works done in the past ten years are generally scanty in the list. This omission does not help the reader in gaining a complete picture of the application of fuzzy logic in hydrology and water resources management.

The book is well written, sections are organized in a coherent manner with a natural flow from basic to more advanced concepts, and concludes with illustrative applications. This is probably the first book on the subject of fuzzy logic in hydrology, and Dr. Şen should be commended for this valuable contribution to the hydrologic literature. The book would be a valuable tool for senior undergraduate students or beginning graduate students in civil and agricultural engineering, earth and watershed sciences, or environmental sciences. For researchers in the field, it can also be a valuable addition to their library.

Download Now!

We have made it easy for you to find a PDF Ebooks without any digging. And by having access to our ebooks online or by storing it on your computer, you have convenient answers with Fuzzy Logic Based Control For Battery Management In Micro Grid . To get started finding Fuzzy Logic Based Control For Battery Management In Micro Grid , you are right to find our website which has a comprehensive collection of manuals listed.
Our library is the biggest of these that have literally hundreds of thousands of different products represented.

Finally I get this ebook, thanks for all these Fuzzy Logic Based Control For Battery Management In Micro Grid I can get now!

I did not think that this would work, my best friend showed me this website, and it does! I get my most wanted eBook

wtf this great ebook for free?!

My friends are so mad that they do not know how I have all the high quality ebook which they do not!

It's very easy to get quality ebooks )

so many fake sites. this is the first one which worked! Many thanks

wtffff i do not understand this!

Just select your click then download button, and complete an offer to start downloading the ebook. If there is a survey it only takes 5 minutes, try any survey which works for you.

Watch the video: Fuzzy Membership Function (October 2021).