The code below represents the van der Pol system in the function, vdp1. The vdp1 function assumes that

. The variables

and

are the entries

and

of a two-element vector.
Код:
function dydt = vdp1(t,y)
dydt = [y(2); (1-y(1)^2)*y(2)-y(1)];
For the van der Pol system, you can use ode45 on time interval [0 20] with initial values

and

.
Код:
[t,y] = ode45(@vdp1,[0 20],[2; 0]);