声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1478|回复: 0

[稳定性与分岔] 变系数系统分岔分析

[复制链接]
发表于 2011-5-30 20:18 | 显示全部楼层 |阅读模式

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

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

x
主程序是:
clc
clf
Ld=0.6;
r=0.1;
lx=0.5;
p=1;
K1=0.025;
K2=0.03;
m2=10;
Rx=-40;
w=6;  %参数
[T,Y]=ode45('dy2',[0 2*pi/w],[1.001 0 0 0],[],w,lx,r,Ld,p,K1,K2,Rx,m2);
[n1,mm1]=size(Y);
    j(1,:)=[Y(n1,1) Y(n1,2) Y(n1,3) Y(n1,4)];
for i=2:1000
    i
[T,Y]=ode45('dy2',[0 2*pi/w],[Y(n1,1) Y(n1,2) Y(n1,3) Y(n1,4)],[],w,lx,r,Ld,p,K1,K2,Rx,m2);
[n1,mm1]=size(Y);
j(i,:)=[Y(n1,1) Y(n1,2) Y(n1,3) Y(n1,4)];
end;
plot(j(:,1),j(:,2),'.');
xlabel('x1');ylabel('x2');
子程序是:
function dy=dy2(t,y,flag,w,lx,r,Ld,p,K1,K2,Rx,m2)
g=9.81;
k1=K1/(m2*lx*lx);
k2=K2/(m2*lx*lx);
kg=g/lx;
dy=[0,0,0,0];
xg=Ld-r*cos(w*t);
yg=r*sin(w*t);
xgt=r*w*sin(w*t);
ygt=r*w*cos(w*t);
xgtt=r*w^2*cos(w*t);
ygtt=-r*w^2*sin(w*t);
d=sqrt(xg*xg+yg*yg);
k=sqrt(4*lx^2-d^2);
cf1=(xg-yg*k/d)/(2*lx);
cf2=d^2/(2*lx^2)-1;
sf1=(yg+xg*k/d)/(2*lx);
sf2=d*k/(2*lx^2);
cf21=(xg+yg*k/d)/(2*lx);
sf21=(-yg+xg*k/d)/(2*lx);
f1t=-(xgt-ygt*k/d+4*lx^2*yg*(xg*xgt+yg*ygt)/(k*d^3))/(yg+xg*k/d);
f2t=-2*(xg*xgt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f1t^2*cf2-1/2*kg*sf21-1/2*sf2*f1tt+1/3*Rx))*y(3)+(6*(2+3*cf2)/(4*p+12-9*cf2^2)*(k2-(1/2*f2t-f1t)*sf2-1/2*f2t*sf2)-12*(p+4+3*cf2)/(4*p+12-9*cf2^2)*k2)*y(4)))+12*(p+4+3*cf2)/(4*p+12-9*cf2^2)*(-1/4*kg*cf21*y(1)^2+1/2*kg*cf21*y(1)*y(3)-1/2*sf2*y(2)^2-f1t*cf2*y(2)*y(3)+(1/4*f1t^2*sf2-1/4*kg*cf21-1/4*cf2*f1tt)*y(3)^2-1/2*sf2*y(3)*((12/(4*p+12-9*cf2^2)*(-1/2*kg*((-p-2)*sf1+sf21)+Rx)+3*(2+3*cf2)/(4*p+12-9*cf2^2)*kg*sf21)*y(1)+(12/(4*p+12-9*cf2^2)*(-k1+f2t*sf2)-6*(2+3*cf2)/(4*p+12-9*cf2^2)*f1t*sf2)*y(2)+(12/(4*p+12-9*cf2^2)*(-1/2*f2t*(f2t-2*f1t)*cf2+1/2*kg*sf21+sf2*f1tt-1/2*sf2*f2tt)+6*(2+3*cf2)/(4*p+12-9*cf2^2)*(-1/2*f1t^2*cf2-1/2*kg*sf21-1/2*sf2*f1tt+1/3*Rx))*y(3)+(12/(4*p+12-9*cf2^2)*(k2-(1/2*f2t-f1t)*sf2-1/2*f2t*sf2)-6*(2+3*cf2)/(4*p+12-9*cf2^2)*k2)*y(4)));
dy=[a1;a2;a3;a4];
但是运行之后结果一直不对,希望大家帮忙看一下~谢谢!
回复
分享到:

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-12-19 08:45 , Processed in 0.056746 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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