You are on page 1of 84

ABSTRACT In control systems there are a number of generic systems and methods which are encountered in all areas

of industry and technology. From the dozens of ways to control any system, it turns out that fuzzy is often the ery best way. The only reasons are faster and chea!er. "ne of successful a!!lication that used fuzzy control istem!ature control in shower. The !ur!ose of this !ro#ect is to design a simulation system of fuzzy logic controller for tem!ature control in shower by using simulation !ac$age which is Fuzzy %ogic Toolbo& and Simulin$.in 'AT%AB software. In order to find the best design to stabilize the tem!ature control in thes hower, some factors will be considered. For this !ro#ect, the tem!aturewas controlled by using three rules of membershi! function which then e&tended to fi e rules and se en rules for erification !ur!ose and further im!ro ement of the system. Besides that, se eral of different methods also been used in order to design the most stabilize system and this !ro#ect was focused to the software !art only. By doing some modification of this !ro#ect, the design will be ery useful for the system relates to tem!ature control in showerthat use in domestic !ur!ose nowadays.


F%C ( Fuzzy %ogic Controller )I* ( )ro!ortional, Integral and *eri ati e S)C ( Smith )redictor Controller A+FIS ( Ada!ti e +euro(Fuzzy Inference System ,-I ( ,ra!hical -ser Interface 'I'" ( 'ultiin!ut 'ultiout!ut FAR'A ( Fuzzy Auto(Regressi e 'o ing A erage


Fuzzy logic techni.ue is an inno ati e technology used in designing solutions for multi( !arameter and non(linear control models for the definition of a control strategy. As a result, it deli ers solutions faster than the con entional control design techni.ues. This !a!er thus !resents a fuzzy logic based(tem!erature control system, which consists of a microcontroller, tem!erature sensor, and o!erational am!lifier, Analogue to *igital Con erter, dis!lay interface circuit and out!ut interface circuit. It contains a design a!!roach that uses fuzzy logic techni.ue to achie e a controlled tem!erature out!ut function. /uman brain has an im!recise way of reasoning and thus has a high ada!ti e control a!!roach. It does not reason as com!uters do. Com!uters reason in a clear statement that uses true or false 01 or 23 ( an element is either a number of a gi en set or it is not. There are many com!le& systems which do not fit into the !recise categories of con entional set theory. This is because of the fact that there is no way to define a !recise threshold to re!resent their com!le& boundary, and as such their control system is com!le&. Fuzzy logic was de elo!ed owing to this im!recise nature of sol ing control !roblems by com!uter. In a fuzzy logic(based system, a ariable can ta$e any truth alue from a close set 41, 25 of real numbers thus generalizing Boolean truth alues 425. But the fuzzy facts are true only to some degrees between 1 and 2, and they are false to some degrees. /uman brains wor$ with fuzzy !atterns. But com!uters cannot do so because its logic is based on a!!ro&imate reasoning in a more familiar Boolean forms of logic used in con entional set theory. Fuzzy logic allows the use of labels li$e 6slightly7, 6moderately7, medium, and 6 ery7 so that statements may be made with arying degree of !recision. This fle&ibility is useful in co!ing with the im!recision of real(world situations such as designing !recision en ironmental control systems. In a broad sense, fuzzy logic refers to fuzzy sets ( a set with non(shar! boundaries. Fuzzy logic is widely used in machine controls, as it allows for a generalization of con entional logic and

!ro ides for terms between 6true7 and 6false7, li$e 6almost true7 or 6!artially false7. This ma$es the logic not to be directly !rocessed on com!uters but must be emulated by s!ecial codes. A fuzzy logic based design control system offers fle&ibility in system design and im!lementation, since its im!lementation uses 6if then7 logic instead of so!histicated differential e.uations. Its technology !ro ides room for gra!hical user interface, which ma$es it understandable by !eo!le who do not ha e !rocess control bac$grounds. Another $ey significance of a fuzzy logic(based control design is the ability to automatically and smoothly ad#ust the !riorities of a number of controlled ariables 485. Finally, it hel!s to achie e a !rocess that is stable for a long !eriod of time without a need for inter ention. /owe er, because of the rule(based o!eration of fuzzy systems, any reasonable number of in!uts can be !rocessed and numerous out!uts generated9 although defining the rule(base .uic$ly becomes com!le& if too many in!uts and out!uts are choosen for a single im!lementation, since rules defining their interelations must also be defined. There are countless a!!lications of fuzzy logic. In fact many researchers still claim that fuzzy logic is an encom!assing theory o er all ty!es of logic 4:5. Fuzzy logic can control non(linear systems that would be difficult or Fuzzy logic is conce!tually easy to understand. The im!ossible to model mathematically. This o!ens door for control system that would normally be deemed unfeasible for automation. mathematical conce!ts behind fuzzy reasoning are ery sim!le. Fuzzy logic is a more intuiti e a!!roach without the far(reaching com!le&ity. Fuzzy logic is fle&ible. ;ith any gi en system, it is easy to layer on more functionality without starting again from scratch. Fuzzy logic is tolerant of im!recise data. < erything is im!recise if you loo$ closely enough, but more than that, most things are im!recise e en on careful ins!ection. Fuzzy reasoning builds this understanding into the !rocess rather than tac$ing it onto the end. Fuzzy logic can model nonlinear functions of arbitrary com!le&ity. =ou can create a fuzzy system to match any set of in!ut(out!ut data. This !rocess is made !articularly easy by ada!ti e techni.ues li$e Ada!ti e +euro(Fuzzy Inference Systems 0A+FIS3, which are a ailable in Fuzzy %ogic Toolbo& software. Fuzzy logic can be built on to! of the e&!erience of e&!erts. In direct contrast to neural networ$s, which ta$e training data and generate o!a.ue, im!enetrable models9 fuzzy logic lets you rely on the e&!erience of !eo!le who already understand your system. Fuzzy logic can be blended with con entional control techni.ues. Fuzzy systems don>t necessarily re!lace con entional control methods. In many cases fuzzy systems augment them and sim!lify their im!lementation. Fuzzy

robotics?motion control. you>ll see it can be a ery !owerful tool for dealing . if you ta$e the time to become familiar with fuzzy logic. !attern recognition. has been sha!ed by thousands of years of human history to be con enient and efficient. fuzzy logic is easy to use. try something else. . +atural language. fuzzy logic differs both in conce!t and substance from traditional multi alued logical systems. in a wider sense fuzzy logic 0F%3 is almost synonymous with the theory of fuzzy sets. 'any controllers. fuzzy logic should be inter!reted as F%.uic$ly and efficiently with im!recision and nonlinearity. The basis for fuzzy logic is the basis for human communication. If a sim!ler solution already e&ists. Fuzzy logic is also s!reading a!!lications in the field of telecommunications. based on AT' Technology. /owe er.hen should you not use fuzzy logic@ The safest statement is the first one made in this introductionA fuzzy logic is a con enient way to ma! an in!ut s!ace to an out!ut s!ace. If you find it>s not con enient. which is used by ordinary !eo!le on a daily basis. fuzzy logic is a logical system. that is. for e&am!le. Fuzzy logic has two different meanings. There are many a!!roaches to im!lement fuzzy logic systems9 they can be software only. fuzzy logic has been im!lemented using se eral technologies to sol e real world !roblems such as image !rocessing. fuzzy database and industrial engineering a!!lications. In a narrow sense. The last statement is !erha!s the most im!ortant one and deser es more discussion.In Fuzzy %ogic Toolbo&C software. Sentences written in ordinary language re!resent a trium!h of efficient communication. This obser ation under!ins many of the other statements about fuzzy logic. PROBLEM OUTLINE Fuzzy logic is not a cure(all. hardware only or the combination of software and hardware. Fuzzy logic is the codification of common sense B use common sense when you im!lement it and you will !robably ma$e the right decision. . !articularly in broad band integrated networ$s. fuzzy logic in its narrow sense is a branch of F%. which is an e&tension of multi alued logic. Because fuzzy logic is built on the structures of . In this !ers!ecti e. you must first understand what is meant by fuzzy logic. a theory which relates to classes of ob#ects with un shar! boundaries in which membershi! is a matter of degree. do a fine #ob without using fuzzy logic.ualitati e descri!tion used in e eryday language. /owe er. use it. In recent years.logic is based on natural language. < en in its more narrow definition. To understand why use of fuzzy logic has grown.

is that of a fuzzy if(then rule or. In the future.Another basic conce!t in F%. Roger Eang for this !ur!ose is called A+FIS 0Ada!ti e +euro(Fuzzy Inference System3. fuzzy rule. 'ore generally. such systems !lay a !articularly im!ortant role in the induction of rules from obser ations. much of F% may be iewed as a methodology for com!uting with words rather than numbers. Although words are inherently less !recise than numbers. sim!ly.fuzzy logic in its wide sense. The basic ideas underlying F% are e&!lained ery clearly and insightfully in the Introduction. the one that has highest isibility at this #uncture is that of fuzzy logic and neurocom!uting. that is. -nli$e the traditional. This method is an im!ortant com!onent of the toolbo&. in reality. the conce!ts of fuzzy logic relies on age(old s$ills of human reasoning.ithin fuzzy logic.Fuzzy logic is all about the relati e im!ortance of !recisionA /ow im!ortant is it to be e&actly right when a rough answer will do@In this sense. Although F*C% is not used e&!licitly in the toolbo&. although the modern and methodical science of fuzzy logic is still young. hard com!uting. a translation of a human solution into F*C%. . uncertainty. robustness. soft com!uting could !lay an increasingly im!ortant role in the conce!tion and design of systems whose 'ID 0'achine ID3 is much higher than that of systems designed by con entional methods. fuzzy logic. their use is closer to human intuition. a ariable whose alues are words rather than numbers. leading to neuro( fuzzy systems.uents and fuzzy antecedents. which !lays a central role in most of its a!!lications. what is missing in such systems is a mechanism for dealing with fuzzy conse. Although rule(based systems ha e a long history of use in AI. this mechanisms !ro ided by the calculus of fuzzy rules. In most of the a!!lications of fuzzy logic. An effecti e method de elo!ed by *r.Among arious combinations of methodologies in soft com!uting. In fuzzy logic. . Furthermore. neurocom!uting. . com!uting with words e&!loits the tolerance for im!recision and thereby lowers the cost of solution. soft com!uting accommodates the im!recision of the real world. a fuzzy logic solution is. and genetic algorithms may be iewed as the !rinci!al constituents of what might be called soft com!uting. The guiding !rinci!le of soft com!uting isA <&!loit the tolerance for im!recision.hat might be added is that the basic conce!t underlying F% is that of a linguistic ariable. The calculus of fuzzy rules ser es as a basis for what might be called the Fuzzy *e!endency and Command %anguage 0F*C%3. fuzzy logic is both old and new because.A trend that is growing in isibility relates to the use of fuzzy logic in combination with neurocom!uting and genetic algorithms. it is effecti ely one of its !rinci!al constituents. In effect. and low solution cost. and !artial truth to achie e tractability.

8. This . This !ro#ect will be discussing and analyzing the result obtained to erify This !ro#ect will be discussing and analyzing the result obtained to erify below mentioned itemsA 2. This is a sim!le and easy a!!roach to $now more about water le el system. Building system with the Fuzzy %ogic Toolbo& which goes into detail about the ste! ta$en to build and edit the fuzzy system using the toolbo&. :. Building the system with Fuzzy %ogic Controller with Rule Giewer bloc$s using Simulin$ and integrates it with Fuzzy %ogic Toolbo&."b#ecti e will basically based on followingA The aim of this !ro#ect is to !erform a design simulation of fuzzy logic controller for stabilizing the water tan$ le el control which is done by using 'AT%AB?Simulin$.-I3 tools in Fuzzy %ogic Toolbo& in 'AT%AB !rogrammed. In order to achie e the !ro#ect main ob#ecti es. Then !erform fuzzy inference into the e&!ert system 0Fuzzy %ogic Toolbo&3. there are some tas$s that ha e to be done.uired. The !ur!ose of this !ro#ect is to !ro ide a feasibility study on the water le el control simulation based on Fuzzy %ogic e&!ert system. 2. The o erall structure of the !ro#ect 2. al e setting. -se se eral different methods and fuzzy membershi! functions to find the best method that should be used for the system to get the most accurate result as re. Run the system using different numbers of rules to !ro e that the more accurate result can be obtained by adding the number of rules. F. -nderstand the foundation of fuzzy logic which co ers the introduction to the general conce!ts. data consistency and also about the rules of the ariables. Study and familiar with the fuzzy inference system which consists of methods of fuzzy inference used in the Fuzzy %ogic Toolbo&. fuzzy rules and !rocedures. so this ste! should be considered to become familiar with the fuzzy inference !rocedures and !rocess. Fuzzy %ogic Toolbo& !ac$ages and 'AT%AB !rogramming. < aluate the result obtained from the simulation. 8. The tas$ is to design and dis!lay the simulation of the fuzzy logic controller for water le el tan$ control and the result of the simulation will be dis!lay by using Rule Giewer and Surface Giewer which are !arts of the gra!hical user interface 0. H. Since the field of fuzzy logic uses many terms that do not yet ha e standard inter!retations. including its le el mo ements.: Sco!e The sco!e of !ro#ect is to encode the fuzzy sets.

The $nowledge(base contains membershi! functions and rules. this system will be also tested by using different ty!es of methods and membershi! functions. Fuzzy "ut!ut : Considers raw suggestions for what the system out!ut should be in res!onse to the current in!ut conditions. Besides that. A !rogrammer who does not $now how the a!!lication system wor$s can write a fuzzy inference $ernel.+ '<T/"*"%".uirement for stability of the le el control for the water tan$ system. It starts from the theory until it im!lemented into the simulation en ironment. this !ro#ect also ma$es the analysis of the ariety results that obtained from system. . usually in a !rogram loo! structure to determine the degree to which each linguistic ariable of each system is true. In addition. Rule < aluation: )rocesses a list of rules from the $nowledge(based using current fuzzy in!ut alues to !roduce a list of fuzzy out!ut linguistic ariable. Fuzzification: The current in!ut alues are com!ared against stored in!ut membershi! functions. so the analysis for results will be conducted. "ne 6e&ecution !ass7 through a fuzzy inference $ernel generates system out!ut signals in res!onse to current system in!ut conditions 4J5. *ifferent numbers of rules that used in the system will gi e the different result. This !ro#ect co ers the !rocesses of de elo!ing the a!!lication of fuzzy e&!ert system in water tan$ le el control. The fuzzy inference $ernel is e&ecuted !eriodically to determine system out!ut based on current system in!ut. *efuzzification: *issol es multi!le degree ambiguous by !utting raw fuzzy out!uts into a com!osite numerical out!ut. The simulation will dis!lay the animation of the water tan$ le el that controlled based on the rules of fuzzy sets. *<SI. The Fuzzy %ogic Toolbo& has the ability to ta$e fuzzy systems directly into Simulin$ and test them out in a simulation en ironment.= A microcontroller(based fuzzy logic control system has a fuzzy inference $ernel and a $nowledge(base.!ro#ect is designed to ma$e use of the great ad antages of the Fuzzy %ogic Toolbo& and integrate it with SI'-%I+I which is also in 'AT%AB !rogrammed. The !ur!ose is to find the best way to get the result as close as the re.

The microcontroller is the heart of the system. It contains the inference $ernel and the $nowledge(base. The A*C circuit con erts analogue signals to digital signal which the microcontroller understands. The inference $ernel is the engine of the microcontroller where fuzzification. microcontroller. which should ha e the following featuresA a3 Ability to maintain the tem!erature of a room automatically with the aid of de ices li$e sensor. The !ro!osed logical?!hysical system with the !roblem statement and the features of the new system 0a fuzzy logic(based tem!erature control system3 seems to meet the re. These sensors deli er signals to the A*C. while the fuzzy out!ut interface aids in the transmission of deffuzified signals to the system out!u . etc.hat $ind of control system would be relati ely ine&!ensi e and im!recise thus $ee!ing the o erall system cost and com!le&ity low@ :3 Can a control system in!uts be easily altered or modified to im!ro e system !erformance@ The !roblem statements can now be answered using fuzzy logic(based com!uter control system. The $nowledge(base contains membershi! functions and rules. c3 Fle&ibility in im!lementing multi!le in!ut ariables and achie ing a smooth control function out!ut. where users define rules go erning the target control system. rule e aluation and deffuzzification are done The dis!lay fuzzy out!ut is done by the dis!lay unit. The system in!uts are ariable in!uts introduced into the system with the aid of sensors 0tem!erature sensors3. A*C.+ '<T/"* )roblem statements were formulated after attem!ting to !ro ide answers to !roblems noticed in the e&isting !hysical?logic systemA 23 /ow can non(linear system that is difficult to model mathematically be im!lored or im!lemented on control system li$e tem!erature control@ 83 .GI.uirement of the new system. b3 Ability to achie e the maintenance of a room tem!erature by a!!lying im!recise logic 0fuzzy logic3. STR-CT-R<* A+A%=SIS A+* *<SI. The fuzzy inference $ernel is e&ecuted !eriodically to determine system out!uts based on current system in!uts.

K ery hotK. *efining di ide KwarmK from KhotK. .4 THESIS OUTLINE The ariable Ktem!eratureK in this system can be di ided into a range of KstatesK. KwarmK. but this would result in a discontinuous change when the in!ut alue !asses. KhotK. such asA KcoldK. KmoderateK. KcoolK.1.

Fuzzy logic is a way of interfacing inherently analog !rocesses. directed by a microcontroller chi!. that mo e through a continuous range of alues. Some other nomenclature might ha e been !referable. For e&am!le. K ery hotK. KwarmK. KmoderateK. such asA KcoldK. The way around this is to ma$e the states KfuzzyK. the term itself ins!ires a certain s$e!ticism. KhotK. An arbitrary threshold might be set to other ariables in the system. The ariable Ktem!eratureK in this system can be di ided into a range of KstatesK. and fuzzy logic is actually ery straightforward. but it>s too late now. s!eed. *efining di ide KwarmK from KhotK. to a digital com!uter. The microcontroller has to ma$e decisions based on bra$e tem!erature. that is. KcoolK. that li$es to see things as well( defined discrete numeric alues. and the bounds of these states is a bit tric$y. sounding e. /owe er.1 OVERVIEW L KFuzzy logicK has become a common buzzword in machine control.CHAPTER 2 FUNDAMENTALS 2. but this would result in a discontinuous change when the in!ut alue !assed o er that threshold. =ou could define the in!ut tem!erature states using Kmembershi! functionsK such as the followingA . consider an antiloc$ bra$ing system.ui alent to Khalf(ba$ed logicK or Kbogus logicK. allow them to change gradually from one state to the ne&t.

: cool. • . but the scheme can deal with them as sim!lified fuzzy functions that are either one alue or another.i en Kma!!ingsK of in!ut the formA IF bra$e tem!erature IS warm A+* s!eed IS not ery fast T/<+ bra$e !ressure IS slightly decreased. or K"+("FFK. This result in turn will be ma!!ed into a membershi! function and truth alue controlling the out!ut ariable. Kslightly decreasedK. Instead. is also defined by a fuzzy set that can ha e alues li$e KstaticK. In this e&am!le.M nominal and 1. A control system may also ha e arious ty!es of switch. each of All the rules that a!!ly are in o$ed.ual to either 2 or 1. it loses alue in one membershi! function while gaining alue in the ne&t.J nominal and 1. the in!ut ariable>s state no longer #um!s abru!tly from one state to the ne&t. the Ktruth alueK of the bra$e tem!erature will almost always be in some degree !art of two membershi! functionsA 1. Kslightly increasedK. and so on. in!uts along with its analog in!uts. but remember the decision is based on a set of rulesA • ariables into membershi! functions and truth alues.ith this scheme. to determine the result of the rule. The !rocess of con erting a cris! in!ut alue to a fuzzy alue is called KfuzzificationK. or 1. Kbra$e !ressureK.F warm.. the microcontroller then ma$es decisions for what action to ta$e based on a set of KrulesK. This rule by itself is ery !uzzling since it loo$s li$e it could be used without bothering with fuzzy logic. and such switch in!uts of course will always ha e a truth alue e. the two in!ut ariables are Kbra$e tem!eratureK and Ks!eedK that ha e alues defined as fuzzy sets. $nown as Kfuzzy setsK. and so on. At any one time. . using the membershi! functions and truth alues obtained from the in!uts. The in!ut ariables in a fuzzy control system are in general ma!!ed into by sets of membershi! functions similar to this. The out!ut ariable. as the tem!erature changes.

The in!ut stage ma!s sensor or other in!uts. fuzzy logic is well suited to low(cost im!lementations based on chea! sensors. the actual bra$e !ressure. or may be too Ke&!ensi eK in terms of com!uter !rocessing !ower and memory. such as switches. If )I* and other traditional control systems are so well(de elo!ed. The !rocessing stage in o$es each a!!ro!riate rule and generates a result for each. and so on. In many cases. FUZZY LOGIC CONTROL IN DETAIL L Fuzzy controllers are ery sim!le conce!tually. why bother with fuzzy control@ It has some ad antages. Finally.uations that define the system res!onse to its in!uts. the mathematical model of the control !rocess may not e&ist. Such systems are often im!lemented as K!ro!ortional(integral(deri ati e 0)I*3K controllers. low(resolution analog(to(digital con erters. . Such systems can be easily u!graded by adding new rules to im!ro e !erformance or add new features. thumbwheels.• These results are combined to gi e a s!ecific 0Kcris!K3 answer. a !rocedure $nown as KdefuzzificationK. fuzzy control can be used to im!ro e e&isting traditional controller systems by adding an e&tra layer of intelligence to the current control method. then combines the results of the rules. Furthermore. the out!ut stage con erts the combined result bac$ into a s!ecific control out!ut alue. Traditional control systems are based on mathematical models in which the the control system is described using one or more differential e. They are the !roducts of decades of de elo!ment and theoretical analysis. and an out!ut stage. In many cases. This combination of fuzzy o!erations and rule(based KinferenceK describes a Kfuzzy e&!ert systemK. and F(bit or N(bit one(chi! microcontroller chi!s. a !rocessing stage. to the a!!ro!riate membershi! functions and truth alues. and a system based on em!irical rules may be more effecti e. They consist of an in!ut stage. and are highly effecti e.

Consider a rule for a thermostatA IF 0tem!erature is KcoldK3 T/<+ 0heater is KhighK3 This rule uses the truth alue of the Ktem!eratureK in!ut. "b iously. since this is only one rule among many. for one e&am!le. KnearK. These o!erations may ha e !recise definitions. There is also a +"T o!erator that subtracts a membershi! function from 2 to gi e the Kcom!lementaryK function. As discussed earlier. the greater the truth alue of KcoldK. Common hedges include KaboutK. but the sha!e is generally less im!ortant than the number of cur es and their !lacement. s. This result is used with the results of other rules to finally generate the cris! com!osite out!ut. "R. the !rocessing stage is based on a collection of logic rules in the form of IF( T/<+ statements. K eryK. such as A+*. Ty!ical fuzzy control systems ha e dozens of rules.The most common sha!e of membershi! functions is triangular. though again the definitions tend to aryA A+*. while KsomewhatK broadens the function by ta$ing the s.ui alent to ad#ecti es. In some cases. which is some alue of KhighK. where the IF !art is called the KantecedentK and the T/<+ !art is called the Kconse. to generate a result in the fuzzy set for the KheaterK out!ut. KslightlyK. though the definitions can ary considerably between different im!lementations. the membershi! functions can be modified by KhedgesK that are e. and +"T. the fuzzy rule sets usually ha e se eral antecedents that are combined using fuzzy o!erators. . KGeryK. KtooK. and KsomewhatK.uired range of an in!ut alue. sim!ly uses the minimum weight of all the antecedents. though this does not necessarily mean that the out!ut itself will be set to KhighK. which is some truth alue of KcoldK. in one !o!ular definition.uentK. From three to se en cur es are generally a!!ro!riate to co er the re. K<&tremelyK cubes the alues to gi e greater narrowing. In !ractice.uares membershi! functions9 since the membershi! alues are always less than 2. this narrows the membershi! function. Ke&tremelyK. although tra!ezoids and bell cur es are also used.uare root. or the Kuni erse of discourseK in fuzzy #argon. Ka!!ro&imatelyK. the higher the truth alue of KhighK. while "R uses the ma&imum alue. Kclose toK.

or se. KyK. The results of all the rules that ha e fired are KdefuzzifiedK to a cris! alue by one of of se eral methods. Rules can be sol ed in !arallel in hardware.There are se eral different ways to define the result of a rule. while the height method ob iously fa ors the rule with the greatest out!ut alue. which ta$es the alue of the biggest contributor. Another a!!roach is the KheightK method. in which the out!ut membershi! function is gi en the truth alue generated by the !remise. and KzK and an out!ut ariable KnK. The e&am!le below demonstrates ma&(min inferencing and centroid defuzzification for a system with in!ut ariables K&K. each with arious ad antages and drawbac$s. but one of the most common and sim!lest is the Kma&(minK inference method. +ote that KmuK is standard fuzzy(logic nomenclature for Ktruth alueKA . The KcentroidK method is ery !o!ular. The centroid method fa ors the rule with the out!ut of greatest area.uentially in software. There are dozens in theory. in which the Kcenter of massK of the result !ro ides the cris! alue.

. Run through test suite to alidate system. that is. *ocument the fuzzy sets for the in!uts. basically a methodical a!!roach to trial(and(error. L Fuzzy control system design is based on em!irical methods.uired. In centroid defuzzification the alues are "R>d. *ocument the rule set.+otice how each rule !ro ides a result as a truth alue of a !articular membershi! function for the out!ut ariable. The general !rocess is as followsA • • • • • *ocument the system>s o!erational s!ecifications and in!uts and out!uts. *etermine the defuzzification method. the ma&imum alue is used and alues are not added. ad#ust details as re. and the results are then combined using a centroid calculation.

The turbine>s o!eration can be re ersed.• Com!lete document and release to !roduction. and a single out!ut ariable. As a general e&am!le. tem!erature and !ressure. so the throttle setting can be !ositi e or negati e. consider the design of a fuzzy controller for a steam turbine. the turbine throttle setting. The bloc$ diagram of this control system a!!ears as followsA There are two in!ut ariables. The fuzzy set ma!!ings are shown belowA .


rule FA IF tem!erature IS cool A+* !ressure IS strong. The . the controller acce!ts the in!uts and ma!s them into their membershi! functions and truth alues. the ma&imum is used. as the e&am!les abo e do. rule 8A IF tem!erature IS cool A+* !ressure IS low. +8A 'edium negati e. rule :A IF tem!erature IS cool A+* !ressure IS o$. T/<+ throttle is )8. The rule set includes such rules asA rule 2A IF tem!erature IS cool A+* !ressure IS wea$. T/<+ throttle is +8. ):A %arge !ositi e. These ma!!ings are then fed into the rules. T/<+ throttle is ):. In !ractice. +2A Small negati e. OA Oero. T/<+ throttle is O. )8A 'edium !ositi e. If the rule s!ecifies an A+* relationshi! between the ma!!ings of the two in!ut ariables.The throttle settings are defined as followsA +:A %arge negati e. )2A Small !ositi e. the minimum of the two is used as the combined truth alue9 if an "R is s!ecified.

1 1.1 1.J 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1. Fuzzy %ogic System Com!onentsA Fuzzification A 'embershi! alue assignmentA Rule base systemA decision ma$ing systemA *efuzzification methodsA PF-OOIFICATI"+ '<T/"*S 2.J 1.1 1.1 1.N 1.1 1.1 Q+≦(:.1 1.1 1.1 1.: 1.M (2. *ISCR<T< CAS< 0+-'<RICA%3 µ0 X 3 = ∑ I µ0 Ai 3 xi Duantization and )rimary Fuzzy Sets -sing a +umerical *efinition %<G<% +".8<Q+≦(1.2 R1.: 1.1 1.J 1.8 2.J 1.1 1.: 1.J 1.< +B +' +S O< )S )' )B 1.N (1.: 2.1 1.1 1.1 1.F (1.1 1.2 (1.1 1.2<Q+≦R1.1 1.J 1.J 1.: 2.1 1.1 1.a!!ro!riate out!ut state is selected and assigned a membershi! alue at the truth le el of the !remise.1 1. (M (H (F (: (8 (2 1 2 8 : RA+.1 1.1 1.F R1.1 1.1 1.: 1.1 1.1 1.1 1.J 1.: 2.: 1.J 1.1 1. The truth alues are then defuzzified.8 (1.1 1.1 1.J 1.1 1.N<Q+≦(1.1 1.F<Q+≦R1.1 1.1 1.2<Q+≦R1.8 R1.1 (:.: 2.1 1.1 1.1 1.8<Q+≦R1.1 1.M<Q+≦(1.1 1.1 .F<Q+≦(1.1 1.8<Q+≦(2.

1 1.1 1.1 1.1 1.: 1.M R2.1 1.1 F-OOIFICATI"+ '<T/"*S 8.J 1.1 1.1 1.8 :. +' +B +S O< Sg0&3 )S )' )B  & Sg0&3  TRA)<O"I*A% '<'B<RS/I) F-+CTI"+.M<Q+≦R:.1 1. & µ 0 x3  .<+<RA%IO<* B<%% '<'B<RS/I) F-+CTI"+.1 1.: 2.1 1.J 1.1 1.-ASSIA+ '<'B<RS/I) F-+CTI"+.N<Q+≦R2. µ0 x3 = e −0 x −c σ 38 C σ Q µ 0 x3  .1 1.%< '<'B<RS/I) F-+CTI"+. µ0 x3 = 2+ 2 x −c a 8b X . C"+TI+-"-S CAS< 0F-+CTI"+A%3 TRIA+.: 2.8≦Q+ 1.1 1.1 1.F H M R1.1 1.

(c) . = 大 中 小 8.  C-RS< "F *I'<+SI"+A%IT=./"%< I+)-T S)AC< T/AT C/ARACT<RIO<S A R<.IR* )ARTITI"+  +<<* "+%= S'A%% +-'B<R "F '<'B<RS/I) F-+CTI"+ F"R <AC/ I+)-T.I"+ CA+ B< -+ID-<%= S)<CIFI<* A%"+.)ARTITI"+ ST=%< F"R F-OO= '"*<%S 2. SCATT<R )ARTITI"+  B= C"G<RI+.  CA+ B< -S<* . A C"RR<S)"+*I+.   小 中 (a) 大 Q <AC/ R<.I"+ "F )"SSIB%< "CC-RR<+C< "F T/< I+)-T G<CT"RS. '"R< '<'B<RS/I) F-+CTI"+ F"R <AC/ I+)-T AR< +<<*<*. ( b) :. .  %I'IT T/< +-'B<R "F R-%<S T" A R<AS"+AB%< A'"-+TS. A S-BS<T "F T/< . TR<< )ARTITI"+  *<CISI"+ TR<<. <Q)"+<+TIA%%= I+CR<AS< I+ T/< +-'B<R "F R-%<S./<+ I+G"%G<S "+%= S<G<RA% STAT< GARIAB%<S AS I+)-TS.

S"-RC< "F F-OO= C"+TR"% R-%<S :.<. <G<+ IF T/<= CA+.< "F C"+TR"% <+. 8.I+<<RI+.  T/< ")<RATI"+ "F C"')%ICAT<* )R"C<SS IS +"T A%."R*S.(/". T/< I+STI+CTS "F C"+TR"% <+.  A+ <FF<CTIG< *<SI."R*S <Q)R<SS T/I+. BAS< "+ ")<RATI"+TS C"+TR"% ACTI"+. I+T" %"./<+ T/< "BE<CT IS A )R"C<SS .+ '<T/"* I+ T/IS T=)< "F CAS< IS A '"*<% "F T/< F-+CTI"+S CARRI<* "-T B= T/< ")<RAT"RS.%<*./<+ T/<IR .I+<<RS. T/<R< AR< I+STA+C<S . I+".I+<<RS IS <Q)R<SS<* D-A%ITATIG<%= I+ .  F-OO= )ARTITI"+S "F T/< I+)-T S)AC< '-ST B< *<T<R'I+<* T/R"-.IT/"-T <Q)<RTS "R /-'A+ . BAS< "+ F-OO= '"*<% "F A )R"C<SS.  <Q)<RI<+C< "F SII%%<* ")<RAT"RS A+* I+".S .IT/ ")<RATI"+S A+* B= -SI+."RIS I+ .S"-RC< "F F-OO= C"+TR"% R-%<S 2.ICA% F"R'.%<*.A=S <AS= T" )-T T/<IR I+"."R*S.  <Q)<RTS 'A= +"T B< AB%< T" <Q)R<SS T/<IR .S I+C"')%<T<%=.  . <Q)<RT <Q)<RI<+C< A+* C"+TR"% <+./ I+T<RGI<.

F-OO= 6IF(T/<+7 R-%<S IF Q IS A A+* = IS B T/<+ O IS C.  /AS ABI%IT= T" CR<AT< F-OO= C"+TR"% R-%<S A+* '"*IF= T/<' BAS<* "+ <Q)<RI<+C<.")<RAT"RS. C"+TR"%%<R. BAS< "+ %<AR+I+.A+IOI+. F./ D-A%IT= C"+TR"%.  S<%F "R.+ "F A C"+TR"%%<R AI'<* AT T/< /I. Antecedent 0!remise3 Conse.uent 0conclusion3 R = 4 A ∩ B5 → C µR = 4 µA 0 x3 ∧ µB 0 y 35 → µc 0 z 3 Error NB PB PM PS PO NO NS NM NB % % PS PM PM PB PB PB NM % % PS PM PM PB PB PB Ch !"# o$ Error NS NM NM NO PS PS PM PB PB Z NB NB NB NO NO PM PB PB PS NB NB NB NS NS NO PM PM PM NB NB NB MN MN NS % % PB NB NB NB MN MN NS % % .  A B<TT<R '<T/"*S IS BAS<* "+ A F-OO= '"*<% "F T/< )R"C<SS F"R T/< *<SI.






The !ressure alues ensure that only rules 8 and : fire.For an e&am!le. and the !ressure is in the KlowK and Ko$K states. assume the tem!erature is in the KcoolK state. Rule 8 is e aluated as .

followsA Rule : is e aluated as followsA .

The two out!uts are then combinedA .

KcoolK. A!&'(o)* +r *#. The ariable Ktem!eratureK in this system can be subdi ided into a range of KstatesKA KcoldK. KhotK. .The out!ut alue will ad#ust the throttle and then the control cycle will begin again to generate the ne&t alue. consider an anti(loc$ bra$ing system directed by a microcontroller chi!. KmoderateK. The transition from one state to the ne&t is hard to define. . KwarmK. K ery hotK. s!eed. and other ariables in the system. As a first e&am!le. The microcontroller has to ma$e decisions based on bra$e tem!erature.

But this would result in a discontinuous change when the in!ut alue !assed o er that threshold. tem!erature.e.Indeed. in this case. The way around this is to ma$e the states fuzzy. .ith this scheme. Adding additional so!histication to this bra$ing system.J nominal and 1. allow them to change gradually from one state to the ne&t. using the abstraction of alues from multi!le alues. the in!ut ariable>s state no longer #um!s abru!tly from one state to the ne&t. as the tem!erature changes.425 %ogical inter!retation of fuzzy control In s!ite of the a!!earance there are se eral difficulties to gi e a rigorous logical inter!retation of the IF-THEN rules. Instead. the Ktruth alueK of the bra$e tem!erature will almost always be in some degree !art of two membershi! functionsA i. and so on . according to the designed fuzzy system.A >1. Then we can translate this system into fuzzy !rogram in such a way that f is the inter!retation of a ague . In order to do this there must be a dynamic relationshi! established between different factors. The abo e e&am!le demonstrates a sim!le a!!lication. s!eed. at e&actly U1 degrees. howe er. At any sam!led timeframe. inter!ret a rule as IF (temperature is "c l!"" THEN (#eater is "#i$#"" by the first order formula C l!(x"%Hi$#(y" and assume that r is an in!ut such that C l!(r" is false. In other words. as would be re. As an e&am!le. denote by f the fuzzy function arising of an IF(T/<+ systems of rules. That is. inertia.M nominal and 1.An arbitrary static threshold might be set to di ide KwarmK from KhotK. A rigorous logical #ustification of fuzzy control is gi en in /V#e$>s boo$ where fuzzy control is re!resented as a theory of /V#e$>s basic logic.erla 811H a logical a!!roach to fuzzy control is !ro!osed based on fuzzy logic !rogramming. This only re!resents one $ind of data. Also in . could be done by additional factors such as traction. Then the formula C l!(r"%Hi$#(t" is true for any t and therefore any t gi es a correct control gi en r. it loses alue in one membershi! function while gaining alue in the ne&t.F warm>.: cool>. its ran$ing in the category of cold decreases as it becomes more highly ran$ed in the warmer category. The transition wouldn>t be smooth. For e&am!le. warm ends and hot begins.e start by defining the in!ut tem!erature states using Kmembershi! functionsKA .uired in bra$ing situations. set u! in dynamic functions. or >1. .

!redicate & !(x'y" in the least fuzzy /erbrand model of this !rogram. . This gi es further useful tools to fuzzy control Ch -&#r .

The system is designed so that. which is a mathematical model of the system. called the controllerA . The aim is to !ro ide a desired out!ut alue. FUZZY TEMPERATURE CONTROLLER IN SHOWER F/001 (o"') )o!&ro((#r. 2FLC3 Consider an o!en loo! system ha ing a control in!ut / and an out!ut 1A The control in!ut u determines the out!ut after a certain law 0e. Changing u de!ends on changing y from yL and is !erformed by another system connected between the e&it and entry system. in the absence of disturbances and ariations of system !arameters. Therefore.uation3.FUZZY LOGIC CONTROL SYSTEMS. But this situation 0absence of disturbances3 did not occur in !ractice yL y if we o!en loo! system with u W uL. yL. u should change from uL so as to com!ensate the disturbances. to ensure yWyL in the !resence of disturbances. y W yL for a gi en in!ut u W uL.

or a fee!bac( system.u0$(23. the controllerul has a memory of t. and t is the order of the controller. but also commands u to earlier moments of timeA u0$3Wf0e0$3. The out!ut of the controller.. is the control in!ut of the system and generally de!ends on errors in !re ious moments of time between out!ut y and desired out!ut yL.e0$(t3. The classical control laws areA a3 the !ro!ortional control law 0)3A uWI!Le WX u0$3W I!Le0$3 .....The system is called a cl se! l p system. u. f is non(linear..u0$(t3 where f defines the control law. The error e is defined asA e0$3WyL(y In general. If t X 1..e0$(23.') ( )o!&ro( ( 4. In classical control theory.. f is inferred based on the mathematical model of the !rocess in o!en loo! C( ..

.i en a F%S with the following in!uts e0$3. .u0$(23. e0$(t3.. and the fuzzy controller out!ut is the u. the )I controllerA F/001 )o!&ro((#r. meaning that the !re ious out!ut u0$(23 does not fall within the fuzzy rules9 the fuzzy rules only co er e0$3 and e0$(23. e0$(23 . and so the fuzzy controllers used most commonly are for t W 2A u0$3 W f0e0$3..u0$(233 Ty!ical fuzzy controllers ha e a sim!lified form. for e&am!le.. . In general..u0$(t3 we can find a linguistic de!endancy between u0$3 and these in!uts. defined asA .b3 the integral control law 0I3A or. if discreteA c3 the deri ati e control law 0*3A d3 combinations of these laws... it>s difficult to e&!ress this de!endancy for t X 2.e0$(23.

and where F W the transfer function of the F%S. Ty!ically. gi en byA • • • • the fuzzy sets for the in!uts and out!ut the fuzzy rule base the inference mechanism the defuzzification method. the cris! in!uts of the F%S areA • • the error e0$3 the ariation of the errorA and the out!ut is .

thus the ob#ecti e can be seen asA 6e is O<7. This ty!e of fuzzy controller was !ro!osed by 'amdani and Assilian in 2UJH. E5 6-(# % M 67 !' &1-# FLC • Fuzzy sets for in!uts and out!ut The easiest way is to use three fuzzy setsA +egati e0+3. meaning e W yL(y W 1. In addition. and is called 'amdani ty!e F%C. • The fuzzy rule base The fuzzy rules are deduced ta$ing into account that the ob#ecti e isA y W yL. for the in!uts and the out!utA N8 ZE and P ma$e a fuzzy !artition. consider that the out!ut y aries in the same manner as the command uA . This 617 must be fuzzified.This F%S is a fuzzy logic controller F%C with t W 2. Oero0O<3 and )ositi e0)3.

y W cst ( if u decreases.3. y decreases In order to deduce the rules of the F%C. and the defuzzification method used is C"A 0C". y encreases ( if u W cst. the C%F interference mechanism used is 'amdani 0ma&(min3. all the !ossible combinations between the in!uts must be e&aminedA In general.( if u encreases. The ty!ical res!onse of a system for automatically ad#usting to a ste! signal is !resented in the ne&t figure and can be characterized by se eral !arametersA • • rise time' pea( time' settli)$ time *ers# t .

T#6-#r &/r# )o!&ro((#r The control system consists of a !rocess 0o en3 and the fuzzy controller. A !ossible bloc$ diagram for such a control system is shown in the figure belowA whereA • • • Ts Y the desired tem!erature in the ca ity 0Set )oint Tem!erature3 Tout Y measured tem!erature 0from the tem!erature sensor inside the o en3 cu!torului3 error Y error W Ts Y Tout .

The o en heat relie ed to the e&ternal en ironment is at the tem!erature Te. The tem!erature controller ad#usts the !ower dissi!ated to the heating element. For modelling the generation and transfer of heat.ues are ery useful and easy to use .ual to the !rescribed tem!erature 0Ts3. connected through a resistance Rho W 1.5.ues are hardest to a!!ly. 2UUF3. these techni.ui alent circuit in the figure belowA The !ower current source 0thermal !ower3 re!resents the !ower su!!lied to the heating? cooling element. The abo e com!rises a heating ? cooling system with an electric ca!acity of ChWH114E?ZC5. and to which classical control techni.5. and the command in!ut of the !rocess3 The controller>s role is to maintain the o en tem!erature e. through the heat transfer resistance RoW1.24ZC?. The way to a!!roach such a !roblem is to reduce the com!le&ity by increasing the uncertainty of the ariables 0E. AFuzzy control of tem!erature The use of the Fuzzy %ogic methodology in real systems is immediately a!!licable to those systems whose beha ior is $nown based on im!recisely defined rules. Sala et al. we use the e. in !roblems that !resent non(linearities.. This im!recision arises from the com!le&ity of the system itself. 81119 =ager [ File . Thus.• !ower ( !ower re.uired for heating ? cooling 0tem!erature controller out!ut.2F:4ZC?. for a furnace heating ca!acity CoW21114E?ZC5. by com!aring the o en>s tem!erature Tout to the reference tem!erature Ts 0Tem!erature Set )oint3.

Said rules are !ro ided by an e&!ert. we need only a!!ly rules of the ty!e 6If the flow is e&cessi e. a general $nowledge base for the system is a ailable9 that is. a set of rules that aim to model the actions to be carried out on the system so as to achie e the desired action. This last rule ty!e is the most fre. -sing !recise magnitudes such as 6flow rate of 2. The 'andani fuzzy inference mechanism is ery useful when a!!lying Fuzzy %ogic to the control of systems 0)assino. we can formulate different rules of the ty!e 6If the cost is small and the .uently seen in daily life. 81129 . the !ressure is small7. the systemsT beha ior can be gi en by a set of rules that are often im!recise. ma$e a large in estment7. 2UUF3. Therefore. which define the beha ior of a system. be they highly com!le& or not. or 6If the flow is low. the controller has enough information about the system to determine the command that must be a!!lied . to regulate water flow from a faucet.ang. one whose e&!erience with handling the system !ro ides him with $nowledge of how the system beha es. close the ta! a lot7. 2UUN3.0Ta$ana [ Sugeno. If we consider a classic feedbac$ scheme. o!en the ta! a little7 in order to carry out the desired action.uality is good. 2UU89 Tana$a [ .8 gallons?minute7 or 6turn FH\ cloc$wise7 is unnecessary.ang. or that rely on linguistic terms laden with uncertainty. This results in rules of the ty!e 6If the olume is large. If we focus on the rules that are defined to control the system. In the ast ma#ority of systems. For e&am!le.

and hence they are referred to as a whole as a fuzzy control rule base. !ut forth by Oadeh. If we wish to a!!ly this control scheme to a real system. which relies on !recise magnitudes 0Eantzen. Said rules contain fuzzy sets 0linguistic terms3 in the antecedents and in the conse. the fuzzy controller must be ad#usted to e&isting sensor and actuator technology. for using Fuzzy Control algorithms relies on introducing the $nowledge base into the controller such that its out!ut is determined by the control rules !ro!osed by the e&!ert. The idea. .uents. said system so as to achie e a desired set!oint.

<&ercices <&!eriments will be conducted in the 'atlab Simulin$ en ironment. *uring the simulations. we used two bloc$s of linear con ersion of the in!ut fields 0error Scale. . Saturation23. 2. =ou can use a 'amdani or Ta$agi( Sugeno 0TS3 system. you are encouraged to iew the fuzzy rules and to follow the time ariations of arious signals. using the KSco!eK feature. To ensure the KgeneralityK of the fuzzy controller. to ma$e sure that the alues !ro ided at the in!ut are inside the uni erse of discourse. at your choice. Scale delta]error3 and a con ersion bloc$ for the out!ut 0Scale !ower3. The bloc$ scheme of the system used is shown in the figure below. Also. Im!lement the fuzzy tem!erature controller in 'atlab. we used limitation bloc$s 0Saturation.

8. Giew the contro surface :. Sa e the system as 6Tem!Control'.fisT for 'amdani ty!e, or 6Tem!ControlTS.fisT for TS ty!e. F. %oad the Simulin$ model for the fuzzy tem!erature controller, 6Tem!Control'.mdl7 for 'amdani ty!e, or 6Tem!ControlTS.mdl7 for TS ty!e. ( set the simulation time at :111 ( run the model ( iew the wa eforms on the oscillosco!e ( determine the !aramaters of the control systemA rise time, o ershoot, settling time, using the KzoomK features of the oscillosco!e. ( modify the scaling factors for the in!uts and analyze the effect of these modifications ( redesign the system in order to increase its !erfomances 0shorter rise time and settling time, lower o ershoot3


F-OO= T<')<RAT-R< C"+TR"%%<R I+ S/";<R

There are two in!uts to the fuzzy controllerA the water tem!erature and the flow rate. The controller uses these in!uts to set the !osition of the hot and cold al es F'" ,ho4'!" &#6- &/r# )o!&ro( '! ,ho4#r

Fuzzy controllers are very simple conceptually. They consist of an input stage, a processing stage, and an output stage. The input stage maps sensor or other inputs, such as switches, thumbwheels, and so on, to the appropriate membership functions and truth values. The processing stage invokes each appropriate rule and generates a result for each, then combines the results of the rules. Finally, the output stage converts the combined result back into a specific control output value. The most common shape of membership functions is triangular, although trapezoidal and bell curves are also used, but the shape is generally less important than the number of curves and their placement. From three to seven curves are generally appropriate to cover the required range of an input value, or the "universe of discourse" in fuzzy jargon. s discussed earlier, the processing stage is based on a collection of logic rules in the form of !F"T#$% statements, where the !F part is called the "antecedent" and the T#$% part is called the "consequent". Typical fuzzy control systems have dozens of rules.

&onsider a rule for a thermostat' IF (temperature is "cold") THEN (heater is "high

This rule uses the truth value of the "temperature" input, which is some truth value of "cold", to generate a result in the fuzzy set for the "heater" output, which is some value of "high". This result is used with the results of other rules to finally generate the crisp composite output. (bviously, the greater the truth value of "cold", the higher the truth value of "high", though this does not necessarily mean that the output itself will be set to "high" since this is only one rule among many. !n some cases, the membership functions can be modified by "hedges" that are equivalent to adjectives. &ommon hedges include "about", "near", "close to", "appro)imately", "very", "slightly", "too", "e)tremely", and "somewhat". These operations may have precise definitions, though the definitions can vary considerably between different implementations. "*ery", for one e)ample, squares membership functions+ since the membership values are always less than ,, this narrows the membership function. "$)tremely" cubes the values to give greater narrowing, while "somewhat" broadens the function by taking the square root. !n practice, the fuzzy rule sets usually have several antecedents that are combined using fuzzy operators, such as %-, (., and %(T, though again the definitions tend to vary' %-, in one popular definition, simply uses the minimum weight of all the antecedents, while (. uses the ma)imum value. There is also a %(T operator that subtracts a membership function from , to give the "complementary" function. The following steps shows how to use a fuzzy"logic inference system in a /imulink mode , .$01!.$- 2.(-1&T
To run this e)ample, /imulink is required.

if ~fuzzychecktoolbo i!stalled("simuli!k") disp("#imuli!k($) is re%uired to ru! this e ample&") retur! e!d

Simulation /imulate controller response with periodic changes in the setpoints of the water temperature and flow rate. set'param("sho(er)flo( scope"*"+pe!"*"o!"*",mi!"*"-"*",ma "*".")/ set'param("sho(er)temp scope"*"+pe!"*"o!"*",mi!"*".0"*",ma "*"1-")/ sim("sho(er"*0-)/

. $&#r ,/!/( &'o! )o!&ro((#r 4&h -#r'o7') r#,-o!,# $(o4 ,)o-#

&/r# .T#6.)o-# .

bdclose("sho(er")/ C/A)T<R F .

-IN& A F+..DESIGN APPROACH 4.ER L Consider im!lementing with a microcontroller chi! a sim!le feedbac$ controllerA .1 OVERVIEW B+I./ C0NTR0..

the to! row alues are used to generate the mu alues.: 1 1 1 1.8H 1. with the error ? delta ? out!ut alues in the to! row and the truth alues for each membershi! function arranged in rows beneathA ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] (2 (1.J 1.8H.: 1 1 1.JH 2 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] mu0%)3 mu0S)3 mu0O<3 mu0S+3 mu0%+3 1 1 1 1.: 1 1 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] This table is a little tric$y to inter!ret.H 1.J 1. KdeltaK. as well as the Kout!utK. also a!!lies to the out!ut ariable3 can be described ery sim!ly as a table. It sim!ly defines each of the elements of the fuzzy set 0K%)K through K%+K3 in terms of the alues 0KmuK3 that they ha e relati e to the gi en alues in the to! row.: 2 1.8H 1 1.: 2 1.: 2 1. . the mu alues are used to generate the to! row alues. while for the out!ut ariable.J 1. in this case. and the deri ed change in error from the !re ious error in!ut.JH (1.J 1 1 1.J 1. as followsA %)A large !ositi e S)A small !ositi e O<A zero S+A small negati e %+A large negati e If the error ranges from (2 to R2.A fuzzy set is defined for the in!ut error ariable KeK.J 1 1 1 2 1. It is im!ortant to remember that for the error ? delta ariables.: 2 1 1 1 1.J 1 1 1. then the in!ut ariable>s fuzzy set 0which. with the analog(to(digital con erter used ha ing a resolution of 1.: 1 1 1.H (1.J 1 1 1.

L +ow. The alue for the out!ut setting is defined by rule 2 as KO<K. alue is the O< fuzzy set element. weighted by the alues by the a!!ro!riate mu alues !ro ided by the rule calculation. using the centroid calculationA S-'0 I W 2 T" F "F 0 mu0I3 L out!ut0I3 3 3 ? S-'0 I W 2 T" F "F mu0I3 3 The result of this calculation gi es the actual out!ut setting. while the conse. what rule 2 says is that if the error alue is the O< fuzzy set element and the delta. %oo$ing at the fuzzy alue table shows that KO<K has its ma&imum alue corres!onding to the alue of K1K on the to! row of the table. at least directly. then the out!ut is also the O< fuzzy set element.uent is a control command out!ut. su!!ose that at a gi en time we ha eA error W 1.H. Similarly. The thing to remember is that the actual out!ut is a c mbi)ati ) of the out!uts of these four rules.hat is *ery tric$y is that !lugging actual numeric alues into this rule does ) t gi e. and so this rule al1ays gi es an out!ut setting of 1. or change from last error. rule : always gi es an out!ut setting of K%)K or 2. an actual alue for the out!ut setting. . These rules can also be a little tric$y to inter!ret. For e&am!le. rule 8 always gi es an out!ut setting of KS+K or (1.Su!!ose this fuzzy system has the following rule baseA rule 2A IF e W O< A+* delta W O< T/<+ out!ut W O< rule 8A IF e W O< A+* delta W S) T/<+ out!ut W S+ rule :A IF e W S+ A+* delta W S+ T/<+ out!ut W %) rule FA IF e W %) "R delta W %) T/<+ out!ut W %+ These rules are ty!ical for control a!!lications in that the antecedents consist of the logical combination of the error and delta signals. and rule F always gi es an out!ut setting of K%+K or (2.8H .

: 3 W 1. Kmu023K.8H delta W 1.J out!ut083 W ( W 1.: 2 1.J.H rule :A IF e W S+ A+* delta W S+ T/<+ out!ut W %) .: As mentioned abo e.H Then the corres!onding mu alues can be obtained by sim!ly ta$ing them from the a!!ro!riate columns of the fuzzy set tableA ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] error W 1.: 1 1 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] These alues can then be !lugged into the rules to gi e out!ut alues.H ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] mu0%)3 mu0S)3 mu0O<3 mu0S+3 mu0%+3 1 1. 1.J 1. 2 3 W 1. is !roduced with the sim!le calculationA mu023 W 'I+0 1.J. the out!ut alue of this rule is always 2A out!ut023 W 1 The other rules gi eA rule 8A IF e W O< A+* delta W S) T/<+ out!ut W S+ mu083 W 'I+0 1.J 1 1 1. Ta$ing the first ruleA rule 2A IF e W O< A+* delta W O< T/<+ out!ut W O< The weighting for the out!ut.

: W (1.:H R 1 ( 1.mu0:3 W 'I+0 1.H 3 R 0 1 L 2 3 R 0 1.: 1 ( 1.1 3 W 1 out!ut0:3 W 2 rule FA IF e W %) "R delta W %) T/<+ out!ut W %+ mu0F3 W 'AQ0 1.J R 1 R 1.: R 1.J L (1.H .1.: W ]]]]]]]]]]]]]]]]]] 2. 1.: out!ut0F3 W (2 The centroid com!utation yieldsA mu023Lout!ut023 R mu083Lout!ut083 R mu0:3Lout!ut0:3 R mu0:3Lout!ut0:3 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] mu023 R mu083 R mu0:3 R mu0F3 W 0 1.: L (2 3 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] 1.: W (1.MH ? 2.: 3 W 1. 1.: L 1 3 R 0 1.1.

.... . R 'n 3 W 0 Q2 L '2 R Q8 L '8 R .. an increase in the occurrence of flooding e ents and es!ecially of flash flooding e ents is li$ely to continue into the future. So if Q1 is the center of gra ity. In those conditions and because building new flood defenses structures for defending ulnerable areas has serious financial im!lications. . the alues of mu corres!ond to the masses.. based on mirroring natural !rocesses with !hysically based e.uating the sum to zero. L If you ha e !roblems figuring out the centroid e. R 'n 3 Q1 L 0 '2 R '8 R . "f course the hard !art is figuring out what rules actually wor$ correctly in !ractice. R 'n 3 In our e&am!le. this gi esA 1 W 0 Q2 ( Q1 3 L '2 R 0 Q8 ( Q1 3 L '8 R .(( for the final control out!ut. " er iew of the artificial neural networ$s and fuzzy logic a!!lications in o!erational hydrological forecasting systems *amage due to flooding has increase in many countries in the last years. and the alues of Q to location of the masses.. remember that a centroid is defined by summing all the moments 0location times mass3 around the center of gra ity and e.... The com!le&ity of natural systems and of hydrological !rocesses that influence ri er le els e olutions ma$e the traditional modeling a!!roaches.uations ery difficult.uation... R 0 Qn ( Q1 3 L 'n 1 W 0 Q2 L '2 R Q8 L '8 R . and due to the global climate change. and 'i is each mass.. which is now recognized as a real threat. the timely forecasting of floods is becoming more im!ortant for flood defense and in general for water management !ur!oses. R Qn L 'n 3 0 Q2 L '2 R Q8 L '8 R .. R Qn L 'n 3 ( Q1 L 0 '2 R '8 R . Qi is the location of each mass. R Qn L 'n 3 Q1 W ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] 0 '2 R '8 R .

and they ha e already been demonstrated as successfully substitutes for the classical rainfall Y runoff models. artificial neural networ$. becoming more and more com!le& systems. !ro!erty and other damages. "!erational hydrological forecasting systems. es!ecially in situations where the !hysical !rocesses relationshi!s are not fully understood and they are also !articularly well suited to modeling com!le& systems on a real(time basis. ri er discharges and water le els. so within the fuzzy set theory an element can ha e a gradual membershi! to different sets. you need to define fuzzy sets. o!erational hydrological forecasting systems "!erational hydrological forecasting systems "n a global scale. Better forecasting floods and with a larger lead time. . which lin$ state of the ri er catchments. fuzzy rules or so called IF(T/<+ rules and a!!ly a fuzzy inference scheme.*es!ite the fact that in the last decades the "!erational /ydrological Forecasting Systems were significantly de elo!ed. can be used to res!ond to floods as they occur and to reduce their costs in term of li es. IeywordsA hydrological forecasting model. and also as tools for the real time u!dating of hydrological forecasting models and es!ecially for the multimodal a!!roach. artificial neural networ$s and fuzzy logic systems. together with the use of distributed hydrological models. Fuzzy logic is a generalization of Boolean logic im!lementing the conce!t of !artial truth or uncertainty. ingesting and !rocessing in real time a great amount of data from automated hydrometrical and meteorological stations networ$s and high resolution gridded data from radars and satellites. the warning and forecasts im!ro ements are not ery significant. floods account for o er MH^ of !eo!le affected by natural disasters and they are the most damaging of all natural disasters. both artificial neural networ$s and fuzzy logic modeling systems offer the !otential for a more fle&ible. is the main sustainable way of ada!ting to and managing such disasters. In conclusion. Artificial neural networ$s are widely used as an effecti e a!!roach for handling non(linear and noisy data. and !resenting also some e&am!le of rainfall(runoff modeling im!lementations. !ossible a!!lications for the im!ro ements of the "!erational /ydrological Forecasting Systems. in many cases the !erformance of the new !hysically based distributed models being com!arable with the 6older7 conce!tual lum!ed models. less assum!tion a!!roach to hydrological !rocesses. recorded !reci!itations and weather forecasts. fuzzy logic. The generation of a fuzzy forecast model can be based both on e&!erts $nowledge and historical data. To describe system beha ior with fuzzy logic. The !a!er !resents an o er iew of some alternati e and com!lementary modeling a!!roaches.

as the !ublic !erce!tion of warnings messages may be ery im!ortant. li$e accuracy. "!erational hydrological forecasting systems ha e 0or could ha e3 the following com!onentsA *ata ac. and not #ust to the accuracy of a forecast for a !articular flood. location and timing.enerally the longer the lead times the less accurate and reliable are the forecasts of flood magnitude. In s!ecial situations. ReliabilityA Can be associated with accuracy.Current flood forecasting and warning systems ha e se eral limitations. Forecasts re. . 'oreo er their ability in considering the uncertainties in estimating and forecasting !reci!itation and flood discharges is ery limited.uire both data collection and modeling. such as. and the data ty!e and a ailability ha e ma#or im!lications on the modeling !art of the system.uantitati e !reci!itations forecasts. if sufficient lead(time is a ailable and the !redictions are accurate then e acuation. insufficient lead(time to !ro ide accurate flood warnings. -nfortunately the !resent results of the numerical meteorological . but also can be limited by the hydrological models or forecasting methodologies that are im!lemented. AccuracyA Is usually related to the correctness the forecasts of the magnitude and time of the flood !ea$ and of the resulting le els. The reliability. and there is a natural conflict between the desire for greater forecast lead time and greater accuracy and reliability 0usually the warning messages are based on model simulations that ta$e into account #ust the recorded !reci!itations and not the forecasted !reci!itations3. inade. The increase of the lead(time is mainly limited by the a ailability of reliable . it may relate to the forecasts of the com!lete hydrogra!h of the flood. little integration of different sources of forecast information. accuracy and reliability ary from catchment to catchment. affects the confidence in deciding on res!onse measures. e en of relati ely large numbers of !eo!le may be !ossible.uisition systemsA Is the basic com!onent for an o!erational system.uate s!atial and tem!oral resolution of the real(time rainfall obser ations and forecasts for flood !roducing storm. The more accurate the forecast the better flood control?modification and damage mitigation measures can be im!lemented. The desirable characteristics of a good flood forecasting system areA TimelinessA The lead(time is the time between ma$ing a forecast of an e ent and its occurrence. It should always forecast a flood when one occurs and it should not forecast floods when one doesnTt occur. The amounts of data and the com!le&ity of the modeling necessary to achie e s!ecific targets of lead(time. Rainfall forecasts modelsA Is the most im!ortant !art for the forecast lead(time increase. but is related to the o erall long(term reliability of the flood forecasting system. -sually the long(term reliability of the system can be assessed by its !erformance in two res!ects.

+eural networ$s are com!osed of many sim!le elements o!erating in !arallel. Artificial neural networ$s can be characterized most ade. etc. classification. "n short term.uately as com!utational models with !articular !ro!erties such as the ability to ada!t or learn. traffic. and the field is still de elo!ing ra!idly. generally each connection is defined by a weight which determines the effect which the signal of one unit has on other unit9 a !ro!agation rule. or to cluster or organize data. and allow reasonable estimations of flood ma!s. flood im!act analysis could be finally obtained by su!erim!osing flood ma!s with . and which o!eration is based on !arallel !rocessing. s!eech. which also determines the out!ut connections between the units. which are still the most used models in o!erational. These elements are ins!ired by biological ner ous systems. but the general direction is to use a!!ro!riate hydraulic models. Rainfall(runoff forecasts modelsA The !ossible a!!roach e&tend from the e&tremely sim!le forecast relations.ithin neural systems it is useful to distinguish three ty!es of unitsA in!ut units which may recei e data . agriculture. The networ$ function is determined largely by the connections between elements.models are not enough accurate for the hydrological forecasts a!!lications. forecasting. Flood im!act analysis com!onentA If flood ma!s are a ailable. to generalize. A set of ma#or as!ects can be distinguishedA of the unit9 a set of !rocessing units 0neurons39 a state of acti ation for e ery unit. identification. Artificial +eural +etwor$s 'odels The field of neural networ$s has a history of fi e decades but has found solid a!!lication only in the !ast decade. through conce!tual semi(distributed models. which determines the effecti e in!ut of a unit from its e&ternal in!uts9 an acti ation function. to com!le& !hysically based models. which ta$e into account the ri er geometry. which determines the new le el of acti ation based on the effecti e in!ut and the current state9 an e&ternal in!ut or offset for each unit9 a neural networ$ architecture9 a training method. Flood routing and flood !lain modelsA The hydrological routing methods are still e&tensi ely used. e ent ty!e model. +eural networ$s ha e been trained to !erform com!le& functions in arious fields of a!!lication including !attern recognition. the solution could be a combination with the short future scan estimations based on radar information.IS georeferenced s!atial data on constructions. . ision and control systems. An artificial networ$ consists of a !ool of sim!le !rocessing units which communicate by sending signals to each other o er a large number of weighted connections.

the end of training. being so a good choice for real(time im!lementations of neural networ$s models.which is a "!en Source Ea a framewor$ 0%.)% licence3 that can be used to build and run a!!lications based on neural networ$s. *efuzzification layerA In the defuzzification layer each neuron re!resents a conse. ha e been re!orted by a large number of researchers. which is used in the main networ$ module. within the networ$. The first model can be used to estimate the !ea$ discharge and the associated moment of occurrence using as in!ut data the rainfall amount and duration. es!ecially in the last decade. After getting the corres!onding out!ut the ad#ustment is made in the connection weights and the membershi! functions in order to com!ensate the error and !roduce a new control signal. !ro iding so a ma&imum lead time alue. where im!lemented two ty!es of e ent forecasting models using feed forward neural networ$s with modular structure.from outside the system. E""+< a!!lications can be built on a local machine. is using the last 21 day rainfall information and the initial discharge in order to estimate an internal inde& for the soil moisture state. of those different com!uting techni. for the . *ifferent successfully a!!lications. +eural +etwor$s models e&!erimentation For !reliminary e&!erimentations of using neural networ$s models in the hydrological forecasts elaboration. Between the a!!lications that are related to the hydrological forecasting acti ity we can mentionA Rainfall(runoff modelling9 Flood routing9 *irectly forecasts of water le els9 %in$ different indi idual forecasting models into a single forecasting system 0multimodel ?consensus ? combination ri er flow forecasting39 Forecasting ri er ice #ams brea$(u!9 Duantitati e !reci!itations forecasts9 'odelling of the flood forecasting uncertainty9 Ri er flow forecasts u!dating techni.uent and is stage(discharge relationshi!. initial discharge and the daily rainfall alues for the last 21 days. out!ut units which send data out of the system and hidden units whose in!ut and out!ut signals remain within the system itself.#oone.uent !ro!osition and its membershi! function can be im!lemented by combining one or two sigmoid functions and linear functions. be trained on a distributed en ironment and run on whate er de ice or from e&ternal Ea a a!!lications using the !ro ided classes library. The rainfall amount and duration can be ta$en from the meteorological forecasts. "ne module.ue9 Control and o!timization of reser oir o!erations9 Re!licating com!le& hydraulics or rainfall(runoff models9 +on(linear. The models im!lementation was done using E""+< software framewor$ 0htt!A??www. The weight of each out!ut lin$ here re!resents the centre of gra ity of each out!ut membershi! function of the conse. non(uni.

In the figures F and H are !resented some of the results obtained with the two models. which is digitalized by .2H G.8 $m8 and a mean altitude of HNM m. In the ne&t : years. es!ecially in situations where the !hysical !rocesses relationshi!s are not fully understood and they are also !articularly well suited to modelling com!le& systems on a real(time basis. one hour ahead. being es!ecially useful when the relation between in!ut and out!ut s!ace ariables is not well($nown. Both artificial neural networ$s and fuzzy logic modelling systems offer the !otential for a more fle&ible. which is situated in the western !art of Romania. and also as tools for the real time u!dating of hydrological forecasting models and es!ecially for the multimodel a!!roach. C"+TR"%%<R *<SI.AT decisional and informational integrated national system for management in case of disasters !ro#ect will be im!lemented. we intend to in estigate the !ossibility of adding into the system of modelling com!onent using the neural networ$ and fuzzy logic a!!roaches.-I*A+C< com!onent. After the first year modelling system im!lementation.+ The out!ut from the tem!erature sensor is in the form of analog oltage ranges 1(1. for some s!ecific catchments9 F%AS/ F%""* . a!!lications we can summarizes the following conclusionsA Both neural networ$s and fuzzy logic models are a con enient way to ma! an ndimensional in!ut s!ace to an m(dimensional out!ut s!ace. recorded in the last : hours.flood characteristics estimations. The two different models were a!!lied for 'oneasa Ri er Basin. the national *<S.eather Ser ice Ri er Forecasting System 0+. The hydrological modelling and forecasting system of this !ro#ect will im!lement the following modelling com!onentA +ational . e&ce!t the fact that is a nonlinear relation.SRFS ( -SA39 +"A/ Y %IS distributed modelling com!onent9 T")%ATS distributed model. Fuzzy logic is a The ery !owerful tool for dealing . The second model im!lementation is a continuous e ent model. the discharge alue. than use as in!ut data the hourly time series alues of rainfall and discharges. generation of a fuzzy forecast model can be based both on e&!erts $nowledge and historical data. less assum!tion a!!roach to hydrological !rocesses. Artificial neural networ$s are widely used as an effecti e a!!roach for handling non(linear and noisy data. in order to simulate.uic$ly and efficiently with im!recision and nonlinearity. and they ha e already been demonstrated as successfully substitutes for the classical rainfall Y runoff models. with an area of JM. in the Crisul Alb Ri er basin.

the out!ut is e aluated which is used in control action. following ste!s are designedA Ste! "neA *efine In!uts and "ut!uts for the Fuzzy %ogic Controller Ste! TwoA *efine frame for fuzzy ariables Ste! TheeA Assign membershi! alues to fuzzy ariable Ste! FourA Create a rule base Ste! Fi eA Fuzzify in!uts to the fuzzy logic controller Ste! Si&A *etermine which rule fires Ste! Se enA Infer the out!ut recommended by each rule Ste! <ightA Aggregate the fuzzy out!uts recommended by each Rule Ste! +ineA *efuzzify the aggregated fuzzy set to form cris! out!ut from the fuzzy logic controller. The in!ut ariables of the fuzzy logic controller areA <rror W Set !oint Y 'easured tem!erature Change in error W Current error Y )re ious error . The in!ut ariables are fuzzified and after !ro!er defuzzification using rule base and aggregation methods.*AD. To achie e the accurate out!ut from the fuzzy inference system.


2 SIMULINK S imulin$ is a gra!hical e&tension to 'AT%AB for modeling and simulation of systems. 'any elements of bloc$ diagrams are a ailable.CHAPTER 9 TOOL DESCRIPTION 5. In Simulin$.. Simulin$ is integrated . summing #unctions. as well as irtual in!ut and out!ut de ices such as function generators and oscillosco!es. such as transfer functions. etc. systems are drawn on screen as bloc$ diagrams.

ss Simulin$ is started from the 'AT%AB command !rom!t by entering the following commandA simulin$ Alternati ely. The first is the main Simulin$ window. Simulin$ brings u! two windows. build controllers. Simulin$ is su!!orted on -+IQ. In these tutorials. and simulate the systems. 'acintosh.hen it starts. and . you can hit the +ew Simulin$ 'odel button at the to! of the ' AT%AB command window as shown belowA .with 'AT%AB and data can be easily transferred between the !rograms. we will a!!ly Simulin$ to the e&am!les from the ' AT%AB ssstutorials to model the systems.indows en ironments9 and is included in the student ersion of 'AT%AB for !ersonal com!uters. which a!!ears asA .

etc. Bloc$s are used to generate. -nused out!ut terminals are indicated by a small triangular !oint. The bloc$ shown below has an unused in!ut terminal on the left and an unused out!ut terminal on the right. out!ut. %ines are used to transfer signals from one bloc$ to another. %ines must always transmit signals from the out!ut terminal of one bloc$ to the in!ut terminal of another bloc$. modify. model window.3 %inearA %inear. -nused in!ut terminals are indicated by a small o!en triangle. Basic Elements There are two ma#or classes of items in Simulin$A +(o)*. untitled. etc. discrete(time system elements 0transfer functions. delay. saturation. state(s!ace models. continuous(time system elements and connections 0summing #unctions.3 ConnectionsA 'ulti!le&9 *emulti!le&. etc. combine. gains. System 'acros. This is the window into which a new model can be drawn.. etc. and ('!#. "n e&ce!tion to this . Blocks: There are several general classes of blocks: • • • SourcesA -sed to generate arious signals Sin$sA -sed to out!ut or dis!lay signals *iscreteA %inear. Lines %ines transmit signals in the direction indicated by the arrow.The second window is a blan$. • • • Bloc$s ha e zero to se eral in!ut terminals and zero to se eral out!ut terminals. and dis!lay signals.3 +onlinearA +onlinear o!erators 0arbitrary functions.

The lines used to transmit scalar and ector signals are identical. The ty!e of signal carried by a line is determined by the bloc$s on either end of the line. Simple Example The simple model 0from the model file section3 consists of three bloc$sA Ste!.mdl3. Transfer a line can ta! off of another line. consisting of two or more scalar signals. ector signals are often used. 'ulti("ut!ut systems. and Sco!e. For Single(In!ut.o/r)# +(o)* from which a ste! in!ut signal originates. The Ste! is a . scalar signals are generally used. as shown below 0clic$ the figure to download the model file called s!lit. For 'ulti(In!ut. . A signal can be either a scalar signal or a ector signal. s!litting the signal to each of two destination bloc$s. %ines can ne er in#ect a signal i)t another line9 lines must be combined through the use of a bloc$ such as a summing #unction. Single("ut!ut systems.

the desired transfer function can be entered.'!* +(o)* used to dis!lay a signal much li$e an oscillosco!e. we will e&amine #ust the three we ha e used in the simple model. if you double(clic$ on the KTransfer FcnK bloc$ in the simple model. The Transfer Function modifies its in!ut signal and out!uts a new signal on a line to the Sco!e. enter the following into the denominator fieldA . to change the denominator to s_8R8sR2. By entering a ector containing the coefficients of the desired numerator or denominator !olynomial. Modifying Blocks A bloc$ can be modified by double(clic$ing on it. For e&am!le.This signal is transfered through the ('!# in the direction indicated by the arrow to the Transfer Function ('!# r +(o)*. There are many more ty!es of bloc$s a ailable in Simulin$. The Sco!e is a . some of which will be discussed later. you will see the following dialog bo&. Right now. This dialog bo& contains fields for the numerator and the denominator of the bloc$>s transfer function. For e&am!le.

. The Kste!K bloc$ can also be double(clic$ed. which reflects the change in the denominator of the transfer function. 0in other words. the model window will change to the following. from an initial le el of zero to a le el of 2. <ach of these !arameters can be changed. The default !arameters in this dialog bo& generate a ste! function occurring at timeW2 sec. a unit ste! at tW23. bringing u! the following dialog bo&.42 8 25 and hit the close button. Close this dialog before continuing.

*ouble clic$ing on this brings u! a blan$ oscillosco!e screen. The only function we will use is the autoscale button. we will wor$ with the following model fileA . the signal which feeds into the sco!e will be dis!layed in this window.hen a simulation is !erformed. Running Simulations To run a simulation. *etailed o!eration of the sco!e will not be co ered in this tutorial. .The most com!licated of these three bloc$s is the KSco!eK bloc$. which a!!ears as a !air of binoculars in the u!!er !ortion of the window.

to start the simulation.uic$ly and the sco!e window will a!!ear as shown below. first o!en the sco!e window by double( clic$ing on the sco!e bloc$. The simulation should run ery . Then. either select S& r& from the S'6/( &'o! menu 0as shown below3 or hit Ctrl(T in the model window.Before running a simulation of this system. .

. which will rescale the a&es as shown below.+ote that the simulation out!ut 0shown in yellow3 is at a ery low le el relati e to the a&es of the sco!e. To fi& this. hit the autoscale button 0binoculars3.

and you should see the following in the sco!e window. . In the model window. =ou will see the following dialog bo&. Simulin$ simulated the system for a full ten seconds e en though the system had reached steady state shortly after one second. This can be changed by double(clic$ing on the Kste!K bloc$. +ow. it it com!ressed into a ery narrow !art of the sco!e window. select P r 6#&#r. To correct this. but with the simulation itself. +otice that the auto scale button only changes the ertical a&is. This is not really a !roblem with the sco!e. you need to change the !arameters of the simulation itself. *ouble(clic$ on the KTransfer FcnK bloc$ in the model window and change the denominator to 42 81 F115 Re(run the simulation 0hit Ctrl(T3 and you should see what a!!ears as a flat line in the sco!e window.+ote that the ste! res!onse does not begin until tW2. we will change the !arameters of the system and simulate the system again. Since the new transfer function has a ery fast res!onse. from the S'6/( &'o! menu. /it the autoscale button.

After hitting the autoscale button. . which should be only shortly after the system settles. Change S& r& &'6# from 1.1 to 1.There are many simulation !arameter o!tions9 we will only be concerned with the start and sto! times.1. which tell Simulin$ o er what time !eriod to !erform the simulation.&'6# from 21.N 0since the ste! doesn>t occur until tW2.1. Change S&o.1 to 8. Close the dialog bo& and rerun the simulation. the sco!e window should !ro ide a much better dis!lay of the ste! res!onse as shown below.





-sing )S" the o!timal location of the series ca!acitors is carried out. The e&act location and the degree of com!ensation for the series ca!acitor to be installed in the transmission line were found out. The o!timized alue for the series ca!acitor is found with the degree of com!ensation. This reduces the effecti e reactance of the line and hel!s reduce the reacti e !ower loss in turn !ro iding high degree of stability to the system. .CHAPTER . Com!ensation in the form of series ca!acitors also increases the !ower transfer ca!ability of the line.. This area of control will also im!ro e and ad ance the study of control engineering in modern systems ..enetic algorithm can be used in future to find the o!timal location of the series ca!acitor for further com!ensation. CONCLUSION AND FUTURE SCOPE . The combination of )S" and .2 FUTURE SCOPE In this !a!er the series reacti e !ower loss minimization is achie ed through the series com!ensation method. The algorithm de elo!ed shows the e&act line for the em!loyment of series ca!acitor.1 CONCLUSION The de elo!ment of a fuzzy logic control system is a way forward to the im!ro ement of industrial automation. This )ro#ect also deals with the o!timal location of the series ca!acitors to minimize the reacti e !ower loss in order to enhance the stability by obtaining the a!!ro!riate alue of com!ensation. The results obtained are erified with the standard I<<< 2F and :1 bus systems.

'A )R<SS ( .. 6Real Time Controls7.R.. .. -SA. Arbib. 6'icrocontroller(Based Tem!erature 'onitoring and Control7. 6"!timal Fuzzy %ogic Control Techni. .o indara#u.. 2UUMA +eural networ$s. theory and a!!lications. 4215French.... %agos. +edunuri..ilmslow.I. E. S. Rochester. 4U5+etwor$s.raw /ill Inc. 6Solutions to Fuzzy 4H5 *ouglas G. Eones Communications.. 4:5 %ewis A. /. 2UUHA The /andboo$ of Brain Theory and +eural. 6'icrocontroller )rinci!les and A!!lications7. 4285%iong. 2UUFA Regional <stimation of Floods for -ngaged Catchments with +eural +etwor$s. Ibadan.eo!hysical Society . and *andy. :8. In Cheong.T. 2UU8A Introducing +eural +etwor$.. 4J5 )eters Andrew.=. +igeria. 212:(2188. -nited Iingdom.C.G.iurgiu '. 8118.Romania.eneration )ublishers. . G. !a!er !resented at the <uro!ean . +guyen. Bucharest..S. 'a&on )ress %td. +igeria..Toderean . Eet )ublishers %td.illam C. 2UUHA -se of neural networ$s in !redicting the nonlinear rainfall(runoff relationshi!s for small watersheds. 811U.eneral Assembly. Blue )ress. %agos. R. 4F5 Francis T./. 2UUH and abstracted in the conference !roceedings. 2UUHA Artificial neural networ$s. R..).. 2UUMA The use of artificial neural networ$s for the !rediction of water .T. 485 . Costeiu '. 2:J..Romania *umitrescu *..F. SI. Chan.. E.+.. /ariton C. . . and Cuy$endall.R. 4M5 Schuster A. 811U. I. and Ioelli$er. 2UU8A Rainfall forecasting in s!ace and time using a neural networ$ Carling A. Clu#(+a!oca.G. /(F.hiteca! )ublishing Co. 2(:2. 6'icrocontrollers and InterfacingA )rogramming /ardware7 'c. Teora.REFERENCES 425 "$orie F. I$e#a. +ew . %agos +igeria. /amburg.ue7.<lse ier Science [ Technology Boo$. . 811N. 4225. -nited States of America.. Anmala. 811N. 'ichael A. 4N5 *ogan Ibrahim. Ira#ews$i. . Eournal of /ydrology.ater Resources Research. <d. +ew =or$.. '.S..C. 811N. =. and Chia....C. 811N.). Fuzzy %ogic and Real Time A!!lications7. 'assachusetts Institute of Technology. T/< 'IT )R<SS.uality !arameters. Shan$ar 'aier. 'aryland.. 6Fuzzy %ogic Systems7. F.

. -I. )roceedings of the 2Mth IA/R Intrnational Sym!osium on Ice. Gol. ing.eogra!hy. Al isi. C. F. -ni ersity of %eeds. ..emmar. )otsdam. Abrahart. F2. Rangan.. 811:A *etection of conce!tual model rainfall(runoff 42:5!rocesses inside an artificial neural networ$.C.Stuber. *unedin. School of . I.ater le el forecasting through fuzzy logic and artificial neural networ$ a!!roaches..E. .using Fuzzy %ogic.%. .-.ater Resources Research. .'. R.. 42H5%inda See. Abrahart. +ewOealand.). Oe$ai. 8111A 'achine su!!orted *e elo!ment of Fuzzy Y Flood Forecast Systems.MH. 811HA Short(term flood forecasting with a neurofuzzy model. <uro!ean Conference on Ad ances in Flood Research.<. '. Tur$ish . Sen. ). Stan "!enshaw. 'ascellani. Robert E.. '. Robinson Faye$. Ramasastri. I. *awson. FN..ater Foundation.ilby. 811HA . 2M:(2N2.S. +aya$. S. A. Sudheer. Bardossy. 2UUNA An Integrated +euro(Fuzzy(Statistical A!!roach to /ydrological 'odelling. !ublished in /ydrology and <arth System Science *iscussions. /ydrological Sciences Eournal. 8118A Forecasting Ice Eam Ris$ at Fort 'c'urray. 42M5). Franchini. /ic$s. <. . *. 'ahabir. 811FA Fuzzy logic and system models in water sciences. R. 42F5'.8.Istanbul. AB. )II Re!ort +r.