宇宙混沌 发表于 2014-9-18 18:20

分插图chaohundunfenchak

怎么效果不好
function [ output_args ] = chaohundunfenchak( input_args )
%CHAOHUNDUNFENCHAK Summary of this function goes here
%Detailed explanation goes here
global k1
global k2
global k3
global c
global k
k1=1;k2=3;k3=0.5;
N=5000;
c=-1;
for k=0:0.01:30
%解微分方程
options = odeset('RelTol',1e-6,'AbsTol',);
=ode45(@vdp1,,,options);
x1=x(2000,1);
x2=x(2000,2);
x3=x(2000,3);
x4=x(2000,4);
=ode45(@vdp1,,,options);
for n=1:N+1
    xt(n)=x(n,1);
end
for n=2:N
   if xt(n)>xt(n-1) & xt(n)>xt(n+1) & xt(n)>0;
      plot(k,xt(n));
       hold on;
   end   
end
end
xlabel('k');ylabel('X');
%微分方程
function dx=vdp1(t,x)
global k1
global k2
global k3
global c
global k
dx=zeros(4,1);
dx(1)=35*(x(2)-x(1))+x(2)*x(3);
dx(2)=-x(1)*x(3)+35*x(1)-2*x(4);
dx(3)=x(1)*x(2)-c*x(3);
dx(4)=k*x(2);

页: [1]
查看完整版本: 分插图chaohundunfenchak