dufng.m

来自「一种新的时频分析方法的matlab源程序。」· M 代码 · 共 27 行

M
27
字号
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 + =
减小字号Ctrl + -
显示快捷键?