〃Lin一.nn.上i

>> lintest.m - 《神经网络控制工具箱》(nnct
点击查看更多 ▼
点击收缩隐藏 ▲
lintest.m - 《神经网络控制工具箱》(nnct
源码下载: &
% PROGRAM FOR DEMONTRATING CONTROL BASED ON INSTANTANEOUS LINEARIZATION
% Programmed by Magnus Norgaard, IAU/IMM, Technical Univ. of Denmark
% LastEditDate: Feb. 20, 1996
StopDemo=0;
for k=1:1, %dummy loop
% &&&&&&&&&&&&&&&&
BUILD GUI INTERFACE
&&&&&&&&&&&&&&&&&
[guihand,edmulti,contbut,quitbut]=
set(guihand,'Name','Control based on instantaneous linearization');
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
s1='The purpose of this demo is to show how the instantaneous';
s2='linearization principle can be used in the design of';
s3='control systems for nonlinear processes. Two types of';
s4='designs will be investigated: pole placement with zero';
s5='cancellation and pole placement without zero cancellation.';
s6='The process in question is a spring-mass-damper system';
s7='with a hardening spring: y&(t) + y''(t) + y(t) + y(t)^{
} = u(t)';
smat=str2mat(s0,s1,s2,s3,s4,s5,s6,s7);
pmnshow(smat,guihand,edmulti,contbut,quitbut);
if StopDemo==1, close all, end
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
% -- Generate data --
N2=length(U);
N1=floor(N2/2);
Y1 = Y(1:N1)';
U1 = U(1:N1)';
Y2 = Y(N1+1:N2)';
U2 = U(N1+1:N2)';
s1='Before we can apply the controller design we need a neural';
s2='network model of the process. To create this we must make';
s3='an experiment and collect a set of data describing the';
s4='process over its entire range of operation. Such an';
s5='experiment has been simulated in advance with the function';
s6='&experim.& The plot above shows the data set.';
smat=str2mat(s0,s1,s2,s3,s4,s5,s6);
subplot(411)
plot(U1); grid
axis([0 N1 min(U1) max(U1)])
title('Input and output sequence')
subplot(412)
plot(Y1); grid
axis([0 N1 min(Y1) max(Y1)])
xlabel('time (samples)')
pmnshow(smat,guihand,edmulti,contbut,quitbut);
if StopDemo==1, close all, end
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
s1='To identify the neural network model we will use the';
s2='function &nnarx& from the NNSYSID-toolbox. Since it''s';
s3='a second order process we will use as regressors two';
s4='past outputs and two past controls. Furthermore we choose';
s5='a network architecture with five hidden &tanh& units and';
s6='one linear output.';
subplot(411);delete(gca);subplot(412);delete(gca)
subplot('position',[0.1 0.55 0.45 0.38]);
drawnet(ones(7,5),ones(1,8),eps,{
'y(t-1)' 'y(t-2)' 'u(t-1)' 'u(t-2)'
title('Network architecture')
smat=str2mat(s0,s1,s2,s3,s4,s5,s6);
pmnshow(smat,guihand,edmulti,contbut,quitbut);
if StopDemo==1, close all, end
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
% ----- Train network -----
&& Training process in action!! &&';
s5='We run up to 200 iterations so you may have to';
s6='wait for a while.';
smat=str2mat(s0,s1,s2,s3,s4,s5,s6);
set(edmulti,'String',smat);
trparms = settrain(trparms,'maxiter',200);
= ['HHHHH';'L----'];
NN=[2 2 1];
[W1,W2]=nnarx(NetDef,NN,[],[],trparms,Y1,U1);
save forward2 W1 W2 NetDef NN
delete(gca);
subplot('position',[0.1 0.55 0.45 0.38]);
drawnet(W1,W2,eps,{
'y(t-1)' 'y(t-2)' 'u(t-1)' 'u(t-2)'
title('Trained network')
if StopDemo==1, close all, end
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
s1='The network has now been trained and we are ready to';
s2='simulate the control system. First we will try a';
s3='pole placement strategy where we cancel the zero.';
s4='Let''s choose the desired closed loop system as:';
s6='H(z)=----------------------------';
} - 1.4z^{
} + 0.49z';
s8='corresponding to two poles in z=0.7 and one in z=0.';
smat=str2mat(s0,s1,s2,s3,s4,s5,s6,s7,s8);
pmnshow(smat,guihand,edmulti,contbut,quitbut);
if StopDemo==1, close all, end
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
figure('Units','Centimeters','Position',[1.5 1.5 10 1.5]);
subplot(411)
plot([0:samples-1],[ref_data y_data ym_data]); grid
axis([0 samples -2 2])
title('Reference, output and desired output')
subplot(412)
plot([0:samples-1],u_data);
axis([0 samples min(u_data) max(u_data)]); grid
title('Control signal')
xlabel('time (samples)')
s1='Very nice model-following is clearly achieved. However';
s2='the control signal is very active because the zero we';
s3='cancel is close to -1. To avoid this we instead';
s4='choose not to let the controller cancel the zero.';
s5='Let''s use the same desired model as before but introduce';
s6='a dead-beat observer polynomial for causality reasons:';
s7='Ao(z)=z';
smat=str2mat(s0,s1,s2,s3,s4,s5,s6,s7);
pmnshow(smat,guihand,edmulti,contbut,quitbut);
if StopDemo==1, close all, end
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
figure('Units','Centimeters','Position',[1.5 1.5 10 1.5]);
subplot(411)
plot([0:samples-1],[ref_data y_data]); grid
axis([0 samples -2 2])
title('Reference and output signal')
subplot(412)
plot([0:samples-1],u_data);
axis([0 samples min(u_data) max(u_data)]); grid
title('Control signal')
xlabel('time (samples)')
s1='It is seen that the response looks more or less as';
s2='before but that the control signal now is much more';
s3='smooth.';
smat=str2mat(s0,s1,s2,s3);
pmnshow(smat,guihand,edmulti,contbut,quitbut);
if StopDemo==1, close all, end
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
subplot(411)
plot([0:samples-1],B_data); grid
axis([0 samples min(min(B_data(3:samples,:))) max(max(B_data))])
title('Numerator (above) and denominator (below) coefficients')
subplot(412)
plot([0:samples-1],A_data(:,2:3));
axis([0 samples min(min(A_data(3:samples,2:3))) max(max(A_data))]); grid
title('Control signal')
xlabel('time (samples)')
s1='A very nice feature of instantaneous linearization is';
s2='that it provides an excellent understanding of the';
s3='dynamics of the process. As shown above we can, for';
s4='example, plot the coefficients of the extracted linear';
s5='models.';
Another possibility is to plotpoles and zeros in';
s7='the complex plane.';
smat=str2mat(s0,s1,s2,s3,s4,s5,s6,s7);
pmnshow(smat,guihand,edmulti,contbut,quitbut);
if StopDemo==1, close all, end
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
subplot(411);delete(gca);subplot(412);delete(gca)
subplot('position',[0.1 0.55 0.45 0.38]);
Zmat = zeros(samples-2,nb-1);
for k=3:samples,
Zmat(k-2,:)=roots(B_data(k,:))';
ZPmat = zeros(samples-2,na);
for k=3:samples,
ZPmat(k-2,:)=roots(A_data(k,:))';
plot(ZPmat,'x');
title('Poles (x) and zeros (o) of extracted linear models');grid
axis([-1 1 -1 1])
axis('equal')
plot(Zmat,Zmat*0,'o');
t=-pi:0.05:
plot(sin(t),cos(t))
s1='From this plot it is quite clear why there were problems';
s2='when the controller canceled the zero. Obviously it is';
s3='very close to the unity circle. We can also see that the';
s4='poles varies quite a lot. To get a better understanding';
s5='of how the pole locations affect the behavior of the';
s6='process we can calculate damping factor and natural';
s7='frequency.';
smat=str2mat(s0,s1,s2,s3,s4,s5,s6,s7);
pmnshow(smat,guihand,edmulti,contbut,quitbut);
if StopDemo==1, close all, end
% &&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&
Cmat = zeros(samples-2,na-1);
for k=3:samples,
r=roots(A_data(k,:))';
[n,m]=sort(real(r));
[MAG,a1,a2]=ddamp(r(m)',0.2);
Cmat(k-2,1)=a1(1);
Cmat(k-2,2)=a2(1);
Cmat=real(Cmat);
subplot(411)
plot(2:samples-1,Cmat(:,1));grid
title('Natural frequency (rad/s) and damping factor')
axis([0 samples min(Cmat(:,1)) max(Cmat(:,1))])
subplot(412)
plot(2:samples-1,Cmat(:,2));grid
axis([0 samples 0 1])
xlabel('time (samples)')
s1='Obviously the process becomes less damped and the';
s2='natural frequency larger when the magnitude of';
s3='the output increases.';
THE END &&';
smat=str2mat(s0,s1,s2,s3,s4,s5,s6);
set(edmulti,'String',smat);
源码下载: &
源码文件列表
温馨提示: 点击源码文件名可预览文件内容哦 ^_^
名称大小日期
&4.07 kB01-29-00 05:46
&2.91 kB01-25-00 13:19
&expdata.mat15.67 kB06-05-97 07:27
&2.48 kB01-24-00 16:15
&2.57 kB01-26-00 13:28
&5.50 kB01-26-00 13:18
&2.62 kB01-25-00 11:57
&forward.mat632.00 B01-25-00 11:40
&forward2.mat632.00 B01-28-00 14:12
&forward3.mat912.00 B01-26-00 13:18
&2.61 kB01-25-00 12:58
&initopt.mat579.00 B06-05-97 07:27
&inverse.mat632.00 B12-18-02 10:46
&inverse2.mat580.00 B06-05-97 07:27
&inverse3.mat579.00 B06-05-97 07:27
&2.63 kB01-25-00 11:41
&2.67 kB01-24-00 16:31
&3.36 kB02-06-00 06:28
&7.77 kB01-24-00 16:13
&3.39 kB01-24-00 16:04
&8.58 kB01-22-00 15:34
&lipdata.mat15.67 kB06-05-97 07:27
&3.76 kB01-28-00 14:06
&optctrl.mat736.00 B01-23-00 11:37
&2.65 kB01-24-00 16:04
&3.45 kB01-23-00 11:35
&6.28 kB01-22-00 16:52
&6.25 kB01-28-00 14:10
&31.00 B06-05-97 07:27
&7.78 kB01-24-00 16:02
&8.32 kB01-24-00 16:02
&89.00 B06-05-97 07:27
&10.00 kB01-25-00 13:22
&784.00 B06-05-97 07:27
&903.00 B09-18-97 08:29
&6.68 kB04-02-03 10:12
&8.69 kB01-26-00 13:37
&8.35 kB01-25-00 13:24
&2.48 kB01-16-00 11:13
&8.69 kB01-25-00 13:25
&7.96 kB01-25-00 13:22
&3.82 kB12-18-02 10:42
&invsim.m~4.58 kB06-06-97 06:05
&9.94 kB12-18-02 10:43
&lincon.m~9.93 kB01-25-00 13:26
&21.22 kB01-28-00 14:00
&16.72 kB01-28-00 14:00
&7.99 kB01-25-00 13:26
&15.32 kB01-25-00 13:27
&1.31 kB06-05-97 08:15
&1.20 kB06-05-97 07:27
&386.00 B06-05-97 07:27
&1,000.00 B06-05-97 09:53
&10.55 kB01-25-00 13:27
&14.89 kB01-25-00 13:27
&15.88 kB01-25-00 13:28
&Fblin3.21 kB01-29-00 05:47
&Feedforw3.17 kB01-29-00 05:48
&Imc3.31 kB01-29-00 05:49
&Instlin3.76 kB01-29-00 05:50
&Inverse5.30 kB01-29-00 05:50
&manual.pdf250.89 kB04-02-03 10:15
&Npc3.84 kB01-29-00 05:51
&Optim5.08 kB01-29-00 05:52
&2.83 kB02-03-00 15:12
&RELEASE5.01 kB02-06-00 06:53
&2.73 kB01-29-00 05:59
&2.26 kB01-29-00 05:57
&2.36 kB01-29-00 05:54
&2.54 kB01-29-00 05:54
&2.45 kB01-29-00 05:58
&2.47 kB01-29-00 05:58
&2.58 kB02-06-00 06:29
&3.30 kB02-06-00 06:29
&3.03 kB01-29-00 06:01
&3.58 kB01-29-00 06:01
&2.49 kB01-29-00 06:09
&3.36 kB01-29-00 06:09
Sponsored links
23 篇源代码 21 篇源代码 18 篇源代码 13 篇源代码 9 篇源代码
285 篇源代码 173 篇源代码 48 篇源代码 42 篇源代码 36 篇源代码
登录 CodeForge
还没有CodeForge账号?
Switch to the English version?
CF仔没有找到您要的代码,请去留下您的问题吧,可能会有大神帮助你哦!
该用户暂时未开通博客
请按 Ctrl+D 键添加到收藏夹。qq炫舞中有一首歌是怎么唱的 i want ... bang lin bang lin i wa_百度知道
qq炫舞中有一首歌是怎么唱的 i want ... bang lin bang lin i wa
大厅歌曲都在图上可以百度查看一下
来自团队:
其他类似问题
为您推荐:
qq炫舞的相关知识
其他1条回答
大厅背景音乐还是什么哦?是不是,“漂亮是全部吗”?
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Lin tao and I live in the same building.But he lives two floors ( ) me.有选项:A.on B.over C.under D.above_百度作业帮
Lin tao and I live in the same building.But he lives two floors ( ) me.有选项:A.on B.over C.under D.above
Lin tao and I live in the same building.But he lives two floors ( ) me.有选项:A.on B.over C.under D.above
选D.ON 表示紧紧贴在……上.over和 above意思差不多,都是在……上.但因为我住的楼是固定的.所以只能用above.至于under,表示在……正下方,我觉得用below更好,因为below不是一定在正下方的.
c,如果楼房的层数时都用under
C.undertwo floors under sb比某人低两层 上传我的文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
基于INN801B的反激式开关电源电路建模与仿真
下载积分:1000
内容提示:基于INN801B的反激式开关电源电路建模与仿真
文档格式:PDF|
浏览次数:117|
上传日期: 02:10:05|
文档星级:
该用户还上传了这些文档
基于INN801B的反激式开关电源电路建模与仿真
官方公共微信很抱歉,该歌曲因版权到期或者内容问题已下线,或者听一下我们推荐的歌曲
正在播放:Lin-G - I want you
播放出现故障,您需要更新!对不起,您需要更新您的浏览器到最新版本或更新您的flash播放器版本!
对不起,由于版权原因,我们暂时不能提供此歌曲在线试听!
歌词于更新
您可能喜欢TA们的歌曲
歌曲Lin-G - I want you在线试听 ,如果您喜欢Lin-G - I want you,请将九酷音乐网()告诉您的3个朋友!!DJMAX感谢您的支持。
Copyright @2011 - 2015 .All Rights Reserved.

我要回帖

更多关于 地球上最后一个人 的文章

 

随机推荐