资源简介
本资源为基于单神经元PID连续控制系统仿真的Simulink仿真模型,仿真算法为改进后的Hebb学习算法,各参数已调好,可完美运行。如有怀疑请浏览我的微博:单神经元PID控制+Simulink仿真。地址:https://blog.csdn.net/weixin_42650162/article/details/90517955
代码片段和文件信息
function [sysx0strtssimStateCompliance] = sy2(txuflagdeltakK)
switch flag
case 0
[sysx0strtssimStateCompliance]=mdlInitializeSizes;
case 2
sys=mdlUpdate(txudeltak);
case 3
sys=mdlOutputs(txuK);
case {149}
sys=[];
otherwise
DAStudio.error(‘Simulink:blocks:unhandledFlag‘ num2str(flag));
end
function [sysx0strtssimStateCompliance]=mdlInitializeSizes
sizes = simsizes;
sizes.NumContStates = 0;
sizes.NumDiscStates = 3;
sizes.NumOutputs = 4;
sizes.NumInputs = 5;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1;
sys = simsizes(sizes);
x0 = [0.10.10.1];
str = [];
ts = [-1 0];
simStateCompliance = ‘UnknownSimState‘;
function sys=mdlUpdate(txudeltak)
sys = x+deltak*u(1)*u(5)*(2*u(1)-u(2));
function sys=mdlOutputs(txuK)
xx = [u(1) u(1)-u(2) u(1)+u(3)-2*u(2)];
sys = [u(4)+K*xx*x/sum(abs(x));K*x/sum(abs(x))];
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17058 2019-05-29 20:28 dsj_pid_gjHeeb\dsj_pid_gjHebb.slx
文件 893 2019-05-29 20:20 dsj_pid_gjHeeb\gj_Hebb.m
文件 149711 2019-05-29 20:42 dsj_pid_gjHeeb\Help.docx
目录 0 2019-05-29 20:42 dsj_pid_gjHeeb
----------- --------- ---------- ----- ----
167662 4
- 上一篇:LSD直线提取算法MATLAB.rar
- 下一篇:matlab经典题目
评论
共有 条评论