fuzzy inference process -graphic construction

Upload: dario-dadda-turres

Post on 09-Mar-2016

2 views

Category:

Documents


0 download

DESCRIPTION

Fuzzy Inference Process -Graphic Construction

TRANSCRIPT

  • 1/26/2016 Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

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

    FuzzyInferenceProcess

    Fuzzyinferenceistheprocessofformulatingthemappingfromagiveninputtoanoutputusingfuzzylogic.Themappingthenprovidesabasisfromwhichdecisionscanbemade,orpatternsdiscerned.TheprocessoffuzzyinferenceinvolvesallofthepiecesthataredescribedinMembershipFunctions,LogicalOperations,andIfThenRules.

    Thissectiondescribesthefuzzyinferenceprocessandusestheexampleofthetwoinput,oneoutput,threeruletippingproblemTheBasicTippingProblemthatyousawintheintroductioninmoredetail.Thebasicstructureofthisexampleisshowninthefollowingdiagram:

    Informationflowsfromlefttoright,fromtwoinputstoasingleoutput.Theparallelnatureoftherulesisoneofthemoreimportantaspectsoffuzzylogicsystems.Insteadofsharpswitchingbetweenmodesbasedonbreakpoints,logicflowssmoothlyfromregionswherethesystem'sbehaviorisdominatedbyeitheroneruleoranother.

    Fuzzyinferenceprocesscomprisesoffiveparts:

    Fuzzificationoftheinputvariables

    Applicationofthefuzzyoperator(ANDorOR)intheantecedent

    Implicationfromtheantecedenttotheconsequent

    Aggregationoftheconsequentsacrosstherules

    Defuzzification

    Afuzzyinferencediagramdisplaysallpartsofthefuzzyinferenceprocessfromfuzzificationthroughdefuzzification.

    Step1.FuzzifyInputsThefirststepistotaketheinputsanddeterminethedegreetowhichtheybelongtoeachoftheappropriatefuzzysetsviamembershipfunctions.InFuzzyLogicToolboxsoftware,theinputisalwaysacrispnumericalvaluelimitedtotheuniverseofdiscourseoftheinputvariable(inthiscasetheintervalbetween0and10)andtheoutputisafuzzydegreeofmembershipinthequalifyinglinguisticset(alwaystheintervalbetween0and1).Fuzzificationoftheinputamountstoeitheratablelookuporafunctionevaluation.

    Thisexampleisbuiltonthreerules,andeachoftherulesdependsonresolvingtheinputsintoanumberofdifferentfuzzylinguisticsets:serviceispoor,serviceisgood,foodisrancid,foodisdelicious,andsoon.Beforetherulescanbeevaluated,theinputsmustbefuzzifiedaccordingtoeachoftheselinguisticsets.Forexample,towhatextentisthefood

  • 1/26/2016 Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

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

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

    Inthismanner,eachinputisfuzzifiedoverallthequalifyingmembershipfunctionsrequiredbytherules.

    Step2.ApplyFuzzyOperatorAftertheinputsarefuzzified,youknowthedegreetowhicheachpartoftheantecedentissatisfiedforeachrule.Iftheantecedentofagivenrulehasmorethanonepart,thefuzzyoperatorisappliedtoobtainonenumberthatrepresentstheresultoftheantecedentforthatrule.Thisnumberisthenappliedtotheoutputfunction.Theinputtothefuzzyoperatoristwoormoremembershipvaluesfromfuzzifiedinputvariables.Theoutputisasingletruthvalue.

    AsisdescribedinLogicalOperationssection,anynumberofwelldefinedmethodscanfillinfortheANDoperationortheORoperation.Inthetoolbox,twobuiltinANDmethodsaresupported:min(minimum)andprod(product).TwobuiltinORmethodsarealsosupported:max(maximum),andtheprobabilisticORmethodprobor.TheprobabilisticORmethod(alsoknownasthealgebraicsum)iscalculatedaccordingtotheequation

    probor(a,b)=a+bab

    Inadditiontothesebuiltinmethods,youcancreateyourownmethodsforANDandORbywritinganyfunctionandsettingthattobeyourmethodofchoice.

    ThefollowingfigureshowstheORoperatormaxatwork,evaluatingtheantecedentoftherule3forthetippingcalculation.Thetwodifferentpiecesoftheantecedent(serviceisexcellentandfoodisdelicious)yieldedthefuzzymembershipvalues0.0and0.7respectively.ThefuzzyORoperatorsimplyselectsthemaximumofthetwovalues,0.7,andthefuzzyoperationforrule3iscomplete.TheprobabilisticORmethodwouldstillresultin0.7.

  • 1/26/2016 Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

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

    Step3.ApplyImplicationMethodBeforeapplyingtheimplicationmethod,youmustdeterminetherule'sweight.Everyrulehasaweight(anumberbetween0and1),whichisappliedtothenumbergivenbytheantecedent.Generally,thisweightis1(asitisforthisexample)andthushasnoeffectatallontheimplicationprocess.Fromtimetotimeyoumaywanttoweightonerulerelativetotheothersbychangingitsweightvaluetosomethingotherthan1.

    Afterproperweightinghasbeenassignedtoeachrule,theimplicationmethodisimplemented.Aconsequentisafuzzysetrepresentedbyamembershipfunction,whichweightsappropriatelythelinguisticcharacteristicsthatareattributedtoit.Theconsequentisreshapedusingafunctionassociatedwiththeantecedent(asinglenumber).Theinputfortheimplicationprocessisasinglenumbergivenbytheantecedent,andtheoutputisafuzzyset.Implicationisimplementedforeachrule.Twobuiltinmethodsaresupported,andtheyarethesamefunctionsthatareusedbytheANDmethod:min(minimum),whichtruncatestheoutputfuzzyset,andprod(product),whichscalestheoutputfuzzyset.

    Step4.AggregateAllOutputs

    BecausedecisionsarebasedonthetestingofalloftherulesinaFIS,therulesmustbecombinedinsomemannerinordertomakeadecision.Aggregationistheprocessbywhichthefuzzysetsthatrepresenttheoutputsofeachrulearecombinedintoasinglefuzzyset.Aggregationonlyoccursonceforeachoutputvariable,justpriortothefifthandfinalstep,defuzzification.Theinputoftheaggregationprocessisthelistoftruncatedoutputfunctionsreturnedbytheimplicationprocessforeachrule.Theoutputoftheaggregationprocessisonefuzzysetforeachoutputvariable.

    Aslongastheaggregationmethodiscommutative(whichitalwaysshouldbe),thentheorderinwhichtherulesareexecutedisunimportant.Threebuiltinmethodsaresupported:

    max(maximum)

    probor(probabilisticOR)

    sum(simplythesumofeachrule'soutputset)

    Inthefollowingdiagram,allthreeruleshavebeenplacedtogethertoshowhowtheoutputofeachruleiscombined,oraggregated,intoasinglefuzzysetwhosemembershipfunctionassignsaweightingforeveryoutput(tip)value.

  • 1/26/2016 Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

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

    Step5.DefuzzifyTheinputforthedefuzzificationprocessisafuzzyset(theaggregateoutputfuzzyset)andtheoutputisasinglenumber.Asmuchasfuzzinesshelpstheruleevaluationduringtheintermediatesteps,thefinaldesiredoutputforeachvariableisgenerallyasinglenumber.However,theaggregateofafuzzysetencompassesarangeofoutputvalues,andsomustbedefuzzifiedinordertoresolveasingleoutputvaluefromtheset.

    Perhapsthemostpopulardefuzzificationmethodisthecentroidcalculation,whichreturnsthecenterofareaunderthecurve.Therearefivebuiltinmethodssupported:centroid,bisector,middleofmaximum(theaverageofthemaximumvalueoftheoutputset),largestofmaximum,andsmallestofmaximum.

  • 1/26/2016 Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

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

    FuzzyInferenceDiagramThefuzzyinferencediagramisthecompositeofallthesmallerdiagramspresentedsofarinthissection.Itsimultaneouslydisplaysallpartsofthefuzzyinferenceprocessyouhaveexamined.Informationflowsthroughthefuzzyinferencediagramasshowninthefollowingfigure.

    Inthisfigure,theflowproceedsupfromtheinputsinthelowerleft,thenacrosseachrow,orrule,andthendowntheruleoutputstofinishinthelowerright.Thiscompactflowshowseverythingatonce,fromlinguisticvariablefuzzificationallthewaythroughdefuzzificationoftheaggregateoutput.

    Thefollowingfigureshowstheactualfullsizefuzzyinferencediagram.Thereisalottoseeinafuzzyinferencediagram,butafteryoubecomeaccustomedtoit,youcanlearnalotaboutasystemveryquickly.Forinstance,fromthisdiagramwiththeseparticularinputs,youcaneasilyseethattheimplicationmethodistruncationwiththeminfunction.ThemaxfunctionisbeingusedforthefuzzyORoperation.Rule3(thebottommostrowinthediagramshownpreviously)ishavingthestrongestinfluenceontheoutput.andsoon.TheRuleViewerdescribedinTheRuleViewerisaMATLABimplementationofthefuzzyinferencediagram.

  • 1/26/2016 Fuzzy Inference Process - MATLAB & Simulink - MathWorks Benelux

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

    MoreAboutMembershipFunctions

    LogicalOperations

    IfThenRules

    TypesofFuzzyInferenceSystems