Fuzzy Inferencing – Inverted Pendulum Problem CS 621 Artificial Intelligence Lecture 10 - 23/08/05 Prof. Pushpak Bhattacharyya Fuzzy Inferencing – Inverted Pendulum Problem
Example Situation θ = 0.06 units θ` = 0.09 units Sensors 23.08.05 IIT Bombay
Fuzzification Read off μ values Profiles: a) Zero (z) b) Small +/- c) Medium +/- e) Large +/- 23.08.05 IIT Bombay
μ values for θ = 0.06 μ zero ( 0.06 ) = 0.4 μ small+ ( 0.06 ) = 1.0 μ med+ ( 0.06 ) = 0.25 μ large+ ( 0.06 ) = 0.0 23.08.05 IIT Bombay
μ values for θ` = 0.09 μ zero (θ` = 0.09 ) = 0.1 μ small+ (θ` = 0.09 ) = 1.0 μ med+ (θ` = 0.09 ) = 0.08 μ large+ (θ` = 0.09 ) = 0.0 23.08.05 IIT Bombay
Rule Firing Potentially all rules fire with various degrees. Matching the LHS. Computing AND (min). 23.08.05 IIT Bombay
R1: If θ = Z and θ` = Z then i = Z μz(θ) μz(θ`) LHS: min(0.4, 0.1) = 0.1 RHS: By complete truth transfer μz(i) = 0.1 23.08.05 IIT Bombay
R2: If θ = Z and θ` = s+ then i = s- LHS: min(μz(θ = .06) , μs+(θ`= 0.009) = min(0.4, 1.0) = 0.4 so, μs-(i) = 0.4 23.08.05 IIT Bombay
R3: If θ = Z and θ` = M+ then i = M- LHS: min( μz(θ) , μM+(θ`)) = 0.08 RHS: μM-(i) = 0.08 23.08.05 IIT Bombay
After Rule Firing for θ = 0.06, θ` = 0.09 R1 Gives μz(i) = 0.1 R2 Gives μs -(i) = 0.4 R3 Gives μM-(i) = 0.08 R4 Gives …………. and so on 23.08.05 IIT Bombay
Defuzzification To Get Crisp Values Read off the Y – Axis. Project on to the X – Axis. C. Decide the value. 23.08.05 IIT Bombay
Defuzzification (Contd) μz(i) = 0.1 gives i = - 0.09 or + 0.09 as read from the profile μs-(i) = 0.4 gives i = - 0.25 μM-(i) = 0.08 gives i = - 0.1 23.08.05 IIT Bombay
Max of Min. Centroid (uses alpha cut). Two Strategies Max of Min. Centroid (uses alpha cut). Max of Min give i = -0.25 units send -0.25 units of current
Centroid α - cut in the area below the curve cut at μ value For R1: A1= Area below α – cut μz(i) = 0.1 R2: A2= Area below α – cut μs-(i) = 0.4 R3: A3= Area below α – cut μM-(i) = 0.08 23.08.05 IIT Bombay
= X- axis value of the centroid of A1, A2, A3, …… Required Current = X- axis value of the centroid of A1, A2, A3, …… Required ( XR, YR) values of Centroid XR = Xc1 × A1 + Xc2 × A2 + Xc3 × A3 +….. A1+ A2+ A3+…………… 23.08.05 IIT Bombay