without time lags. To get an estimate of rate of change of wandering curvilinear

data, assume that the input is a function of time, realized as a time series of measure-

ments taken at equal time intervals Dt. Expand this function into a McClauren series;

f (t À Dt) ¼ f (t) À f 0 (t)Dt þ f 00 (t)(Dt2 ) À Á Á Á (15:5)

We can also write

f (t À 2Dt) ¼ f (t) À f 0 (t)(2Dt) þ f 0 (t)(2Dt)2 À Á Á Á (15:6)

Dropping the terms after the second derivative, we manipulate these two equations

to eliminate the second derivative term, and obtain

f 0 (t) ¼ (3f (t) À 4f (t À 1) þ f (t À 2))=(2Dt) (15:7)

TEAM LinG - Live, Informative, Non-cost and Genuine !

265

15.4 TYPES OF RULES USEFUL IN REAL-TIME ON-LINE WORK

The third derivative can also be eliminated by

À11F(x) þ 18F(x þ Dx) À 9F(x þ 2Dx) þ 2F(x þ 3Dx)

f 0 (t) ¼ (15:8)

6DX

Equation (15.7) corrects the input stream for presence of a (constant) second deriva-

tive, and assumes that the third and all higher derivatives are zero; (15.8) corrects

also for a third derivative. There is no time lag in the result. Deriving similar for-

mulas that eliminate the effect of higher order derivatives is a straightforward but

somewhat tedious task.

While formulas like (15.7) and its higher order counterparts correct for the pre-

sence of 2nd and higher order derivatives in the input data stream, they are virtually

useless for eliminating the effects of random noise in input data.

15.4 TYPES OF RULES USEFUL IN REAL-TIME

ON-LINE WORK

15.4.1 Fuzzy Control Rules

The ¬eld of fuzzy control has been discussed in depth in many excellent books; see,

for example, Pedrycz (1995), deSilva (1995) . . . . Since our main interest is the use

of fuzzy expert systems in other than control applications, we will only outline the

main features of fuzzy control rules.

A typical fuzzy control rule has this format:

IF (x1 is Small and x2 is Slow) THEN y is Positive; (15:9)

Ordinarily x1, x2, and y are scalar numbers, although it is not uncommon for x1 and x2

to be fuzzy numbers. Small, Slow, and Positive are members of discrete fuzzy sets

properly called linguistic variables, in which each member such as Small has an

associated membership function. Usually, there are several such rules, ¬red in parallel.

Rule (15.9) is much more complex than it appears; many steps and several

choices are involved before its evaluation is complete.

The ¬rst step is fuzzi¬cation; that is, the input values xi are used with the member-

ship functions to determine the grades of membership of Small, Slow, and so on in

their respective linguistic variables. Next, the truth values of the input clauses (x1 is

Small, x2 is Slow . . .) are combined, usually using a t-norm operator, to get truth

values for the antecedents of the various rules to be ¬red together. The combined ante-

cedent truth values now become the truth value of the consequent, and in (15.9) the

truth value of Positive. We are now ready to start the defuzzi¬cation process, and

determine a numeric value for y. The membership function for Positive is modi¬ed

by taking the fuzzy AND of the membership function truth values with the antecedent

truth value. Now the consequents of the various rules must be aggregated, which

means combining the membership functions together to form a single complex

TEAM LinG - Live, Informative, Non-cost and Genuine !

266 RUNNING ON-LINE IN REAL-TIME

fuzzy number (not necessarily convex) de¬ned on the real line. We then use one of the

methods available (most often the centroid method) to derive a value for y.

While the notation of rule (15.9) is quite compact, it is quite in¬‚exible, and not

really useful for general-purpose fuzzy reasoning. In FLOPS, for ¬‚exibility and

clarity we break out fuzzi¬cation and defuzzi¬cation as separate consequent

operations. We also refer speci¬cally to the names of input and output linguistic vari-

ables (discrete fuzzy sets). The complete FLOPS code for such a control rule

might be

:------------------------------------------------------

:Data declarations

declare Data

x1 ¬‚t

x2 ¬‚t

y ¬‚t

size fzset (Small Medium Large)

speed fzset (Slow Medium Fast)

output fzset (Negative Zero Positive;

:------------------------------------------------------

:De¬ne membership functions

memfunct Data size linear

Small.....;

:------------------------------------------------------

:Fuzzify inputs

rule block 1 (goal Fuzzify inputs)

IF (in Data x1 = <X1> AND x2 = , X2)

THEN

fuzzify 1 size <X1>,

fuzzify 1 speed <X2>,

¬re block 1 off,

¬re block 2 on;

:------------------------------------------------------

:Fuzzy inference

rule block 2 (goal Rules to get output fuzzy sets from

input fuzzy sets)

IF (in Data size is Small AND speed is Slow)

THEN

in 1 output is Positive,

¬re block 2 off,

¬re block 3 on;

:------------------------------------------------------

:Defuzzi¬cation to get output

TEAM LinG - Live, Informative, Non-cost and Genuine !

267

15.4 TYPES OF RULES USEFUL IN REAL-TIME ON-LINE WORK

rule block 3

IF (Data)

THEN

defuzzify 1 output centroid 1 y ;

Note that FLOPS syntax permits using the linguistic term Medium in two differ-

ent contexts; fuzzy control rules do not often permit this, since their linguistic terms

such as Medium are not usually associated with a speci¬c linguistic variable, in this

case size and speed.

The point to having fuzzi¬cation and (especially) defuzzi¬cation as separate

operations is that the discrete fuzzy sets and the grades of membership of their

members are available for use elsewhere in the program, either as input to succeeding

stages of reasoning or as output to the user. It is not always necessary to have a

defuzzi¬cation rule; programs that have their output in words rather than in

numbers may not have any defuzzi¬cation taking place at all.

This rule scheme requires de¬nition of the input (and output) linguistic variables,

the discrete fuzzy sets, their members, and membership functions, at some time

before the rules are ¬red. Although it is possible to de¬ne these fuzzy sets as the

program runs, using information acquired during the run, in practice the input and

output fuzzy sets are almost always de¬ned when the program is written, rather

than during the course of a run.

A potential problem with this type of rule is the “combinatorial explosion” in

number of rules as the number of input variables and input fuzzy set members

increases. Suppose we have N input numeric variables and (correspondingly) N