声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1902|回复: 7

[编程技巧] 求助_有关时间响应

[复制链接]
发表于 2007-6-9 16:08 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
自己编了一个微分环节在不同参数下的时间响应的简短程序,但运行后出现了下面的错误提示
??? Error using ==> rfinputs
Not supported for non-proper models.

下面是其中的一段,已将微分环节改为积分环节,运行很好,但当把积分环节改为微分环节(将3个%上移3行)后就出现上面的问题。我想的话,就改了一下传递函数应该不会有什么问题的,但还是有问题,实在想不通,还望指教。
%测试微分环节G(s)=Ts
clear all;
t1=[0:0.01:0.8];
t2=[0:0.1:1.0];
t3=[0:0.01:0.8];
t4=[0:0.01:0.8];
u1=sin(2*pi.*t1);
u2=[0,0.2,0.4,0.6,0.8,1.0,0.8,0.6,0.4,0.2,0];
[u3,t3]=gensig('square',20,100,0.01);
u4=t4;
T=1;fz=[1];fm=[T,0];G1=tf(fz,fm);
T=2;fz=[1];fm=[T,0];G2=tf(fz,fm);
T=3;fz=[1];fm=[T,0];G3=tf(fz,fm);
%T=1;fz=[T,0];fm=[1];G1=tf(fz,fm);
%T=2;fz=[T,0];fm=[1];G2=tf(fz,fm);
%T=3;fz=[T,0];fm=[1];G3=tf(fz,fm);

y1=lsim(G1,u1,t1);%输入为正弦信号
y2=lsim(G2,u1,t1);
y3=lsim(G3,u1,t1);
subplot(2,2,1),plot(t1,u1,':',t1,y1,'-',t1,y2,'-.',t1,y3,'--');
legend('u(t1)','y1(t1)','y2(t1)','y3(t1)');
grid;
xlabel('t1(sec)'),ylabel('x(t1)');
回复
分享到:

使用道具 举报

发表于 2007-6-9 16:32 | 显示全部楼层
你用的是matlab R13吧,出现“Error using ==> rfinputs”错误。这是程序本身的Bug,在R14已经修改好了。解决方法是:
1. Quit MATLAB

2. Rename the following M-file:

$MATLAB\toolbox\control\control\@tf\feedback.m

(where $MATLAB = MATLABs root directory on your machine)

Rename the file to feedback.m.old

3. Download the following file from our Web site:

http://www.mathworks.com/support ... s/s33168/feedback.m

and place it in the same directory mentioned in step 2.

4. Restart MATLAB

5. After restarting MATLAB, issue the following command at the MATLAB prompt :

rehash toolboxcache

评分

1

查看全部评分

 楼主| 发表于 2007-6-9 16:36 | 显示全部楼层
请问是不是lsim命令中的传递函数必须是分母阶数不得小分子阶数啊?如果是,那该怎么写微分环节的传递函数Ts啊?由于初学,还望各位指教,谢谢了!
 楼主| 发表于 2007-6-9 16:38 | 显示全部楼层

回复 #2 happy 的帖子

噢,我用的是的Matlab7.1的,我来试下,谢谢了
 楼主| 发表于 2007-6-9 17:01 | 显示全部楼层

回复 #2 happy 的帖子

文件feed.m已经找到,不过路径
http://www.mathworks.com/support ... s/s33168/feedback.m
已经改为
http://www.mathworks.com/support ... s/s33168/feedback.m

先已按上面的要求做了一遍,不过还是老问题哈
??? Error using ==> rfinputs
Not supported for non-proper models
 楼主| 发表于 2007-6-9 17:06 | 显示全部楼层
这个问题在Matlab的网站上也有说明
http://www.mathworks.com/support ... ml?solution=1-1A63H
不过按他上面的做还是不行
哎,重启机器看看

[ 本帖最后由 eight 于 2007-6-9 17:09 编辑 ]
发表于 2007-6-9 17:16 | 显示全部楼层
我这里运行的结果是

??? Error using ==> ltipack.ltidata.utCheckComputability
Not supported for models with more zeros than poles.


原因很明显,零点不能多于极点
 楼主| 发表于 2007-6-11 19:01 | 显示全部楼层

回复 #7 happy 的帖子

恩,以后写传递函数得记住了
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-4-28 00:31 , Processed in 0.200874 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表