Rabu, 16 September 2015

fuzzy logic mamdani in matlab

what is fuzzy logic? ( answer from another post to explain definition for fuzzy logic). Fuzzy logic is a form of many-valued logic in which the truth values of variables may be any real number between 0 and 1. By contrast, in Boolean logic, the truth values of variables may only be 0 or 1. Fuzzy logic has been extended to handle the concept of partial truth, where the truth value may range between completely true and completely false.Furthermore, when linguistic variables are used, these degrees may be managed by specific functions.The term fuzzy logic was introduced with the 1965 proposal of fuzzy set theory by Lotfi A. Zadeh.Fuzzy logic has been applied to many fields, from control theory to artificial intelligence. Fuzzy logic had however been studied since the 1920s, as infinite-valued logic—notably by Łukasiewicz and Tarski.(https://en.wikipedia.org/wiki/Fuzzy_logic)

ok that short explain abaut fuzzy logic from wikipedia. then i will share to you about how to make fuzzy logic in matlab. we know that calculate fuzzy logic have many calculate, so we can harness matlab sofwere to make easy calculate fuzzy logic. ok lets try matlab for calculate fuzzy logic but you must know that my example is fuzzy logic mamdani.



1. make question and make rule


If the speed of the mobil 2 is : 50 km / h and the distance is 0.75 m with mobil 2, how the pedal position should be in trampled ? 
rule as follows :
- Rule 1 : If the car speed is fast and the distance is very close then stepped on the brake pedal a little - Rule 2 : If the speed of the car is pretty and is slightly closer to the brake pedal being stepped on
- Rule 3 : If the car's speed and the distance was close enough then stepped on the brake pedal a little full

2. open your matlab program and write fuzzy in command window and enter


after you enter in the command window you can find this panel , this panel automatic in fuzzy logic tipe mamdani



3.  give name in utilited (mamdani) on the panel of FIS editor with click File → Eksport → To      
     Disk/to File, I give name with Process.
 
4. add 2 input input because we have distance and speed as input, click edit → add variable...
    → input, then edit name input1 with speed, input2 with distance, output1 with break angular.


5. click edit → membership function...,
 6. select speed then click edit → remove all MFs, to ereser all and make it with blank document.    then click edit → add MFs , scroll at number of MFs in membership function with 5. do it again with distance and breakeangle.


 7. edit range (0,1) to (0,80) because we have speed in range 0-80 km/h, click in Mf1 and edit name to low, do it to all komponen like this picture:



 
8. after include all, we create the rule with click edit → Rules, include all rule in rule editor then add

 
9.  at the last click view rules. then add rule that 50 0.75 ( 50 km/h and 0.75m)


 
with this simulate we kow that if we in speed 50 km/h and distance 0.75. we must break with angle 20   




thanks for read this article (afn)

status artikel : Not yet verified by Lecturer

0 komentar:

Posting Komentar