声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 821|回复: 2

[编程技巧] 程序运行结果有错求助

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

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

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

x
clear all

%the non-zero point is (sqrt(35*3),sqrt(35*3),-35),(-sqrt(35*3),-sqrt(35*3),-35)

ch=inline...
('[35*y(2)-(35-y(4)+1)*y(1);(28-y(6)-y(4))*y(1)+(28-1-y(6))*y(2)-sqrt(35*3)*y(3)-y(1)*y(3);sqrt(35*3)-(3+1+y(5))*y(3)+y(1)*y(3);-(y(1)^2)+y(1)*y(2);-(y(3)^2);y(2)^2+y(1)*y(2)]','t','y');
options=odeset('RelTol',1e-4,'AbsTol',1e-4);
[t,ya]=ode45(ch,[0 10],[10,10,10,-1,1,-1],options);
figure(1)
%plot the system states x,y,z
plot(t,ya(:,1)+sqrt(35*3),'k-',t,ya(:,2)+sqrt(35*3),'k-.',t,ya(:,3)-35,'k:')
xlabel('t/s');
ylabel('x,y,z');


结果有错,望高人指点!

[ 本帖最后由 eight 于 2008-4-9 16:35 编辑 ]
回复
分享到:

使用道具 举报

发表于 2008-4-9 16:34 | 显示全部楼层
原帖由 sindy209 于 2008-4-9 16:33 发表
clear all

%the non-zero point is (sqrt(35*3),sqrt(35*3),-35),(-sqrt(35*3),-sqrt(35*3),-35)

ch=inline...
('[35*y(2)-(35-y(4)+1)*y(1);(28-y(6)-y(4))*y(1)+(28-1-y(6))*y(2)-sqrt(35*3)*y(3)-y(1)*y(3 ...
新人发帖前先看看置顶的会员守则,你这样提问对解答毫无帮助
发表于 2008-4-9 17:36 | 显示全部楼层
改下区间就可以了:

clear all

%the non-zero point is (sqrt(35*3),sqrt(35*3),-35),(-sqrt(35*3),-sqrt(35*3),-35)

ch=inline...
('[35*y(2)-(35-y(4)+1)*y(1);(28-y(6)-y(4))*y(1)+(28-1-y(6))*y(2)-sqrt(35*3)*y(3)-y(1)*y(3);sqrt(35*3)-(3+1+y(5))*y(3)+y(1)*y(3);-(y(1)^2)+y(1)*y(2);-(y(3)^2);y(2)^2+y(1)*y(2)]','t','y');
options=odeset('RelTol',1e-4,'AbsTol',1e-4);
[t,ya]=ode45(ch,[-0.05 0.05],[10,10,10,-1,1,-1],options);
figure(1)
%plot the system states x,y,z
plot(t,ya(:,1)+sqrt(35*3),'k-',t,ya(:,2)+sqrt(35*3),'k-.',t,ya(:,3)-35,'k:')
xlabel('t/s');
ylabel('x,y,z');
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-11-18 06:39 , Processed in 0.051277 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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