声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1533|回复: 1

[近似分析] 程序求解求助

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

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

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

x
主程序:
clear;
[t,y]=ode45(@yinhexly,[0 20],[0 0 0 0 0 0 0 0]);
figure(1),plot(t,y(:,1))
figure(2),plot(t,y(:,5))

子程序:
function z=yinhexly(t,y)
z=zeros(8,1);
z(1)=y(2);
z(2)=1/7.76*(-360*(y(2)+71.42*y(4)-y(6)+103.55*y(8)-0.263*(43.15*cos(43.15*t)-11.66*sin(11.66*t)))-122.79*y(2)-13152.89*(y(1)+71.42*y(3)-y(5)+103.55*y(7)-0.263*(sin(43.15*t)+cos(11.66*t)))-5737.91*y(1));
z(3)=y(4);
z(4)=1/47576*(-71.42*(360*(y(2)+71.42*y(4)-y(6)+103.55*y(8)-0.263*(43.15*cos(43.15*t)-11.66*sin(11.66*t)))+13152.89*(y(1)+71.42*y(3)-y(5)+103.55*y(7)-0.263*(sin(43.15*t)+cos(11.66*t)))-3474747+165*sin(40.3/180)));
z(5)=y(6);
z(6)=1/16.65*(360*(y(2)+71.42*y(4)-y(6)+103.55*y(8)-0.263*(43.15*cos(43.15*t)-11.66*sin(11.66*t)))-122.79*y(6)+13152.89*(y(1)+71.42*y(3)-y(5)+103.55*y(7)-0.263*(sin(43.15*t)+cos(11.66*t)))-6597.45*y(5));
z(7)=y(8);
z(8)=1/122754*(-71.42*(360*(y(2)+71.42*y(4)-y(6)+103.55*y(8)-0.263*(43.15*cos(43.15*t)-11.66*sin(11.66*t)))+13152.89*(y(1)+71.42*y(3)-y(5)+103.55*y(7)-0.263*(sin(43.15*t)+cos(11.66*t)))-5027958+187*sin(27.8/180)));

我要y(1),y(5)的图解,但解不出来,求求帮帮忙!谢谢了!
yinhexly@163.com

[ 本帖最后由 mjhzhjg 于 2007-1-24 22:37 编辑 ]
回复
分享到:

使用道具 举报

发表于 2007-1-25 10:44 | 显示全部楼层

回复

运行了一下,好象并没有什么问题.
附图是图形,不知是否是你想要的效果.
%%%%%%%%%%main program%%%%%%%%%%%%
clear
[t,y]=ode45(@yinhexly,[0 20],[0 0 0 0 0 0 0 0]);
figure(1),plot(t,y(:,1),'b',t,y(:,5),'r')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%function
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function z=yinhexly(t,y)
z=zeros(8,1);
z(1)=y(2);
z(2)=1/7.76*(-360*(y(2)+71.42*y(4)-y(6)+103.55*y(8)-0.263*(43.15*cos(43.15*t)-11.66*sin(11.66*t)))-122.79*y(2)-13152.89*(y(1)+71.42*y(3)-y(5)+103.55*y(7)-0.263*(sin(43.15*t)+cos(11.66*t)))-5737.91*y(1));
z(3)=y(4);
z(4)=1/47576*(-71.42*(360*(y(2)+71.42*y(4)-y(6)+103.55*y(8)-0.263*(43.15*cos(43.15*t)-11.66*sin(11.66*t)))+13152.89*(y(1)+71.42*y(3)-y(5)+103.55*y(7)-0.263*(sin(43.15*t)+cos(11.66*t)))-3474747+165*sin(40.3/180)));
z(5)=y(6);
z(6)=1/16.65*(360*(y(2)+71.42*y(4)-y(6)+103.55*y(8)-0.263*(43.15*cos(43.15*t)-11.66*sin(11.66*t)))-122.79*y(6)+13152.89*(y(1)+71.42*y(3)-y(5)+103.55*y(7)-0.263*(sin(43.15*t)+cos(11.66*t)))-6597.45*y(5));
z(7)=y(8);
z(8)=1/122754*(-71.42*(360*(y(2)+71.42*y(4)-y(6)+103.55*y(8)-0.263*(43.15*cos(43.15*t)-11.66*sin(11.66*t)))+13152.89*(y(1)+71.42*y(3)-y(5)+103.55*y(7)-0.263*(sin(43.15*t)+cos(11.66*t)))-5027958+187*sin(27.8/180)));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
z.jpg

评分

1

查看全部评分

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

本版积分规则

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

GMT+8, 2024-9-21 14:32 , Processed in 0.056611 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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