Vous êtes sur la page 1sur 6

1/26/2016

Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

FuzzyInferenceProcess
Fuzzyinferenceistheprocessofformulatingthemappingfromagiveninputtoanoutputusingfuzzylogic.Themapping
thenprovidesabasisfromwhichdecisionscanbemade,orpatternsdiscerned.Theprocessoffuzzyinferenceinvolves
allofthepiecesthataredescribedinMembershipFunctions,LogicalOperations,andIfThenRules.
Thissectiondescribesthefuzzyinferenceprocessandusestheexampleofthetwoinput,oneoutput,threeruletipping
problemTheBasicTippingProblemthatyousawintheintroductioninmoredetail.Thebasicstructureofthisexampleis
showninthefollowingdiagram:

Informationflowsfromlefttoright,fromtwoinputstoasingleoutput.Theparallelnatureoftherulesisoneofthemore
importantaspectsoffuzzylogicsystems.Insteadofsharpswitchingbetweenmodesbasedonbreakpoints,logicflows
smoothlyfromregionswherethesystem'sbehaviorisdominatedbyeitheroneruleoranother.
Fuzzyinferenceprocesscomprisesoffiveparts:

Fuzzificationoftheinputvariables

Applicationofthefuzzyoperator(ANDorOR)intheantecedent

Implicationfromtheantecedenttotheconsequent

Aggregationoftheconsequentsacrosstherules

Defuzzification

Afuzzyinferencediagramdisplaysallpartsofthefuzzyinferenceprocessfromfuzzificationthroughdefuzzification.

Step1.FuzzifyInputs
Thefirststepistotaketheinputsanddeterminethedegreetowhichtheybelongtoeachoftheappropriatefuzzysets
viamembershipfunctions.InFuzzyLogicToolboxsoftware,theinputisalwaysacrispnumericalvaluelimitedtothe
universeofdiscourseoftheinputvariable(inthiscasetheintervalbetween0and10)andtheoutputisafuzzydegreeof
membershipinthequalifyinglinguisticset(alwaystheintervalbetween0and1).Fuzzificationoftheinputamountsto
eitheratablelookuporafunctionevaluation.
Thisexampleisbuiltonthreerules,andeachoftherulesdependsonresolvingtheinputsintoanumberofdifferent
fuzzylinguisticsets:serviceispoor,serviceisgood,foodisrancid,foodisdelicious,andsoon.Beforetherulescanbe
evaluated,theinputsmustbefuzzifiedaccordingtoeachoftheselinguisticsets.Forexample,towhatextentisthefood

http://nl.mathworks.com/help/fuzzy/fuzzy-inference-process.html

1/6

1/26/2016

Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

reallydelicious?Thefollowingfigureshowshowwellthefoodatthehypotheticalrestaurant(ratedonascaleof0to10)
qualifies,(viaitsmembershipfunction),asthelinguisticvariabledelicious.Inthiscase,weratedthefoodasan8,which,
givenyourgraphicaldefinitionofdelicious,correspondsto=0.7forthedeliciousmembershipfunction.

Inthismanner,eachinputisfuzzifiedoverallthequalifyingmembershipfunctionsrequiredbytherules.

Step2.ApplyFuzzyOperator
Aftertheinputsarefuzzified,youknowthedegreetowhicheachpartoftheantecedentissatisfiedforeachrule.Ifthe
antecedentofagivenrulehasmorethanonepart,thefuzzyoperatorisappliedtoobtainonenumberthatrepresentsthe
resultoftheantecedentforthatrule.Thisnumberisthenappliedtotheoutputfunction.Theinputtothefuzzyoperatoris
twoormoremembershipvaluesfromfuzzifiedinputvariables.Theoutputisasingletruthvalue.
AsisdescribedinLogicalOperationssection,anynumberofwelldefinedmethodscanfillinfortheANDoperationorthe
ORoperation.Inthetoolbox,twobuiltinANDmethodsaresupported:min(minimum)andprod(product).Twobuiltin
ORmethodsarealsosupported:max(maximum),andtheprobabilisticORmethodprobor.TheprobabilisticORmethod
(alsoknownasthealgebraicsum)iscalculatedaccordingtotheequation
probor(a,b)=a+bab

Inadditiontothesebuiltinmethods,youcancreateyourownmethodsforANDandORbywritinganyfunctionand
settingthattobeyourmethodofchoice.
ThefollowingfigureshowstheORoperatormaxatwork,evaluatingtheantecedentoftherule3forthetipping
calculation.Thetwodifferentpiecesoftheantecedent(serviceisexcellentandfoodisdelicious)yieldedthefuzzy
membershipvalues0.0and0.7respectively.ThefuzzyORoperatorsimplyselectsthemaximumofthetwovalues,0.7,
andthefuzzyoperationforrule3iscomplete.TheprobabilisticORmethodwouldstillresultin0.7.

http://nl.mathworks.com/help/fuzzy/fuzzy-inference-process.html

2/6

1/26/2016

Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

Step3.ApplyImplicationMethod
Beforeapplyingtheimplicationmethod,youmustdeterminetherule'sweight.Everyrulehasaweight(anumber
between0and1),whichisappliedtothenumbergivenbytheantecedent.Generally,thisweightis1(asitisforthis
example)andthushasnoeffectatallontheimplicationprocess.Fromtimetotimeyoumaywanttoweightonerule
relativetotheothersbychangingitsweightvaluetosomethingotherthan1.
Afterproperweightinghasbeenassignedtoeachrule,theimplicationmethodisimplemented.Aconsequentisafuzzy
setrepresentedbyamembershipfunction,whichweightsappropriatelythelinguisticcharacteristicsthatareattributedto
it.Theconsequentisreshapedusingafunctionassociatedwiththeantecedent(asinglenumber).Theinputforthe
implicationprocessisasinglenumbergivenbytheantecedent,andtheoutputisafuzzyset.Implicationisimplemented
foreachrule.Twobuiltinmethodsaresupported,andtheyarethesamefunctionsthatareusedbytheANDmethod:
min(minimum),whichtruncatestheoutputfuzzyset,andprod(product),whichscalestheoutputfuzzyset.

Step4.AggregateAllOutputs
BecausedecisionsarebasedonthetestingofalloftherulesinaFIS,therulesmustbecombinedinsomemannerin
ordertomakeadecision.Aggregationistheprocessbywhichthefuzzysetsthatrepresenttheoutputsofeachruleare
combinedintoasinglefuzzyset.Aggregationonlyoccursonceforeachoutputvariable,justpriortothefifthandfinal
step,defuzzification.Theinputoftheaggregationprocessisthelistoftruncatedoutputfunctionsreturnedbythe
implicationprocessforeachrule.Theoutputoftheaggregationprocessisonefuzzysetforeachoutputvariable.
Aslongastheaggregationmethodiscommutative(whichitalwaysshouldbe),thentheorderinwhichtherulesare
executedisunimportant.Threebuiltinmethodsaresupported:

max(maximum)

probor(probabilisticOR)

sum(simplythesumofeachrule'soutputset)

Inthefollowingdiagram,allthreeruleshavebeenplacedtogethertoshowhowtheoutputofeachruleiscombined,or
aggregated,intoasinglefuzzysetwhosemembershipfunctionassignsaweightingforeveryoutput(tip)value.

http://nl.mathworks.com/help/fuzzy/fuzzy-inference-process.html

3/6

1/26/2016

Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

Step5.Defuzzify
Theinputforthedefuzzificationprocessisafuzzyset(theaggregateoutputfuzzyset)andtheoutputisasinglenumber.
Asmuchasfuzzinesshelpstheruleevaluationduringtheintermediatesteps,thefinaldesiredoutputforeachvariableis
generallyasinglenumber.However,theaggregateofafuzzysetencompassesarangeofoutputvalues,andsomust
bedefuzzifiedinordertoresolveasingleoutputvaluefromtheset.
Perhapsthemostpopulardefuzzificationmethodisthecentroidcalculation,whichreturnsthecenterofareaunderthe
curve.Therearefivebuiltinmethodssupported:centroid,bisector,middleofmaximum(theaverageofthemaximum
valueoftheoutputset),largestofmaximum,andsmallestofmaximum.

http://nl.mathworks.com/help/fuzzy/fuzzy-inference-process.html

4/6

1/26/2016

Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

FuzzyInferenceDiagram
Thefuzzyinferencediagramisthecompositeofallthesmallerdiagramspresentedsofarinthissection.It
simultaneouslydisplaysallpartsofthefuzzyinferenceprocessyouhaveexamined.Informationflowsthroughthefuzzy
inferencediagramasshowninthefollowingfigure.

Inthisfigure,theflowproceedsupfromtheinputsinthelowerleft,thenacrosseachrow,orrule,andthendowntherule
outputstofinishinthelowerright.Thiscompactflowshowseverythingatonce,fromlinguisticvariablefuzzificationall
thewaythroughdefuzzificationoftheaggregateoutput.
Thefollowingfigureshowstheactualfullsizefuzzyinferencediagram.Thereisalottoseeinafuzzyinferencediagram,
butafteryoubecomeaccustomedtoit,youcanlearnalotaboutasystemveryquickly.Forinstance,fromthisdiagram
withtheseparticularinputs,youcaneasilyseethattheimplicationmethodistruncationwiththeminfunction.Themax
functionisbeingusedforthefuzzyORoperation.Rule3(thebottommostrowinthediagramshownpreviously)is
havingthestrongestinfluenceontheoutput.andsoon.TheRuleViewerdescribedinTheRuleViewerisaMATLAB
implementationofthefuzzyinferencediagram.

http://nl.mathworks.com/help/fuzzy/fuzzy-inference-process.html

5/6

1/26/2016

Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

MoreAbout

MembershipFunctions

LogicalOperations

IfThenRules

TypesofFuzzyInferenceSystems

http://nl.mathworks.com/help/fuzzy/fuzzy-inference-process.html

6/6