加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

matlab中function ydot函数在庞加莱截面的使用方法

(2010-06-10 22:08:00)
标签:

杂谈

u=[0.85,1.02,0.66,1.08];

x0=1;w0=1;v=1;w=0.44;T=2*pi/w;

str {1}='庞加莱截面--周期1吸引子'

str{2}='庞加莱截面--周期2吸引子'

str{3}='庞加莱截面--不变环面吸引子'

str{4}='庞加莱截面--奇怪吸引子'

for j=1:4

    [t,y]=ode23('zjzdfun',[0:T/1000:50*T],[4,4],[],u(j),x0,w0,v,w);

    figure

    subplot(2,1,1)

    plot(t,y(:,1))

    title('位移曲线');

    xlabel('t');ylabel('x');

   

    subplot(2,2,3)

    plot(y(3000:end,1),y(3000:end,2));

    axis([-3 3 -4 4])

    xlabel('x');ylabel('dx/dt');

    title('相图');

   

    subplot(2,2,4)

    axis([-3 1 -1 1])

    hold on

    for i=7000:1000:14000

        plot(y(i,1),y(i,2),'r.');

    end

    title(str(j))

end

 

函数方程

 

function ydot=zjzdfun(t,y,flag,u,x0,w0,v,w)

ydot=[y(2);u*(x0^2-y(1)^2)*y(2)-w0^2*y(1)-v*cos(w*t)]

end

图片

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有