-
大小: 16KB文件類型: .m金幣: 1下載: 0 次發(fā)布日期: 2021-05-21
- 語言: Matlab
- 標(biāo)簽: MATLAB實現(xiàn)??源代碼??
資源簡介
MATLAB實現(xiàn)的模糊自適應(yīng)控制函數(shù)的源代碼
代碼片段和文件信息
clear %?Clear?all?variables?in?memory
eold=0;? %?Intial?condition?used?to?calculate?c
rold=0;? %?Intial?condition?used?to?calculate?r
yeold=0;? %?Intial?condition?used?to?calculate?yc
ymold=0;? %?Initial?condition?for?the?first?order?reference?model
%?Next?initialize?parameters?for?the?fuzzy?controller
nume=11;? %?Number?of?input?membership?functions?for?the?e
%?universe?of?discourse
numc=11;? %?Number?of?input?membership?functions?for?the?c
%?universe?of?discourse
ge=1/2;gc=1/2;gu=5;
%?Scaling?gains?for?tuning?membership?functions?for
%?universes?of?discourse?for?e?c?and?u?respectively
%?These?are?tuned?to?improve?the?performance?of?the?FMRLC
we=0.2*(1/ge);
%?we?is?half?the?width?of?the?triangular?input?membership
%?function?bases?(note?that?if?you?change?ge?the?base?width
%?will?correspondingly?change?so?that?we?always?end
%?up?with?uniformly?distributed?input?membership?functions)
%?Note?that?if?you?change?nume?you?will?need?to?adjust?the
%?“0.2“?factor?if?you?want?membership?functions?that
%?overlap?in?the?same?way.
wc=0.2*(1/gc);
%?Similar?to?we?but?for?the?c?universe?of?discourse
base=0.4*gu;
%?base?width?of?output?membership?fuctions?of?the?fuzzy
%?controller
%?Place?centers?of?membership?functions?of?the?fuzzy?controller:
%??Centers?of?input?membership?functions?for?the?e?universe?of
%?discourse?for??of?fuzzy?controller?(a?vector?of?centers)
ce=[-1?-0.8?-0.6?-0.4?-0.2?0?0.2?0.4?0.6?0.8?1]*(1/ge);
%?Centers?of?input?membership?functions?for?the?c?universe?of
%?discourse?for??of?fuzzy?controller?(a?vector?of?centers)
cc=[-1?-0.8?-0.6?-0.4?-0.2?0?0.2?0.4?0.6?0.8?1]*(1/gc);
gf=0;
fuzzyrules=[-1??-1???-1???-1??-1????-1??-0.8?-0.6?-0.4?-0.2??0;
????-1??-1???-1???-1??-1???-0.8?-0.6?-0.4?-0.2???0??0.2;
????-1??-1???-1???-1??-0.8?-0.6?-0.4?-0.2???0???0.2?0.4;
????-1??-1???-1??-0.8?-0.6?-0.4?-0.2???0???0.2??0.4?0.6;
????-1??-1??-0.8?-0.6?-0.4?-0.2???0???0.2??0.4??0.6?0.8;
????-1?-0.8?-0.6?-0.4?-0.2???0???0.2??0.4??0.6??0.8??1;
??-0.8?-0.6?-0.4?-0.2???0???0.2??0.4??0.6??0.8???1???1;
??-0.6?-0.4?-0.2???0???0.2??0.4??0.6??0.8???1????1???1;
??-0.4?-0.2???0???0.2??0.4??0.6??0.8???1????1????1???1;
??-0.2??0????0.2??0.4??0.6??0.8???1????1????1????1???1;
???0???0.2???0.4??0.6??0.8???1????1????1????1????1???1]*gu*gf;
%?Next?we?define?some?parameters?for?the?fuzzy?inverse?model
gye=1/2;gyc=1/2;
%?Scaling?gains?for?the?error?and?change?in?error?for
%?the?inverse?model
%?These?are?tuned?to?improve?the?performance?of?the?FMRLC
gp=0.2;
numye=11;? %?Number?of?input?membership?functions?for?the?ye
%?universe?of?discourse
numyc=11;? %?Number?of?input?membership?functions?for?the?yc
%?universe?of?discourse
wye=0.2*(1/gye); %?Sets?the?width?of?the?membership?functions?for
%?ye?from?center?to?extremes
wyc=0.2*(1/gyc); %?Sets?the?width?of?the?membership?functions?for
%?yc?from?center?to?extremes
invbase=0.4*gp;?%?Sets?the?base?of?
- 上一篇:matlab 全息圖
- 下一篇:Matlab圖像模板匹配算法
評論
共有 條評論