programs_10b.m

来自「《Dynamical Systems with Applications usi」· M 代码 · 共 22 行

M
22
字号
% Chapter 10 - Limit Cycles.
% Programs_10b - Phase portrait (Fig. 10.2).
% Copyright Birkhauser 2004. Stephen Lynch.

% Limit cycle of a van der Pol system.
% IMPORTANT - Save Programs_10a.m as vectorfield.m.
clear
hold on
sys=inline('[x(2);-x(1)-5*x(2)*((x(1))^2-1)]','t', 'x');
vectorfield(sys,-3:.3:3,-10:1.3:10);
[t,xs] = ode45(sys,[0 30],[2 1]);
plot(xs(:,1),xs(:,2))      
hold off
axis([-3 3 -10 10])
fsize=15;
set(gca,'xtick',[-3:1:3],'FontSize',fsize)
set(gca,'ytick',[-10:5:10],'FontSize',fsize)
xlabel('x(t)','FontSize',fsize)
ylabel('y(t)','FontSize',fsize)
hold off

% End of Programs_10b.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?