programs_14a.m

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

M
15
字号
% Chapter 14 - Poincare Maps and Nonautonomous Systems in the Plane.
% Programs 14a - Solving an initial value problem.
% Copyright Birkhauser 2004. Stephen Lynch.

% Solve a differential equation (Example 1).
r=dsolve('Dr=-r^2','r(0)=1');

% List the first eight returns on the segment {y=0, 0<x<1}.
% There may be small inaccuracies due to the numerical solution.
deq=inline('[-(r(1))^2]','t','r');
options=odeset('RelTol',1e-6,'AbsTol',1e-6);
[t,returns]=ode45(deq,[0:2*pi:16*pi],[1]);
returns

% End of Programs 14a.

⌨️ 快捷键说明

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