having error while running fuzzy controller and fuzzy set of matlab 2017 in matlab 2023?

1 次查看(过去 30 天)
2 inputs and 1 output with mamdani rule.
  6 个评论
shilpam malik
shilpam malik 2025-7-25
---Input 2 expects a value in range [-1 1] but has a value of -1.77138. no rules fired for Output 1. Defuzzified output value set to its mean range value 0.
Every time i change the range of second input it exceeds the output giving output U as 0.

请先登录,再进行评论。

回答(1 个)

Sam Chak
Sam Chak 2025-7-25
编辑:Sam Chak 2025-7-25

All five membership functions of Input 2 are defined in the range [-1, 1]. However, when Input 2 has a value of -1.77138 that is outside the range, none of the rules are triggered. Consequently, it returns the mid value of the Output range, that is (-1 + 1)/2 = 0, by default in Fuzzy Logic Toolbox.

To address the issue, make sure that the MFs are designed to cover the entire operating range of Input 2. For example, if the operating range is [-2, 2], the MFs should look like the following:

  11 个评论
shilpam malik
shilpam malik 2025-7-28
Whenever i tried changing the range again same error comes.
eg. if i change [-2,2] operating range is beyond [-2,2] value comes out 2.78.
if i chnge the the operating range to [-5,5] again the value goes out of range.
Sam Chak
Sam Chak 2025-7-28
Good, @shilpam malik! This represents another step forward. We can explore other approaches. If you have the mathematical model of the system in Simulink, whether in State-space or Transfer Function form, please provide it here. I can reconstruct it to investigate the fuzzy control issue.
The following examples will give you an idea of how the mathematical model appears:
State-space model (generally described using 4 matrices, A, B, C, D):
sys = rss(2)
sys = A = x1 x2 x1 -3.249 1.165 x2 0.7234 -2.291 B = u1 x1 -1.079 x2 0.4604 C = x1 x2 y1 -0.2372 1.081 D = u1 y1 0 Continuous-time state-space model.
Transfer function model (generally described as a rational function, which is a ratio of two polynomials):
Gp = tf(sys)
Gp = 0.7536 s + 1.232 -------------------- s^2 + 5.54 s + 6.601 Continuous-time transfer function.

请先登录,再进行评论。

类别

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

标签

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by