Fuzzy Logic
دوال العضوية والقواعد الضبابية والاستدلال والتحكم
🎯 Learning Objectives
- Understand the difference between crisp and fuzzy sets.
- Define and interpret membership functions.
- Understand triangular and trapezoidal membership functions.
- Perform fuzzy AND and OR operations.
- Understand IF–THEN fuzzy rules.
- Explain fuzzification, inference, aggregation, and defuzzification.
- Apply fuzzy logic to voltage-control problems.
🎯 أهداف التعلم
- فهم الفرق بين المجموعات التقليدية والمجموعات الضبابية.
- تعريف دوال العضوية وتفسيرها.
- فهم دوال العضوية المثلثية وشبه المنحرفة.
- تنفيذ عمليتي AND وOR الضبابيتين.
- فهم قواعد IF–THEN الضبابية.
- فهم التضييب والاستدلال والتجميع وإزالة الضبابية.
- تطبيق المنطق الضبابي على مسائل التحكم بالجهد.
1. Why Fuzzy Logic?
Classical logic works with only two truth values: true or false, 1 or 0.
Fuzzy logic allows partial membership:
1. لماذا نستخدم المنطق الضبابي؟
يعتمد المنطق التقليدي على قيمتين فقط: صحيح أو خطأ، أي 1 أو 0.
أما في المنطق الضبابي فيمكن أن تكون درجة الانتماء أي قيمة بين صفر وواحد:
2. Crisp Set vs Fuzzy Set
A voltage may be classified only as acceptable or unacceptable.
A voltage can be described as low, normal, or high with different membership degrees.
2. المجموعة التقليدية مقابل المجموعة الضبابية
يمكن تصنيف الجهد فقط على أنه مقبول أو غير مقبول.
يمكن وصف الجهد بأنه منخفض أو طبيعي أو مرتفع بدرجات انتماء مختلفة.
3. Membership Function
The membership function assigns each input x a membership degree:
For example:
This means that the voltage 0.98 pu belongs to the fuzzy set “Normal Voltage” with membership degree 0.8.
3. دالة العضوية
تقوم دالة العضوية بإسناد درجة انتماء لكل قيمة دخل x:
على سبيل المثال:
أي أن الجهد 0.98 pu ينتمي إلى المجموعة الضبابية "الجهد الطبيعي" بدرجة انتماء 0.8.
4. Triangular Membership Function
A triangular membership function is defined by three parameters:
Its mathematical definition is:
(x-a)/(b-a), a<x≤b
(c-x)/(c-b), b<x<c
0, x≥c
The value b is the point of full membership:
4. دالة العضوية المثلثية
يتم تعريف دالة العضوية المثلثية باستخدام ثلاث نقاط:
تبدأ درجة الانتماء من الصفر عند a، ثم تزداد خطيًا حتى تصل إلى 1 عند b، ثم تنخفض حتى تصبح صفرًا مرة أخرى عند c.
5. Simple Derivation of the Rising Side
Between a and b, the membership curve is a straight line.
The slope is:
Using the equation of a straight line:
Therefore:
5. اشتقاق مبسط للجزء الصاعد
بين النقطتين a وb تكون دالة العضوية خطًا مستقيمًا.
ميل الخط هو:
وباستخدام معادلة الخط المستقيم:
نحصل على:
6. Trapezoidal Membership Function
A trapezoidal membership function uses four points:
Between b and c the membership value equals 1.
6. دالة العضوية شبه المنحرفة
يتم تعريف دالة العضوية شبه المنحرفة بأربع نقاط:
تكون درجة الانتماء مساوية للواحد بين b وc.
7. Multiple Fuzzy Sets
A single input variable can belong to several fuzzy sets simultaneously.
7. مجموعات ضبابية متعددة
يمكن لقيمة دخل واحدة أن تنتمي إلى عدة مجموعات ضبابية في الوقت نفسه.
8. Fuzzy AND and OR
In Mamdani-type fuzzy logic, two common operations are:
AND
OR
Example:
8. عمليتا AND وOR الضبابيتان
في نظام Mamdani يمكن استخدام:
فإذا كانت درجتا الانتماء 0.4 و0.7 فإن:
9. Fuzzy IF–THEN Rules
A fuzzy controller uses linguistic rules.
THEN Reactive Power is Increase
Another rule may be:
THEN Reactive Power is Decrease
9. قواعد IF–THEN الضبابية
يعتمد المتحكم الضبابي على قواعد لغوية.
فإن القدرة الردية يجب أن تزداد
فإن القدرة الردية يجب أن تنخفض
10. Fuzzy Inference System
10. نظام الاستدلال الضبابي
11. Fuzzification
Fuzzification converts a numerical input into membership degrees.
Suppose:
We may obtain:
μNormal = 0.7
μHigh = 0
Therefore, the same voltage participates in more than one rule.
11. التضييب Fuzzification
تقوم عملية التضييب بتحويل الدخل العددي إلى درجات انتماء.
مثلًا إذا كان:
فقد تكون درجات العضوية:
μNormal = 0.7
μHigh = 0
12. Rule Activation
If a rule is:
and:
then the rule activation level is:
The output fuzzy set is clipped at this level.
12. تفعيل القاعدة
إذا كانت القاعدة:
وكانت درجة انتماء الجهد إلى المجموعة "منخفض":
فإن مستوى تفعيل القاعدة يساوي:
13. Aggregation
Several fuzzy rules may produce several output fuzzy sets. These outputs must be combined.
13. التجميع Aggregation
يمكن أن تنتج عدة قواعد ضبابية عدة مجموعات خرج. لذلك يجب دمج هذه النتائج في مجموعة خرج واحدة.
14. Defuzzification
After fuzzy inference, the result is still a fuzzy set. A physical controller needs one numerical value.
A common method is the center of gravity:
14. إزالة الضبابية Defuzzification
بعد الاستدلال نحصل على مجموعة ضبابية، لكن المتحكم الحقيقي يحتاج إلى قيمة عددية واحدة.
إحدى أشهر الطرق هي طريقة مركز الثقل:
15. Discrete Center-of-Gravity Form
In digital implementations, the integral is often approximated using discrete points:
Example:
| zi | μ(zi) | zi μ(zi) |
|---|---|---|
| 1 | 0.2 | 0.2 |
| 2 | 0.6 | 1.2 |
| 3 | 0.4 | 1.2 |
15. الصيغة المتقطعة لمركز الثقل
في التطبيق الرقمي يمكن تقريب التكامل باستخدام مجموع القيم:
في المثال السابق تكون النتيجة:
16. Power-System Application: Voltage Control
Consider a distribution-network bus with measured voltage V.
Define the voltage error:
The fuzzy controller receives the error and produces a reactive-power command:
Example rules:
| Voltage Error | Reactive-Power Action |
|---|---|
| Negative Large | Decrease Q |
| Zero | No Change |
| Positive Large | Increase Q |
16. تطبيق في نظم الطاقة: التحكم بالجهد
لنفترض وجود عقدة في شبكة توزيع كهربائية يتم قياس جهدها V.
نعرّف خطأ الجهد:
ثم يستخدم المتحكم الضبابي هذا الخطأ لإنتاج أمر قدرة ردية:
إذا كان الجهد منخفضًا، يمكن للمتحكم زيادة القدرة الردية للمساعدة في رفع الجهد. وإذا كان مرتفعًا يمكن تقليل القدرة الردية.
17. Why Fuzzy Control is Attractive
- No exact mathematical model may be required.
- Engineering knowledge can be written as linguistic rules.
- Nonlinear behavior can be handled naturally.
- Control actions change smoothly.
- The controller is relatively easy to interpret.
17. لماذا يعد التحكم الضبابي جذابًا؟
- قد لا يحتاج إلى نموذج رياضي دقيق للنظام.
- يمكن تحويل الخبرة الهندسية إلى قواعد لغوية.
- يمكن التعامل مع السلوك غير الخطي بسهولة نسبية.
- تتغير أوامر التحكم بسلاسة.
- من السهل نسبيًا تفسير منطق المتحكم.
18. Complete Fuzzy-Control Chain
18. السلسلة الكاملة للتحكم الضبابي
19. Summary
- Fuzzy sets allow partial membership between 0 and 1.
- Membership functions convert numerical values into linguistic concepts.
- Triangular functions are based on simple straight-line equations.
- AND can be implemented using minimum and OR using maximum.
- Fuzzy rules connect linguistic inputs to linguistic outputs.
- Defuzzification converts the fuzzy output into a numerical command.
- Fuzzy control is useful for nonlinear and uncertain power-system problems.
19. الخلاصة
- تسمح المجموعات الضبابية بدرجات انتماء بين الصفر والواحد.
- تحول دوال العضوية القيم العددية إلى مفاهيم لغوية.
- تعتمد دوال العضوية المثلثية على معادلات خطوط مستقيمة بسيطة.
- يمكن تنفيذ AND باستخدام القيمة الصغرى وOR باستخدام القيمة الكبرى.
- تربط القواعد الضبابية بين المدخلات والمخرجات اللغوية.
- تحول إزالة الضبابية الخرج الضبابي إلى قيمة عددية.
- يعد التحكم الضبابي مفيدًا في مسائل نظم الطاقة غير الخطية وغير المؤكدة.
📝 Review Questions
- What is the difference between a crisp set and a fuzzy set?
- What does μA(x)=0.7 mean?
- How is a triangular membership function defined?
- Where does the equation (x-a)/(b-a) come from?
- How are fuzzy AND and OR commonly calculated?
- What is fuzzification?
- What is defuzzification?
- Explain the center-of-gravity method.
- How can fuzzy logic be applied to voltage control?
📝 أسئلة المراجعة
- ما الفرق بين المجموعة التقليدية والمجموعة الضبابية؟
- ماذا تعني μA(x)=0.7؟
- كيف يتم تعريف دالة العضوية المثلثية؟
- من أين تأتي العلاقة (x-a)/(b-a)؟
- كيف يتم حساب AND وOR في المنطق الضبابي؟
- ما المقصود بالتضييب؟
- ما المقصود بإزالة الضبابية؟
- اشرح طريقة مركز الثقل.
- كيف يمكن تطبيق المنطق الضبابي للتحكم بالجهد؟