声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2796|回复: 3

[稳定性与分岔] 单摆方程的Poincare截面Matlab实现

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

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

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

x
% Author: Thomas Lee
% E-mail: lixf1979@126.com
% Corresponding: School of Mathematics, Physics and Software Engineering, Lanzhou Jiaotong University, Lanzhou 730070, China


function ydot=pend(t,y,n)
F=1.15;
a=0.5;
ydot=[y(2);
    -sin(y(1))-a*y(2)+F*cos(n*t)];


clear;
%set innitial conditions as y and dy/dt
y0=[0.8;0.8];
ic=1;
n=2/3;
%integrate for 80 periods T
for i=1:1000
    T=2*pi/n;
    tspan=[(i-1)*T i*T];
    options=odeset('AbsTol',1e-8,'RelTol',1e-8);
    [t,y]=ode45(@pend,tspan,y0,options,n);
    steps=length(t);
    y0=y(steps,:);
    ypoin(i,:)=y0;
    yp(ic:ic+steps-1,:)=y(1:steps,:);
    ic=ic+steps;
end
for i=10:1000
    fprintf('%10.6f %10.6f\n',ypoin(i,1:2))
    subplot(2,1,1)
    plot(ypoin(i,1),ypoin(i,2),'k.','markersize',5)
    xlim([-60 -53]);
    hold on
end
subplot(2,1,2)
plot(yp(1:ic-1,1),yp(1:ic-1,2),'k');
xlim([-60 -53]);
untitled.PNG
回复
分享到:

使用道具 举报

发表于 2008-7-28 15:43 | 显示全部楼层

communications

真的是好东西,我是搞数学的,现在对非线性科学非常感兴趣,但对数学软件不是很熟悉,希望咱们有机会合作,相互学习!
 楼主| 发表于 2008-7-28 16:17 | 显示全部楼层
ok, 谢谢,欢迎交流!随时恭候!
发表于 2017-10-9 14:14 | 显示全部楼层
谢谢楼主分享
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-3-28 18:18 , Processed in 0.065157 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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