神经网络PID基于simulink的神经网络PID控制器仿真
Posted fpga&matlab
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了神经网络PID基于simulink的神经网络PID控制器仿真相关的知识,希望对你有一定的参考价值。
function [sys,x0,str,ts,simStateCompliance] = Hebb_z(t,x,u,flag,ni,np,nd,K)
switch flag
case 0
[sys,x0,str,ts,simStateCompliance]=mdlInitializeSizes;
case 2
sys=mdlUpdate(t,x,u,ni,np,nd);
case 3
sys=mdlOutputs(t,x,u,K);
case 1,4,9
sys=[];
otherwise
DAStudio.error('Simulink:blocks:unhandledFlag', num2str(flag));
end
function [sys,x0,str,ts,simStateCompliance]=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.1,0.1,0.1];
str = [];
ts = [0.001 0];
simStateCompliance = 'UnknownSimState';
function sys=mdlUpdate(t,x,u,ni,np,nd)
sys = x+[ni*u(1)*u(5)*u(1);np*u(1)*u(5)*(u(1)-u(2));nd*u(1)*u(5)*(u(3)-2*u(2))];
function sys=mdlOutputs(t,x,u,K)
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))];
A05-105
以上是关于神经网络PID基于simulink的神经网络PID控制器仿真的主要内容,如果未能解决你的问题,请参考以下文章
m基于simulink的负荷频率小波神经PID控制器仿真,并对比PID控制器
Simulink教程案例1基于Simulink的PID控制器设计与实现