An affine fuzzy model with local and global interpretations

An affine fuzzy model with local and global interpretations

Applied Soft Computing 11 (2011) 4226–4235 Contents lists available at ScienceDirect Applied Soft Computing journal homepage: www.elsevier.com/locat...

550KB Sizes 1 Downloads 375 Views

Applied Soft Computing 11 (2011) 4226–4235

Contents lists available at ScienceDirect

Applied Soft Computing journal homepage: www.elsevier.com/locate/asoc

An affine fuzzy model with local and global interpretations夽 Fernando Matía ∗ , Basil M. Al-Hadithi, Agustín Jiménez, Pablo San Segundo Intelligent Control Group at the Universidad Politécnica de Madrid, Spain

a r t i c l e

i n f o

Article history: Received 7 July 2009 Received in revised form 28 July 2010 Accepted 20 March 2011 Available online 26 March 2011 Keywords: Nonlinear systems Dynamics Fuzzy systems Modelling Fuzzy control Universal approximators

a b s t r a c t Universal approximation properties of Mamdani fuzzy model are well known. On the other hand, TakagiSugeno fuzzy model with affine consequent was thought to be a local approximator of the dynamics. However, it can also be tuned to be an universal approximator, but loosing its local interpretation. In this paper, an innovative affine global model with universal approximation capabilities which maintains local interpretation is introduced. This novel model can be considered a generalization of Takagi-Sugeno affine fuzzy model, and is based on decoupling the dynamic parameters of the system at the fuzzification step. We demonstrate how this new model can exactly match non-linear functions expressed either as product form or additive form. Finally, we apply all the above to model a multivariable tank, analyzing the modelling errors obtained, depending on the model used: Mamdani, Takagi-Sugeno or the affine one with decoupled dynamics. © 2011 Elsevier B.V. All rights reserved.

1. Introduction Mamdani and Takagi-Sugeno fuzzy models are traditionally used to model non-linear systems. Mamdani model [17] does not take into account explicitly local dynamics in the rules, but an appropriate selection of the membership functions can provide an adequate interpolation of the system dynamics. Many papers have analyzed the effect of the membership functions on the model behavior: a justification of the use of triangular and trapezoidal shapes [29], the analysis of the membership functions shape in the inference map [11,14], the influence of the mathematical operators and the properties of the membership functions in the obtention of a monotone input-output behavior [4] or the use of piecewise parabolic membership functions (simplified splines) which approximate both the value and the first derivative of the nonlinear system [12] are just some examples. The concept of universal approximator [18] arises then to prove that a fuzzy logic system (rule-based or not) can approximate any function as much as desired. Again, many papers deal with this topic: the approximation behavior of fuzzy relations [7], the use of neuro-fuzzy structures for function approximation [8,26–28,35], the definition of algebras for function approximation using fuzzy logic [30,31], the universal approximation of systems using hierarchical fuzzy models [6], interpolation and extrapolation which involve multiple fuzzy rules, with each rule consisting

夽 This work is funded by the Spanish Ministry of Science and Innovation (ARABOT project DPI 2010-21247-C02-01) and supervised by CACSA. ∗ Corresponding author. 1568-4946/$ – see front matter © 2011 Elsevier B.V. All rights reserved. doi:10.1016/j.asoc.2011.03.018

of multiple antecedents [13], or the use of standard additive models to approximate a function with a fuzzy logic rule-based system [19]. On the other hand, Takagi-Sugeno model [37] has been widely used in fuzzy modelling for control applications, because it includes valuable information about the system dynamics. More precisely, this model interpolates among affine submodels, something which apparently should mean a good approximation of the dynamics of the non-linear system. However, a non-convex interpolation is obtained [2]. Interpolation difficulties of this model have been widely studied [3]. And when the model is tuned to behave as an universal approximator, it does not fit the local dynamics [1,15,25]. Many researchers have dealt with this problem when designing fuzzy control systems: using polynomials instead of affine functions in the rules’ consequent [5,41], using linear consequents instead of affine ones [39,40,42], using proportional affine consequents [43], using third order polynomial membership functions to obtain smooth models which match the original function in both the value and their first derivative [34], increasing the number of rules as much as desired to obtain an universal approximator of polynomials [44], or introducing interpolative rules without local interpretability [32,33]. Furthermore, much literature exists on fuzzy systems and identification techniques. For instance, we can find least-squares methods applied to determine the numeric coefficients which are not limited to triangular fuzzy sets [9], online learning approaches including adaptation of linear parameters appearing in the rule consequents and premise parameters appearing in the membership functions [21], algorithms approximating band of nonlinear functions [36], or filtering algorithms for Takagi-Sugeno fuzzy mod-

F. Matía et al. / Applied Soft Computing 11 (2011) 4226–4235

Fig. 2. Centers of gravity for xn+1 .

Fig. 1. Membership functions for input xl .

els based on minimizing the expected value of the exponential of filtering errors energy [20]. In the present work we merge two ideas: i) Mamdani model is equivalent to the zeroth order Takagi-Sugeno model, and ii) Takagi-Sugeno affine model is an interpolation of affine models. We propose to obtain the best of Mamdani and Takagi-Sugeno models by using an affine model with variant coefficients which are independently governed by a zeroth order fuzzy inference system. This model may be interpreted as a generalization of Takagi-Sugeno model in which dynamic coefficients have been decoupled. The organization of the paper is as follows. Section 2 introduces the classical affine and fuzzy models used in the literature. Sections 3 and 4 discuss the advantages and drawbacks of Mamdani and Takagi-Sugeno models, respectively. Section 5 describes the proposed affine model with decoupled fuzzy dynamics. Finally, section 6 presents the application of the previous models to a multivariable tank.

(1)

being x = [x1 . . . xn ]T , and f a continuous or discrete non-linear function. Our goal is to build non-linear models able to reflect the dynamics of f. We will study the three following models: • Affine local models, able to reflect only local dynamics around a (0) (0) point (x1 , . . . , xn+1 ):



∂f  ∂x1 

X (il ) (xl ) = 1, l

∀xl(il ) ≤ xl ≤ xl(il +1) ∀l = {1, . . . , n}

(3)

il =1 (i1 ...in ) of where xl(il ) are guide points. Consider also the fuzzy sets Xn+1 the output xn+1 , ∀il = {1, . . ., rl }, ∀ l = {1, . . ., n}, with corresponding membership functions X (i1 ...in ) (xn+1 ), as in Figure 2, n+1

(i1 ...in ) are their centers of gravity, and all their areas where xn+1 are equal. Then, each rule R(i1 . . .in ) of Mamdani model can be defined using the centers of gravity instead of the fuzzy sets for each consequent [11,14,17,22]: 1 ...in ) A(i n+1

IF(x1 is X1(i1 ) ) AND . . . AND (xn is Xn(in ) ) (i1 ...in ) THEN xn+1 = xn+1

(4)

and the output of the system can be computed by r1 

...

rn 

(i1 ...in ) w(i1 ...in ) (x) xn+1

(5)

in =1

where

xn+1 = f (x)

(0)



i1 =1

We will consider empirical models such as

(0)

which overlap by pairs, this means, rl

xn+1 =

2. Non-linear models versus affine models

xn+1 ≈ f (x1 , . . . , xn ) +

4227

w(i1 ...in ) (x) =

n 

X (il ) (xl )

(6)

l

l=1

represents the weight of each rule. 3.2. Mamdani Model as an Universal Approximator (Product Version) It is known that Mamdani model can be used as universal approximator [18,19,23,24].

(0)

(x1 − x1 ) + . . . (0)

 ∂f  (0) (0) (0) (0) + (xn − xn ) = a0 + a1 x1 + . . . + an xn ∂xn 

(2)

(0)

(0) a0

with = / 0, in general. • Mamdani model, able to approximate globally an empirical n n g (x ). model such as xn+1 = l=1 gl (xl ) or xn+1 = l=1 l l • Takagi-Sugeno affine global model, which interpolates affine local models: xn+1 = a0 (x) + a1 (x)x1 + . . . + an (x)xn

Proposition 1. The empirical model xn+1 = f(x) may be exactly approximated by a Mamdani model in the range xl(il ) ≤ xl ≤ xl(il +1) , ∀l = {1, . . ., n}, with rules R(i1 . . .in ) like: IF(x1 is X1(i1 ) ) AND . . . AND (xn is Xn(in ) ) (i1 ...in ) THEN xn+1 = xn+1

(7)

provided that f can be decomposed as f (x) =

n 

gl (xl )

(8)

l=1

3. Discussion about Mamdami model First, we present the formulation to be used for Mamdani model. Secondly, we see how to select the shape of the membership functions using the concept of universal approximator.

being gl (xl ) strictly monotonous (increasing or decreasing) in the range xl(il ) ≤ xl ≤ xl(il +1) . Furthermore, the fuzzy sets for perfect approximation are given by X (il ) (xl ) = l

3.1. Mamdani Model

l

l

(9)

gl (xl(il +1) ) − gl (xl(il ) )

X (il +1) (xl ) = 1 − X (il ) (xl ) =

Let us suppose that Xl(il ) are the fuzzy sets for input xl , ∀il = {1, . . ., rl }, ∀ l = {1, . . ., n}. rl is the number of fuzzy sets for xl , and X (il ) (xl ) are the corresponding membership functions (Figure 1),

gl (xl(il +1) ) − gl (xl )

l

gl (xl ) − gl (xl(il ) )

gl (xl(il +1) ) − gl (xl(il ) )

(10)

These membership functions do not belong to [0, 1] when gl (xl ) are not monotonous, and another partitioning must be done in such a case.

4228

F. Matía et al. / Applied Soft Computing 11 (2011) 4226–4235

Proof.

xn+1 =

We can develop xn+1 as follows: r1 

rn 

... i1 =1

=

n rn  

... i1 =1

=

r1 

xn+1

w(i1 ...in ) (x)f (x(i1 ...in ) )

in =1

r1 

gl (xl(il ) )=

X (il ) (xl ) l

in =1

l=1

i1 =1

l=1

X (i1 ) (x1 )g1 (x1(i1 ) ) ·

r2 

in =1

n rn  

i2 =1

=

l

in =1

x1(i1 )





=

≤ x1 ≤

·

r2 

...

i2 =1

xn+1 =

...

l

in =1 l=1 rn

...

 

i1 =1

(12)

X (il ) (xl )gl (xl(il ) )

n 

X (il ) (xl )

=

l

in =1 l=2

m=1

n 

(im ) X (il ) (xl )gm (xm ) l



in =1 l=1

im−1 =1im+1 =1

rl n  



(19)

(i ) (im ) (xm )gm (x m ) Xm m n 

⎞ X (il ) (xl )gl (xl(il ) )⎠ l

in =1 l=1,l = / m

X (il ) (xl )gl (xl(il ) ) =

n 

l

l=1 il =1

X (il ) (xl )gl (xl(il ) ) + l

(im ) gm (xm )

m=1 im =1 ⎛ rm−1 rm+1 r1 rn     ⎝ ... ...



Iterating ∀l = {2, . . ., n}, we obtain that n 

in =1

r1 n  

1

rn n  

w(i1 ...in ) (x)f (x(i1 ...in ) )

rn n  



xn+1 = X (i1 ) (x1 )g1 (x1(i1 ) ) + 1 − X (i1 ) (x1 ) g1 (x1(i1 +1) ) 1

r1 

rn 

m=1 i1 =1 rm n

l=2

As X (i1 ) (x1 ) and X (i1 +1) (x1 ) only have a value in 1 1 x1(i1 +1) , we obtain that



...

i1 =1

l=1

X (il ) (xl )gl (xl(il ) )

...

1

i1 =1

=

X (il ) (xl )gl (xl(il ) ) (11) l

...

=

r1  i1 =1

r1 n rn   

n 

We can develop xn+1 as:

Proof.

gl (xl )

l=1

hence

1 − X (il ) (xl ) l





gl (xl(il +1) )

(13)

gl (xl ) = X (il ) (xl )gl (xl(il ) ) + 1 − X (il ) (xl ) gl (xl(il +1) ) l



l



= X (il ) (xl ) gl (xl(il ) ) − gl (xl(il +1) ) + gl (xl(il +1) )

l=1

(20)

l

On the other hand,

xn+1 = f (x) =

and

n 

gl (xl )

(14)

X (il ) (xl ) = l

gl (xl(il +1) ) − gl (xl )

(21)

gl (xl(il +1) ) − gl (xl(il ) )

l=1

X (il +1) (xl ) = 1 − X (il ) (xl ) =

so

l



gl (xl ) = X (il ) (xl )gl (xl(il ) ) + 1 − X (il ) (xl ) gl (xl(il +1) ) l

l

l





= X (il ) (xl ) gl (xl(il ) ) − gl (xl(il +1) ) + gl (xl(il +1) ) l

as in the previous case.

gl (xl ) − gl (xl(il ) )

gl (xl(il +1) ) − gl (xl(il ) )

(22)



(15) 4. Discussion about Takagi-Sugeno model

this means, X (il ) (xl ) = l

gl (xl(il +1) ) − gl (xl )

(16)

gl (xl(il +1) ) − gl (xl(il ) )

and thus

We will first explain the affine Takagi-Sugeno model. Then, we will focus on difficulties and solutions of the model to build an universal approximator.

4.1. Affine Takagi-Sugeno Model

X (il +1) (xl ) = 1 − X (il ) (xl ) = l

l

gl (xl ) − gl (xl(il ) )

gl (xl(il +1) ) − gl (xl(il ) )

(17)

In Takagi-Sugeno model [37,38], each rule R(i1 . . .in ) is described as follows: IF(x1 is X1(i1 ) ) AND . . . AND (xn is Xn(in ) )



THEN xn+1 = f (i1 ...in ) (x) 3.3. Mamdani Model as an Universal Approximator (Additive Version)

Nevertheless, in control applications, the affine version is usually written as:

Proposition 2. The empirical model xn+1 = f(x) may also be exactly approximated by a Mamdani model when

f (x) =

n  l=1

gl (xl )

(23)

(18)

IF(x1 is X1(i1 ) ) AND . . . AND (xn is Xn(in ) ) 1 ...in ) x + . . . + a(i1 ...in ) x THEN xn+1 = a0(i1 ...in ) + a(i n 1 n 1

(24)

The meaning of these affine consequents is to linearize the empirical model at different points, one per rule, and interpolate the dynamic of the system among them, in order to compensate

F. Matía et al. / Applied Soft Computing 11 (2011) 4226–4235

4229

linearization errors. Then, the output of the system is computed as follows: r1 

rn 

i1 =1

xn+1 =

=

...

w(i1 ...in ) (x)f (i1 ...in ) (x)

in =1

 r1

r1 

...

rn 

i1 =1 rn

...

i1 =1



w(i1 ...in ) (x)

in =1

(25)



1 ...in ) w(i1 ...in ) (x) a(i 0

in =1

1 ...in ) x + . . . + a(i1 ...in ) x + a(i n 1 n 1



where again we have supposed that the membership functions of the input variables xl overlap by pairs. This expression clearly reflects the interpolation among affine systems mentioned above. A special case is zero-order Takagi-Sugeno system in which f(i1 . . .in ) (x) are constant, this means, 1 ...in ) f (i1 ...in ) (x) = a(i 0

(26)

Fig. 3. Takagi-Sugeno linear model

1 ...in ) a(i 0

In this case, we have in fact a Mamdani model, where may be considered the center of gravity of the output membership functions: (i1 ...in ) 1 ...in ) xn+1 = a(i 0

(27)

and so xn+1 =

r1 

...

i1 =1

rn 

1 ...in ) = a (x) w(i1 ...in ) (x)a(i 0 0

(28)

in =1

Several solutions to the universal approximation problem for Takagi-Sugeno affine model have been proposed. A convex interpolation is suggested in [34]. The idea is to find which shape of membership functions generates a perfect interpolation, as we previously did with Mamdani model. For example, in the case of the first order system y = f(x) = − x2 , with x ∈ [0, 2], if we choose

X (2) (x) =

x2 4 − 4x

−x2 4 − 4x

(29) (30)

2 

w(i) (x)y(i) = X (1) (x)y(1) + X (2) (x)y(2)

i=1 

=

x2 1+ 4 − 4x



(31) −x2 ·0+ · (4 − 4x) = −x2 4 − 4x

which is a perfect approximator. Or at least in theory, because we can observe that the membership functions are non-continuous, non-monotonous, and take values outside [0, 1], and X (i) (x) = ∞ at x = 1. A second idea to build an universal approximator is shown in [40], where the affine consequents of the rules are replaced by linear consequents. For example, using the following rules, R(1) : IF(x is X (1) ) THEN y(1) = 0 R(2) : IF(x is X (2) ) THEN y(2) = −2x

(32)

x 2

=

2 

w(i) (x)y(i) = X (1) (x)y(1) + X (2) (x)y(2)

i=1 x 1−

2

(35)

x · 0 + · (−2x) = −x2 2

The idea of approximating functions by using the linear TakagiSugeno model can also be found in [42]. For this case there also exists a simple stability analysis method [39], while for the affine models, stability analysis is more complex and is usually solved using linear matrix inequalities [10,16]. Unfortunately, when global approximation of Takagi-Sugeno model is improved, local interpretability of the rules is lost [1,15,16,25] as we can see in Figure 3: the linear consequent for R(2) , −2x, is not a linearization of the empirical model at x(2) = 2. The reason is that when we linearize it always appears an affine term. Other authors have proposed to replace the affine consequents by polynomials [5], using rules like: (i)

(i)

(i)

R(i) : IF(x is X (i) ) THEN y(i) = p0 + p1 x + p2 x2 + . . .

(36)

R(i) : IF(x is X (i) ) THEN y(i) = K (i) [a0 + a1 x]

(37)

In fact, increasing the number of rules is the simplest way to bound the approximation error as much as desired, even in the general non convex case [44]. However, it is always recommendable to maintain the number of rules as reduced as possible. Finally, other authors propose to introduce additional rules to change the function shape as needed [32,33]. In that case, the original rules have an interpretable meaning, while the added rules have just an interpolating sense. Again, it seems more reasonable for all the rules to maintain their local interpretation. 5. The affine fuzzy dynamic model 5.1. Takagi-Sugeno as an Affine Global Model

and triangular membership functions, X (1) (x) = 1 −

(34)

but the consequent part is not represented in an affine form, which is widely applied in control theory. And others use proportional affine systems with a higher number of rules [43] like:

then, we obtain that y=

x 2

we obtain a perfect approximator again: y=

4.2. Takagi-Sugeno model as an universal approximator

X (1) (x) = 1 +

X (2) (x) =

(33)

Our goal is to build an affine global model, following the well known idea that states that Takagi-Sugeno model with affine con-

4230

F. Matía et al. / Applied Soft Computing 11 (2011) 4226–4235

5.2.1. Product Version Proposition 3. Suppose that the empirical model is xn+1 = f (x) = n g (x ), and define, ∀l ∈ {1, . . ., n}, l=1 l l al (x) =

g  (xl ) ∂f = l f (x) = gl (xl ) ∂xl

a0 (x) = f (x) −

n  ∂f l=1

sequents is equivalent to an affine global model [3]. First we replace Takagi-Sugeno rules by Mamdani rules with n + 1 consequents:

1 ...in ) AND . . . AND a = a(i1 ...in ) THEN a0 = a(i n n 0

(38)

al (x) =

 i1 =1

 rn

...

(41)

 xl =

1−

n  g  (xl ) l

l=1

gl (xl )

 xl f (x)

(42) (im ) ≤ x ≤ xm m

a0 (x) =

n 

hm0 (xm )

(43)

m=1 (im ) ≤ x ≤ x(im +1) , then with hm0 (x) strictly monotonous in the range xm m m f(x) may be exactly approximated by a Takagi-Sugeno model in this range, with n + 1 subsets of rules: (i1 ) ) AND . . . AND (x is X (in ) ) R0(i1 ...in ) : IF(x1 is X10 n n0 1 ...in ) THEN a0 = a(i 0

Then, defining r1

hml (xm )

m=1

with hml (x) strictly monotonous in the range (im +1) ∀l ∈ {1, . . . , n}. If a (x) can be decomposed as xm 0

Fig. 4. Block representation of Takagi-Sugeno affine global model.

IF(x1 is X1(i1 ) ) AND . . . AND (xn is Xn(in ) )

∂xl

n 

1 ...in ) w(i1 ...in ) (x)a(i l

(39)

in =1

with X (im ) (xm ) = m0

∀l = {0, . . ., n}, the output is given by

(im +1) ) − h hm0 (xm m0 (xm ) (i (im ) ) hm0 (xmm +1) ) − hm0 (xm

(45)

X (im +1) (xm ) = 1 − X (im ) (xm ) (40)

In fact, this equation can be considered as a Mamdani model supervising an affine system with variant coefficients, as shown in Figure 4. a0 (x) is an offset term, while al (x) represent the variant dynamics of the system. It should be noted that all these dynamic coefficients are coupled, because they are calculated using the same set of rules.

∀m ∈ {1, . . ., n}, and (i1 ) ) AND . . . AND(x is X (in ) ) Rl(i1 ...in ) : IF(x1 is X1l n nl 1 ...in ) THEN al = a(i l

We propose to use an affine global model with different set of rules for each coefficient al (x) (see Figure 5). As we will see now, by using this model we are using the same affine global expression, but maintaining local and global interpretability, and approximating both the function value and its derivative by changing independently the offset and dynamic terms, this means, by decoupling the system dynamics. Furthermore, we avoid the use of non-affine, proportional, or polynomial consequents, while keeping the number of rules to the minimum. We will see how to build an approximator using this model.

(47)

with X (im ) (xm ) = ml

(im +1) ) − h (x ) hml (xm ml m (im +1) ) − h (x(im ) ) hml (xm ml m

(48)

X (im +1) (xm ) = 1 − X (im ) (xm ) ml

5.2. Decoupling the Dynamics

(46)

m0

m0

xn+1 = a0 (x) + a1 (x)x1 + . . . + an (x)xn

(44)

(49)

ml

∀m ∈ {1, . . ., n}. The output is calculated as xn+1 = a0 (x) + a1 (x)x1 + . . . + an (x)xn Proof.

(50)

From the first subset of rules, we obtain exactly that

a0 (x) = f (x) −

n  ∂f l=1

∂xl

xl

(51)

From the other n subsets, we also obtain exactly that al (x) =

∂f , ∂xl

∀l ∈ {1, . . . , n}

(52)

Then, xn+1 = a0 (x) + a1 (x)x1 + . . . + an (x)xn = f (x)

(53)

so the model gives again a perfect approximation.



5.2.2. Additive Version Suppose the empirical model is xn+1 = f (x) = g (x ), and define, ∀l ∈ {1, . . ., n}, l l l=1

Proposition 4.  n al (x) =

∂f = gl (xl ) = hl (xl ) ∂xl

a0 (x) = f (x) − Fig. 5. Block representation of the affine global model with decoupled dynamics.

n  ∂f l=1

∂xl

xl =

n  l=1

(54)

[gl (xl ) − gl (xl )xl ] =

n  l=0

hl0 (xl )

(55)

F. Matía et al. / Applied Soft Computing 11 (2011) 4226–4235

4231

Fig. 6. The tank.

with hl (xl ) and hl0 (xl ) strictly monotonous in the range xl(il ) ≤ xl ≤ xl(il +1) ∀l ∈ {0, . . . , n}. Then f(x) may be exactly approximated by a Takagi-Sugeno model in this range, with n + 1 subsets of rules: (i1 ) ) AND . . . AND (x is X (in ) ) R0(i1 ...in ) : IF(x1 is X10 n n0

(56)

1 ...in ) THEN a0 = a(i 0

Fig. 7. Dynamical evolution of the tank.

with 

X (il ) l0

(xl ) =

(0)

hl0 (xl(il +1) ) − hl0 (xl )

(57)

hl0 (xl(il +1) ) − hl0 (xl(il ) )

X (il +1) (xl ) = 1 − X (il ) (xl ) l0

(59)

THEN al = al(i1 ...in ) with hl (xl(il +1) ) − hl (xl )

(60)

hl (xl(il +1) ) − hl (xl(il ) )

X (il +1) (xl ) = 1 − X (il ) (xl ) l

l

xn+1 = a0 (x) + a1 (x)x1 + . . . + an (x)xn The proof is the same as in the previous case.

q(t) = 2˛(t)



(68)

6.2. Affine Model of the Tank



(63)

2G h(t)



2 , G

and we eliminate the interme-

(64)

h(t)

then, the evolution of the tank level will follow the solution of the next equation:

If we identify the tank at h(0) = 4, ˛(0) = 0.5, we should obtain the linearization of (66), which is given by

⎧ ⎨ v˙ (t) = qi (t) − q(t) v(t) = S h(t)  ⎩

˙ h(t) = qi (t) − q(t)

(67)

(62)

Let us suppose a tank of section S with a liquid inside of height h(t), volume v(t) and outlet flow q(t), due to an inlet flow qi (t), a valve opening ˛(t), with a maximum output section C and under gravity G (Figure 6). An empirical model of this multivariate system is given by



3 − cos2t 4

We can verify that the system reaches steady state and that its final value is an oscillatory signal around 1.8. Figure 7 shows the dynamical evolution of the system.

6.1. Model of the Tank

If we choose S = 1 and C = diate variable v(t), we obtain

˛=

(61)

6. Application

q(t) = C ˛(t)

(66)

3 − cos2t  h h˙ = 2 − 2

The output is calculated as

Proof.

h

If we suppose that the valve opening is given by

(i1 ) ) AND . . . AND (x is X (in ) ) Rl(i1 ...in ) : IF(x1 is X1l n nl

l



h˙ = 2 − 2˛

and ∀l ∈ {1, . . ., n},

h˙ ≈ h˙ (0) − 2





h(0) ˛ − ˛(0) −

h˙ ≈ 3 − 4˛ − 0.25h

˙ h(t) = qi (t) − 2˛(t)

h(1)

(65)

h(0)

(h − h(0) )

(69)

(70)

Figure 8 compares the response of the affine model versus the response of the empirical model. The system reaches steady state, but the final value is negative instead of positive, something that is clearly unacceptable. Settling time ts is less than that of the empirical system, and with larger oscillation amplitude. The results are reasonable: the affine local model leads to large errors as much as we deviate from the equilibrium point. It seems clear that global models as Mamdani, and affine global models as Takagi-Sugeno should give much more promising results. 6.3. Mamdani Model of the Tank

h(t)

˛(0)



This equation represents a multivariate relation among qi (t), ˛(t) and h(t):



= 2,

= 0.5. In order to analyze the dynamical behavior of this empirical model, we will keep the input flow qi (t) equal to 2:

(58)

l0

X (il ) (xl ) =

An equilibrium point for this system is held at h(0) = 4, qi

˛(0)

If we identify the output flow q(t) of the tank at ˛(1) = 0, ˛(2) = 1, = 1 and h(2) = 4, we obtain that q(11) = 0, q(12) = 0, q(21) = 2 and

4232

F. Matía et al. / Applied Soft Computing 11 (2011) 4226–4235

Fig. 8. Tank model (thick line) v.s. affine model (thin line) response. Fig. 11. Empirical model (thick line) v.s. Mamdani model (thin line) response.

+ Open (˛)High (h)q(22) = (1 − ˛) +˛ Fig. 9. Triangular membership functions for ˛.



˙ h(t) = qi (t) − 2˛(t)

: IF(˛ is Closed) AND (h is Low) THEN q = 0

R(12) : IF(˛ is Closed) AND (h is High) THEN q = 0

(71)

R(21) : IF(˛ is Open) AND (h is Low) THEN q = 2

being the membership functions for ˛ and h as in Figures 9 and 10, respectively: Closed (˛) = 1 − ˛

(72)

Open (˛) = ˛

(73)

Low (h) =

4−h 3

(74)

High (h) =

h−1 3

(75)

Then, the output flow is given by: q=

h(t)

(76)

(77)

then, if qi (t) = 2, the dynamical behavior of the tank model can be obtained from the solution of: h+2 h˙ = 2 − 2˛ 3

R(22) : IF(˛ is Open) AND (h is High) THEN q = 4

2 2  

4−h h−1 h+2 ·2+˛ · 4 = 2˛ 3 3 3

This function matches the original one at the four guide points, but is not a perfect interpolator. Taking into account that

q(22) = 4. The resultant Mamdani model is: R(11)

4−h h−1 · 0 + (1 − ˛) ·0 3 3

(78)

Figure 11 compares the response of Mamdani model versus the response of the empirical model. The system reaches steady state, ts is similar, but the final value is greater than in the empirical system. Again, by choosing appropriate membership functions we can improve the model as much as desired. 6.3.1. Mamdani Model of the Tank (Product Version) √ As an example, the tank q = 2˛ h can be approximated in 0 ≤ ˛ ≤ 1 and 1 ≤ h ≤ 4, using Mamdani model, as R(11) : IF(˛ is Closed) AND (h is Low) THEN q = 0

w(i1 i2 ) (˛, h)q(i1 i2 ) = Closed (˛)Low (h)q(11)

i1 =1 i2 =1

R(12) : IF(˛ is Closed) AND (h is High) THEN q = 0 R(21) : IF(˛ is Open) AND (h is Low) THEN q = 2

(79)

R(22) : IF(˛ is Open) AND (h is High) THEN q = 4 (12)

+ Closed (˛)High (h)q

(21)

+ Open (˛)Low (h)q

Fig. 10. Triangular membership functions for h.

In this case we have g1 (˛) = 2˛

(80)

g2 (h) =

(81)



h

Fig. 12. Membership functions for ˛.

F. Matía et al. / Applied Soft Computing 11 (2011) 4226–4235

4233

Fig. 15. Membership functions for h. Fig. 13. Membership functions for h.

The membership functions are shown in Figures 12 and 13: g1 (˛(2) ) − g1 (˛)

Closed (˛) =

g1 (˛) − g1 (˛(1) )

Open (˛) =

g1 (˛(2) ) − g1 (˛(1) ) g2 (h(2) ) − g2 (h)

Low (h) =

g2 (h(2) ) − g2 (h(1) ) g2 (h) − g2 (h(1) )

High (h) =

=1−˛

g1 (˛(2) ) − g1 (˛(1) )

g2 (h(2) ) − g2 (h(1) )



(83)

=2− =

(82)



h

(1)

Large (qi ) =

Low (h) =

h−1

(2) (1) g1 (qi ) − g1 (qi )

g2 (h(2) ) − g2 (h) g2 (h(2) ) − g2 (h(1) )

(84) High (h) =



g1 (qi ) − g1 (qi )

g2 (h) − g2 (h(1) ) g2 (h(2) ) − g2 (h(1) )

=

qi 2

=2−

=

(92)



h

(93)

h−1

(94)



(85) Then, we obtain,

Effectively, we obtain, q=

2 2  

h˙ =

w(i1 i2 ) (˛, h)q(i1 i2 )

2 2  

w(i1 i2 ) (qi , h)h˙ (i1 i2 )

i1 =1 i2 =1

i1 =1 i2 =1

= Closed (˛)Low (h)q(11) + Closed (˛)High (h)q(12) + Open (˛)Low (h)q(21) + Open (˛)High (h)q(22)  √ √ = (1 − ˛) 2 − h · 0 + (1 − ˛) h−1 ·0  √ √ + ˛ 2− h ·2+˛ h−1 ·4 √ = 2˛ h

(86)

= Small (qi )Low (h)h˙ (11) + Small (qi )High (h)h˙ (12) ˙ (22) + Large (qi )Low (h)h˙ (21) + Large High (qi )

(h)h √ qi  qi √ = 1− 2 − h · (−1) + 1 − h − 1 · (−2) 2

2 qi qi  + 2− h ·1+ h−1 ·0 2 √ 2 = qi − h

(95)

This means,



h˙ = 2 − 2˛

h

(87)

which is again a perfect interpolation.

which matches the original system. 6.4. Takagi-Sugeno Model of the Tank 6.3.2. Mamdani Model of the Tank (Additive Version) √ As an example, the tank h˙ = qi − h can be approximated in 0 ≤ qi ≤ 1 and 1 ≤ h ≤ 4, using Mamdani model, as R(11) : IF(qi is Small) AND (h is Low) THEN h˙ = −1 R(12) : IF(qi is Small) AND (h is High) THEN h˙ = −2 R(21) : IF(qi is Large) AND (h is Low) THEN h˙ = 1 R(22)

(88)

√ If we identify the tank q = 2˛ h at its four guide points, given by ˛(1) = 0, ˛(2) = 1 and h = 1, h = 4, and taking into account that the linearization version of the empirical model is



q ≈ q(i1 i2 ) + 2

: IF(qi is Large) AND (h is High) THEN h˙ = 0

g1 (qi ) = qi g2 (h) = −

h

(89)

R(11) : IF(˛ is Closed) AND (h is Low) THEN q = 2˛

(90)

R(12) : IF(˛ is Closed) AND (h is High) THEN q = 4˛

The membership functions are shown in Figures 14 and 15: Small (qi ) =

(2) g1 (qi ) − g1 (qi ) (2) (1) g1 (qi ) − g1 (qi )

(96)

then Takagi-Sugeno model results as follows

In this case we have



˛(i1 ) h(i2 ) (˛ − ˛(i1 ) ) + √ (h − h(i2 ) ) h(i2 )

=1−

qi 2

Fig. 14. Membership functions for qi .

(91)

R(21) : IF(˛ is Open) AND (h is Low) THEN q = −1 + 2˛ + h

(97)

R(22) : IF(˛ is Open) AND (h is High) THEN q = −2 + 4˛ + 0.5h Choosing, for example, triangular membership functions, Closed (˛) = 1 − ˛

(98)

Open (˛) = ˛

(99)

Low (h) =

4−h 3

(100)

High (h) =

h−1 3

(101)

4234

F. Matía et al. / Applied Soft Computing 11 (2011) 4226–4235

High1 (h) = 1 − Low1 (h) = (11)

R2

(12) R2 (21) R2 (22)

R2



h−1

(109) (11)

: IF(˛ is Closed2 ) AND (h is Low2 ) THEN a2 = a2 : IF(˛ is Closed2 ) AND (h is High2 ) THEN a2 = : IF(˛ is Open2 ) AND (h is Low2 ) THEN a2 =

=0

(12) a2

(21) a2 (11)

: IF(˛ is Open2 ) AND (h is High2 ) THEN a2 = a2

=0

=1

(110)

= 0.5

with (2)

Closed2 (˛) =

h12 − h12 (˛) (2)

=1−˛

(1)

h12 − h12

(111)

Open2 (˛) = 1 − Closed2 (˛) = ˛ (2)

h22 − h22 (h)

(112)

2 = √ −1 h

(113)

Fig. 16. Empirical model (thick line) v.s. Takagi-Sugeno model (thin line) response.

2 High2 (h) = 1 − Low2 (h) = 2 − √ h

(114)

we obtain that

and

Low2 (h) =

 2

2

q=

(11)

R0

w(i1 i2 ) (˛, h)q(i1 i2 )

(12) R0

i1 =1 i2 =1

= = /



a1 (˛, h) = h12 (h) = 2

h

a0 (˛, h) = h01 (h)h02 (h) = 2˛

(103)



h−2

(1)

(1)

(2)

(2)

R1 : IF(h is Low1 ) THEN a1 = a1 = 2 R1 : IF(h is High1 ) THEN a1 = a1 = 4

 ˛ h˛ − √ h = −˛ h h

(106)

(107)

with (2)

(2)

(1)

(2)

=1−˛

(1)

h10 − h10

(116)

h20 − h20 (h)

Low0 (h) =

(2) h20

(1) − h20

=2−

High0 (h) = 1 − Low0 (h) =

(117)



h

(118)

h−1

(119)



q = a0 (˛, h) + a1 (˛, h)˛ + a2 (˛, h)h 



√ √ √ √ = −˛(2 − h) − 2˛( h − 1) + 2(2 − h) + 4( h − 1) ˛

2





2 h √ − 1 + 0.5˛ 2 − √ h  √  √ ˛ h √ = −˛ h + 2 h + √ h = 2˛ h h + ˛

(120)

6.6. Affine Model for the Tank (Addition Version)

The three subsets of rules and membership functions are, respectively:

h21 − h21

= −2

So finally we obtain that

(105)



h21 − h21 (h)

(11)

(115)

(104)

˛ a2 (˛, h) = h21 (h)h22 (h) = √ h

Low1 (h) =

h10 − h10 (˛)

(2)

Let us approximate q = 2˛ h in the range 0 ≤ ˛ ≤ 1 and 1 ≤ h ≤ 4 by using the affinel model with decoupled dynamics. First, we decompose f(˛, h) as follows

with

= −1

Open0 (˛) = 1 − Closed0 (˛) = ˛



h = a0 (˛, h) + a1 (˛, h)˛ + a2 (˛, h)h

(21)

(2)

6.5. Affine Model for the Tank (Product Version)

q = 2˛

=0

with Closed0 (˛) =

which gives a non-convex interpolation that only matches the function value at the guide points, but not its derivative. Figure 16 compares the response of this model, with that of the original one.



: IF(˛ is Closed0 ) AND (h is High0 ) THEN a0 =

: IF(˛ is Open0 ) AND (h is High0 ) THEN a0 = a0

R0

+

=0

(12) a0

(22)

+ Open (˛)Low (h)q(21) + Open (˛)High (h)q(22) =

(11)

: IF(˛ is Closed0 ) AND (h is Low0 ) THEN a0 = a0

: IF(˛ is Open0 ) AND (h is Low0 ) THEN a0 = a0

R0

(102)

(1) − h22

(21)

= Closed (˛)Low (h)q(11) + Closed (˛)High (h)q(12) 4−h h−1 (1 − ˛) 2˛ + (1 − ˛) 4˛ 3 3 4−h h−1 ˛ (−1 + 2˛ + h) + ˛ (−2 + 4˛ + 0.5h) 3 3 1 + 2.25h − 0.25h2 2˛ 3 √ 2˛ h

(2) h22

=2−



h

(108)

√ Let us approximate now h˙ = qi − h in the range 0 ≤ qi ≤ 2 and 1 ≤ h ≤ 4. First, we decompose f(qi , h) as follows h˙ = qi −



h = a0 (qi , h) + a1 (qi , h)qi + a2 (qi , h)h

(121)

with a1 (qi , h) = 1

(122)

1 a2 (qi , h) = h2 (h) = − √ h

(123)

a0 (qi , h) =



qi −

  h −

qi −

√  h h =0 h

(124)

F. Matía et al. / Applied Soft Computing 11 (2011) 4226–4235

So, for a2 (qi , h) we have the next set of rules: (1) R2 (2) R2

: IF(h is Low)THEN a2 =

: IF(h is High)THEN a2 =

(1) h2

(2) h2

= −1 = −0.5

(125)

with (2)

Low (h) =

h2 − h2 (h) (2) h2

(1) − h2

2 = √ −1 h

2 High (h) = 1 − Low (h) = − √ h

(126)

(127)

So we obtain q = a0 (qi , h) + a√ 1 (qi , h)qi + a2 (qi , h)h  h = 0 + 1 · qi − h = qi − h h

(128)

7. Conclusion This paper has shown how Mamdani and Takagi-Sugeno models can be combined so that local and global interpretations are preserved. A novel affine global fuzzy model has been introduced, by using different sets of rules for each coefficient, and so decoupling the dynamics of the system. For any non-linear system which may be formulated in product or additive forms, we have demonstrated that the new affine model is able to exactly match it. The advantages and disadvantages of Mamdani and Takagi-Sugeno models in comparison with the proposed affine model with decoupled dynamics are shown, with the help of a tank used as example. Furthermore, the model is easy to implement, as it has been shown in the examples. References [1] J. Abonyi, R. Babuˇska, L. Nagy, F. Szeifert, Local and global identification for fuzzy model based control, in: Proceedings of the Intelligent Systems in Control and Measurement Symposium, INTCOM, Veszprem, Hungary, 2000, pp. 111–116. [2] R. Babuˇska, R. Jager, H. Verbruggen, Interpolation issues in sugeno-takagi reasoning, in: Proceedings of International Conference on Fuzzy Systems, 1994, pp. 859–863. [3] R. Babuˇska, Fuzzy Modeling for Control, Kluwer Academic Publishers, 1998. [4] E. Van Broekhoven, B. De Baets, Only smooth rule bases can generate Monotone Mamdani-Assilian models under center-of-gravity defuzzification, IEEE Trans. Fuzzy Syst. 17 (5) (2009) 1157–1174. [5] J.J. Buckley, Y. Hayashi, Fuzzy input-output controllers are universal approximators, Fuzzy Sets Syst. 58 (3) (1993) 273–278. [6] R. Campello, W. Caradori, Hierarchical Fuzzy Relational Models: Linguistic Interpretation and Universal Approximation, IEEE Trans. Fuzzy Syst. 14 (3) (2006) 446–453. [7] J. Castro, M. Delgado, Fuzzy systems with deffuzzification are universal approximators, IEEE Trans. Syst. Man Cybern. (B) 26 (1) (1996) 149–152. [8] C.-H. Chen, C.-J. Lin, C.-T. Lin, A functional-link-based neurofuzzy network for nonlinear system control, IEEE Trans. Fuzzy Syst. 16 (5) (2008) 1362–1378. [9] L.-H. Chen, C.-C. Hsueh, Fuzzy regression models using the least-squares method based on the concept of distance, IEEE Trans. Fuzzy Syst. 17 (6) (2009) 1259–1272. [10] F. Delmotte, T.M. Guerra, M. Ksantini, Continuous Takagi-Sugeno’s models: reduction of the number of LMI conditions in various fuzzy control design technics, IEEE Trans. Fuzzy Syst. 15 (3) (2007) 426–438. [11] D. Driankov, H. Hellendoorn, M. Reinfrank, An Introduction to Fuzzy Control, Springer Verlag, 1993. [12] R. Hassine, F. Karray, A.M. Alimi, M. Selmi, Approximation properties of piecewise parabolic functions fuzzy logic systems, Fuzzy Sets Syst. 175 (2006), 501–151. [13] Z. Huang, Q. Shen, Fuzzy Interpolation and Extrapolation:A Practical Approach, IEEE Trans. Fuzzy Syst. 16 (1) (2008) 13–28.

4235

[14] R. Jager, “Fuzzy logic in control”, Ph.D. dissertation, Delft University of Technology, Delft, the Netherlands, 1995. [15] T. Johansen, R. Shorten, R. Murray-Smith, On the interpretation and identification of dynamic Takagi-Sugeno fuzzy models, IEEE Trans. Fuzzy Syst. 8 (3) (2000) 297–313. [16] M. Johansson, A. Rantzer, K.-E. Arzén, Piecewise quadratic stability for fuzzy systems, IEEE Trans. Fuzzy Syst. 7 (6) (December 1999) 713–722. [17] W.J.M. Kickert, E.H. Mamdani, Analysis of fuzzy logic control, Fuzzy Sets Syst. 1 (1978) 29–44. [18] B. Kosko, Fuzzy systems as universal approximators, in: Proceedings of IEEE International Conference on Fuzzy Systems, FUZZ-IEEE, San Diego, CA, 1992, pp. 1153–1162. [19] B. Kosko, Fuzzy Engineering, Prentice Hall, 1997. [20] M. Kumar, N. Stoll, R. Stoll, On the estimation of parameters of Takagi-Sugeno fuzzy filters, IEEE Trans. Fuzzy Syst. 17 (1) (2009) 150–166. [21] E.D. Lughofer, FLEXFIS: a robust incremental learning approach for evolving Takagi-Sugeno fuzzy models, IEEE Trans. Fuzzy Syst. 16 (6) (2008) 1393– 1410. [22] F. Matía, A. Jiménez, On optimal implementation of fuzzy controllers, Int. J. Intell. Control Syst. 1 (3) (1996) 407–415. [23] F. Matía, B.M. Al-Hadithi, A. Jiménez, On normalised fuzzy systems for fuzzy control, in: EUSFLAT Conference, Palma de Mallorca (Spain), 1999. [24] F. Matía, A. Jiménez, B.M. Al-Hadithi, R. Galán, Fuzzy models: enhancing representation of dynamic systems, in: 15th IFAC World Congress, Barcelona, 2002. [25] S. Mollov, R. Babuˇska, J. Abonyi, H. Verbruggen, Effective optimization for fuzzy model predictive control, IEEE Trans. Fuzzy Syst. 12 (5) (2004) 661– 675. [26] D. Nauck, R. Kruse, Neuro-fuzzy systems for function approximation, Fuzzy Sets Syst. 101 (1999) 261–271. [27] M. Panella, G. Martinelli, Neurofuzzy networks with nonlinear quantum learning, IEEE Trans. Fuzzy Syst. 17 (3) (2009) 698–710. [28] B-J. Park, W. Pedrycz, S-K. Oh, A design of genetically oriented fuzzy relation neural networks (FrNNs) based on the fuzzy polynomial inference scheme, IEEE Trans. Fuzzy Syst. 17 (6) (2009) 1310–1323. [29] W. Pedrycz, Why triangular membership functions? Fuzzy Sets Syst. 64 (1994) 21–30. [30] I. Perfilieva, Normal forms for fuzzy logic functions and their approximation ability, Fuzzy Sets Syst. 124 (2001) 371–384. [31] I. Perfilieva, Normal forms in bl-algebra and their contribution to universal approximation of functions, Fuzzy Sets Syst. 143 (2004) 111–127. [32] A. Riid, R. Isotamm, E. Rüstern, Transparency analysis of first-order takagisugeno systems, in: Proceedings of 10th International Symposium on System-Modeling-Control, vol. 2, Zakopane, Poland, 2001, pp. 165–170. [33] A. Riid, E. Rüstern, Takagi-sugeno systems with improved interpretability and interpolation with a complementary interpolation model, in: Proceedings of IEEE 4th International Conference on Intelligent Systems Design and Applications, vol. 1, Budapest, 2004, pp. 259–264. [34] T.A. Runkler, J. Bezdek, Function approximation with polynomial membership functions and alternating cluster estimation, Fuzzy Sets Syst. 101 (1999) 207–218. [35] G. Serra, C. Bottura, An IV-QR algorithm for neuro-fuzzy multivariable online identification, IEEE Trans. Fuzzy Syst. 15 (2) (2007) 200–210. [36] I. Skrjanc, S. Blazic, O. Agamennoni, Interval fuzzy model identification using l-norm, IEEE Trans. Fuzzy Syst. 13 (5) (2005) 561–568. [37] M. Sugeno, An introductory survey of fuzzy control, Information Sciences 36 (1985) 59–83. [38] T. Takagi, M. Sugeno, Fuzzy identification of systems and its applications to modeling and control, IEEE Trans. Syst. Man Cybern. 15 (1) (February 1985) 116–132. [39] K. Tanaka, M. Sugeno, Stability analysis and design of fuzzy control systems, Fuzzy Sets Syst. 45 (2) (1992) 135–156. [40] K. Tanaka, M. Sano, Trajectory stabilization of a model car via fuzzy control, Fuzzy Sets Syst. 70 (2–3) (1995) 155–170. [41] K. Tanaka, H. Yoshida, H. Ohtake, H.O. Wang, A sum-of-squares approach to modeling and control of nonlinear dynamical systems with polynomial fuzzy systems, IEEE Trans. Fuzzy Syst. 17 (4) (2009) 911–922. [42] H.O. Wang, J. Li, D. Niemann, K. Tanaka, T-S fuzzy model with linear rule consequence and pdc controller: an universal framework for nonlinear control systems, in: 9th IEEE International Conference on Fuzzy Systems, San Antonio, 2000, pp. 549–554. [43] H. Ying, General SISO takagi-sugeno fuzzy systems with linear rule consequent are universal approximators, IEEE Trans. Fuzzy Syst. 6 (4) (1998) 582–587. [44] K. Zeng, N. Zang, W. Xu, A comparative study on sufficient conditions for TakagiSugeno fuzzy systems as universal approximators, IEEE Trans. Fuzzy Syst. 8 (6) (2000) 773–780.