单摆方程的Poincare截面Matlab实现
% 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=;
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);
=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]);
communications
真的是好东西,我是搞数学的,现在对非线性科学非常感兴趣,但对数学软件不是很熟悉,希望咱们有机会合作,相互学习! ok, 谢谢,欢迎交流!随时恭候! 谢谢楼主分享
页:
[1]