声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2053|回复: 5

[编程技巧] ode15i 解方程,求大神

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

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

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

x


1.7726*x''-5.01*x'-2000*x=
6.52*                              sqrt(x'^2+y'^2)+40*cos100t-40sin100t
    1.7726*y''-5.01*y'  -  2000*y=40sin100t+40cos100t-14.11148


function dy=li9(t,x,xp);
dy=[xp(1)-x(2);...
  xp(2)*1.7726-x(2)*5.01-x(1)*2000-sqrt(x(2)^2+x(4)^2)*6.52+40*cos(t*100)-40*sin(t*100);...
    xp(3)-x(4);...
   x(4)*1.7726-x(4)*5.01-x(3)*2000-sin(100*t)*40-cos(100*t)*40-14.11148] ;
保存li9文件,然后
clear all;
x0=[0.000275,0.000275 ]';
xp0=[0,0]';
tspan=[0,100];
options=odeset('RelTol',le-5);
[t,x]=ode15i('li9',tspan,x0,xp0,options);
figure;
plot(t,x(:,1),'k-');
hold on;
plot(t,x(:,3),'k-');
legend('x 曲线','y 曲线');
xlabel('时间t');
ylabel('转子位移');
回复
分享到:

使用道具 举报

 楼主| 发表于 2013-6-9 21:41 | 显示全部楼层
1.7726*x''-5.01*x'-2000*x=6.52* sqrt(x'^2+y'^2)+40*cos100t-40sin100t

1.7726*y''-5.01*y'  -  2000*y=40sin100t+40cos100t-14.11148

这是我的方程为什么matlab老说出错呢
 楼主| 发表于 2013-6-10 09:58 | 显示全部楼层
没人理啊
发表于 2013-11-30 18:44 | 显示全部楼层
发表于 2013-12-1 10:11 | 显示全部楼层
缺少报错内容!
我想高手都懒得复製LZ的问题吧!
发表于 2013-12-7 10:23 | 显示全部楼层
中神通 发表于 2013-6-9 21:41
1.7726*x''-5.01*x'-2000*x=6.52* sqrt(x'^2+y'^2)+40*cos100t-40sin100t

1.7726*y''-5.01*y'  -  2000 ...

出错在什么地方?能不能把出错的内容copy上去 看一下
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-9-28 16:33 , Processed in 0.059958 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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