Open Collections

UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Applications of fuzzy set theory in reservoir operations Campbell, Paul Francis 1993

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata


831-ubc_1994-0042.pdf [ 8.78MB ]
JSON: 831-1.0050434.json
JSON-LD: 831-1.0050434-ld.json
RDF/XML (Pretty): 831-1.0050434-rdf.xml
RDF/JSON: 831-1.0050434-rdf.json
Turtle: 831-1.0050434-turtle.txt
N-Triples: 831-1.0050434-rdf-ntriples.txt
Original Record: 831-1.0050434-source.json
Full Text

Full Text

APPLICATIONS OF FUZZY SET THEORY IN RESERVOIR OPERATIONS by  PAUL FRANCIS CAMPBELL B.Eng., Technical University of Nova Scotia A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE  in  THE FACULTY OF GRADUATE STUDIES DEPARTMENT OF CIVIL ENGINEERING  We accept this thesis as conforming to the required standard  THE UNIVERSITY OF BRITISH COLUMBIA December 1993 PAUL FRANCIS CAMPBELL, 1993  in  presenting this thesis  in  partial fulfilment of the  requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make it freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the head of my department or by his or her representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission.  Department of  c/iI/Z  E///,v1A/c  The University of British Columbia Vancouver, Canada  Date 7’P/ 5 1  DE-6 (2/88)  ABSTRACT Attempts to maximize benefits from hydroelectric reservoirs with mathematical models have been a focus of study for water resource specialists. As increasingly complex models are developed to more closely imitate reality, their usefulness may paradoxically diminish since reservoir operators are less apt to fully understand the models. This results in a general lack of acceptance of mathematical reservoir models amongst the people they were originally developed to serve. Also, the stochastic nature of modelling a system influenced by climatic and economic factors such as a hydroelectric reservoir puts an upper limit on the attainable accuracy of a model. This thesis suggests that a method based on fuzzy set theory may provide a more readily understandable model that recognizes the inherent uncertainties in reservoir modelling. Heuristics or “rules of thumb” are used to simulate operation of a reservoir subject to uncertain inflows and changing hydroelectric power values. This system describes the operation of the reservoir in vague terms such as: “IF predicted inflow is medium-low AND reservoir volume is high THEN suggested outflow is  ...“.  These rules can be obtained directly from an experienced  operator; from analysis of historical data; from data generated by a mathematical simulation of the reservoir or any combination of all three. This thesis illustrates the development and use of a simple fuzzy rulebase for a single hydroelectric reservoir. The rulebase is formed from data generated by a mathematical optimization model (dynamic programming) of the reservoir that simulates several years of operation with random inputs. II  TABLE OF CONTENTS Page ABSTRACT TABLE OF CONTENTS  iii  LIST OF FIGURES  v  ACKNOWLEDGEMENTS  vi  CHAPTER 1: INTRODUCTION  1  CHAPTER 2: FUZZY SET THEORY  6  2.1 Introduction to Fuzzy Sets  6  2.2 Basics of Fuzzy Set Theory  8  2.3 Operations with Sets  10  2.4 Fuzzy Propositions  17  CHAPTER 3: UNCERTAINTY IN MODELLING 3.1 Probability, Possibilty and Uncertainty  21 21  CHAPTER 4: RESERVOIR SIMULATION AND DATA GENERATION  26  4.1 Fundamentals of Modelling Hydroelectric Systems  26  4.2 Hindsight Analysis and Reservoir Systems  27  4.3 Basics of dynamic programming  27  4.4 Reservoir Model  30  CHAPTER 5: RULE GENERATION  37  5.1 Development of Fuzzy Rulebase from Raw Data  37  5.2 Structure of Rulebase  40  CHAPTER 6: FUZZY INFERENCE  52  6.1 Introduction to Fuzzy Inference Techniques CHAPTER 7: FUZZY DYNAMIC PROGRAMMING  52 76  7.1 Introduction to Fuzzy DP  76  7.2 Nonstochastic Decision Making  78  7.3 Stochastic Programming  79  7.4 Reservoir Fuzzy DP Model  83  7.5 Satisfying short term goals vs long term  86  III  CHAPTER 8: ARTIFICIAL NEURAL NET  93  8.1 Introduction to Neural Nets  93  8.2 Classification of Raw Data into Fuzzy Rules  96  8.3 Prediction  98  CHAPTER 9: CONCLUSIONS AND RECOMMENDATIONS  106  BIBLIOGRAPHY  110  iv  LIST OF FIGURES Page  Figure 2.1  Representation of a Fuzzy Set  8  Figure 2.2 Different representations of “quick” by fuzzy and crisp membership functions  9  Figure 2.3 Union of Fuzzy Sets  10  Figure 2.4 Intersection of Fuzzy Sets  11  Figure 2.5 Complement of Fuzzy Sets  11  Figure 4.1 Possible Optimal Paths in Dynamic Programming  28  Figure 5.1 Membership Values of a Data Set  39  Figure 5.2 FAM Structure  40  Figure 5.3 Three Sample Data Sets and Resulting Memberships  42  Figure 5.4 Sample Output Functions  43  Figure 6.1 Summary of Generated Rule Base  53  Figure 6.2 Two Fuzzy Inference Methods  54  Figure 6.3 Overlapping Rule Conclusions  55  Figure 6.4 Inference Algorithm  57  Figure 6.5 Differences in Membership Structure between 48 and 100 rule sets  59  Figure 6.6 Rule base with disabled rules blackened out.  .  .  61  Figure 7.1 Fuzzy Goals  77  Figure 7.2 Fuzzy Constraints  78  Figure 8.1 Stucture of Backpropogation Network  95  V  ACKNOWLEDGEMENTS  A student cannot develop a thesis without a combination of financial, directional and moral support. The assistance of Dr. S. 0. Russell in bringing into focus this sometimes amorphous topic was indispensable. The author also extends his sincere appreciation to NSERC and UBC for financial support. Finally, the author would like to thank his family, classmates and other friends for their patience and valuable suggestions during the course of the work.  vi  1 CHAPTER 1: INTRODUCTION Since most of the cost effective and environmentally acceptable sites for hydroelectric dams have already been exploited, electrical utilities have attempted to defer construction of new dams by implementing demand side management and optimizing operations. As a result, water resource engineers involved with hydroelectric development are increasingly redirecting efforts from construction of new hydro facilities to efficient utilization of existing ones. The development of efficient strategies for reservoir operations provide tempting challenges to those involved in optimization theory. This thesis will examine the potential of a relatively new and quite distinct method of aiding the decisionmaking process using fuzzy set theory. The crux of the problem in reservoir models usually involve dealing with the uncertainty of future events and the nonlinear relations that commonly exist between variables. Even the simplest single reservoir models are subject to stochastic inflows since weather is inherently unpredictable. Hydroelectric dams are usually components of larger power systems which would require consideration of continually varying external factors such as the price of oil and demand for electrical power. The uncertainty associated with predicting such economic trends adds to the stochastic nature of planning optimal reservoir strategies. Examples of nonlinear relations in reservoir modelling may occur when describing the relationship between reservoir volumes and available head or between head and power produced per unit flow. Reservoirs can also provide multiple services, some of which work in almost direct conflict with each other such as allowing storage for flood control and supplying head for power generation. In an effort to account for these conflicting demands and uncertain parameters, models of reservoir operations have become increasingly complex. However, it is this complexity that may hinder their acceptance within the hydroelectric industry. Yeh (1985) in his survey of reservoir management and  2 operations models, notes the reluctance of reservoir operators to use optimization models for real time control. One of the reasons cited for the rejection by operators is that development of the models often takes place without input from those involved in day to day operations of the systems. This may be due to lack of coordination between academic researchers and the operators. It may also be attributed to the inability of the modelers to utilize heuristics or ‘rules of thumb’ that the operators have acquired through experience. It is not in the nature of those who create models to ignore any potential source of information but until the development of fuzzy set theory, rules of thumb and information dealing with vague descriptions could not be integrated into reservoir models. Fuzzy set theory allows the transformation of vague but valuable information into a format that is acceptable for computer models. This thesis investigates a model of a simplified single reservoir operating system that recognizes the stochastic and nonlinear nature of the system. The model simulates operation of a 110MW hydroelectric dam operating under 85 to 100 m of head with a reservoir containing 1400 cu.m/s  -  months active  storage. The model, based on a procedure called fuzzy inference, is capable of incorporating knowledge provided by an experienced operator. This knowledge, expressed as a set of rules, can be supplemented by data from hindsight analysis thereby gaining from the strengths of both the operator and the hindsight model. Another model, called a backpropogation artificial neural network, which shows some similar characteristics to the fuzzy inference model is examined later in the thesis for purposes of comparison. This backpropogation model does not use heuristics from a human expert but may be considered in situations where no expert knowledge exists. A third distinct model that applies fuzzy set theory to stochastic dynamic programming is also investigated. This model bears little resemblance to the fuzzy inference model but it is included with the intention of showing the  3 diversity of fuzzy sets in modelling. Although three models are discussed, the emphasis of the thesis is placed on exploring the strengths and weaknesses of the fuzzy inference model. Chapter 2 of this thesis introduces fuzzy set theory, with its unique terminology and novel concepts. The various guises of uncertainty in modelling and the potential pitfalls encountered in fuzzy models are then covered in chapter 3. The fuzzy inference model developed in this study is contained within chapters 4, 5 and 6. These three chapters describe respectively, the simulation of a hydroelectric reservoir by hindsight analysis, using the ‘experience’ gained through the simulation to develop a series of rules and finally putting these rules in operation to assist in controlling the reservoir. The method used for simulating the operations of a reservoir in chapter 4 uses a framework similar to dynamic programming (DP). Simulation is necessary if no historical data exists for the reservoir. If there is historical data available for the reservoir, the techniques covered in chapter 4 are not required to implement the fuzzy inference model. Chapter 5 describes an algorithm that creates a series of  ‘  IF  THEN  ‘  type rules from the DP simulation. This is a  type of categorizing algorithm that recognizes general trends between inputs and output. Eventually, a simple, structured series of rules ( a rulebase ) is created that can be easily understood and verified by an experienced operator. Chapter 6 describes a computation routine called fuzzy inferencing that combines the rules to yield a decision when given any combination of inputs. The fuzzy inferencing method uses input values to fire the appropriate “IF. .THEN” rules, sums up weighted outputs from each rule and then determines a final averaged output value. In chapter 7 another model called fuzzy dynamic programming is investigated. Fuzzy DP uses fuzzy sets in a much different manner than the fuzzy inference model. Also, rules are not explicitly stated in the fuzzy DP  4 model. Instead the model generates a series of decisions that are optimized according to fuzzy constraints and fuzzy goals. Chapter 8 provides an introduction to a third model, the backpropogation neural network. Based loosely on the workings of the brain, it does not resemble the fuzzy inference model at first glance but yields similar results. Upon closer investigation, it is seen that both the fuzzy inference model and the backpropogation model both involve encoding of a memory and subsequent recall during reservoir operation. However, there is not an explicit rule base used in the backpropogation neural net and a certain ‘black box’ effect is inherent within this setup. Finally, chapter 9 summarizes the strengths and weaknesses of the three different models and provides conclusions and suggestions for future research on fuzzy models in reservoir operations.  5 CHAPTER 2: FUZZY SET THEORY 2.1 Introduction to Fuzzy Sets Fuzzy set theory is an attempt to quantify previously unquantifiable information by assigning numerical values to vague terms and performing operations on these values in a consistent and, hopefully, logical manner. A fuzzy model can be considered as a ‘common sense’ model that also uses historical data and other non-intuitive statistical parameters to influence decisions. When incorporating vagueness into decision making, some efficiencies are lost and the traditional objective of optimizing performance is compromised. Rather than striving for the last one or two percentage points of efficiency, the objective turns into developing a robust, flexible model that has more intuitive appeal to the user. The risk of major failure is minimized. The model does not counter nor neglect the experience of the operator and as more experience is acquired, this additional knowledge can be incorporated into the system. Vagueness in a fuzzy system is not useful in the form of some inflow and some  .  ..“  “  If there is  but must contain a relative (but not necessarily  exact) measurement of a variable like  “  If inflow is low and  ....“  Fuzzy sets theory is the creation of Lotfi Zadeh, a USC Berkeley professor. He first promoted the concept in a 1962 article comparing circuit theory and system theory. In 1965, Zadeh’s article entitled “Fuzzy Sets” for the journal, Information and Control, presented a more complete mathematics “of fuzzy or cloudy quantities”. When fuzzy set theory is placed in a historical context, it can be seen that western logic and mathematics have been based on a binary or “true or false” system that has helped shape our view of the universe. Aristotle, in his work MetaDhysics, introduced the laws of Contradiction and the Excluded Middle which can be summed as  “  A cannot be B and NOT B” and “A must be  either B or NOT B” respectively( Bier 1991). These axioms have been accepted by other western philosophers such as Decartes, Locke and Kant in their further studies of logic. The concept of partial truths ( A is mostly B and a little not B  6 has, until recently, received little attention since it involves negation of these most basic axioms. As a binary system of logic was developing in western societies, Nagarjuna, a Buddhist philosphopher of the second century, created a four sided system of logic (Freiberger 1993) that more closely resembled the graded degrees of truth in fuzzy set theory. Although these schools of thought may appear far removed from present day applications of technology, it is interesting to note how fuzzy set theory was enthusiastically accepted and applied in Japan where Buddhist concepts are a part of daily life. Despite its origins in the United States, fuzzy set theory remained relatively unrecognized in the West for its first ten years of existence. It was only after Japanese firms developed practical applications of fuzzy real-time control in household appliances, electronics and transportation systems did the Western applied science community begin to invest significant time and effort into this field. 2.2 Basics of Fuzzy Set Theory Fuzzy set theory provides a means for translating ambiguous terminology often used in everyday language for use in mathematical problems such as decision analysis and real time control. The following material can be found in various fuzzy math texts, but the author suggests referring to Terano (1992) for a more thorough discussion of the topic. Fuzzy set theory can determine the degree of membership that any element x of set X belongs to subset —A. A function which expresses this within the real number interval from zero to one [0,1] is called the membership function. This may be expressed by; IJA(xl)  =  ) 2 0; PA (x  =  1;  UA(x 1 ) 3  =  where PA is the membership function.  0.7 etc.  7 SupportSetX  zzySet ) 2 x 3  Figure 2.1 Representation of a Fuzzy Set  xl Where the rectangular area in figure 2.1 represents the set X and within it the dotted circle represents a fuzzy subset of X called -A with an ambiguous border. Conditions are described in terms of degree of belongingness to a set. For example, if the condition  “  If ball is approaching quickly, swing bat quickly.”  were to be programmed into an expert system for an automated baseball player, the term quickly must be more discretely defined to be utilized by the program. Using a crisp (non-fuzzy) definition of quickly may result in a traditional logic statement such as “If speed > 40 mph then quick; else not quick”. Fuzzy set theory allows a function ascribing membership to the term ‘quickly’, assigning a value in the interval [0,1] to express belongingness. For instance, any speed above 90 mph may be considered definitely quick so it would be assigned a quickness value of one. Likewise a speed below 40 mph may be considered slow and these quickness values are zero. Speeds between 40 and 90 mph can then be represented on a linear scale from 0 to 1 (see figure 2.1) or they can be represented by a non-linear function.  8 LINEAR  NONLINEAR  1.0  0  go  CRISP  I_ _ _ _ _  T 40  SPEED OF PITCH (MPHJ  I Figure 2.2 SB Different  representations of “quick” by fuzzy and crisp membership functions. The crisp membership function is a special case of a fuzzy set with an abrupt transition from zero to full membership. This illustrates that classical set theory is a subcategory of a more general fuzzy set theory. Although fuzzy set theory is considered more general than classical set theory, many of the operations governing fuzzy sets are derived from classical set theory. Applying the rules of classical set theory to the more general fuzzy sets is viewed by some theorists as a logical extension but others such as French (1984) regard this as an unsubstantiated assumption. 2.3 Operations with Sets The union of sets: —AU —B  =  max[PA(x),.,UB(x)], where p(x) is the  membership function.  A U —B is shown in solid line below.  9 U(x) Figure 2.3 Union of Fuzzy Sets.  ‘A  Bellman and Zadeh (1973) 4’  use this operation to describe the  4’ X  intersection of sets: —A fl —B  =  term “—A or —B  “.  The  min[JJA(x),/JB(x)]  —A fl —B is shown below in solid.  ‘A Ufxl  4  I  I,  B  I I I 1%  x  Figure 2.4 Intersection of Fuzzy Sets.  This is the verbal equivalent of “—A and —B”. The complement of a set (fuzzy negation): .A  =  l-JJA(X), not A  10 Figure 2.5 Complement of I  Fuzzy Sets.  I  U(x)  I I  Algebraic sum and product of Fuzzy Sets---  / I  Sum: IJA(X)  + PB(X)  Product:  /1  -  PA(X) •  -Afl -B  P-AU  —B  (x)  =  (x) 8 /J (x)  =  PA(X) •  (x) 8 fl  Bellman and Zadeh (1973 ) state that these operations can be used in some circumstances as a “softer” version of “—A and —B / —A or —B” respectively. The softer versions may be used when interactivity or some type of interdependent relationship is implied between the two sets. Zadeh and other proponents of fuzzy set theory have stated that the “hard” max and mm  operations are based on an assumption of noninteractivity  between the arguments in a premise. In other words, the resulting value of the truth of a compound statement is only dependent on the values of the components of the statement and there should be no interrelationship between the components. V.M.Bier (1992 ) refers to this condition as “truth functionality” and expresses concern about potential misuse of fuzzy operators because of violation of this condition. When considering the equivalent operations in classical probability such as Bayes’ theorem (Eq. 1 ) the relationship between arguments is taken into account. (1)  P(A fl B)  =  P(A) P(B/A)  11 In fuzzy set theory there is no equivalent consideration for interrelationship in the “hard” operations; max and mm. Bier concludes that this aspect of truth functionality in the max and mm  operators should be  eliminated to avoid the misrepresentation of the meaning of the words “AND” or “OR” within rule bases. Consider for example a fuzzy rule describing age and height of buildings, or more specifically, skyscrapers. Building A, built in 1930, is 30 stories high Building B is also 30 stories high but was built in 1992. Both buildings are considered to have a value of .6 in the membership of “tall”, since there may be several taller buildings in a large city. Building A is given a value of .6 in the set of “old” and building B is described as 1 .0 in the set “new”. The Building A satisfies the statement “tall,old skyscraper” with the value 0.6 which also happens to be the same that Building B satisfies the premise of “tall, new skyscraper”. This seems to be a reasonable answer until our expert states that “for an old skyscraper, Building A is pretty tall. For a new structure, Building B is only average in height”. It is seen that the two descriptors do not satisfy the condition of noninteractivity required for the mm  operator.  This can be extended to reservoir operations in which an expert may consider a high inflow in the winter season as being very different from a high inflow in the summer. Linguistic variables are valuable because they are versatile but it is also this versatility that forces the builder of the knowledge base to consider the context of their use. Zimmerman (1991) found that the  12 most commmon usage of the word “AND” corresponds more closely to the geometric mean of the arguements than to either the hard or soft definitions of intersection. The truth functionality of fuzzy max and mm  operators can still allow  consistently logical handling of vague descriptions if interdependence between arguments is considered. However according to French (1984), truth functionality in fuzzy operators leads to inconsistencies in solving uncertainties of a statistically random nature. Bellman and Zadeh (1973) recommend that in most circumstances the “hard” (i.e. max and mm) operators be used except when it is obvious a soft meaning is intended. Fuzzy set theory differs noteably from classical set theory when the Laws of contradiction and excluded middle are brought into the picture.  Neither I.LAU  A-(x) =  1 nor PAfl .A-(x)  =  0 are supported by fuzzy set  theory. In other words, water can be described as both hot and not hot. This is often the desired effect in a rule base but it is noted by V.M.Bier (1992) that in some circumstances it may be desired to have a linguistic use of negation that accomodates the law of contradiction. This can be done in classical probability but not yet in fuzzy set theory. Parallel to the laws of contradiction and negation, Ng and Abramson (1992) expressed concern about the mm IJA*B(u,V)  =  rule of the form  min[,UA(u), PB(V)].  13 “If A and B are mutually exclusive events, the possibility that they will occur simultaneously should be zero, but the mm  rule may not  recognize it.” It is difficult to imagine the premise of a rule in an expert system that might involve mutually exclusive events. However, within expert systems, not all rules are expressed explicitly and arguments within a premise can be variables. In this situation, mutual exclusivity can occur within a rule that might not be forseen during the development of the system. CONVEXITY Convexity of the fuzzy sets is implied in the above operations. Formally stated this is: For x < y < z; PA> mm  [,UA(x),  JJA(z)l. A property of convexity  is for —A and —B which are both convex then —A fl —B is also convex. MODIFIERS Membership functions are used in expressing fuzzy propositions such as ‘X is —A’ where —A is a fuzzy set. These propositions can be modified further by such linguistic variables as “very” and “almost”. Representing the modifier by the letter “m” we arrive at: X is m(—A) Examples of liguistic modifiers could be: almost —A  =  0.8—A ; very —A  EXTENSION PRINCIPLE  -  =  ; not —A 2 —A  =  1  -  —A  defines how the fuzzy subset —A of X can  correspond to fuzzy subset f(A) of Y.  14 If —A is a fuzzy set on u; —A  /u + 2 x 1 /u + x  the extension principle states that f(—A)  =  f( 1 /u + x /u + 2 x  =  1 f(u x ) + 2 1 /f(u + x )  for example u —A  {  =  + x/u) + x/ f(u)  1, 2, 3  10}  set describing “large” =0.4/1 + 0.6/2 + 0.8/3 + 1.0/4 + 1.0/5  then “very large”  2 —A  =  0.4/1 + 0.6/4 + 0.8/9 + 1.0/16 + 1.0/25  this acts in much the same way as the principle of superposition in classical sets. A further example: define —A  =  “about 2”  =  —2  =  0.6/ 1 + 1/ 2 + 0.8/ 3  define —A  =  “about 9”  =  —9  =  0.8/ 8 + 1/ 9 + 0.7/ 10  Now find “(about 2) , u 1 f(u ) 2  =  =  / u 11 (x 11  12 *j  12 x 211 min(x 21 )/u  +  32 *u x 311 min(x 31 )/u *  +  (about 9)”. 21 + / x 21 /u 31 ) x 31 u  , )/u 11 min(x 12 x 11  +  —2  *  =  +  12 j  +  *  1 + /u 22 + /u x 22 32 x ) 32 ( x/u  22 + 11 32 u 1 *u , ) 11 min(x 22 / 1 x )/u 3 x 111 min(x 2 *u  22 )/u *u 22 ,x 21 min(x  (0.6/1 + 1/2 + 0.8/3)  *  +  mm  (0.8/8 + 1/9 + 0.7/ 10)  =  min(0.6, 0.8)! 8 + min(0.6, 1)! 9 +  =  0.6/8 + 0.6/9 + 0.6/ 10 + 0.8/ 16 + 1/18 + 0.7/20 + 0.8/24  + 0.8/ 27 + 0.7/30  + min(0.8, 0.7)! 30  15 if more than one member of u 1x u 2 is mapped to one only one member of V, use the maximum membership grades of the member in fuzzy set —A. —A —B  —  =  “about 4” “about 5”  —4 x —5  =  + mm =  —  0 5/ 3 + 1/ 4 + 0 6/ 5 0.4/4 + 1/5 + 0.4/6  =  =  =  —4 —5  min(0.5, 0.4)/12 + min(0.5, 1)/15 + min(O.4, 1)116 (0.5, 0.4)/18 + max[min(1, 1), min(0.6, 0.4)] / 20 +  0.4/12  + 0.5/ 15 + 0.4/16 + 0.4/18 + 1/20 + 0.4/24 +  0.6/25 + 0.4/ 30  2.4 Fuzzy Propositions Consider the composite proposition  “  Bill is not a very heavy person, he’s  about average.” Logically, this resembles the proposition, x is A and x is B. What rules govern the combination of fuzzy sets in this manner? For tying together two propositions based on a single subject (or dimension) such as the weight of a person, the following rules can be applied. x is —A  or  x is -B  x is —A  and x is —B  =  x is —A U  =  x is —A fl  —B (the hard max operator) —B  (the hard mm  operator)  This can be extended to applications of propositions of two or more dimensions or subjects such as x is —C and y is —D  =  product of —C and —D. and also  “  Bill is average height and not very heavy.”  (x,y) is —C x —D  where —Cx —D is the direct  16 x is —C or y is —D  =  (x,y) is [—C x Yl U [Xx —Dl where X is the  support set of —C and Y is that of —D. In both cases the result is a fuzzy support set of two dimensions. A third type of proposition is of the type “if x is —C then y is —D”.The “if then” proposition is denoted in logical terms by an arrow --> x is —C --> y is —D  =  (x,y) is —C--> —D  where —C --> —D is the fuzzy subset of Xx Y and its membership function is  1-4-c-->  _D)(X,Y)  =  PR (x,y)= max[(./Jc(x) fl pD(y),(1  -  Pc(x))]  We can show this with an example of crisp sets: Let the sets —C and —D be represented as: CRISP SETS  1.111  1.01  5 4 3 2 1 X  the relational matrix then would be: yl  y2  y3  y4  y5  y6  xl  1  1  1  1  1  1  x2  0  0  1  1  1  0  x3  0  0  1  1  1  0  relational matrix=>  x4  1  1  1  1  1  1  ,UR(x,y)  x5  1  1  1  1  1  1  17 The previous two dimensional relational matrix can be shown in other ways. The membership function PR(X,V) decribes the relation x to y and is demonstrated in the following example in which IJR(X,Y) describes the relation x is much larger than y.  UR(x,y)  0;  x>=y  ); 2 1/(1 +(1O/ y-x)  x < y  =  So far it has been shown how to deal with the logical propositions: 1) x is -A or -B  by using max and mm  2) x is —A and —B  comparisons respectively on the fuzzy subsets. Also it  has been shown how to use the fuzzy relation R  ,  to express  “  if x is —A, then  yis —B”. We can further extend the concept of fuzzy relations, If R is a fuzzy relation in X x Y and S is a fuzzy relation in Y x Z, the composition of R and S. R S. is a fuzzy relation in X x Z. R S <--->  /JR.S(x,z)  This is termed the max-mm  =  max{ min[p(x,y), ps(x,y)]}  composition.  For example: given fuzzy sets  —A  =  0.3/a + 0.9/b + 0.5/c  18 and  —B  x a b c  Ietf=  =  O.5/x +  1/y  V p q r  [a,xl  PB(P)  =  p r p  [a,y]  [c,y]  max[min(0.3,0.5), min(0.3,1), min(0.5,1)] ; [b,xl  PB(q)  =  max[min(0.9,0.5)]; [c,xl =  max[min(0.5,0.5),  [b,y] min(0.9,1)]  The resulting membership function:  =  0.5/p + 0.5/q + 0.91r  This is how a fuzzy control system can generate a fuzzy output p—given a fuzzy input /.LAand a fuzzy system ,LLR.  19 CHAPTER 3: UNCERTAINTY IN MODELLING 3.1 Probability, Possibilty and Uncertainty Uncertainty comes in many different forms. The statement : “It will probably not rain today, by the looks of the blue sky.” shows two types of uncertainty, namely that caused by vagueness (blue), and that of a more statistical nature due to random processes unknown to the observer at present (probably not). The latter type of uncertainty has been the focus of classical probability analysis. Vagueness cannot be analyzed with classical probability methods since randomness or chance has nothing to do with a vague statement. Fuzzy set theory is equipped to handle vagueness. When developing a reservoir model that incorporates uncertainty in the form of vagueness, it is important to understand the various conditions in which fuzzy set theory is applicable and those in which the more familiar probability theory should be used. This chapter will quickly summarize types of uncertainty and the corresponding methods for solving each type. Zadeh suggests that vagueness or fuzziness is unavoidable in describing our surroundings. If we choose to say that the sky is blue, it is not necessary to state the average wavelength of visible light to describe just how blue it is. Although ‘blue’ is a vague description, it still contains significant value as information. Precise information is good if it can be easily collected. Vague information is better than no information and sometimes the only way of efficiently describing a situation.  20 Fuzzy set theory has already proven its effectiveness in real time control situations by increasing the efficiency and robustness of various systems. In the application of fuzzy sets to decision analysis however, controversies have arisen in regard to proper usage of fuzzy arithmetic in a way that is consistently logical. When should fuzzy set theory be used to aid in the decision making process? French (1984 ) questions the idea of modelling fuzziness when the purpose of a management decision making tool is to clarify the thinking within the user’s mind. French argues that many vague concepts such as “Bill is tall have historically been broken down into crisp concepts (i.e. Bill is 6’ 2”). He further suggests that a vague concept such as flexibility of workforce can be broken down into crisp indices that are suitable for analysis by classical set techniques. This is how most economic analysis is currently carried out by monitoring indices of various sorts that represent complex and vague concepts such as the economic health of a nation. However if one wishes to input an expert’s advice into a decision support model, there is no sense in delineating a crisp boundary in the model where none exists in the expert’s mind. Precision without accuracy is not to be encouraged in these models. It can also be argued that viewing a problem in the simpler and less precise manner encouraged by fuzzy set theory promotes more clarity of thought than a more precise, complex model filled with indices. When used properly, fuzzy set theory describes problems with simplicity and clarity. The flip side is loss of precision. If the decision maker wishes to obtain an  21 answer within five percent of the optimum, fuzzy sets will not deliver and classical set theory should be used. So far, only two types of uncertainty, randomness (or dissonance) and vagueness ( or fuzziness)  ,  have been considered. Klir (1992) suggests that  there exists two other types of uncertainty, namely nonspecificity and confusion. Nonspecificity is due to lack of information and is examplified in the case of someone drilling for oil in an area previously unexplored. Information does not exist about chances of finding an oil reserve. Dissonance describes conflict between options and would be applicable if one knew they had a 40% percent chance of hitting oil based on past drilling patterns. Confusion contains potential conflict as well as pure conflict, which might occur if test wells sometimes give misleading results about oil reserves. Conflict and chances of incorrect test results must both be considered in the case of confusion. Fuzziness would occur if a local geologist stated “There is a fair bit of oil in that area”. As mentioned earlier, dissonance or randomness is treated by probability theory and fuzzy set theory can be used for resolving vagueness and nonspecificity. For cases of confusion and nonspecificity, possibility theory can be utilized. Possibility theory, developed by Zadeh, parallels probability theory in some ways but has some unique traits. Below is a short example describing Zadeh’s concept of possibility.  22 We may associate a possibility distribution with X by interpreting F(u) as the degree of ease with which Hans can eat u eggs. We may also associate a probability distribution with X by interpreting P(u) as the probability of Hans eating u eggs for breakfast. Assuming that we employ some explicit or implicit criterion for assessing the degree of ease with which Hans can eat u eggs for breakfast, the values of F(u) and P(u) might be as shown:  u  1  2  3  4  5  F(u)  1  1  1  1  0.8  P(u)  0.1  0.8  0.1  0  0  6  7  8  0.6  0.4  0.2  0  0  0  We observe that, whereas the possibility that Hans may eat 3 eggs for breakfast is 1, the probability that he may do might be quite small. Thus, a high degree of possibility does not imply a high degree of probability, nor does a low degree of probability imply a low degree of possibility. However, if an event is impossible it is bound to be improbable.(Gaines et. al [1984. p81  In this case the probabilty distribution must total one, whereas the membership function representing possibility can total to a value greater than one.  23 Proving or disproving the validity of using fuzzy set theory for assessing probabilistic uncertainty by using possibility theory is significant for determining the type of model suitable for generating the input into a fuzzy inference program. Galvao and Ikebuchi (1992 ) utilize possibility sets for inflow prediction in their fuzzy reservoir model based on long range forecasts. Many weather forecasts combine fuzziness with dissonance in short term forecasts (i.e. There is a 40% chance of heavy rain). Possibility theory is not intuitively as appealing as probabilistic methods for long range inflow predictions since the envelope of possible inflows is relatively unrestricted. Input combining dissonance and fuzziness is utilized in the fuzzy DP model with the use of state transition matrices and fuzzy constraints. The fuzzy inference model does not address the method of estimating inflows directly. Since many probabilistic inflow prediction models exist, it would be suitable to select such a model for input into the fuzzy inference model. It is not necessary to develop a possibilistic model. To further confuse matters, Bart Kosko, a mathematician at USC, derived Bayes’ s Theorem from his more broad concept of fuzzy subsets implying that probability theory may be a subdomain of fuzzy set theory. Should this theory gain acceptance, all types of uncertainty described by Klir may be handled within the framework of fuzzy sets. This is described in McNeill and Freiberger (1993 p.200).  24 CHAPTER 4: RESERVOIR SIMULATION AND DATA GENERATION 4.1 Fundamentals of Modelling Hydroelectric Systems Before a method of optimization is introduced, it is helpful to recap the fundamental concepts of reservoir modelling. The equation of continuity states that outflow and losses of volumes of water in a reservoir must be equal to inflows plus the change in volume. The losses may be due to evaporation from the surface of the reservoir or losses due to groundwater seepage. In the model adopted here, these losses are not considered. Also, outflow is either directed through the turbines or over a spillway. Spillway flows in this model only occur at full reservoir conditions coupled with maximum flow through the turbines and do not contribute to the generation of power. Power generated is expressed in S.l. units by P (in kilowatts) where y  =  Q  =  y Q H /1000  the unit weight of water ( 9810 N /cu. m) =  H  the rate of flow ( cu. m/ sec) =  the energy head, ( m  the energy developed is this power multiplied by time ( eg. kilowatt-hours). A factor representing revenue per unit energy (eg. mill! kw-hr) is then used to determine the total revenue generated. The efficiency of a turbine  , =  (power delivered to the shaft) I (power  taken from water). In this case the efficiency increases at a diminishing rate as energy head is increased. A reservoir characteristics curve expressing net head  25 supplied vs. volume of the reservoir is combined with the turbine efficiency vs. head to result in Table 4-1 which gives volume vs. efficiency. 4.2 Hindsight Analysis and Reservoir Systems Hindsight analysis is a formalized method of learning from experience. Reservoir operation analysts utilize this type of learning to circumvent the problem of dealing with unpredictibility. By looking at historical input data inflows and unit energy values for this model), it is possible to calculate what would have been the best way to operate the system. If this type of analysis is done with substantial quantities of data, patterns begin to emerge between predicted input and optimal output. These patterns will take the form of “If.. .Then” rules for the fuzzy inference model. This chapter is concerned with the problem of using hindsight to determine optimal decision strategies given various inputs to the system. Pseudo random inputs are generated, simulating several years of inflows and oil price fluctuations and then optimal outflows are determined with the aid of a dynamic programming algorithm. Dynamic programming, first presented by Richard Bellman in 1957, is a method of finding an optimal strategy in the case of sequential decisions. 4.3 Basics of dynamic programming. Most optimization problems take the form of Maximize (or minimize)  1 f(x  1 subject to constraints on the values of x  ,  x.  x)  26 Dynamic programming instead expresses a problem in terms of n stages. A stage is a discrete interval in time or space when a decision is required to be taken before advancement to the next stage. In this particular example, policy decisions are to be made at the beginning of each month, so stages are represented by months. At each stage the system must be at one of several states. The system may change state from one stage to another depending on the decision made at the previous stage. This model expresses the reservoir volume in a series of 22 discrete state values from a minimum of 350 m /s months to a maxmimum of 3 1400 m /s months. The resultant state 3 /s months in increments of 50 m 3 (volume) at stage n + 1 depends on the decision (outflow through turbines) taken at stage n. In simple graphical terms this is represented as Shiqes—> [Mouths) 0  0  o  o  0  : :  States 0 0  0  o  0  0  o  0  Figure 4.1 Possible Optimal Paths in Dynamic Programming  27 The number of possible paths through the state-stage grid can become unwieldy as the states and stages increase. Even a simple problem with 12 stages and 22 states is unsolvable when all possible combinations have to be considered. Bellman’s principle of optimization allows us to discard suboptimal paths during the problem solving process, greatly reducing the number of required calculations. Bellman’s principle says that an optimal policy is made up of optimal subpolicies. In other words, if we consider only the optimal subpolicies to get to each state at stage n, then only these are used in the formulation of the optimal subpolicies to get to stage n + 1. This principle is utilized by treating the problem recursively. The algorithm works from the last stage to the first; determining the benefit of the optimal policy with n stages remaining. Usually dynamic programming examples are stated in terms of minimizing costs but since the objective function of the reservoir model is concerned with maximizing revenue, the examples will reflect this.  If f*(i) is the benefit of an optimal policy when there are n stages remaining and the decision of state at the beginning of stage n-i is made at state i, f*(j)  =  {r(i,i + max ) 1  )} 1 (i  where r(in,ini) is the revenue earned from into  1111.  DeNeufville (1991) breaks down dynamic programming method into four activities; namely organization, formulation, constraints and solution. These four steps will be used to describe the reservoir model.  28 4.4 Reservoir Model ORGANIZATION Determining the basic structure of a reservoir operation DP problem is relatively simple. Using months to represent the various stages and reservoir volumes to represent states is almost the only reasonable arrangement to represent medium to long term operation. What is less intuitive, is deciding how many stages to include within a single run of the program. The DP algorithm was originally used to simulate a 12 month operating time. Initial conditions and constraints on the reservoir volume at the beginning and end of the run tended to restrict the optimal path such that, in spite of value and inflow inputs, it tended to rise to the reservoir volume yielding maximum turbine efficiency after the first three months and drop to meet the final constraints after month nine. Initial and final constraints were relaxed and the run time was increased to 24 months in order to more closely represent a continual process that responds to the inputs in a flexible manner. FORMULATION As stated previously, the objective function is to maximize revenue. Revenue is the product of a value of each unit of energy and the amount of power produced. Maximize Revenue in month n where revenue Energy* energy value factor  *  discount rate  Energy  =  Energy/unit outflow  *  outflow  Energy/unit outfIow is obtained from head-efficiency curve.  29 The head-effic. curve is a lookup table which returns power/unit outflow given ave. res. vol. (See table 4-1 OutfIow  =  Reservoir Volume + lnfIow  -  Reservoir Volume  +1  (mass  balance equation) The transition from reservoir volume at stage n to volume at n + 1 is the decision process. CO NSTRAI NTS Constraints are placed on the maximum and minimum outflow through the turbines ( 30 > Q > 200 cu.m/s ). There is also a constraint on the rate of fluctuation of the reservoir volume. This is simply a limitation on the number of decisions that can be taken at any state. In other words, the states from stage to stage cannot change by more than 150 cum/s -months. This leaves a limit of seven possible decisions (-150, -100, ..., 0, ...+150). There is a maximum and a minimum level of the reservoir, If the water level reaches the maximum reservoir level and outflow through the turbines is at the maximum, any additional discharge will be redirected over the spillway. Initial and final reservoir volumes at the beginning and end of the 24 month runs are specified. SOLUTION The DP algorithm is used in two ways. One is to accept pseudo random inputs and produce data that represent the best way of operating the reservoir given perfect hindsight. This output from the DP algorithm is then used as input into the fuzzy rule generating algorithm. After the fuzzy rules have been  30 developed and the fuzzy inference model has been run, the DP algorithm is again run for comparison purposes against the fuzzy decision model. In the second case, both models are given the same inputs, and the differences in recommended ouflows are noted. In the first instance where raw data is generated for rule generation, the data sets corresponding to the optimal stage-state path was used for rule generation  .  However after running several simulations, it was observed that the  optimal path restricted the data sets to a relatively limited range of reservoir volumes around the maximum head/efficiency level as would be expected. There was limited data generated to create operating rules for very high or low reservoir volumes. To expand the range of reservoir volumes of the data sets it was decided to include the optimal decision at each state and stage within the DP simulation rather than just the optimal path. This gave an even representation of data sets from all states for input into the rule generation algorithm. Concept of Value per Unit of Energy Since most hydroelectric facilities are part of a larger grid system comprising of fossil fuel, nuclear or other hydro generating stations, it is only reasonable to consider this external effect on the operation policies of the single reservoir. Donald J. Druce (1988) describes several factors which affect the potential value of impounded water. He describes an algorithm developed by B.C. Hydro to maximize benefits from short term exports of hydroelectricity.  31 The model considers expected future export markets for both firm and interruptable quantities as well as the cost of generating power by thermal sources. The potential cost of flood damage can also be factored into such a water- value model where the efficiency of generating power at high heads is offset with loss of storage capability. In the current dynamic programming model the value of water is represented by a value factor which is multiplied by each unit of energy produced. An actual representation of value factors on a real reservoir would entail considerable study and is outside of the scope of this thesis, however, an arbitrary distribution of value factors was generated such that it affected the optimal operation strategy beyond merely optimizing power output. These factors multiplied energy units by values obtained from a normal distribution with a mean of 1 .4 and a standard deviation of 0.4. Specific units such as mills per kilowatt hour were not used in this model to emphasize the concept of relative values of impounded and moving water and not strictly revenue from power generation. A practical application could use the marginal cost of power expressed in mills/ in place of this factor. Final revenue values are expressed simply in revenue units. If the value factors in this study were represented by mills/ annual revenue in dollars could be determined by multiplying the revenue units by 365. Since this study is comparitive in nature, revenue is expressed in relative terms between models.  32 Discount Rate A discount rate of .5 % per month is factored into each iteration or stage of the algorithm. This translates to slightly over 6% per year which is considered low but not unrealistic in conditions of low inflation and interest rates. The overall effect of factoring in the discount rate is small in comparison to other constraints and inputs into the algorithm. Correlation of inputs It is a common assumption that inflows are correlated in reservoir models. This assumption may appear less valid as the forecasting horizon is stretched from short term to long term. Under what conditions is it reasonable to suggest that a high inflow in month n increases the probability of a high inflow in month n + 1? If the inflows are not moderated by snowpack and the reservoir is fed by a relatively small watershed, it is less likely to show correlation between monthly inflows. For instance, many of B.C. Hydro’s reservoirs are dependant on snowpack to replenish volumes over the summer months and this allows rough forecasting of summertime inflows in January. The correlation coefficient of monthly flows was set at 0.3 and the value factor correlation coefficient was set at 0.6. In the DP algorithm, correlated inputs at stage n were calculated by multiplying the input value at stage n + 1 by the correlation coefficient and adding a random value that corresponded to the given distribution characteristics.  33 Necessary assumptions for dynamic programming 1) The return functions must be independent. In other words, the return from stage n + 1 has nothing to do with the decision at stage n or any previous decision. Although the model inputs are correlated so inflow and the value factor at n + 1 are affected by inflow and value factor at stage n, they are still independent of the decisions. 2) Monotonicity of multiplicative functions. As stated by deNeufville (1990), given an objective function of the form G(X)  =  (Xj, G’(X)] the 1 [g  (X g ’ ) > ) (X g 1 1 1 for the objective function is monotonic if for all the cases where 1 different states X ’ and Xi”. This is satisfied in the reservoir model with 1 increases to either input resulting in nonlinear, but continuous and positive increases to the objective function.  35 CHAPTER 5: RULE GENERATION 5.1 Develonment of Fuzzy Rulebase from Raw Data The purpose of the dynamic programming algorithm explained in the preceding chapter was to develop a simple model of a reservoir and simulate several years of operation by subjecting it to random but correlated inputs and suggesting corresponding suitable outputs. Experience or knowledge of the reservoir is not created by simulating its operation, only data in the form of input-output pairs. The objective of this chapter is to show a method for extracting patterns from such raw data to build a structured series of “IF.. .THEN” rules. There are two ways rules can be acquired for a fuzzy control system. Someone acting as a knowledge engineer can interview an expert familiar with the system and distill the expert’s thought processes into a more formal and discrete set of rules for input into the control system. Another method to acquire the rule base is to artificially generate rules from hard data obtained either from actual or simulated operation of the system. If actual data can be obtained  ,  this would  be preferable to that created by a computer model but in the case of a new system, a model may be the only option to create the rule base. Wang and Mendel (1991) have suggested a general method for creating fuzzy rules from data. The three input variables (inflows  -  x,  (n),  x, and reservoir level- x ) and the output variable (outflow 3  -  value factor  -  y) are divided  up into fuzzy regions with linear, triangular membership functions. These membership functions could be nonlinear but equilateral triangles with apexes  36 coinciding with the zero membership values of the functions on either side provide a simple and effective description. The difference between triangular and nonlinear membership functions is insignificant in terms of performance of the system but the positioning of the functions can have a significant effect (Sulzberger et. al 1993). There will be a comparision of systems using different positionings of membership function later in this chapter. Splitting the variables into fuzzy categories is an arbitrary process. There should be a minimium of three categories for each variable. For example, the reservoir level can be described as either low, medium or high. The number of fuzzy categories for each variable is limited by the total number of rules that one wishes to input into the fuzzy inference algorithm. For instance, the author selected three fuzzy categories for reservoir level, four for value factor and four for projected inflow. This results in 3 *4*4  =  48 rules. It can be seen that by  increasing the number of descriptive fuzzy categories for each variable the fuzzy model becomes less vague but requires a greater number of rules to be input. For each data set, determine the level of membership in each fuzzy , x ’ 1 , 1 1 2 ;y ’ 3 x ” ) category. A data set is an input-output pair (for example: x obtained from a month of actual operation or a line of output from the dynamic programming model. A rule is generated from a data set by incorporating the fuzzy category with the highest membership value into the rule format.  37 INFLOW  J 2 VALUE FACTOR fx  1 (X  1 3 RESERVOIR LEVEL(X H  1110  0.9  130  OUTFLOW (yl)  125 Figure 5.1 Membership Values of a Data Set  Example: Given the data set shown on the above diagram where: 1 (inflow) x 1 y  =  (outflow)  130; x 1 (value factor) 2 =  ’” (reservoir level) 3 0.9; x  =  1110 and  125.  An inflow of 130 has a membership of 0.0 in low, 0.7 in med-low, 0.3 in med-high and 0.0 in high. To construct the rule base, only the fuzzy region with the highest degree of membership is considered in this case. This data set is assigned the following rule:  “  If Inflow is Med-Low and Value Factor is Low  and Reservoir Level is Medium THEN Outflow is Medium.” Notice only logical “ANDS” are used in the formulation of the rules. Later the rule set can be abbreviated with the use of “OR” rules. Each rule is assigned a degree of membership which is simply the product of all the individual membership values. D(Rule)  =  PMed-Low  )* P 1 (x  LOW(X2)  PMedium(X3)* PMedium(Y1)  38 In this example the total rule membership value is 0.7  *  0.8  *  0.6  *  1 .0= 0.33 6 for the previous data set. 5.2 Structure of Rulebase As the rule base is developed by assigning a rule and a membership value to each data set  ,  spaces in the Fuzzy Associative Memory (FAM) Bank are  completed. A FAM Bank is a convenient method of mapping multiple fuzzy inputs to a fuzzy output. A graphical depiction of a 3 variable input -1 variable output FAM Bank is shown below.  H MH VALUE FACTOR ML  ‘ii, RES Id’ —  INFLOW—)  Figure 5.2 FAM Structure  Each section of the cube represents a rule as a conjunction of inflow, reservoir volume,and value factor fuzzy descriptors. When completed, each section has a resultant output value (outflow) and a combined membership value expressing degree of belongingness to the rule. The blackened out section in figure 5.2 represents the premise;  If Inflow is high AND Value Factor is med-low AND  Reservoir Volume is low THEN Outflow is...”. In this case there are 1600 sets of data created by the DP reservoir model that were used as input for the FAM  39 rule generation algorithm. This data was generated by the dynamic programming algorithm in the form as shown  Data pair 1 2 3  lnf. (cu.m/s) 120 90 114  Val. Fact. 1.2 0.9 1.5  Res. Vol (cu.m/s-mon) 1200 1150 1100  Outflow (cu.m/s) 170 140 154  Since there are more data sets than rule spaces available in the FAM Bank, there will be several data sets corresponding to each of the 48 rule spaces. Wang and Mendel suggest that when more than one data set is assigned to a rule space, the data set with the highest total membership degree takes precedence and all other data sets that suit the same rule with lesser membership values be excluded. This method of artificially generating linguistically descriptive rules from numerical data has certain disadvantages. When Wang and Mendel recommend the data set with the highest belief value (or the greatest correlation to the subjectively defined membership functions) be selected, it is not necessarily representative of the data. Consider the following situation, If several data sets had near optimal belief values for the antecedent of a rule then the output for that given antecedent is totally dependent on the degree of belief of the output.  40 VALUE FACTOR  INFLOW  RESERVOIR LEVEL H  rLH  L23l  (1.2.3J  31 ’ 1 ( 2 x [k.H  H  OUTFLOW  Figure 5.3 Three Sample Data Sets and Resulting Memberships  In the above case, the third data set with the outflow membership of one in the category Med  ,  is chosen as representative of the antecedent  If inflow  is Med-Low and Value factor is Low and Reservoir Level is Med” despite the other two sets which suggest a Med-Low output. The first two data sets are not considered in the final rulebase, only data set number three. To further illustrate the instability of this method of rule construction, consider the situation of a moderately noisy output and densely defined membership functions for the output. Rule generation becomes a random process and less apt to define trends in the data. For example:  41  Figure 5.4 Sample Output Functions A slight shift in the position of one of the output values changes the ”]and the output assigned to the antecedent. Wang 1 degree of membership m[y and Mendel suggest a method to get around this problem posed by “wild data”. A degree of membership expressing the reliability of the data set is assigned to each set. For example D(rulel)  =  PMedLoW(X1)  ) 2 PLOW(x  PMedium(X3)  m”  Where m 1 is the degree of reliability of data set one. This is similar to using confidence factors, a common technique in expert systems. The above mentioned methodology is not desirable for this particular application since the data sets that have input from the DP simulation can be seen as being all equally reliable. The following is a suggested modification to the algorithm which is analogous to determining the centroid for the output and creating a “weighted rule FAM”. The degree of belief in the output membership functions is disregarded for the rule formulation. Instead the value of the output is multiplied by the product of the belief values of the antecedent.  42  IiJIJtotal*yiI 1 J[utotal]  Output for antecedent where  =  ,UA(xl)  = # of data sets;  *  =  # of input variables; A,B,C,. .Z .  =  fuzzy category  corresponding to antecedent Consider the following example in which four sets of data are assigned to one antecedent. Seti  Set2  Set3  Set4  lnf [/1(x )] 1  120 [1.0]  120 [1.0]  115 [0.9]  115 [0.91  Val Fac [/1(x )] 2  1.2 [0.91  1.2 [0.91  1.1  1.1  ] Res 3 Lev[/J(x )  1200 [1.01  1200[1.0]  1200[1.O]  1200[1.0]  0.9  0.9  0.9  0.9  3.6  100  145  152  146  543  90  131  137  131  489  Final output is 489/3.6  =  [1.0]  Sum  [1.01  136  In the previously discussed (non-weighted) method, the output would have been 100 if that coincided with a vertex of a fuzzy category for output. This method is more descriptive of trends in data than the method suggested by Wang and Mendel but requires more calculation and memory. New data is not compared and discarded but rather accumulated into the final result. The rule base developed by the weighted rule method shows the expected trends with outflows increasing as the reservoir level, inflow and  43 value factor increase. This overall trend is not as evident in the original method. See tables 5.1 through 5.6 for results. Data sets can also be used as input into other learning algorithms such as a neural net. A main advantage of developing a fuzzy rule base is that it can be displayed in graphical form and easily inspected for inconsistencies. It should be noted that this method is suitable for continuous systems. If discontinuities or bifurcations exist in the system, the resulting rule base may prove misleading. Another method of representing an operation strategy is using the knowledge engineering approach. An experienced decision maker in the field may be able to distill complex decisions into a series of rules. These rules may also be of the form; “If A and B and C then X”. Where A,B, and C represent input variables (i.e. inflow, season) and X represents a choice of output. It is assumed in this case that the operator(the expert) is aware of all the significant input variables. He may choose to neglect some input variable (i.e. hours of sunshine) should the effect of these seem relatively insignificant on the outcome. As well the expert may choose to simplify the rulebase by combining several factors (snowpack depth, water content of snow) into a single representative factor. In other words, an FAM Bank can be constructed through raw data, expert advice or a combination of both. Often historical or model generated data does not cover all foreseeable conditions and must be supplemented by expert opinion.  45-  +1  Ii  4,  50 CHAPTER 6: FUZZY INFERENCE 6.1 Introduction to Fuzzy Inference Techniques This thesis has thus far demonstrated a way of creating a rulebase from data generated by a reservoir model. Now, all that is required is to put the rules to work by giving an output for any combination of inputs. This is done through fuzzy inferencing. No pretentions are made about applying this simplistic model to the full anatomy of a multipurpose reservoir subject to regulatory influences. A more complex rulebase would be required in a practical application. However, the rulebase should be simple enough to allow itself to be expressed in clear natural language thus making it subject to review, rejection or modification by a human expert. The final objective of the fuzzy reservoir control model is to describe the operation of the reservoir through a series of linguistically expressible ‘IF. .THEN’ rules. In the previous chapters, development of a rule base in the absence of an expert and supplementing the rule base with historical data have been discussed. Once the rules are created, a method of inference is selected to suggest a crisp (nonfuzzy) action given a set of crisp inputs. The FAM rule generation algorithm has developed the rule base shown in figure 6.1. The fuzzy outflow values are shown in the boxes. To infer something is to derive a conclusion from facts or premises. Fuzzy inference procedures require the input of crisp numbers. Then these inputs may activate many of the various fuzzy premises (or rules) which may be  51  assigned various weights depending on how applicable they are to the inputs. Finally a crisp answer is derived through a defuzzification process. Self (1990) and Mamdami (1975) provide background articles on fuzzy inference and control. The most common inference algorithms use the mm  or “hard and”  operator to find the conjunction of the membership functions of the premise variables. A combined output function is created and a crisp output is calculated by finding the centroid of this combined membership function. VALUE FACTORS => LOW ML MH HIGH 0.9 1.15 1.4 1.B5  LOW RESERVOIR LEVEL  MEDIUM RESERVOIR LEVEL  HIGH RESERVOIR LEVEL  LOW INF  L  L  L  L  MED-LOW INF  L  L  L  ML  100  MED-HIGH INF  L  L  I  ML  140  HIGH INF  MLML  ML  ML  200 6O  LOW INF  L  L  ML  M  MED-LOW INF  L  L  ML  M  MED-HIGH INF  L  ML  ML  M  HIGH INF  ML  M  M  M  LOW INF  MLMLM  MED-LOW INF  MHMH MH MH  MED-HIGH INE  MI-IMH  H  H  HIGH INF  MH  H  H  H  Figure 6.1 Summary of Generated Rule Base  MH  52 Two of the most widely used methods of fuzzy inferencing are the max mm  and max-product methods. The max-mm  method truncates the membership  functions of the output variable to form trapezoidal shapes for a further max operation. The max-product method scales the output functions to form triangles with vertices equal to the conjunction of the premise functions. inflow  outflow  reservoir level ed res  low res rule  low  A’oufflow  -‘  2  input for inflow  res input  Ir I i centroid  rule 1— if ml is med AND res is med THEN out is med rule 2— if mt Is med AND res is low THEN out Is low MAX- MIN METHOD  inflow  outflow  reservoir level  low res  low  AuI?’oufflow  rule 2  input for inflow  res input  rule 1— if ml is med AND res is med THEN out is med rule 2— if mt is med AND res Is low THEN out is low  MAX PRODUCT METHOD -  Figure 6.2 Two Fuzzy Inference Methods  I centroid  53 For computational ease, the max product method is used in this study. This is a simplified example in which each premise leads to different outputs. When there are several premises that correspond to the same output level (ie. med) the mm  membership values are accumulated and the sum is multiplied by  the moment and area of the corresponding output function. This procedure is repeated for all output levels and all of the factored areas and moments of the different level are summed.The resulting sums of output moments are divided by the sum of the areas to get the centroid which is the crisp output.  For example. Ua 1.11 mm rule 1  mm  rule 3 outflow  Figure 6.3 Overlapping Rule Conclusions  In the above diagram, rules two and three both lead to the same conclusion (i.e. med outflow). There are different methods of incorporating a suboptimal rule such as rule three. One method is assessing each rule individually and finding the max output activation over the support set of x as is shown by the thick outline. A second option is to sum the vertices of the scaled  54 functions for each output value. In the above diagram, this would be done by summing vertices of rule two and three and multiplying the sum by the moment and area of the med outflow membership function. This creates the potential for scaled membership functions with values greater than one. The latter method of summing the vertices is utilized in this paper due to the computational efficiency of performing simultaneous operations on rule premises that correspond to the same output value rather than handling each rule individually. Also the latter method uses information from all fired rules rather than just the maximal mm  values for each output descriptor level.  A flow diagram of the inference procedure is shown in the following diagram. A 10 is the sum for all the premises leading to output low of the confluences of the membership values. The moment and area of each membership function for the output must be determined before use in this procedure. This is a specialized example of a fuzzy inference algorithm since it describes the case of premises of the type  “  If x 1 AND x 2 AND x THEN y 3 . No 1  premises utilizing “OR” is used in this inference example.  55 INFERENCE SUBROUTINE Input one set of crisp values for Inflow, val.tact. and res. level 1 A  =  OW + +  p [res_is_lowj fl p Lval.fact. _is_low) fl pliaf_is_lowi p (res_is_low) fl p _is_low) fl p[inf_ls_med_lnw) .u(res_is_IowJ fl p(val.fact. _is_med_IowJ fl p(inf_is_Iow)  +  +  for all premises with conclusion low)  Also find Amed low: Amed and Ahlgh high  outflowcontrol moment=  ihigh  Z.  l=low  A  outflow  A.  outflow area.  momentS  I  ithigh outflow control area  outflow control  =  Z.ij011  I  outflow control momentj outflow control area  where outflow moment. the moment of the 1111 membership function for outflow and outflow area the area of the i membership function for outflow Figure 6.4 Inference Algorithm  The maximum potential value for A 1 is 4. This does not imply a multiplicative effect on the output value but rather a skewing of the centroid of the output towards the vertex of the output descriptor that is fired most often. This will give a crisp output for one set of crisp inputs. The inference model can be used as a subroutine within a mass balance program that will update the reservoir volume by adding the inflows and subtracting the outflows for each stage. With this routine, comparisons can be made between different  56  rule bases and hindsight analysis can be used to see if membership functions should be adapted. NUMBER OF RULES To test the significance of the coarseness of the rule structure on the output of the inference algorithm, a second rule base consisting of 100 rules was developed by the FAM rule generator from the same sets of data pairs as in the 48 rule example. The 100 rule set consists of 5 inflow, 5 value factor and 4 reservoir level descriptors. The outflow support set is divided into 5 descriptor functions. All of the membership functions retain a symmetrical triangular shape with vertices corresponding to boundaries of adjacent functions. Examples of differences between the first and second rule sets are shown in the diagram below.  48 rule set 0.9  1.4  1.G5  MLMMHH  I 100 rule set  1.15  >000<  60  90 120 150 180  INFLOW  ll.  1.1  1.3 1.5 1.7  VALUE FACTOR  Figure 6.5 Differences in Membership Structure between 48 and 100 rule sets.  57 Sets of value factors and inflows, each serially correlated as described in Chapter 4 are fed into the inference algorithms for both 48 and 100 rule sets with the results shown in tables 6-1 through 6-4. It can be seen that the outflow decisions are very close by the parallel paths of the reservoir levels. Expected revenue units are shown in the brackets. The 100 rule set is often offset at a slightly higher level than the 48 rule set. This can be attributed to a coarse definition of reservoir levels in the 48 rule set. When only three membership functions are used to describe a range of 16 or more states it could be expected that imprecision of one or more states should occur. The general effect of changing the number of fuzzy descriptors is not very significant unless the number is relatively low. The results of the inference model are then compared against the crisp DP model which has perfect hindsight over the span of the 24 month cycle. In other words, the inference model is idealized in the sense that the predicted inflow and value factor for the next month is correct whereas the crisp DP assumes perfect prediction abilities for a full 24 months. These are shown in tables 6-6 through 6-10. The revenues generated by the fuzzy model and the crisp DP model are both compared against a steady volume model in which inflows equal outflows subject to constraints on maximum outflow. The steady volume examples maintain the reservoir level at near maximal efficiencies but ignore the effect of the value of water. Robustness of the fuzzy inference model was tested by changing the inputs in only a few months and rerunning the model to see what the change in  58 response is. The fuzzy model moved from its original path in proportion to the magnitude of the changes as would be expected. The sensitivity of the crisp DP model to changes in inputs was not easily measured since the optimal path may remain identical until a completely new optimal path is selected. For an example see table 6-1 1. If a low head reservoir was being modelled, the resulting flat optimal surface would increase the sensitivity of the crisp DP model while the fuzzy inference model would still behave in a similar manner. Robustness is desired over optimality since it only uses extreme states and policies for extreme inputs. A model that emphasizes optimization may recommend maintaining very high or low levels in order to obtain a slightly better output. This is usually avoided in practical reservoir operation by maintaining target levels and minimizing variations from these levels. The fuzzy inference acts as an adaptable rule curve by acting upon forecast inputs and current level without radical fluctuations. This moderation is due in part to training by correlated inputs and the interpolating nature of fuzzy inferencing. As an additional note, the fuzzy model still gives better results than guesses without the aid of a model. The robustness of the fuzzy inference model was further tested by disabling 10 rules from the 48 rule set. The modified rule base is shown with disabled rules blacked out.  59 VALUE FACTORS => LOW ML MH HIGH 0.9 1.15 1.4 1.B5 —  LOW INF LOW RESERVOIR LEVEL  MED-LOW INF MED-HIGH INF  El  El  HIGH INF LOW INF MEDIUM RESERVOIR LEVEL  :IMI  MED-LOW INF MED-HIGH INF  Ll  HIGH INF  HIGH RESERVOIR LEVEL  MH  LOW INF  ML  MED-LOW INF  MH MH MH  MED-HIGHINF  MHMH  HIGH INF  H  H  E  Figure 6.6 Rule base with disabled rules blackened out.  The results from this partially disabled rule base are shown in tables 6-12 and 6-13. It can be seen that the decisions are consistent with the 48 rule inference model. Thus it seems that it is not necessary to develop a complete FAM to achieve good results. The significance of this becomes more apparent when models requiring more rules are to be created. If, instead of 3 input variables, there were 5, the number of rules to be input might exceed 450 to 600 rules depending on the  60 coarseness of the membership functions. Instead of expressing each rule explicitly, a suitable model may be created with only two thirds of the full FAM set.  ;.:Z  -  I  .:  t  :  :-  :::t:  :  t  r--  t : * I 4 .:.::t: :::E-t H::: ::: -;:$ :::::::t::::::4 r rt  4:::  S  •  t.  s” 5  -:::  k S.  4  a. ••Sc  ••k••• ••••k\ ••%  S.  5  :  _+_  S  ......  S S  S S..  *:::::::::  t  S S  s  S  hsss4..  ..  ..  :S!  (61.c[) eini ooi.  ::::::::::::  s S  S  S  S  S  s S  S  4  : i * t t t:::: :::*:::; -:>: .;::4  S.  S  ..  _  •  ••  .  9I : •  :  S  t-  Ej4 :::::::::  t  --  4  :--  :::  4  :*::::::::::::.::::::*::::v:::F: : ,  I  t S  S  ..J  L S : S  : S  “S  I S S  S S  *J  S  A..  t..  s S  s  t++  ::<t :  ::::--  1t  z  : t --  S  S  S .S. S s S  sl S  S .5  S ::::::: 5 s S +  S  :  —r—r•—i  S  s S  S  I s S  : S S  t S S S v:: :5::  S  s S  +....L 5  S  * S  S S  S...  •S  S  S%...t..  s S  +.  A  S  ..  4 s S  S s S  S S -5”  ts””r S S t ..  S  S  ..*4..a.  S.  ..t.  S  * S  ‘J 008 098 006 096 000[ 0901- E  S  ‘  CD  S S 5 5 S s S 5++”.fr”5.*&”.5&”””  5”  •f”*-’•  S  :  1  Th  t 4  :t:L  r  S  s....  rr  t”s 4 S ......  4 s S  4 s S  s S  S r  s S  r t  S  S  •t  S S S  :-  k  S  5  S  .s..  t S S  S_  4• *4*  .s  S  k-” ••• S  r*r.t S S t S S  *  S.  S H::. :: S S S  S  S  5 S  :ikt  c*4Wpr  \L “S.  I  A  k4 4 •.L  s  S I ::v.;A:: :: :J1t  ‘-•-•  S S  ,  S S  ...  :;  •  zo=enueAebulooueiewa% (60€ Ueini g Azzni  sqjuoj  O89[14[OL8 IZ 6[ :::t[ £[j€[ [1-r6 :----  Y  S  k S S  S Y_fl_* S S  A  ES S S  “S””S”•’•S””V•”$ S 4 5 5  •••S•••• 4  S  S  S  4”. *kfl””S*”fl” .S””.•_-.•...4-.•  ”:::;:::::i t : 5 i  f  91O Q  tr  091-[’S’ 0OI.  S  5  5  5  +.  5  5  5  5  0081L  4.”  D Uit4 — nnni  00171-  eqej.  -g epow eirn 001. SA epow eiw 9j7 Azznj  lit  2  ‘-- ---::------------:-  t  :----.. .  4  ..::  •t-- :::::  :  ...  4 4  ---7-..;  -  * 4  I 4_.  .. _r**  4  4  ‘-+•‘-+‘— ——  *  4 4  4  1  L— I  1444  $  dS%  L  :  4  4  I t.  I I •t__4  *  4  I  I  .-i:.:!..t:..::. -  $  1 ‘—1 4  ,.S  &  I  I’  I  4  4+  ::::-::.  ::.:-t  4  1  I  4 5  tt%N  •?  ,,—-.  I  4  I *  I—  I  -  *  I I  I  *  rr”*  I *  I  I *  -I I  4  I  I  I  I -I  :::::  * I.’ *  :::  I * *  1 I *  *  ::::: -:3-:: 1 E:::*  I  :;  * __4__  I 4  4P t *E 4  __  1 *  *  4  ,  *  *  1  *  *  I 4  I 4  *“  r  <fl  k  I  :: .  *  4  ‘k’ 1  1 I  1  .  4  I  4’ I I  r%,  t  I I  El  *_%I<  *  * S  ÷——  ‘4  -  * . I  I r  I  I*4 I 4 4  4 I  4 1 *  4 4  —p  -  *  *  4  *  4  4  *  .::4:: I  fl-V:.4:::::: *  *  .4 *  A  3’S%fl4fl  I  r—r—t t 4 *  4  1  : it± I -t.  .+  -  4 4  r  I  ETTh  :4::::::::3 :EZE:::- :::4::* :::::;4  *  I •  ‘  I  4  +  .::. .  *b I  —1”<•-—4  1 •  4  I  :  1 1  --It  I  ‘  —  ttI 1 ‘lI 4 1 4  I  r  \t\  -  4  4  ———‘•-r—  4  I  _$_  1+  .-•; -  *  ::::  ‘3\j  -:-.  I  I  I  :  .  *  *  —  <  •+  -r-  :  I  t  --  1 I  S I  *  :::::::::r  •:  4  I  I  —— — t:.:.:::t :::4: I 1 4  4 I ‘•r÷  I  > ::::  ::! ::,:;:4  I  tttitlnti: H  I ::::4.  ;:: .7.: A:.  I  i—F +1  —  : 4  S  qwI  I  S 4  I  I  ai—H : ..  ::  :  4  *  I. *  I •*::I* :::r:.:--3:. I * 4 1 * 4 4 4.. I  V .d  :r  :!:r  —-4  -4  —4-—  t  4’.  4-  4-  4-  ‘• 4 -  -  4k  : :r 4  4  4  4  4 4  E -:  a  a  4  4  4  :::: :  4  ‘4pfl —7 k  —.3W  :::  :  r”r *  ;i  ::::  *  rt *  I S  .1  ..  2  ....  t  _..  ! ! 5  :  *  t__  *.....:.*.. .;*::S  t 4 4 *  F  ....  * * . ..3 :  *—  * *  •* * *  *  —  —  .-  *.  —.  4&  —t-  •I  I *  * *  -,-t 4  *:  *  * *  —  * *  * I  I  *  r  •t•*  —r  * t-  *  * *  *  ‘  I *  I  *—t—r—  *  *  I  I  —  1  * *  4  ,___*_  *  J z :  -i--a  I *  * *  *  *  ‘r”rt  I  .&&aL—— I  *  —,——  *  I I * *  *  * * *  * *  4  *  —  *  *— *  —  *  i * * I  I * *  * *  _3 — *  :  +,  “—  *  * * — *  —s——  * t  *  *  k_1__t_ * * I  a,  *  ..  I  *  :  I•  :  .  I  *  I  i_I  4  4  *  *  4  I  -1-4 I  1  4*  *1  *  *  *  *  *  Fuzzy 48 rule model vs. crisp DP model Table 6-5 a t 4  t—  1300 1250 120O ..1150 1100 1050:  a  rr  :.  :::::::::;:  I ‘4  ::;;:::  ::::;  *  ‘t4  ————  rr  ::  i  I  tee  .  t  ***‘-  .;  ——t—.+,.  1  $  u  iooo •  3U)  :3: : JJ:H  950 900 800  4 -S—  :zz:: :*  44  r  :  1  $  *  7 9 11 13 15 17 1921 23 3 5 2468 10121416182022 Months  fuzzy 48 rule(1251) 4- Crisp DP (1308)  % Difference in Rev, crisp Fuzzy = 4.4: -  —)4E--  Steady ‘JoL (1209)  crisp Steady Vol -  =  7.6  /  LL  fuzzy model vs crisp DP model f$  1400:i 4fle  •  EIoo  g1300 115 1250”  Tnkina  I QIJIU JJ  4 ts  IEEEEEEEEEEE! *  ‘  I  !  ::: z::  1150 1100 2 1050’ Q >1000•ö 950’ 900 <j&  *  * I  * *  *  S  t  ‘  1• *  4 t I  t  I  4  4  k  4  I  *  _3’  4 •1•  *fl4  4  4  4  I  4  4  4  *  4 %‘r  t  r  ‘“1  I  *  4  t 4 flTt  4  4 1t  I  *  I  1  4  :.4:::.:4:.....r...... 4 4 4 4  4 4  H  titirir  4  4  •  t  4  f  4  4  I  4 4 I  *  I  I I  4 t 4  *  t  : t-. I I 4  I 4  4 4  *‘r :,t  t :,  •  4  4  4  4  4  4 +  4.  4  ‘4  4.4.  ..4  4  4  —  —*  4  aSs  4  4  4  4  4  r S I  #  4  >e  1  *  1 4  *4*.* 4 4 4 4 4  *  4  I  I  *  4  I I *  :.::.t::::H•::  4  4 4’  :  4  ‘4  4..  4  4  4  4  4  *  4  4  4  .4  4  *  4  4  +4*+  4  44  4U*1f  9  -a— crisp model (1324)  4  :!  4  :Z4:::4<4:::t::  24  %  4  rc” 1 4  4  I  4 1-%&.  t  t  *  ::  4  4  ‘  t  t  4  -  I  .::.  4  t t  ;  4  t  4 4 4  t  *4*tk.,*..r*r.  t t  4 ...S,,, 4  L  i..—t4  ::  #___4  S  :  ‘—  I I  :  I  t__  r-b-t  “  6 —t  8  11131517192123 10121416182022 Months  fuzzy 48 rule(1 309) —*-- Steady vol(1 214)  difference in rev, crisp-fuzzy  =  1.1: crisp- steady vol  =  8.3  F::E:::::::H  ::tH:t  :  t  S  S  I  S  FM&__*  S ‘  I  S  :•  t  J  .  “‘  :  :;4:;::::::::  1  I.’ I  S.  S S  k.. 4 S S  S  5  S  :  :  ::.::+:: :: *  4  ;.::::::::::  ::::*  :  4  S.4.. 5  .$  _4  sS  r  S  J.  4  S  * •  •  ,.t  S  5 I  t  —rr  S  :::;::::.:  .  :>  S  t  ..t...t. 5 S S  t  S S  S •—  -  *  .5-  ‘  ;  L:tuit::H £,_*_t_*  5  S  I, F I  I  S  S  S  F__I L  _  k#A 5 4SSb  S  S  k  S  I  S  ‘ ‘-  —  I S  S  &  S  S  *  -  S  I  I -  S  S.  S  I  S  S  S  -S  4A 4nsf.*4jS_  FL  ‘5.5  :.S:::. :I:: :I  :::::  *•  S  S  <  -. -.  S4aS.L  4  p  S  S  S  I  I  S%’kt\  I  S  t-+--b.--S.- I Stc&\ I I S I S S S  S  ..! S  4 ___  I  .I:::::*:EI;.::  I::  -ZEf:  5 S  5\ S  :I  I  :E: Et1E1:E:_E::T: r  L*E:*J::EE:f:E: -  I  5W4S • 4 ’ ?5V)*  +  S ‘“$  :::: S  J_  t  I  S  :--tt. !:_T*L_  r  _S_&_*__!_ L  sn  S  S  S S  I  ir  1$*  ‘N$\  S  --  F  : :— r is I::::i:ij:z::  ..::::.::..::  .;  f  t ::::::*.<::.:.:  :t::::::4:::::::4;....  S  44  S  ‘<  -P;5 :::  I  S S  S  r  4’  :  ::tyr:;: :  ::  4 *——.at—  :  S —  .s  ‘:  S  S  ::.S::;-  ..& S  •  S  .•  ::::;:::  _4  $f?A  S  S  %  5 S  5  5 S  S  ..  5  5  S  S  *;t  • . :::  ; ::::...;  ——  s:  •::••• •  ‘  .4  :  :J  4:.::?:;:.f.:: —  t  •>  ::;.::.  5  5  S•+  r: : : : : :  :.,  ••  +5  +  S.  -  .“  ** 5  .  .  S S  S  S S  S  S S  S  S  S  4 4-- S  H  :  ;•  5”.  : ‘tt S S S S 44+ -::.:.::::SN::..-E .4 . 4 4-e$ :j  zjtz 5 !:i : r”--  k--$  ...  5  :  !t [  :‘  -t4ê.-4  .  :S;.:4:::>II4. 5 5 5  %5 : S:EE: :5 : ::-::> r” 5 5 5 5 5 S S S S S  !L: i*i*i  t 5 :  e-  I  t S  :I .  :::::J2g’f::;c;  S  :I:  :  s  :1  :  H:  . ï :V :  I  ,‘  .:i:  .  flI@  *  s 5 ‘•Z  5  4 1•  S  ..:S;::.:r**  I  •  55  : .  ; flñ4iwFHThtIm  *t I ;  ---4 *  * *  *  4  .4  *  * 4.  4  4  t....*. 4 .4 4  4. *  4  ......>4..4 .4 4 4  4 * 4 .&...* 4 * 4  * 4 ..4.  4  4  -ç  4  *  .:• .  4  4  p  *  4  4  4 4.. * *  S * .4. 4  * *  * *  4  *  * *  4  4.  4..*.,.....,.  * *  *  * *  * *  4. 4.  *  *  4.  4  *  * *  4 ..4...  4.. *  .*.....*  *  4  ..t.S.  4. 44. 4. * 4...* * *  A  : ;  :  I-  ).  1  ‘  ‘—r;  :::  I-!  :  “  -4—  4pEzz •  et--  .::  ---—,S  ---  :;  :t: 4—  —1-—  :  2-—  I  4—  .._.  •::::: •.  :  :::. :I: -4  :  —  4—  _  •____  -r  :::  :::  ;  ::::  :  *:  :  :.  t  :  ;  :  : r :*: :: : ;r:!  :  ‘*L t t-  .:  —*  di  42 trraw  :  —S.,  zrL  ‘  t  4  -:t  L  c  <t$J  4fl  t t.•:.  $:‘s: k4’à  -s  t  •  :  •‘: g.  .  :::I  .a  ‘W  P  s  —-i—  —4 *4  --  1 4  — 444 *  4  4  4  T_4_J*..T__t 4  4  4  4 *  € *  4  44  t’-$ 4  *  4  $s:  4  ;4  4  *  4  v4—  * 4  4 *  *  4  *  ‘v— 4  4 * 4  4  44  r4  4 *  *  .:4H: *  —  \  4  4  : ::::::::4:::::4::: *  L *  :  *  *  *  •  .  Robustness of fuzzy and crisp paths Table 6-11 (months 3,4,5 & 11 modified)  -•  I 4 t I  .  :::.::::::::::4:::::::-  - :E:  —  S  :::  :N::::::rt::e  •  ::c:::4  ::  •.  •  g  :::::::;  :-:::  •• :s:t  •t  H:  •:  •  •  •:r::—::-::  :-:-::;:r.  t *  r—r%—— t  .,  -vt-I  —  t  $  —C  1150  :  .-:  * ,,#•t——— 4. $ )_  r’:  r  ‘%“  v  r—--e--—  —,--  y  -t  v  Irr  %  ;  i  -i\kfr  i— -  * 4  --i-i  -:  --  -  ‘--  -  1050  iooo..; 950 900 850 8cx  +  1  1  .1  3W5  L_1ifl1f1i411ilit  4  .It4iL 1.....  1  ....AiML.1  I  7 9 i 13 15 1719 21 23 24681012141618202224 Month cnsp#1  —  crisp #2  —*—  Fuzzy#1  Fuzz\I#2’Ja  Crisp DP results are the same in both runs: Fuzzy Model adapts to changes Value Factors lowered by about 20% for above noted months  ::::::::::  S •-  t,,t:  1.  1’  -  3  t  * ::  *  —‘  k.  : - -  -  :  -  t t*-  :  *_4_.kt._ 4 I I  S.  ..—  $:::::-::4 : ::  I  I  I I ••  ..  I I  4 L t :  :4  .4 4 *  -::::::.  .*..t. 4  :  •‘.. S  :::  :  -  \  L  ..  .  t  )  “  I  t’94,’”’  r  V  I  I  l  C  V’  I  I  *  :  *  -  I I •I  I.  I I  I  4  1  r*”t  4  *  ,  I  I  I  -:  -  I  •I+  I I  r  •  -  I  IIIL:  -:  t  ..  I  4  3  -::  4  t  .3..  ..  :  -:  ..a  .I..I._..t....  ----  :::::::::::::::SS:::.::  .3  -a:  :.  - $: -  :-  I  ...$  .4...t 4 ..  ::•-;  a :1:::  1  __.I___•.__— 4  I  4 1  1  4 4 4  I 4  4.  ,  I I  .3.4 :3-  I I.  -  I:-:::--::-  I”I  4 .7  ....  —  -  7  4  I  .14..j..I. -I  1 4  .4  t I  ..  I 4  I  r  I  -  :3-::  :-:k  -  4  I I  -  1  —,  4  I  I I  I I 4 r——v 4 1 4  r  4  I —i  4 *  4—  4.  I  I ,  4  —  I  4  4 4  4  ,—  I  7  :1 4:E L  3  74 CHAPTER 7: FUZZY DYNAMIC PROGRAMMING 7.1 Introduction to Fuzzy DP Fuzzy set theory is not restricted to models based on fuzzy inferencing as shown in the previous chapters. Since proponents of fuzzy set theory consider crisp sets as a subdomain of fuzzy sets, then it would be expected that crisp optimization techniques could be modified to suit fuzzy sets. Some of the applications explored in publications include fuzzy linear programming, fuzzy goal programming and fuzzy dynamic programming. The extent to which these techniques can be fuzzified vary from expressing constraints and goals as membership functions to fuzzifying states and stages in certain fuzzy DP applications. However, since too much fuzziness in a system can reduce it to a mess, it is helpful to use crisp sets whenever possible. This chapter will discuss a simple reservoir model based on fuzzification of the stochastic dynamic programming algorithm. Fuzzy dynamic programming adapts to uncertainty in a different manner than fuzzy inferencing. This method allows stochastic treatment of inflows and fuzzy treatment of constraints and goals. The states and stages will remain crisp in this example. Zadeh and Bellman (1973 ) first described a multistage decision process that accommodates fuzzy goals, constraints and decisions. The reservoir problem can be treated as a stochastic system in a fuzzy environment with a fixed time of termination. In this problem the goal is to achieve a desired reservoir volume at the end of the forecasting horizon, say 5 months. This goal  75 is fuzzified to represent wishes of the operator to achieve a desired volume and the willingness to accept a nonoptimal result. This fuzzy DP operating method is much like creating a fuzzy rule curve that accounts for stochastic inflows and uses fuzzy and crisp constraints. A rule curve is a plot of recommended reservoir volumes over a time period. Usually these curves are represented by a single line or one target volume for each point in time whereas a fuzzy rule curve implies that there may be several acceptable volumes at any one time with varying degrees of preference assigned to each. A fuzzy rule curve is shown in figure 7.1. A membership value of 1.0 at a particular stage, represents the most desirable reservoir volume to maintain. Membership values of 0.0 put upper and lower limits on the acceptable volumes at different stages. During certain months, for example, flood control capacity may take precedence over power generation or recreational needs. Such tradeoffs can be represented accurately by a fuzzy rule curve. Res. Vol. 1300  Fuzzy Goals Staje by Stage Example -  .0.0  1  1100  Jan  Feb.  Mar. Months  Figure 7.1 Fuzzy Goals  Apr.  76 Desired outflows from the reservoir may be represented in fuzzy terms as well. Factors affecting outflows may include downstream water levels, navigation and ecological/fisheries requirements. In figure 7.2 examples of fuzzy constraints on flows are shown with a membership value of 1 .0 representing the most desired outflow level and 0.0, an unacceptable outflow decision. Example of Fuzzy Constraints on Flows  Flow  0.0  Hi!Jh  Jan  0.0  Feb.  Mar.  Apr.  Mo nths Figure 7.2 Fuzzy Constraints  As in the crisp DP model, states represent the various reservoir volumes , x 0 and stages represent months. The states are denoted by x ...x,., where x 1 0 is the lowest volume and x. is the highest volume within the set X. The stages are denoted by subscript t. 7.2 Nonstochastic Decision Making Given n fuzzy goals and m fuzzy constraints, the decision is the confluence of all.  77 D=GlflG2fl....flGnflClflC2fl 0 or in other words p  where PD’  MG’  =  1 PG  .  flCm  fl PG ••’ fl Pn fl jil flp2... flpm 2  Pc are the membership functions of the fuzzy decisions, goals  and constraints respectively. Figure 7.2 shows constraint membership functions for each stage which may be the confluence of several different constraints, both crisp and fuzzy. , 1 In sequential situations, the inputs (or decisions) uO, U  ...UN1  gives the  membership function of a fuzzy goal at time N-i Max  =  UN1  (PM-i (uNi) fl  PG  (f (xNl,uNl)  xN-1 are states analogous to crisp dynamic programming.  where xi, x2  f(x, u 1 is a function that represents the state  for xgiven an input u.  By introducing the recursion of dynamic programming to this equation from the last stages to the first we get pG(xNU =  Max  XN.U+1  f(xNU,  whereu  =  uNU(p(uN..U)  fl PG(xNU+i))  (1)  UNU)  1  7.3 Stochastic Programming Bellman and Zadeh (1973) state that the objective is to maximize probability of attainment of the fuzzy goal at time N, subject to the fuzzy constraints C , 0 GN given state  ...,  xNl  . The conditional probability of attaining the fuzzy goal 1 C and input (or decision) uNl is a function of the probability of  78 attaining state  XN.  In the case of a reservoir, the probabililty of achieving a  volume x in a month’s time depends on the current volume, the outflow decision and a known probability distribution of inflows for this month. Prob  (GN  xNl,uNl) =  EPGN(N)  XN P(XNiXN1, uNl)PGN(N)  =  Expressing this in terms of equations (1) IJG(X ‘-lG  fiG  =  Max  N-u+1g XNU+1,  XNU  fl E,ii”’ (xNU+ 1))  UNU(PNU(uNU)  — —  XNU÷1  j I, ,-.I-v t-’ N-u+1 I N-u’ 4 ‘N -u’IG  ‘  N-u  m describes the fuzzy goal membership function at t  by the fuzzy goal at  t  =  N  -  u+  1,  u=  =  N  -  ci induced  1 ,...N.  In the reservoir model to be described, the expression, PNU(UNU), represents the membership function values of the decisions. Example: Given a reservoir system with four states (volumes, O  ...  1 t stages (months,t ), and two decisions (high and low outflows, 2  ) 4 U  ,  two  1 a a 2  probability transition tables are created based on the known inflow probability distribution and laws of conservation. The decision values are not represented by fuzzy sets but crisp numbers. This provides a crisp probability table.Losses due to evaporation were not considered in this model.  79 Table One: u decision  =  Table Two: u,  =  decision  low outflow (say 100)  °  a.,  2 a  high outflow (say 200)  1 xt+  1 xt+ X  =  =  3 U  O4  2 U  3 U  4 U  X  0i  0.5 0.4 0.1 0.0  1 a  0.9 0.1 0.0  0.0  °2  0.1 0.4 0.4 0.1  2 a  0.7 0.2 0.1  0.0  3 j  0.0 0.1 0.4 0.5  3 a  0.3 0.5 0.2  0.0  4 U  0.0 0.0 0.1 0.9  4 a  0.1 0.2 0.5  0.2  °2  The tables show the values p(xt+i  i  x, ui). For instance, the probability of  at time t+ 1 is 2 3 at time t to reservoir volume a going from reservoir volume a 0.5 given the decision is made for a high outflow. If a low outflow is chosen then the probability for the same state transition drops to 0.1. The rows of the tables can be interpreted as rough probability distributions showing what the most likely future states will be. Assuming a fuzzy goal at the end of stage two is PG  (a,)  =  0.2  PG(U2)  =  0.6  PG(U3)  =  1.0  PG(4)  0.7  it is desirable to have the reservoir near full but not at maximum level at the end of stage two. We can also specify constraints on the decisions.  80 These constraints show the operators preference for a lower outflow in the first month and a high flow in the second. Now the conditional expectations 2 (x are determined. 0 E1J ) with the formula:  E,uG0+I(xNu)  =  XNU  p(xNU+1  N-U uN.U)PG(xNU+1)  xl  1 U  2 a  1 U  °2  3 U  4 U  .44  .73  .81  .73  .24  .36  .56  .78  where p(U , 1  1 a  =  0.44  =  0.5*0.2 ÷ 0.4*0.6 + 0.1*1.0 + 0.0*0.7  This is the product of the fuzzy goal and the probability distributions from the state transition tables. This table of conditional expectations can be seen as quantifying the most desirable decision given the existing state after stage one. For instance, if 1 (which is the lowest volume) it is suggested the reservoir is closest to state s by this table to select decision  1 a  (low outflow).  We must also consider the constraints and the effect on the optimal decision PG(xN.U)  ) 1 PG(  =  =  Max  0.44  uNU(PNU(UNU),  JiG  E/JG’’’(xNU÷l))  (u2)— 0.7  ) 3 IJG(U  =  0.7  ) 4 PG(  =  0.78  81 This is a result of finding the intersection (mm) of the constraint functions and the expected values for each decision and then obtaining the union (max) of the decisions. This is one complete iteration and the fuzzy goal obtained in this last step [IJG’(ul ...4)] is used for determining the new expected value table for stage one. Eventually the fuzzy goal for the starting stage is found. The optimal path of decisions can be traced after the final iteration is completed. There have been later extensions to fuzzy dynamic programming such as fuzzification of the system itself which accommodates noncrisp states or stages. This is not applied in the following example. 7.4 Reservoir Fuzzy DP Model For the fuzzy DP model the state transition matrices are sized at 13 X 13 giving state volumes from 1400 cubic meter/second  -  months to 800 in  increments of 50. There are four of these state transition matrices to represent each outflow decision (50,100, 150 and 200). The conditional probabilities are calculated based on a projected inflow normally distributed with an average of 109.6 and a standard deviation of 55.3. The probabilities are rounded off to one decimal place. For an example of state transition matrices see table 7.1. In defining the number and size of state transition matrices, it can be seen the problem of dimensionality in fuzzy DP occurs at this point of development of the model. In this example, since only one distribution is used, there is no distinction between the inflows for each stage. A more realistic model would utilize a different set of state transition matrices for each stage  82 since each monthly inflow would most likely have distinct historical characteristic. With only four possible decisions, and twelve different distributions, a total number of 4X1 2  =  48 transition matrices would be  required in such a model. Also information dealing with expected inflows can be used to modify the probability matrices corresponding to the most immediate stages. If for instance, snow pack data and weather forecasts suggest that a higher than average inflow for May will occur then the probabilities for the transition matrices will be modified to suite this data. Modification of probability matrices would diminish as the forecasting horizon increases until the matrices for, say, five months in the future would be strictly based on historical data and not affected by forecasts. A distinct disadvantage of fuzzy DP is the sizeable computational effort required to develop these probability matrices. Another consideration is updating the matrices as new inflows are recorded. Correlation of inflows is not considered in the fuzzy DP algorithm. The two dimensional array for constraint membership functions have rows corresponding to the number of stages in the operating horizon and columns for each decision. This example has five stages and four decisions.  83 FUZZY CONSTRAINTS Month (in future) 5 4 3 2 1  Decisions med-low med-high 0.7 1.0 0.8 0.9 1.0 0.7 1.0 0.8 0.9 0.9  low 0.2 0.4 0.7 0.7 0.6  high 0.2 0.3 0.6 0.4 0.6  Choosing the values for the fuzzy constraint membership functions may be a complex problem in a multipurpose reservoir, but a sensitivity analysis can be done by altering the constraint array and rerunning the problem. The fuzzy goal for month five (the month at the forecast horizon) is selected as: Vol. 800 850 900 950 1000 1050 1100  Value 0.1 0.1 0.1 0.1 0.3 0.3 0.3  Vol. 1150 1200 1250 1300 1350 1400  Value 0.4 0.8 0.8 0.8 0.8 0.6  Below is an example of an expected probability table which is created for each stage.  EXPECTED VALUE TABLE decision stage 1 2 3 4 5  volume 800 850 900 950 1000  low .12 .14 .17 .23 .30  med .14 .17 .23 .30 .37  high .17 .23 .30 .37 .44  v.high .23 .30 .37 .44 .52  84 6 7 8 9 10 11 12 13  1050 1100 1150 1200 1250 1300 1350 1400  .37 .44 .52 .61 .70 .74 .72 .60  .44 .52 .61 .70 .74 .72 .60 .42  .52 .61 .70 .74 .72 .60 .42 .21  .61 .70 .74 .72 .60 .42 .21 .05  Intermediate fuzzy goal membership functions are calculated recursively until the goal for the most immediate stage is determined. All that is required for input into this algorithm is a goal on the forecasting horizon, fuzzy and/or crisp constraints for the decisions and state transition matrices. The fuzzy rule curve is calculated up to the horizon in terms of intermediate fuzzy goals. Also an array of optimal decisions is presented; one for each state. Results from the fuzzy DP are simply the optimal decisions for each stage that maximizes the probability of achieving the goal. This means fuzzy rather than crisp answers. This is a distinct drawback in promoting such a technique for actual usage since a slightly vague answer (eg. med-high outflow) is rarely as satisfying as a crisp (eg. 152 cu. m/s) answer. 7.5 Satisfying short term goals vs long term The difference between meeting a short term (one month) and long term (five month) fuzzy goal is shown in tables 7.2 and 7.3. These tables show the immediate optimal decision based on current reservoir volume. In table 7.2, the suggested outflows for the next month range from low to very high depending on the current reservoir volume. In table 7.3, the options become more conservative (and less informative) as the immediate  85 action has less of an effect on reaching the final goal. This is expected since the effect of an immediate decision on a distant goal becomes less significant as the goal is set even further in the future. Table 7.4 simulates two different runs based on different fuzzy constraints. The two sets of constraints are shown below. CONSTRAINT SENSITIVITY  Mon 5 4 3 2 1  low 0.2 0.4 0.7 0.7 0.6  RUN1 Decisions med high vhigh 0.7 1.0 0.2 0.8 0.9 0.3 1.0 0.7 0.6 1.0 0.4 0.8 0.9 0.9 0.6  low 0.2 0.4 0.7 0.7 0.6  RUN2 Decisions med high 0.7 1.0 0.8 0.9 1.0 0.7 1.0 0.6 0.9 0.6  vhigh 0.2 0.3 0.3 0.0 0.0  This simple sensitivity analysis shows that when a long term horizon is selected, decisions in the immediate future are not greatly affected. In this case optimal decisions are not affected unless the current volume of the reservoir is 1050 cu.m/s  -  months.  With the number of decision options limited by the development of state transition tables and difficulties in creating state transition tables that accurately model reservoirs, it is doubtful that fuzzy D.P. provides a practical alternative to fuzzy inference in single reservoir analysis. Another consideration is the fuzzy output provided by fuzzy DP analysis may not be satisfactory in real applications unless the possible decisions were only limited to less than six or seven at each stage.  86 Below is a flow chart for the fuzzy DP algorithm.  I read tour decision  matrices constraint and goal arrays I  -iTI For Stage N11: N<3: N++  I  y  L  Create Expected Prab matrix 4 rows X 13 cols E prob IDI [SI = E prob [DI 151 + Goal [NI IC] dcc [DI IS] IGI  I  I  IF IFor State S=1;S<14;S++I  tL._ For Decision 0=1: D<5: D++ I Find goal function fur next stage temp[01 Miri( E prob 101 LS1 Con [DI I Stage Dedsion = Max[temp[1..4]1 If Stage Decision = temp 1 then output If Stage Decision temp 2 then output temp 3 then output  =  “low”  =11  Mcd”  “High”  TABLE 7.1  Transition matrix for high outflow decision (200 cu.m/s-month) HIGH TO LOW VOLUMES FOR STAGE N-i-i HIGH VOL 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0. 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 STAGE N 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 -0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 LOW VOL 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1  Trans matrix for medium high outflow decision (150 cu.m/s-month) HIGH TO LOW VOLUMES FOR STAGE N-i-i 0.4 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 HIGH VOL 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 STAGE N 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.1 0.0 0.0 0.0 0.0 0.0 0.0 .0.0 0.0 0.0 0.1 0.3 0.3 0.2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3 0.3 LOW VOL 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.3  C C C  ‘10  91 CHAPTER 8: ARTIFICIAL NEURAL NET 8.1 Introduction to Neural Nets There has been much emphasis recently on combining the advantages of fuzzy systems with algorithms known as artificial neural networks. Neural nets have gradually developed over the past forty years as a result of research on the workings and interactions of neurons within the brain. The human brain has a vast number (10 to 100 billion) of neurons which are interconnected in complex webs. It is this interactivity that is modelled on computers. In the brain, electrical impulses are fired across synapses (or gaps) when one neuron activates another whereas in the computer models, communication between neurons is in the form of numerical values. In 1949 Donald Hebb developed the concept that the resistance of synapses lower as they are fired more frequently. This implies that humans remember by training neurons to create pathways through the brain which are later reinforced as learning continues. In artificial neural nets, the basic unit that processes information is a node. Data pairs are fed into one end of a mesh of interconnected nodes. The data is passed through each layer of nodes as the weights of the connections are continually adjusted to minimize the error of the output values. When optimal weights of the connection have been determined for the set of training data the system has “learned” the data and new sets of input data can be fed into the system to generate an output consistent with the pattern of the training data.  92 Several different types of neural nets have been developed but this chapter will focus on the most widely used algorithm for prediction and optimization purposes, the backpropogation algorithm. Simpson (1990) describes backpropogation and several other neural net architectures in a clear manner. Artificial neural networks are data intensive tools that are capable of recognizing and reproducing complex, nonlinear patterns but the knowledge is not available for inspection since it is hidden within the system as a matrix of weighting factors. A fuzzy inference model similar to that discussed in chapters 5 and 6 has an accessible knowledge base but is limited in modelling complex systems which are difficult to express heuristically. In this thesis a commercial neural net package called NSHELL by Ward was used, with varying success, for classification (development of fuzzy rulebase from raw data) and prediction (mimic fuzzy inference model given training data representative of fuzzy rulebase). A general diagram of the backpropogation algorithm is shown below,  93  OUTPUT LAYER  HIDDEN LAYER  INPUT LAYER  Figure 8.1 Stucture of Backpropogation Network  The number of nodes at each layer is adjusted to the application. The reservoir backpropogation neural model has data pairs with three input variables and one output variable so the number of nodes in the input and output layers are three and one respectively. The input-output data pairs are fed into the system for training ( °1..i...t)•  where t is the total number of data pairs. The weight values between  layer I and layer H  (Xii..Xmn)  where m corresponds to a particular input node and  n, a hidden node, are randomly assigned at the beginning as are the weights between the hidden and output layer ( 1 y . .y) which is just one node in this case. Threshold levels Oi  . .  .On  are set for each hidden node and F is set for the output  node. Threshold activation levels are values below which a node is not  94 activated. Each node performs a threshold function on the dot product of the inputs. This allows a node to scale the ranges of input and output values by the use of either step, linear, ramp or sigmoid functions. The reservoir model uses the sigmoid function S(x)  =  (1 +  . 1 exY  Each of the hidden nodes performs the following function:  H  =  1  Im  (m=1...3  Xmn  +  As for the output node;  8). 0  =  f (  1n1..4  Hn  y  +  r)  The error between the calculated output and the output from the training data is compared....[ d  =  O(l-O)(O  -  0) 1  and the error is determined for the hidden nodes  [e  =  H (1- H)yd  ].  The connections are adjusted for the weights between the hidden layer and output node Dy  =  a Had.  where  a is  a learning factor constant adjusted to speed  convergence. The threshold level is adjusted for the output level  .... [111’  =  ad]  The connections between the input and hidden nodes are adjusted [Xmn =  a Imen  1  the thresholds are again adjusted  [  119  =  ae 1. This procedure is  repeated until the error is reduced to an acceptably low level.  8.2 Classification of Raw Data into Fuzzy Rules One of the most useful applications of neural nets involves classifying noisy data into fuzzy or vague groups. This is the same job performed by the  95 FAM rule generation algorithm described in chapter 5. The FAM algorithm is actually another type of artifical neural system that only uses a two layer topology as opposed to the three layers used in the backpropogation algorithm. Also, the backpropogation system employs feedback, the FAM does not. The input data sets for the neural net are also from the same source as that used by the FAM rule generation algorithmwhich is the output from the crisp DP algorithm. The commercial backpropogation package allows direct input of both ASCII and spreadsheet files, greatly speeding up the training process. To encourage rapid convergence of the training process, a learn rate of 0.6 is used and the momentum rate is set at 0.9. The momentum rate further speeds training by adding a ratio of the change of the weight from the previous trial to the current trial. The number of learning events to minimized error was 5100. The threshold activation level was set at 0.0001. The results of the fuzzy classification trials however, were less satisfactory than that of the FAM rule generator. After learning the input data, the backpropogation algorithm is presented with data input sets that correspond to the 48 rule premises in the FAM to see what output is predicted. It can be seen by the results in tables 8-1 to 8-3 that output trends are correctly identified however, there is a heavy emphasis on following the value factor which results in operating rules that neglect inflow and reservoir levels. Later, 24 month simulation trials were conducted with correlated inputs. Reservoir volumes were adjusted as the trial proceeded according to the outflow recommended by the backpropogation model. Trials with prolonged  96 series of correlated high or low value factors resulted in both emptying and overtopping of the reservoir. This instability of the backpropogation model may be attributed to the training data. The backpropogation model must betrained with data that simulates extreme conditions to prevent misleading results whereas the defuzzification (or inference) procedure used in the FAM model, tends to act conservatively when presented with data that is at the relative extremes of its training set. The problem of instability of the backpropogation network could be overcome by using a more representative training set or transforming the input data in a different manner to yield more conservative results at high or low reservoir volumes. However without a visible rulebase, this “tuning” or doctoring of input does not improve upon the operator’s knowledge of the system.  8.3 Prediction If the training set was truly representative, how would the prediction ability of a trained backpropogation network compare with the fuzzy inference procedure when faced with identical inputs? In order to make a more stable network, the raw data from the DP algorithm was replaced with the input-output results of the FAM rule generation algorithm (100 rule model) as the training set. These 100 data pairs cover high and low levels of all inputs. The backpropogation model was then simply tested as a substitute for the inference procedure. Charts 8-4 to 8-6 indicate a close correlation between the fuzzy and backpropogation model results.  97 The suitability of non-rulebased neural nets for decision aids is questionable. If it is important to clarify the decision making process by determining a cause and effect relationship between the input and output then neural nets of this form are not useful. It is doubtful operators would accept a backpropogation model for a decision aid with its inherent lack of explanation facilities. A neural net may be used as a secondary consultant for reservoir operations but a system with a definable rule structure should take precedence. Documented uses of the backpropogation algorithm directly for decision support tend to focus on stock trading and other financial matters where results override the need for understanding the problem.  °oI  rTI . . TEl  444 -4-4” 4 : # *  S  1.’  I  * S  S  ‘—  S  I  S  t  S.  4  s  I I  I \\ I 4  S  I S  I  S  S  t*_ I  I I  ‘5 4’ S  S  15\ Sc 5Sç5  I 1 -  -  •:  -  f-S  N5-  .  S  —  ;+.  ..4”r  44 -4--4. 4-3.--  i*Zi.’T’..,tr r  t  S S  t  S  S.  i.*._$**  4  *%  4  S  S  4  3  : 4  -4 4 *  si$  S  *  s .S  p  ..,  t  S S  .5  S.  S  S.  $  S  3  S  S.  S  S  E\;’T s S 4 t  S.  S  S S  .)  I S S S S S S S t I S S I S S S ‘ \S S S S I I S S S 4 5 4 Ntt 44 ** 4*%kS% • t’’ S 4 S S 5 S * t S S 4 Sc S S S S S5 S S S S S S 4 5 5 5 * S 4 5 5 5 5 S S S S S I S 4 5 S I\ak__ t_..t.&.I__ •S , 5”.- # .5 • t S S I I S S S S S S S S t•’5 S S S S S I S N 5 4 5 5 4 5 4 5 5 5 5 S 1 5 5 5 I S S S 5 $ S S rr4 r”r r—r k trCr”i I t S S S S S S S S S S I S s S S S I t S S S S S I S S S S S S S S S S S S I S S .5 A_.* t ,.5 A 4 4 ‘‘““S 5 5 fl4* * #‘ *In—.c.I 5 5 5 5 I S S S S S S S S I 5 5 s 5 S S S S S S S S S S S 4 5 5 5 S 4 5 5 4 5 5 5 4 . .* s ——.*‘.S fl.S * 4*—S’ —S. ::: 5 5:::: :5: 5:: :-..:;.-.s::::: •: 4:: :S4EN::: &: :• S ;.: .:.S: :t>4:u .:: :5: -4: .:ç :4:4 : • 4 ::::: :••-::::4:. \-‘* S S S S S S S S S 5 S S S 4 S gS4S4S 5 N’S S 4 5 5 S 5 5 ‘-*5---5k ‘S —4 -5,5.fl,.5——t’‘-5 -5*4 -5-‘4 S S S S S S S S S -  --  S S 5 5,  S 5  S  S 5  5  S  -  -  -  ‘45?$ S5’ —4f-3 SSS5S  5 5  S  5  -  -  :::  -  ::  S S ‘*5-—5’-’ S S 5  5  ‘-  5  5’  ‘‘S  5  ‘5  ‘5  S  aatinar  5”’S S S  S 5 S ‘5  S 5 5  S 4  S “5’  S  ‘S 5  S  t”t’  ‘S  S  5’  ‘5’ S  =  (02%  ;  .  . !•---- + --------k--.:--.* 4 I I  _t__J I  I  ‘lIn  I.  **  I I  I+  •  ‘\;  .- -‘-‘- -:--;S+---  I  .$  .4.. I  ..  I I.  I  I  I I I  *  I •I I  ..I..I_  I  I  1 -1  C  ..-  I I  I I  I  ..I.  I I  I  I I  I I  **  44  I I I—  •  4  I I  I  I I  I  I  I  Ik”t SI.*  *  I  I  ;-I  I  I *  * I  I  4 I  tt,’f_ I I I I  I  I I  4* I  I I  -II*’  t  I I  I  I I  I  I  I  Fi  I  ‘  I  I  I  I  I  I  I *  I I  I I  I  I  I  —  1  I 1 I  I  ‘k *t44?  I * I I *II I * I I * I * I I I I  4  I— I I  •Ik* 1  r” I  I I I 444—4——4-.* I*t I I I  .(  4  I I t I  1 I  I  4  I I  I * 1  4 I  I I  I  #““I * I  I  “V 1  I  1  I I  —+*  4’  1  ‘V I  *  I  k.  4’——’4— I  I I  I  I  I—  I  I I I Y*’It I I I I I I I t  *  I I  I p-———  -4  I<—1—  I  ::...  4 I  I ‘$  **  I I  I  :::Y::: I  I  4  —‘•I I I I  —*  I  I I I I-4 1 I I * I * I  J....... I  ‘  I  ::T  ...  *  I  I  —I—  I+k  ..  _-4 Ic  •  L  •  :  —I  I  .  4  ,  ,‘  L 1  ---.----  I  I 1  I  ---  I  re  I  ::  t I  L  I I I  :  -  *  .+tI  I  I  1 1 * 4  **fl S  4  *  S S  S  t—  S  t_  :5::::::::5  ::;:5 S  t  S S  sS.&.%_.*_t_  4  i$4—,—-a**%*t*  4 S  tj:::S ::::::-r a  :N5:.:o  5  4  S S  ‘-4  •4— S S S S S  5  5  -:  —  ?%  “  ;  s  S  t*::::::::::S :S\ 1 S S S  —  ;r:r,*,*  4—t—’ S  :.S:H:::--  -t-  S S S  t-----  5.:::::4  -  S S -  -  -  -  S S  S S S 4  -5  k -  S 5  5  5  S  .E:  S  S .4  .S..  I—.-4.  S 5 S :  4 ‘ -  -  S S 5 .4 S  S  —  S : 5  -  -  S  ::  S.  ::.  S 5 .::::5 SS S S S —S--’..tS 5 S S ..  ——S  •  S  5  S  5  S  S 5 S  t  5  S S S I S  S .S S  S  S  S S S  S S  S ——  S 5  :  :f.:S. H S  L ;:  S S  •S 5 S  •+  S 5  r’r  S S S S 5.....  S  S S S  S  +4  Ht  * *w—+—*—. n4 S S  :  S  —S  S.  5 5  5  r  S  S S S  S S  +: S S  S  .. .S————fl——•——*——  5  -:5 -4 ‘$  \4  a.  S  ..c  -:  S 5 .5— S  4.  5  tr” r  k S S  k *  S  5  S  -  S aka*S  ‘  4 S  S S  . >  S  S S S  ‘flk’k  s  :& : :-:::-..-.S S  5 *  S  S 4 S  5 S  S S S S S  —4,,  S  S  S  S  -*“t<  *  S .S.4  ‘*  S S S  S S  S •  ,--t.”,  -  -;S:-:*.: S t S4}.  S v-  _•••€  •5  S  ..  t.  S t S S S S 4 S 5A I S  S S S .5)”  )4)) S  S  S  S  S S  S S.  4  —  ——  $_  —  S  S  S S  S  sahi 5  _5 S S  S S  S S  S  S  S S  S  F  —  S  N  r  £0)  104 CHAPTER 9.0: CONCLUSIONS AND RECOMMENDATIONS The fuzzy inference model presented offers several advantages over more conventional reservoir operation models. It does not encourage precision without accuracy. The inherent imprecision of reservoir models is acknowledged by fuzzy modelling. Also, potentially useful heuristics can be incorporated into the fuzzy model that cannot be used in conventional systems. The fuzzy inference model handles nonlinear, continuous systems easily. It is also a robust model that does not require all potential conditions to be explicitly stated. The robust nature of the fuzzy inference model is demonstrated by its ability to absorb small changes in input data without changing the output significantly. When rules were randomly dropped from the rule base, the model behavior was not greatly affected. This suggests that all combinations of input do not have to be anticipated and the rule base can be abbreviated without adversely affecting performance of the model. The rule generation algorithm does not necessarily require historical or model created data for each space in the FAM Bank. As new data is acquired, it can be fed into the rulebase. The most significant advantage of a FAM/ inference model is its intuitive appeal and simple rule structure that may make it more acceptable in actual applications. Another notable characteristic of the FAM/inference model is the ability to function without a complete rulebase. The model handles unforeseen combinations of inputs by suggesting a compromise of the most applicable  105 rules. The conservative nature of the FAM/inference model increases confidence in the output. There are also several reasons for exercising caution in applying a fuzzy inference model. The interactivity of input variables must be considered and avoided if possible. In other words, the meaning of the variable modifiers high, low, med etc.) can change depending on context. It is important to standardize and document what is meant by these modifiers before the model is completed. The modeler should also be aware of the nature of the uncertainty and suitability of the model to logically express it. Probabilistic, possibilistic and fuzzy types of uncertainty must be differentiated. Basic cause and effect relationships should be known about the system. The model will not be useful if factors external to the model have a significant effect on the output. A maximum of five input variables on a single model “layer” would be the practical limit to keep the number of rules to a manageable level. Also the intuitive appeal is lost with increase in the number of variables. COMPARISON BETWEEN FUZZY DP MODEL AND FUZZY INFERENCE MODEL The fuzzy dynamic programming model has no restrictions on constraints whereas the fuzzy inference model is not as flexible when simulating the effect of different constraints. The fuzzy inference model does not allow easy examination of scenarios in which constraints are changed since the entire rule base is dependant on a single combination of constraints. Multiple scenarios require the development of multiple rule bases.  106 The fuzzy DP model is computationally less efficient, especially in multidimensional situations where the size of transitional matrices increase rapidly. Correlation of inflows is built into the fuzzy inference model but these correlated inflows are difficult to incorporate into the fuzzy DP model. Dissonance (probabilistic uncertainty) and fuzziness are both accepted in the fuzzy DP model whereas the fuzzy inference model does not deal with dissonance. NEURAL NETWORKS AND FUZZY SYSTEMS As described in chapter 8, the FAM / inference model can be considered as a type of neural net that categorizes data into fuzzy rules and later defuzzifies them into crisp outputs for a given input. This method of encoding (fuzzifying) and recall (defuzzification) resembles typical operations in other neural network algorithms but has the advantage of retaining a visible knowledge base. The backpropogation neural network is also capable of encoding and recalling data patterns but knowledge of the system is not enhanced. Difficulties with maintaining stability in the backpropogation algorithm were encountered when testing data reached the maximum or minimum values of the training data. More effort in transforming or normalizing the data would be necessary to overcome this instability. Under normal conditions, however, the backpropogation model operated in a similar manner as the FAM/inference model.  107 FUTURE CONSIDERATIONS FOR FUZZY MODELS The fuzzy models examined within this paper are too simple for actual implementation. With modifications, a combined short and long term model for reservoir operations can be developed that accepts the format of Environment Canada’s forecasts and possibly snowpack data for fuzzy estimation of inflows. Otherwise, a nonfuzzy, stochastic model could be used for inflow estimation. It may be useful to use fuzzy submodels to predict an input into the main model. An example of this may be a fuzzy inference model to calculate the value factor. Factors such as oil prices, local and export hydropower demand patterns; firm vs. interruptible supplies and ecological concerns could be used to generate a rulebase for determining a relative value of the water stored in the reservoir over time. The FAM/inference model developed for this thesis exists in separate algorithms which could be combined into one trainable network. This would be necessary to provide a more user friendly model. A fuzzy DP algorithm utilizing a branch and bound mechanism (Esobugue 1991) may be useful for modelling series of reservoirs with good historical records. In this technique, unlike the fuzzy DP model examined, the fuzzy goals (or fuzzy rule curve) must be previously known.  108 BIBLIOGRAPHY 1.  Bellman, Richard and Lotfi Zadeh. “Decision-Making in a Fuzzy Environment,” Management Science. Vol.17. 1970. B141-64  2.  Bier, V.M. “Fuzzy Set Theory, Probability Theory, and Truth Functionality.”Analvsis and Management of Uncertainty: Theory and Aøplications. Ed. B.M. Ayyub, M.M. Gupta and L.N. Kanal. New York: North-Holland, 1992. 65 78 -  3.  Carlsson, Chister. “On the Relevance of Fuzzy Sets in Management Science Methodology.” Fuzzy Sets and Decision Analysis. Ed. B.R. Gaines and H.J. Zimmerman. New York: North-Holland, 1984. 11- 28  4.  Chameau, J. L. A, A. Alteschaeffl, H. L. Micheal and J. T. P. Yao. “Potential applications of Fuzzy Sets in Civil Engineering” International Journal of Man-Machine Studies Vol.19. 1983. 9- 18  5.  Druce, Donald J. “ Decision Support for Short Term Export Sales from a Hydroelectric System.” Computerized Decision SuoDort Systems for Water Managers : Proc. of the 3rd Water Resources Operations Management WorkshoD, Fort Collins Colorado. June 27-30 1988 Ed. J.W. Labadie, L.E. Brazil, l.Corbu and L.E.Johnson, ASCE, New York, 490 497 -  6.  Esobue, Augustine 0. “Computational Aspects and Applications of a Branch and Bound Algorithm for Fuzzy Multistage Decision Processes.” Journal of Computers and Mathematics with ADDlcations. Vol.21, 1991 117- 125  7.  Freiberger, Paul, and Daniel McNeilI. Fuzzy Logic. New York: Simon and Schuster, 1993  8.  French, Simon. “Fuzzy Decision Analysis: Some Criticisms.” Fuzzy Sets and Decision Analysis. Ed. B.R.Gaines and H.J.Zimmerman. New York: North-Holland, 1984. 29- 44  9.  Gaines, B.R., “Foundations of Fuzzy Reasoning.” International Journal of Man-Machine Studies. Vol. 8, 1976 623 628 -  10.  Gaines, B.R., L.A. Zadeh and H.J. Zimmerman. “Fuzzy Sets and Decision Analysis- A Perspective.” Fuzzy Sets and Decision Analysis. Ed. B.R. Gaines and H.J. Zimmerman. New York: North-Holland, 1984.3- 8  109 11.  Galvao, Carlos de Oliveira and Shuichi Ikebuchi. “Rule-based Reservoir Operation considering Long Range Forecast.” Bulletin of the Disaster Prevention Research Institute. Vol. 42, Part 3, Kyoto University: Kyoto, September 1992, 71-94  12.  Haak, Susan “Do we need ‘fuzzy logic’ ? “ International Journal of ManMachine Studies Vol.11. 1979. 437- 445  13.  Hadipriono, Fabian C. “Integrating Fuzzy Logic Approach to Expert System.” Comnuting in Civil Engineering. Ed. Louis F. Cohn, William Rasdorf. New York. ASCE. 1991  14.  KIir, G.J. “Probabilistic Versus Possibilistic Conceptualization of Uncertainty.” Analysis and Management of Uncertainty: Theory and ADDlications. Ed. B.M. Ayyub, M.M. Gupta and L.N. Kanal. New York:North-Holland. 1992. 13 25 -  15.  Mamdani, E.H., S. Assilian. “An Experiment in Linguistic Synthesis with a Fuzzy Logic Controller.” International Journal of Man-Machine Studies Vol. 7. 1975 1- 13  16.  Matsuoka, Hiroshi “ A Simple Fuzzy Simulation Model for Nuclear Reactor System Dynamics.” Nuclear Technology Vol. 94. May 1991. 228 241 -  17.  McCullough, Claire L. “An anticipatory fuzzy logic controller utilizing neural net prediction” Simulation. 58:5. May 1992. 327-332  18.  de Neufville, Richard Anølied Svtems Analsis: Engineering Planning and Technology Management McGraw-Hill, New York, 1990  19.  Ng and Abrahmson, Analysis and Management of Uncertainty: Theory and Applications. Ed. B.M. Ayyub, M.M. Gupta and L.N. Kanal. New York:North-Holland, 1992.  20.  Self, Kevin “Designing with Fuzzy Logic.” IEEE SDectrum November. 1990. 42-44  21.  Simpson, Patrick K. Artificial Neural Systems.New York: Pergamon, 1990  22.  Su, Chung-Ching and Yuan-Yih Hsu. “Fuzzy Dynamic Programming: An application to Unit Commitment”, IEEE Trans Power Systems, Vol 6, No. 3, August 1991 1231- 1237  110 23.  Sulzberger, Sandra M., N.N. Tschichold-Gurman and Sjur Vestli “FUN: Optimization of Fuzzy Rule Based Systems Using Neural Networks” IEEE Conf. on Neural Networks: San Fran. Mar 28- AD 1 1993. Vol 1. p314  24.  Terano, Toshiro. Fuzzy Systems Theory and its Apolications. San Diego. Academic Press. 1992  25.  Wang, Li-Xin and Jerry M.Mendel “Generating Fuzzy Rules by Learning from Examples.” Proc. of the 1991 IEEE International SymDosiumon Intelligent Control: 13-15 August 1991. Arlington. Virginia. IEEE, 263 269  -  26.  Yeh, William W-G. “Reservoir Management and Operations Models: A State of the Art Review. “ Water Resources Research, Vol. 21, No. 12, 1797- 1818, December 1985  27.  Zimmerman, H.J. Fuzzy Set Theory and Its ADplications. Second Edition. Boston: Kluwer Academic Publishers, 1991.  


Citation Scheme:


Citations by CSL (citeproc-js)

Usage Statistics



Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            async >
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:


Related Items