⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 program_8c.m

📁 《Dynamical Systems with Applications using MATLAB》一书是用来介绍离散和连续系统下动态非线性系统理论的经典教材(分形、混沌、非线性系统)。这里的附件包含
💻 M
字号:
% Chapter 8 - Planar Systems.
% Program_8c - Phase portrait of a nonlinear system (Fig. 8.12).
% Copyright Birkhauser 2004. Stephen Lynch.

% Phase portrait of a nonlinear system of ODE's.
% IMPORTANT - Save Program_8a as vectorfield.m.
clear
sys=inline('[x(2);x(1)*(1-(x(1))^2)+x(2)]','t', 'x');
warning off MATLAB:divideByZero
vectorfield(sys,-3:.25:3,-3:.25:3);
     hold on
     sep=.5;
     for x0=-3:sep:3
         for y0=-3:sep:3
            [ts,xs] = ode45(sys,[0 5],[x0 y0]);
            plot(xs(:,1),xs(:,2))
         end
     end
     for x0=-3:sep:3
         for y0=-3:sep:3
            [ts,xs] = ode45(sys,[0 -5],[x0 y0]);
            plot(xs(:,1),xs(:,2))
         end
     end
     hold off
axis([-3 3 -3 3])
fsize=15;
set(gca,'xtick',[-3:1:3],'FontSize',fsize)
set(gca,'ytick',[-3:1:3],'FontSize',fsize)
xlabel('x(t)','FontSize',fsize)
ylabel('y(t)','FontSize',fsize)
hold off

% End of Program_8c.

⌨️ 快捷键说明

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