matlab计算模糊控制规则表
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
程序运行结果:
输出量的模糊集合表
U_control =
Columns 1 through 8
-5.3500 -5.2353 -5.3500 -5.2353 -5.3500 -5.2353 -4.6923 -4.2581
-5.0000 -4.9474 -5.0000 -4.9474 -5.0000 -4.9474 -3.8571 -3.7143
-4.6923 -4.5217 -4.6923 -4.5217 -4.6923 -4.5217 -3.0526 -2.9302
-4.2581 -4.2581 -4.2581 -4.2581 -4.2581 -4.2581 -2.9302 -2.2909
-4.0000 -4.0000 -3.7812 -3.7586 -3.4706 -3.4194 -2.4318 -1.7925
-4.0000 -4.0000 -3.3636 -3.0769 -2.4667 -2.1176 -1.5000 -1.0476
-3.5882 -3.5484 -2.9250 -2.6000 -0.9600 -0.5094 0 0.5094
-2.9231 -2.9231 -2.3333 -1.9057 -0.2632 1.0476 1.5000 2.1176
-1.8056 -1.7879 -0.5652 -0.3137 0.4400 1.7925 2.4318 3.4194
-1.0000 -1.0000 0.2453 0.9385 1.4211 2.2909 2.9302 4.2581
-0.5833 -0.6364 0.6875 1.4211 1.9375 2.9302 3.0526 4.5217
-0.2333 -0.2414 1.1190 1.7925 2.3571 3.7143 3.8571 4.9474
0 0 1.2857 2.0000 2.7143 4.2581 4.6923 5.2353
Columns 9 through 13
-2.7143 -2.0000 -1.2857 0 0
-2.3571 -1.7925 -1.1190 0.2414 0.2333
-1.9375 -1.4211 -0.6875 0.6364 0.5833
-1.4211 -0.9385 -0.2453 1.0000 1.0000
-0.4400 -0.0364 0.1600 1.6000 1.6316
0.2632 1.9057 2.3333 2.9231 2.9231
0.9600 2.6000 2.9250 3.5484 3.5882
2.4667
3.0769 3.3636
4.0000 4.0000
3.4706 3.7586 3.7813
4.0000 4.0000
4.2581 4.2581 4.2581 4.2581 4.2581
4.6923 4.5217 4.6923 4.5217 4.6923
5.0000 4.9474 5.0000 4.9474 5.0000
5.3500 5.2353 5.3500 5.2353 5.3500
Matlab程序:
%作业:计算模糊控制规则表
clc;
clear;
%偏差E的隶属函数表
E = [1,0.8,0.7,0.4,0.1,0,0,0,0,0,0,0,0;
0.2,0.7,1,0.7,0.3,0,0,0,0,0,0,0,0;
0,0.1,0.3,0.7,1,0.7,0.2,0,0,0,0,0,0;
0,0,0,0,0.1,0.6,1,0,0,0,0,0,0;
0,0,0,0,0,0,1,0.6,0.1,0,0,0,0;
0,0,0,0,0,0,0.2,0.7,1,0.7,0.3,0.1,0;
0,0,0,0,0,0,0,0,0.2,0.7,1,0.7,0.3;
0,0,0,0,0,0,0,0,0.1,0.4,0.7,0.8,1] %8*13的矩阵%偏差E变化率EC的隶属函数表
EC =[1,0.7,0.3,0,0,0,0,0,0,0,0,0,0;
0.3,0.7,1,0.7,0.3,0,0,0,0,0,0,0,0;
0,0,0.3,0.7,1,0.7,0.3,0,0,0,0,0,0;
0,0,0,0,0.3,0.7,1,0.7,0.3,0,0,0,0;
0,0,0,0,0,0,0.3,0.7,1,0.7,0.3,0,0;
0,0,0,0,0,0,0,0,0.3,0.7,1,0.7,0.3;
0,0,0,0,0,0,0,0,0,0,0.3,0.7,1] %7*13的矩阵%控制量U的隶属函数表,与偏差变化率隶属函数相同
U=[1,0.7,0.3,0,0,0,0,0,0,0,0,0,0;
0.3,0.7,1,0.7,0.3,0,0,0,0,0,0,0,0;
0,0,0.3,0.7,1,0.7,0.3,0,0,0,0,0,0;
0,0,0,0,0.3,0.7,1,0.7,0.3,0,0,0,0;
0,0,0,0,0,0,0.3,0.7,1,0.7,0.3,0,0;
0,0,0,0,0,0,0,0,0.3,0.7,1,0.7,0.3;
0,0,0,0,0,0,0,0,0,0,0.3,0.7,1] %7*13的矩阵%控制规则表,E的模糊分割数为8,EC的模糊分割数为7,包含最大可能的规则数为7*8=56
rulelist= [1,1,1,1,2,4,4;
1,1,1,1,2,4,4;
2,2,2,2,4,5,5;
2,2,3,4,5,6,6;
2,2,3,4,5,6,6;
3,3,4,6,6,6,6;
4,4,6,7,7,7,7;
4,4,6,7,7,7,7] %8*7的矩阵
%********计算模糊控制规则表************
for iii=1:13
for jjj=1:13
for ii=1:8