91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

BP神經網絡PID S函數,可用于Simulink仿真。

資源截圖

代碼片段和文件信息

function?[sysx0strts]=nnbp_pid(txuflagTnhxitealfakF1kF2)
switch?flag
???case?0?[sysx0strts]?=?mdlInitializeSizes(Tnh);
???case?3?sys?=?mdlOutputs(txuTnhxitealfakF1kF2);
????case?{1?2?4?9}sys?=?[];
???otherwise?error([‘Unhandled?flag?=?‘num2str(flag)]);
end;
%??初始化函數
function?[sysx0strtsu]?=?mdlInitializeSizes(Tnh)
?
sizes?=?simsizes;?%?讀入模板,得出默認的控制量
sizes.NumContStates?=?0;?sizes.NumDiscStates?=?0;
sizes.NumOutputs?=?4+7*nh;?sizes.NumInputs=7+14*nh;
sizes.DirFeedthrough?=?1;?sizes.NumSampleTimes?=?1;
sys?=?simsizes(sizes);
x0?=?[];
str?=?[];
ts?=?[T?0];


%?系統輸出計算函數
function?sys?=?mdlOutputs(txuTnhxitealfakF1kF2)
?wi_2=reshape(u(8:7+4*nh)nh4);
?wo_2=reshape(u(8+4*nh:7+7*nh)3nh);
?wi_1=reshape(u(8+7*nh:7+11*nh)nh4);
?wo_1=reshape(u(8+11*nh:7+14*nh)3nh);
xi=[u([641])‘?1];?xx=[u(1)-u(2);?u(1);?u(1)+u(3)-2*u(2)];
I=xi*wi‘;?Oh=non_transfun(IkF1);?K=non_transfun(wo*Oh‘kF2);
uu=u(7)+K‘*xx;?dyu=sign((u(4)-u(5))/(uu-u(7)+0.0000001));
dK=non_transfun(K3);?delta3=u(1)*dyu*xx.*dK;
wo=wo_1+xite*delta3*Oh+alfa*(wo_1-wo_2);
dO=2*non_transfun(I3);
wi=wi_1+xite*(dO.*(delta3‘*wo))‘*xi+alfa*(wi_1-wi_2);
sys=[uu;?K;wi(:);wo(:)];


%?激活函數近似
function?W1=non_transfun(Wkey)
switch?key
???case?1?W1=(exp(W)-exp(-W))./(exp(W)+exp(-W));
???case?2?W1=exp(W)./(exp(W)+exp(-W));
???case?3?W1=2./(exp(W)+exp(-W)).^2;
end

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1449??2014-06-11?15:55??nnbp_pid.m

-----------?---------??----------?-----??----

?????????????????1449????????????????????1


評論

共有 條評論