📄 dufng.m
字号:
function z = dufng(t,x)
% The function DUFNG solves the Duffing equation:
% dX/dT=Y; dY/dT=X*(1-X^3)+r*cos(w*T)-b*Y.
%
% Following coefficients are used in equation: b=0, r=0.1 and w=2*pi/25.
%
% Calling sequence-
% z=dufng(t,x)
%
% Input-
% t - time step
% x - a column vector of 2 components x(2,1)
% representing X and Y
% Output-
% z - a column vector of 2 components z(2,1)
% representing dX/dT and dY/dT
%----- Initialize
lmta=.1;
omg=2*pi/25;
z=zeros(2,1);
%----- Solve
z(1)=x(2);
z(2)=x(1)-x(1)*x(1)*x(1)+lmta*cos(omg*t);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -