%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ファンデルポールの方程式
% d^2x/dt^2 - ε (1 - x^2) dx/dt + ω0^2 x = A sin(ω t)
% の定義
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function dxdt = vanderpol(t, x, epsilon, omega0, A, omega)
%VANDERPOLDEMO Defines the van der Pol equation for ODEDEMO.
%
% Copyright 1984-2002 The MathWorks, Inc.
% $Revision: 1.2 $  $Date: 2002/06/17 13:20:38 $
%
% modified by T. Samejima
%%%%%% 引数 %%%%%%
% t 時間
% x 状態量
%    x(1)がx(振動変位)
%    x(2)がdx/dt(振動速度)を表している
%    を表している
% epsilon ε = c/m
% omega0 ω0 = sqrt(k/m)(固有角振動数)
% A 加振力の振幅
% omega ω(加振力の角振動数)
%%%%%% 戻り値 %%%%%%
% dxdt xの1階微分値
%    dxdt(1)がdx/dt(= x(2))
%    dxdt(2)がd^2x/dt^2(= ε (1 - x^2) dx/dt - ω0^2 x + A sin(ω t))
%    を表している



dxdt = [x(2); epsilon*(1-x(1)^2)*x(2) - omega0^2*x(1) + A*sin(omega*t)];
