Fuzzy Logic controller as a switch

11 次查看(过去 30 天)
How can I use mamdani fuzzy logic controller as a switch in case of capacitor switching for power factor correction. Here fuzzy logic controller is used as to decide which capacitor should operate for the required power factor?
  2 个评论
Sam Chak
Sam Chak 2024-3-14
Are you seeking a discrete switch similar to an 'ON' / 'OFF' switch that outputs the values of '1' and '0'? It's important to determine this in order to assess whether a Mamdani fuzzy controller would be a suitable candidate for fulfilling that function.
Maria Theresa
Maria Theresa 2024-3-14
Yes, I am seeking switch similar to ON/OFF, which can show values 0 or 1 as output in diplay. 0 or 1 indicating whether capacitor is on or off

请先登录,再进行评论。

采纳的回答

Sam Chak
Sam Chak 2024-3-14
Typically, generating discrete '1' / '0' values using a Mamdani FIS can be challenging due to the intricate defuzzification steps involved. However, I can assist you in creating the fundamental fuzzy structure of an ON/OFF-like switch using a specialized Mamdani FIS. As for the remaining switching logic of the capacitor, you will need to figure it out, as power factor correction is not within my area of expertise. Best of luck!
fis = mamfis('Name', "Fuzzy_Mamdani_Switch");
% Fuzzy Input
fis = addInput(fis, [-1, 1], 'Name', 'Criterion'); % set the range of Criterion
fis = addMF(fis, 'Criterion', 'linzmf', [0 0], 'Name', 'N'); % set the threshold point
fis = addMF(fis, 'Criterion', 'linsmf', [0 0], 'Name', 'P'); % must be the same threshold
% Fuzzy Output
fis = addOutput(fis, [-0.48675496688741717, 1.5], 'Name', 'Decision'); % DO NOT ADJUST!
fis = addMF(fis, 'Decision', 'linzmf', [0.5 0.5], 'Name', 'OFF'); % DO NOT ADJUST!
fis = addMF(fis, 'Decision', 'linsmf', [0.5 0.5], 'Name', 'ON'); % DO NOT ADJUST!
% Plot membership functions
figure(1)
subplot(211)
plotmf(fis, 'input', 1), grid on, title('Input MFs for Criterion')
subplot(212)
plotmf(fis, 'output', 1), grid on, title('Output MFs for Decision')
% Rules
rules = [...
"Criterion==N => Decision=OFF"; ...
"Criterion==P => Decision=ON"; ...
];
fis = addRule(fis, rules);
% Plot output of FIS
figure(2)
opt = gensurfOptions('NumGridPoints', 20001);
gensurf(fis, opt), grid on, axis([-1, 1, -0.5, 1.5])
yline(1, '--', 'ON state', 'color', '#808080');
yline(0, '--', 'OFF state', 'color', '#808080', 'LabelHorizontalAlignment', 'left', 'LabelVerticalAlignment', 'bottom');
title('Capacitor Status')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fuzzy Logic in Simulink 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by