資源簡介
曾經做的一個模糊控制的船舶航向仿真,能顯示模糊控制輸入輸出三維立體圖。

代碼片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?Fuzzy?Model?Reference?Learning?Control?(FMRLC)?System?for?a?Tanker?Ship
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%?By:?Kevin?Passino?
%?Version:?4/26/01
%
%?Notes:?This?program?has?evolved?over?time?and?uses?programming?
%?ideas?of?Andrew?Kwong?Jeff?Layne?and?Brian?Klinehoffer.
%
%?This?program?simulates?an?FMRLC?for?a?tanker
%?ship.??It?has?a?fuzzy?controller?with?two?inputs?the?error
%?in?the?ship?heading?(e)?and?the?change?in?that?error?(c).??The?output
%?of?the?fuzzy?controller?is?the?rudder?input?(delta).??The?FMRLC?
%?adjusts?the?fuzzy?controller?to?try?to?get?tanker?ship?heading?(psi)?
%?to?track?the?output?of?a?“reference?model“?(psi_m)?that?has?as?an?
%?input?the?reference?input?heading?(psi_r).?We?simulate?the?tanker?
%?as?a?continuous?time?system?that?is?controlled?by?an?FMRLC?that?
%?is?implemented?on?a?digital?computer?with?a?sampling?interval?of?T=1?sec.??
%
%?This?program?can?be?used?to?illustrate:
%??-?How?to?code?an?FMRLC?(for?two?inputs?and?one?output?
%????for?the?controller?and?“fuzzy?inverse?model“).
%??-?How?to?tune?the?input?and?output?gains?of?an?FMRLC.
%??-?How?changes?in?plant?conditions?(“ballast“?and?“full“?and?speed)?
%????can?affect?performance?and?how?the?FMRLC?can?adapt?to?improve
%????performance?when?there?are?such?changes.
%??-?How?the?effects?of?sensor?noise?(heading?sensor?noise)?and?plant?
%????disturbances?(wind?hitting?the?side?of?the?ship)?can?be?reduced
%????over?the?case?of?non-adaptive?fuzzy?control.
%??-?The?shape?of?the?nonlinearity?synthesized?by?the?FMRLC
%????by?plotting?the?input-output?map?of?the?fuzzy?controller?at?the
%????end?of?the?simulation?(and?providing?the?output?membership?function
%????centers).
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear %?Clear?all?variables?in?memory
%?Initialize?ship?parameters?
ell=350; %?Length?of?the?ship?(in?meters)
abar=1;?????????????%?Parameters?for?nonlinearity
bbar=1;
%?Define?the?reference?model?(we?use?a?first?order?transfer?function?
%?k_r/(s+a_r)):
a_r=1/150;
k_r=1/150;
%?Initialize?parameters?for?the?fuzzy?controller
nume=11;? %?Number?of?input?membership?functions?for?the?e?
%?universe?of?discourse?(can?change?this?but?must?also
%?change?some?variables?below?if?you?make?such?a?change)
numc=11;? %?Number?of?input?membership?functions?for?the?c?
%?universe?of?discourse?(can?change?this?but?must?also
%?change?some?variables?below?if?you?make?such?a?change)
%?Next?we?define?the?scaling?gains?for?tuning?membership?functions?for?
%?universes?of?discourse?for?e?change?in?e?(what?we?call?c)?and?
%?delta.??These?are?g1?g2?and?g0?respectively
%?These?can?be?tuned?to?try?to?improve?the?performance.?
%?First?guess:?
g1=1/pi;g2=100;g0=8*pi/18;?%?Chosen?since:?
%?g1:?The?heading?error?is?at?most?180?deg?(pi?rad)?
%?g2:?Just?a?guess?-?that?ship?heading?will?change?at?most
%?????by?0.01
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????36259??2010-10-20?10:14??fmrlc_tanker.m
-----------?---------??----------?-----??----
????????????????36259????????????????????1
- 上一篇:Matlab調用Cplex教程
- 下一篇:平凸透鏡光線追跡
評論
共有 條評論