Automatic design of fuzzy rule base for modelling and control using evolutionary programming

8
Automatic design of fuzzy rule base for modelling and control using evolutionary programming H.S.Hwang ~ Abstract: In designing a fuzzy model and a fuzzy controller, we encounter a major difficulty in the identification of an optimised fuzzy rule base, which is traditionally achieved by a tedious trial and error process. The paper presents an approach to automatic design of optimal fuzzy rule bases Yor modelling and control using evolutionary programming. Such programming simultaneously evolves the structure and the parameter of fuzzy rule base for a given task. To check the effectiveness of the suggested approach, five examples for modelling and control are examined. The performance of the identified fuzzy models and fuzzy controllers is demonstrated. 1 Introduction The theory of approximated reasoning based on fuzzy logic has been studied across a large variety of applica- tions. Its success derives from the fact that problems which are treated by human beings on the basis of their experienced knowledge often lack an exact mathemati- cal description and therefore can hardly be handled by conventional methods. In practical applications we encounter a major difficulty in finding an appropriate fuzzy rule base for a given task. A trial and error method is used in most cases but with a heavy compu- tation burden and low efficiency. Therefore, more attention has been paid to the problem how to con- struct a suitable rule base for a given task. Several approaches have recently been proposed to identify the fuzzy rule base automatically [IM]. Such work has shown the ability to optimise successfully the fuzzy rule base, but since these methods are restricted to some predefined fuzzy if-then rules and fuzzy sets, the given task will be realised with an assumed rather than opti- mal structure. Genetic algorithms (GA) have success- fully been used in finding a fuzzy rule base with an assumed structure [l, 5, 61 but it is not well-suited for evolving a fuzz,y rule base without any prior assump- tion. The reason is that in GA the crossover of the two-rule base with different structures makes the recombination more difficult. By contrast, evolutionary programming uses mutation as the unique genetic rein- sertion operator. It may express the given task more 0 IEE, 1999 ZEE Proceedings online no. 19990087 DOI: 10.1049/ip-cta: 19990087 Paper received 12th .lune 1998 The author is with tbe Korea Railroad Research Institute, 922-6, F'yson- chon-dong, Dongan-gu, Anyangcity, Kyonggi-do 431-070, South Korea naturally and is more suitable for the evolution of fuzzy rule base. This paper presents an approach to automatic design of the optimal fuzzy rule base for modelling and con- trol using evolutionary programming. Evolutionary programming simultaneously evolves the structure and the parameter of the fuzzy rule base. Since they are co- dependent, simultaneous evolution with no predefined assumption about rule base structure can result in a more appropriate rule base for a given task. To check the effectiveness of the suggested approach, five exam- ples are examined for modelling and control. The per- formance of the identified fuzzy models and fuzzy controllers is demonstrated. 2 Approximate reasoning 2. I Background The theory of approximate reasoning can be viewed as an application of the currently very popular fuzzy logic which has its roots in the multivalued logic systems developed by Lukasiewicz in the 1930s. It was Zadeh who rediscovered these ideas in the 1960s, that is, to introduce the notion of a fuzzy set, and to develop the basics of a multivalued calculus for the technical appli- cation of these ideas which led to great commercial suc- cess in the 1980s [7, 81. The main areas of application are the control of large nonlinear systems, rule based systems and pattern recognition. In the following we emphasise the theory of approximate reasoning as a tool for the design of complex systems which are too complex to be described by mathematical models. The theory offers the opportunity to represent the fuzzy rule base and to draw conclusions from it by means of a very simple calculus. This calculus is robust and can be implemented in an efficient manner. 2.2 Calculus for simplified reasoning Fuzzy knowledge is expressed by the concepts of fuzzy sets and linguistic variables that are defined as mem- bership functions which provide membership values for each element of their universe of discourses. The mean- ing of linguistic terms for the verbal characterisation of the input and output variables is fixed by appropriately defined membership functions. Although there are no restrictions on the form of membership functions, we use a piecewise linear function, such as trapezoids or triangles, in the premise and fuzzy singletons in the consequent. The rules are expressed by the form pro- vided in eqn. 1: Ri : If z1 is A";zl) with ai, and . . . Xk is A& with ai, then y1 is B; and . . . yys is B6 (1) 9 IEE Proc-Control Theory Appl., Vol. 144, No. I, January 1999

Transcript of Automatic design of fuzzy rule base for modelling and control using evolutionary programming

Automatic design of fuzzy rule base for modelling and control using evolutionary programming

H.S.Hwang

~

Abstract: In designing a fuzzy model and a fuzzy controller, we encounter a major difficulty in the identification of an optimised fuzzy rule base, which is traditionally achieved by a tedious trial and error process. The paper presents an approach to automatic design of optimal fuzzy rule bases Yor modelling and control using evolutionary programming. Such programming simultaneously evolves the structure and the parameter of fuzzy rule base for a given task. To check the effectiveness of the suggested approach, five examples for modelling and control are examined. The performance of the identified fuzzy models and fuzzy controllers is demonstrated.

1 Introduction

The theory of approximated reasoning based on fuzzy logic has been studied across a large variety of applica- tions. Its success derives from the fact that problems which are treated by human beings on the basis of their experienced knowledge often lack an exact mathemati- cal description and therefore can hardly be handled by conventional methods. In practical applications we encounter a major difficulty in finding an appropriate fuzzy rule base for a given task. A trial and error method is used in most cases but with a heavy compu- tation burden and low efficiency. Therefore, more attention has been paid to the problem how to con- struct a suitable rule base for a given task. Several approaches have recently been proposed to identify the fuzzy rule base automatically [IM]. Such work has shown the ability to optimise successfully the fuzzy rule base, but since these methods are restricted to some predefined fuzzy if-then rules and fuzzy sets, the given task will be realised with an assumed rather than opti- mal structure. Genetic algorithms (GA) have success- fully been used in finding a fuzzy rule base with an assumed structure [ l , 5, 61 but it is not well-suited for evolving a fuzz,y rule base without any prior assump- tion. The reason is that in GA the crossover of the two-rule base with different structures makes the recombination more difficult. By contrast, evolutionary programming uses mutation as the unique genetic rein- sertion operator. It may express the given task more 0 IEE, 1999 ZEE Proceedings online no. 19990087 DOI: 10.1049/ip-cta: 19990087 Paper received 12th .lune 1998 The author is with tbe Korea Railroad Research Institute, 922-6, F'yson- chon-dong, Dongan-gu, Anyangcity, Kyonggi-do 43 1-070, South Korea

naturally and is more suitable for the evolution of fuzzy rule base.

This paper presents an approach to automatic design of the optimal fuzzy rule base for modelling and con- trol using evolutionary programming. Evolutionary programming simultaneously evolves the structure and the parameter of the fuzzy rule base. Since they are co- dependent, simultaneous evolution with no predefined assumption about rule base structure can result in a more appropriate rule base for a given task. To check the effectiveness of the suggested approach, five exam- ples are examined for modelling and control. The per- formance of the identified fuzzy models and fuzzy controllers is demonstrated.

2 Approximate reasoning

2. I Background The theory of approximate reasoning can be viewed as an application of the currently very popular fuzzy logic which has its roots in the multivalued logic systems developed by Lukasiewicz in the 1930s. It was Zadeh who rediscovered these ideas in the 1960s, that is, to introduce the notion of a fuzzy set, and to develop the basics of a multivalued calculus for the technical appli- cation of these ideas which led to great commercial suc- cess in the 1980s [7, 81. The main areas of application are the control of large nonlinear systems, rule based systems and pattern recognition. In the following we emphasise the theory of approximate reasoning as a tool for the design of complex systems which are too complex to be described by mathematical models. The theory offers the opportunity to represent the fuzzy rule base and to draw conclusions from it by means of a very simple calculus. This calculus is robust and can be implemented in an efficient manner.

2.2 Calculus for simplified reasoning Fuzzy knowledge is expressed by the concepts of fuzzy sets and linguistic variables that are defined as mem- bership functions which provide membership values for each element of their universe of discourses. The mean- ing of linguistic terms for the verbal characterisation of the input and output variables is fixed by appropriately defined membership functions. Although there are no restrictions on the form of membership functions, we use a piecewise linear function, such as trapezoids or triangles, in the premise and fuzzy singletons in the consequent. The rules are expressed by the form pro- vided in eqn. 1:

Ri : If z1 is A";zl) with ai, and . . . Xk is A& with ai, then y1 is B; and . . . yys is B6

(1)

9 IEE Proc-Control Theory Appl., Vol. 144, No. I , January 1999

where R’ is the ith rule (1 S i I Y), x,{l I j 5 k ) is an input variable and yp(l 5 p I q) an output variable. A i (xj) is the fuzzy variable defined as in eqn. 2, and Bp’ takes a fuzzy singleton, (i.e. a real number). The term a6 denotes a numerical positive value characterising the relative importance of thejth fuzzy variable in the ith rule.

(zj + dij + di, - ~ i j ) / d i j

if z. > ( c . . - d . . - d! . ) II - 23 2.7 ZJ

1 if (cij - 4 7 ) I xj < (cij + d p j )

if (cij + d, j ) I xj < (cij + dij + 13.) 2 3

0 otherwise

where A; is trapezoidal form, in case d,, = 0 triangular form.

(i) Given I 1 0 data, x = {x l , x2, ..., xnIxI = (xI1, xI2, ... x/k, yll, y12, ... y~, )} , calculate the degree of the fulfill- ment w, in the premise for the ith rule as in eqn. 3:

We consider the following reasoning procedures:

20, = Ai (511) x x . . * A; (ZL~) x aik (3)

(ii) Calculate the inferred value by taking the weighted average of B; with respect to w, as in eqn. 4:

r I r

where Y is the number of fuzzy rules.

3 Evolutionary programming

Evolutionary algorithms are widely used for their pop- ulation-based optimisation mechanism. The basic idea of evolutionary algorithms is the use of a finite popula- tion of individuals, any one of which represents exactly one point in search space. After its initialisation the population develops in a self-organising collective learning process constituted by the subprocess of selec- tion, mutation and recombination towards better regions of the search space. The selection process favours those individuals with a high fitness value, the mutation operator supplies the population with new genetic information, and the recombination operator controls the mixing of this mutated information when it is passed from one generation to another. There are three types of evolutionary algorithms which differ in the procedures of initialisation, selection, mutation and recombination: evolutionary programming (EP), evolu- tionary strategies (ES) invented by Rechenberg [9, 101 and refined by Schwefel [ 1 11 and genetic algorithms (GA) developed by Holland during the 1960s [12, 131.

Evolutionary programming was originally developed by Fogel et al. in the 1960s [14] and used a quite simple model based on a binary representation of variables and on mutation as the only operator. Each individual consisted in N fields. Starting from a population of P individuals each of them gives birth to one offspring, and then the best P out of both the parents and the offspring are saved for the next generation. This simple basic model has been extended by Fogel [15], so recently evolutionary programming handles directly real variables. Each component in the population is represented by N real values (zi) and N variances (vi), one for each variable, so T = (2, V). This is quite

I O

similar to evolutionary strategies apart from the fact that EP deals with variances (o,? rather than standard deviations (0,); moreover, there is no covariation idea in EP. As in the original and the latest EP scheme there is no recombination.

The selection scheme is based on q-tournament selec- tion, where q is a parameter for EP(q 2 1). This means that we start with P individuals, we create other P indi- viduals by mutating each parent once, then for each individual Tin this wider set we randomly select q indi- viduals from the wider population of old and new ele- ments and then determine how many of them (U) are worse than T as regards fitness. After doing this for all elements we can order all the 2 x PT individuals according to their ‘relative strength’ O, and the best P are selected as members for the next generation. Sum- marising: the selection scheme in EP is probabilistic and extinctive.

In the original idea a standard deviation for muta- tion of the ith component z, is obtained as a function of the fitness value of T @(T) as follows:

where N,(O, 1) is normal distribution, o, = d(p, x Q(T) + x), p, and 3: are 2 x N exogenous parameters which must be tuned for a particular task, however usually p, = 1 and 3: = 0.

The basic procedure of EP utilised in this paper is described as follows: (i) Initialise randomly P individuals with an even number. (ii) Evaluate fitness function for P individuals and rank the individuals according to their fitness. (iii) Select the PI2 individuals whose performance are in the top 50% as offspring of the next generation. Trans- fer them to the next generation without any change and all other individuals are discarded. The selected individ- uals are designated as the parents of the next genera- tion, copied and mutated to produce another PI2 individuals. (iv) After the new population is generated by (iii) go to (ii). This procedure is repeated until a satisfactory solu- tion is obtained.

z: = zp + fsp x N,(O, 1) ( 5 )

4

The evolutionary design method of the fuzzy rule base using evolutionary programming is described. During the evolution, the structure and the parameter of fuzzy rule bases with better fitness are simultaneously searched.

Evolutionary design of fuzzy rule base

4. I

4. I. 1 Structure representation: The connection matrix representing fuzzy rule base structure will be of a two-dimensional matrix form. The size of the matrix is determined by the number of rules and the number of input variables. The number of rules is also a parameter representing structure to be found during the evolutionary process. The element MI1 in the con- nection matrix has a positive real value and indicates the relative importance of the j th input fuzzy variable in the ith rule. Assume that there is a rule base repre- sented by the connection matrix with two rules and two input variables x1 and x2 as shown in Fig. 1. The value of MI, > 0 is utilised as a;, of eqn. 1. Ajfxj) with MI, I

Representation of fuzzy rule base

IEE Proc.-Control Theory Appl.. Vol. 146, No. 1. January 1999

0 is eliminated in the ith rule; therefore it is not utilised in the rule base.

plt

p21

1-1 } no. of rules

p12 p13 p14 p15 rutes

p22 p23 p2.4 p25 p26 p27 p28 p29

" no. of inputs

Fig. 1 Connection matrix representing the structure of a fuzzy rule base

4.7.2 Parameter representation: The parameter matrix, which contains the parameters for defining the membership functions within the fuzzy rule base defined by the connection matrix, will be of two-dimen- sional matrix form. The size of the matrix is deter- mined by the expression: [(number of rules, number of input variables x parameter number of input fuzzy var- iable) + (number of output variables x parameter number of output fuzzy variable)]. Should the input fuzzy variable be of the trapezoidal form, as in eqn. 2, the parameter number of input fuzzy variable is equal to 4. If d, of eqn. 2 is equal to 0, the membership func- tion becomes triangular form. The parameter number of output fuzzy variable is equal to 1. The elements of Pij in the parameter matrix have real values. Assuming that there is a rule base with connection matrix as in Fig. 1 and parameter matrix as in Fig. 2, we can for- mulate the fuzzy rule base as shown in Fig. 3 .

membership functions for x 1 , x 2 and y in (1) and (2) -/ \A A

- " " input x 1 input x 2 output

Fig.2 fuzzy rule hase

parameter matrix representing the membership functions of a

4.2 Evolution of fuzzy rule base To find optimal fuzzy rule base for a given task we adopt evolutionary programming to evolve simultane- ously the structure and parameter matrices of fuzzy rule bases. In evolutionary programming, mutation is the unique genetic reinsertion operator. In exploiting the fuzzy rule base, it is unnecessary to encode them. Therefore, it can search for a suitable fuzzy rule base more efficiently. Mutation in evolutionary program- ming consists of two cases: structure mutation and parameter mutation.

4.2. I Structure mutation: Structure mutation includes increasing or decreasing fuzzy rules and rela- tive importance factors of fuzzy input variables in each rule by adding Gaussian random numbers generated

I f

with the probability of pstr-mutate to them. The Gaussian random numbers in the structure mutation are adjusted in proportional to the fitness values. Accordingly, the connection matrix values of the jth fuzzy variable in the ith fuzzy rule should be modified as in eqn. 6.

MZj = M,, + AM,,,

x 7 2 3 (6) AM - a, e ( F m a ~ - F k ) / % m 2, -

where AM, is the adjusted mutation quantity, F,,, the largest fitness value of fuzzy rule base in the current generation, Fk the fitness value of the kth fuzzy rule base, ap a real value between 0 and 1, and x, a Gaus- sian random number with mean 0 and variance 1, namely r;, E N(0, 1).

The number of fuzzy rules in the kth fuzzy rule base should be modified as in eqn. 7:

r k = T k + A r k ,

where Ark is the adjusted mutation quantity, r,,, the maximum number of fuzzy rules that a fuzzy rule base can have; the minimum number of rk 2, and integer [ ] generates the closest integer value.

The latter rules will be eliminated if the number of rules after mutation is less than before mutation. The ith rule with all the M, values I 0 for a n y j will also be eliminated in the ith rule; therefore it will not be used in the rule base.

4.2.2 Parameter mutation: Parameter mutation alters the parameters of membership functions by add- ing Gaussian random numbers generated with the probability of ppur-mutate to them. The Gaussian random numbers in the parameter mutation are adjusted in proportion to the fitness values. Accordingly, the jth parameter in the ith fuzzy rule should be modified as in eqn. 8.

P,j = PZj + APZj,

x Yi j (8) ap.. - a p x e ( F m - F k ) / F m a z 2.J -

where AP, is the adjusted mutation quantity and a,, real value between 0 and 1.

Initially, fuzzy rule bases are created randomly to form the first generation. Then, the fitness value of each fuzzy rule base is calculated. Fuzzy rule bases scoring in the top 50% are moved into next generation without any change, and the structure and parameter mutations are performed on their copies with mutation probabilities, psfr.mufate and ppar-mutate. Namely, the indi- viduals intact from the last generation and their mutated offspring form a new generation. This proce- dure is continued generation by generation until the fuzzy rule base with the best fitness value in current

2p16

with 1.23 then y is x 2 is p15 -PI 6 - pl7 PIS PIS +p16 + p18 PI 9

2p26

If x I IS with 0.78 and x2 is with 0.56 then y is 1 2p22

p21-pZZ-p23 p21 p21.p22*p2L p25-p26-p27 p25 p25*p26+p28 P29

Fig. 3 Fuzzy rule base represented by connection and parameter matrices

1EE Proc.-Control Theory AppL. Vol. 146, No. 1, January 1999 11

generation satisfies the requirements of a given task or the generation number reaches the specified maximum value.

4.3 Fitness for modelling and control In the design of an optimal fuzzy model, the first task is to minimise error of eqn. 9:

1

where n is thz number of inputloutput data, yb target output and yrp output inferred from a fuzzy rule base.

The objective of fuzzy controller is to drive the out- put of the process to the desired setpoint in the shortest time possible and to maintain the output at the desired setpoint, which is evaluated by eqn. 10:

where n is the time index, T, sampling time, e the error, Rsetpoint desired setpoint, and Tend = 200 as a finish time.

We also have to consider the case that there exist meaningless membership functions with negative dY, d i or d i , and null sets in the universe of discourses of fuzzy rule base due to very narrow trapezoidal mem- bership functions obtained during the evolution. To solve this, we introduce the penalty function of eqn. 11 into the fitness function of eqn. 12.

n

F p e n a l t y ci (11) 2=1

where as a penalty factor, ci is a constant value if wi of eqn. 4 for any i (i = 1, 2, ..., r ) is equal to 0, otherwise

I ci = 0. If any negative dP dY or d i , wi equal to 0. n is the number of I/O data.

The fitness value of fuzzy rule base is calculated as in eqn. 12.

(12) 1

F = E + F p e n a l t y

Maximising F is to minimise error of eqn. 9 for model- ling and of eqn. 10 for control, and to force to solu- tions toward feasible sets by penalising the occurrence of meaningless membership functions and null sets in the universe of discourse. This fitness function provides a means for evaluating the performance of fuzzy model or fuzzy controller with the selected fuzzy rule base in the process of evolution, so that an optimised fuzzy model or fuzzy controller would be developed upon the best individual.

5 Simulation

5.1 Fuzzy modelling

5. I. I Box and Jenkins’gas furnace: We consider the fuzzy model of a dynamic process using a famous example of the system identification given by Box and Jenkins [16]. The process is a gas furnace with an input u(k) and an output y(k): gas flow rate and CO2 concen- tration, respectively. From the 296 I/O data pairs avail- able in this example, we constitute I/O data set x = {x5, x6, ..., X2961xI = (u(l - 4), y(I - l), y(Z))}. Initial parame- ters for evolution are as follows: generation number 3000, population size 70, r,,, 6, structure mutation rate 0.1, parameter mutation rate 0.1, a, = 0.2, and ap = 0.2. During the evolution, the modelling error of the best individual at each generation is calculated by eqn. 9 and shown with the best individual in Fig. 4. The fuzzy model for gas furnace optimised by the best indi- vidual is shown in Fig. 5.

Error

3.5

1.75-

bes t individual I I 0 I I I I

0 EO 1500 2250 3000 Generation

Fig.4

12

Evolutionary process of fuzzy rule base for gus furnace

IEE Proc-Control Theory Appl.. Vol. 146, No. I , January 1999

I f y( t -1 ) is with 1.54 then y(t) is 48.9 5.5 61.7 59.45

6.06

I f u(t -4) is with 3.71 and y(t-1) is /-\ with 1.06 then y(t) is -2.4 -1.3 1.41 43.7 50.6 59.7 53.54

I f

I f

/"\ with 0.17 then y(t) is

56 60.5 68.1 61.86

12.58

with 0.36 then y(t) is /-\

40.5 50.1 54.2 45.57

2.78 0.1

I f u ( t - 4 ) is wi th 0.24 and y(t-l)is with 0.88 then y(t) is -1.7 -0.2 2.48 43 46.5 L7.7 56.57

48.86 with 2.32 and y ( t - l ) i s A with 1.51 then y(t) is

i"\ I f u ( t - L ) is

-1.1 1.13 3.4 &3.7 49.9 59.7 Fig. 5 Optimised fuzzy model for gas furnace

Error

0.5 - best individual

I I I I I 1

0 750 1500 2250 3000 0 '

Generation

Fig. 6 Evolutionary process of fuzzy rule base for nonlinear system

5.1.2 Nonlinear system: This example considers the nonlinear system of eqn. 13:

= (1 + 2;2 + x;1.5)2, 1 5 zl,z2 5 5 (13) We used the first 25 data pairs [4] extracted from eqn. 13. Initial parameters for evolution are as follows: generation number 3000, population size 70, rma.x 6, structure mutation rate 0.1, parameter mutation rate 0.1, a, = 0.2 and ap = 0.2. During the evolution, the modelling error of the best individual at each genera- tion is calculated by eqn. 9 and shown with the best

IEE Proc.-Control Theory Appl., Vol. 146, No. 1. Junuury 1999

individual in Fig. 6 where the second row is empty for the best solution since all the values of M2j I 0 for any j in the second rule are less than 0.

To test the validity of the derived model, we consider the last 20 data pairs [4] that are not used in the model derivation, where E calculated by eqn. 9 is 0.22.

5.1.3 Coagulant dosing process in water puri- fication: In the water purification plant, chemicals are injected for quick purification of raw water. It is clear that the amount of chemicals intrinsically depends on

13

0.69

and x 3 is /? with 0.26 -0.49 0.46 1.805

I f x l is with 1.00

n -0.9 0.24 0.95

"

I f x l i s w i th 1.00 0 1 1.4.4

then PAC i s k 0.1314

and x 5 is /? wilh 1.00 then PAC i s 1 - 0.24 0.74 2.225 I

0.97

0 I f x 2 is A with 1.00 and n4 is with 0.08 and x 5 i s /*\ wilh 1.00 then PAC i s 1

0 0.6 -0.89 0 0.15 0.9787 0.42 1 1.22 0.77

I f x l i s with 0.86 0.4 1 2.215

X I : raw water turbidity, x 2 : water temperature

Fig. 7 Optimised fuzzy model for coagulunt dosing process

water quality such as turbidity, temperature, pH and alkalinity. However, the process of chemical reaction to improve water quality by the chemicals is not yet fully clarified nor quantified. The feedback signal in the process of coagulant dosage, which should be measured by sensors to compute the appropriate amount of chemicals, is not available. Most conventional methods focus on judging the conditions of purifying reaction and determine the amount of chemicals through man- ual operation of field experts using Jar-test data [17]. Recently, intelligent models acquired from plant histor- ical data have been implemented to guide coagulant injection [18, 191.

As a real application, a fuzzy model for coagulant dosing process is identified to determine the optimum dosage of coagulant, PAC (polymerised aluminium chloride) using Jar-test results. Jar-test data based on experts' experiences are utilised for the modelling. Ini- tial parameters for evolution are as follows: generation number 3000, population size 70, rma.u 6, structure mutation rate 0.1, parameter mutation rate 0.1, a, = 0.2 and a,, = 0.2. The fuzzy modelling error of the best individual calculated by eqn. 9 is equal to 5.76, and that of statistical model by eqn. 14 65.58. The opti- mised fuzzy model for coagulant dosing process is shown in Fig. 7, and the performance comparison between the fuzzy model and the statistical model of eqn. 14 is also shown in Fig. 8:

P = (4.03 - 0.05t) x x (14) where P is the coagulant dosing quantity, f water tem- perature, A alkalinity and T raw water turbidity.

statistical model

01 I I I

1 51 101 151 201 251 301 number of JAR test data

Performance comparison of fuzzy model and stutisticul model Fig. 8

5.2 Controller with fuzzy rules Conventional control system theory has been very effective for systems that can be modelled relatively precisely by mathematical equations. However, these precise models have been found to be inefficient in

14

0 2 I

and x5is I \ with 1.00 then PAC i s 1 0.655 1 1.925 1

x 3 : pH, x 4 : alka l in i ty , x 5 : residual turb id i ty

handling systems that are either too complex or too vague to be described by accurate mathematical mod- els. Fuzzy systems arose from the desire to describe complex systems with linguistic descriptions [ 151. The core of designing a fuzzy controller lies in the identifi- cation of high-performance fuzzy rules. As an efficient approach, a genetic algorithm has recently been applied to the optimisation of the fuzzy rule base. Successtul application of this approach has been demonstrated in several control problems [12, 131. However, the design scope of those are only limited to the tuning of mem- bership functions in the prior assumed fuzzy rule base structure. The usual steps in designing fuzzy controllers include (a) defining input and output variables; (b) specifying all the fuzzy sets and their membership func- tions defined for each input and output variable; ( e ) formulating a fuzzy rule base based on the combinato- rial recombination of each input membership function and/or heuristic control rule base, and then optimising the rule base, that is, tuning the membership functions consisting of the rule base.

Using the proposed design method, we can carry out step (b) and step (c) simultaneously for PI and PD con- trollers with fuzzy rule base without any preliminary knowledge. The controllers use fuzzy logic, which are used to adjust proportional (P) , integral (4 and deriva- tive (D) gains of PID controller. The controllers with fuzzy rule base are the conventional linear controller but they have nonconstant gains: P, I and D gains are nonlinear functions of its input signals, which have bet- ter setpoint tracking performance. The fuzzy rule base for a PI controller has an error and change of error as input variables and P gain and I gain as outputs. The fuzzy rule base for PD controller has the same inputs, and P gain and D gain as outputs. This control scheme can have an advantage of adaptive capability, in which optimal controller parameters cannot be set in advance, that is, the parameters have to be adjusted depending on several state variables measured the process. The only additional detail is to include state variables of the process in input variables of the fuzzy rule base during the evolution. In this case, fuzzy logic is used as proc- ess identification and will act as an online adaptive part of the control system. For the simulation, we consider a system with transfer function of eqn. 15. Fixed set- points R of 10 and -10 are used for the design of PI and PD controllers:

IEE Proc.-Control Theory Appl.. Vol. 146, No. I , January 1999

3.16 0

I f x I is with 3.4286 and x2 is with 15627 then Pgis I and I g i s 1 -2.4 -0.34 3.61 5.7 10.5L 10.7 -0.106 -1.108

with 1.0304 then Pg is I and I g is I -O.\ 4.49 6.09 -0.702 1.3479

A If XI is /T\ with 0.0088 and x2 is

-12 -5.65 -1.6

If XI is with 4.1369 -9.9 0.23 3.13

1.54

then Pg is l a n d l g is I 1.693 0.4315

7.23

I f x l is with 0.7260 and x2 is with 0.1778 then Pg is I a n d l g is I r;\ -4.1 1.23 2.2 5.7 10.65 15.3 -0.384 -0.543

I f x l i s wi th 1.3983 and x2 is r\ with 1.3934 then Pgis l a n d Igis I 4.97 7.27 14

Fig.9 Optimisedfuzzy rule bme for PI control -7.3 1.14

5.2.1 PI controller with fuzzy rule base: Initial parameters for the evolutionary design of fuzzy rule base are the same as those used in modelling except that generation number is reduced to 500. Sampling time is 0.5s. The optimised fuzzy rule base in shown in Fig.

- 3

3 0

C O

0.

a

- -

1 51 101 151 2M 251 301 351 LO1 L51 501 551 iterotion

Perfortnance of PI controller with optimi.seedfuzzy rule base Fig. 10

1.01 0.3

15.1 4.3885 -0.517

The performance of PI controller with the optimised fuzzy rule base is shown in Fig. 10, in which for com- parison, the performance of two conventional PID con- trollers whose gains are initially determined by the Ziegler-Nichols rule and further optimised to their best performance by genetic algorithms, are also shown. In the case of the other setpoints not used in the design, the values of input variables, c and ce are applied to the identified fuzzy rule base after being scaled by eqn. 16:

1 R d e s i g n - s e t p o i n t I I R c u r r e n t - s e t p o i n t - R p r e v i o u s - s e t p o i n t I e = e x

ce = ce x I R i e s i g n - s e t p o i n t I I R c u r r e n t - s e t p o i n t - R p r e v i o u s - s e t p o z n t I

(16) where Rdes,gn-serpoint is 10 and -10 as setpoint used in the design.

As can be seen, the performance achieved by the pro- posed controller is apparently superior to that obtained

with 3.0290 then Pg is 1 a n d D g i s J r\ 1.6 3.25 5.7 8.27 9.73 15.1 -1.5572 -2.155

with 1.5715 and x2 is /-\

I f x 1 is

L 3.72

with 1.2102 then Pg is l a n d Dg is I 1-\ with 1.4884 and x 2 is

/-\ If x l i s

-8 .46 -1.89 6.1 3.1 5.18 9.26 3.1265 - 0.075

w i th 2.0794 then Pg is I and Dg is I -10.5 -1.31 4.2 -11.24 1.11 8.06 0.4381 1.5554

A /T\ I f x l is with 2.5257 and x2 is

l a n d Dg is 1 0.53 11.67 17 5.31 5.59 11 0.8382 1.8826

oh with 2.0570 and x 2 is : wi th 0.9839 then Pg is

/?\ I f x l is

Fig. 11

IEE Proc-Control Theory Appl., Vol. 146, No. I , January 1999

Optimisedfuzzy rule base for PD control

15

from the PID controllers with both the overshoot and decay rate being improved.

5.2.2 PD controller with fuzzy rule base: All the initial parameters for the evolutionary design of the fuzzy rule base are the same as those used in PI con- troller design. The optimised fuzzy rule base is shown in Fig. 11.

The performance of PD controller with the optimised fuzzy rule base is shown in Fig. 12, in which the same conditions are applied for the conventional PID con- trollers. In the case of the other setpoints not used in the design, the values of input variables, c and ce are applied to the identified fuzzy rule base after being scaled by eqn. 16. As can be seen, the performance achieved by the proposed controller is apparently supe- rior to that obtained from the PID controllers but a lit- tle inferior to that of PI controller with the optimised fuzzy rule base. The identified fuzzy PI and PD con- trollers proved to have good performance for other set- points not used in the design.

11

1 51 101 151 201 251 301 351 101 151 501 551 iteration

Performance of PD controller with optimisedfuzzy rule base Fig. 12

6 Conclusion

In the design of fuzzy model and fuzzy controller, a major difficulty is encountered in the identification of optimal fuzzy rule base. This study has presented an approach to evolutionary design of fuzzy rule base without any assumed rule base structure in order to eliminate the difficulty. The performance of this approach was checked and validated through five examples. This study also presented PI and PD control- lers with fuzzy rule base, in which PI and PD control- lers are the conventional linear controllers but they

have nonconstant gains whose values are inferred from the optimised fuzzy rule base depending on input sig- nals. The proposed controllers have better setpoint tracking capability than those of the optimised PID controllers in view of overshoot, decay time and steady-state error.

7 References

1 HWANG, H.S., and WOO, K.B.: ‘Linguistic fuzzy model identi- fication’, IEE Proc. Control. Theory Appl., Nov. 1995, 142, (6),

2 JOO, Y.H., HWANG, H.S., KIM, K.B., and WOO, K.B.: ‘Lin- guistic model identification for fuzzy system’, Electron. Lett., Feb. 1995, 31, (4), pp. 330-331

3 SUGENO, M., and YASUKAWA, T.: ‘A fuzzy-logic-based approach to qualitative modelling’, IEEE Trans. Fuzzy Syst., Feb.

4 TAKAGI, T., and SUGENO, M.: ‘Fuzzy identification of sys- tems and its application to modeling and control’, IEEE Trans. Syst., Man. Cybern., 1985, 15, pp. 116-132 KARR, C.L., and GENTRY, E.J.: ‘Fuzzy control of pH using genetic algorithms’, IEEE Trans. Fuzzy Syst., Jan. 1993, 1, (l), pp. 46-53 HOMAIFAR, A., and MCCORMICK, E.: ‘Simultaneous design of membership functions and rule sets for fuzzy controllers using genetic algorithms’, IEEE Trans. Fuzzy Syst., May 1995, 3, (2), pp. 129-139

7 ZADEH, L.A.: ‘A theory of approximate reasoning’ in ‘Machine intelligence’, Vol. 9 (J. Wiley & Sons, New York, 1979)

8 ZADEH, L.A.: ‘Fuzzy sets’, Inf: Control, 1965, 8, pp, 338-353 9 RECHENBERG, I.: ‘Cybernetic solution path of an experimental

problem’. Technical Report, Farnborough, Hants, 1965 10 RECHENBERG, I . : ‘Evolutionsstrategie: Optimierung tech-

nischer System nach prinzipien der biologischen evolution’ (Frommann-Holzboog, 1973)

11 SCHWEFEL, H.P.: ‘Evolutionsstrategie und numerische Opti- mierung’. PhD dissertation, Technische Universitat Berlin, 1975

12 HOLLAND, J.H.: ‘Adaptation in natural and artificial systems’ (University of Michigan Press, Ann Arbor, MI, 1975)

13 GOLDBERG, D.E.: ‘Genetic algorithms in search, optimization and machine learning’ (Addison-Wesley, Reading, MA, 199 1)

14 FOGEL, L.J., MARSH, A.J., and WALSH, M.J.: ‘Artificial Intelligence through Simulated Evolution’ (J. Wiley & Sons, New York, 1966)

15 FOGEL, L.J., and ATMAR, J.W.: “,Proceedings of the first annual conference on Evolutionaiy programming (Evolutionary Programming Society, La Jolla, CA, 1992)

16 BOX, G.E.P., and JENKINS, G.M.: ‘Time series analysis, fore- casting and control’ (Holden Day, San Francisco, 1970)

17 VAN BENSCHOTON, J.E.: ‘Separation and fate of aluminum in water treatment’ (University of Massachusetts, 1998), pp. 1 5 4 1 60

18 BABA, K., ENBUTSU, I., MATSUZAKI, H., and NOGITA, S.: Intelligent support system for water sewage treatment plants

which includes a past history learning functionxoagulant injec- tion guidance system using neural-net algorithm instrumentation’, in ‘Control and automation of water and wastewater treatment and transport systems’, 1994, pp. 227-234

19 ENBUTSU, I., BABA, K., and YODA, M.: ‘Explicit representa- tion of knowledge acquired from plant historical data using neu- ral network’. Proceedings of IJCNN’90, San Diego, 1990, pp. 5 6 - 68

pp. 537-544

1993, 1, (l), pp. 7-31

5

6

16 IEE Proc.-Control Theory Appl.. Vol. 146, No. I. January I999