声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1156|回复: 3

用matlab画时滞系统图遇到的问题

[复制链接]
发表于 2008-4-22 11:04 | 显示全部楼层 |阅读模式

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

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

x
m文件如下:function dydt = dde_chenf(t,y,Z,a,b,c)
ylag = Z(:,1);
dydt = [ -a*y(1)+a*y(2)-ylag(1)
        (c-a)*y(1)+c*y(2)-ylag(2)-y(1)*y(3)
        (-b)*y(3)+ylag(3)+y(1)*y(2)      ];
a=35;
b=3;
c=28;
tau=2;
tspan = [0,25];
opts = ddeset('RelTol',1e-5,'AbsTol',1e-8);
history = [-3;-4;2];
t=0:0.1:4000;
sol = dde23(@dde_chenf,tau,history,tspan,opts,a,b,c)
plot(t,sol.y(1,4000:end))问题是plot(t,sol.y(1,4000:end))
画不了,还有就是怎么画t-(t-tau)
先谢谢了  有研究延时的同学可以加我q q45574874

运行结果:

sol =
     solver: 'dde23'
    history: [3x1 double]
    discont: [0 2 4 6]
          x: [1x6524 double]
          y: [3x6524 double]
      stats: [1x1 struct]
         yp: [3x6524 double]
??? Error using ==> plot
Vectors must be the same lengths.
Error in ==> Untitled at 10
plot(t,sol.y(1,4000:end))


[ 本帖最后由 linzx270 于 2008-4-22 16:57 编辑 ]

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

发表于 2008-4-22 14:15 | 显示全部楼层

回复 楼主 的帖子

这样的帖子可能接受的很少
发表于 2008-5-31 23:51 | 显示全部楼层
用dde23求解后,不妨试试deval命令!!!

评分

1

查看全部评分

发表于 2009-5-31 17:31 | 显示全部楼层

我试了一下,用以下语句可以画出来

y是 [3x6524 double]
    t 是3x40001 double
   Vectors must be the same lengths.
   用t1=t(1:6524);语句使t1 变成1x6524 double
添加
t1=t(1:6524);
plot(t1,sol.y);
即可画出来
或者用以下语句分开画3个图
plot(t1,sol.y(1,:));plot(t1,sol.y(2,:));plot(t1,sol.y(3,:))

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-5-21 03:47 , Processed in 0.149964 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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