% Plot outcomes of Van der Pol oscillator for µ varying bewteen 0 and 2. % % The van der Pol equation (y_1)"-µ*(1-(x_1)^2)*y'+(y_1)=0 is equivalent % to a system of coupled first-order differential equations % (y_1)'=(y_2) % (y_2)'=µ*[1-(y_1)^2]*(y_2)-(y_1). % % for 0<µ<2. % % see also "vdpeqMU.m" disp(' ') disp(' ') disp('To Stop Simulation, Press "Ctrl+c" in the Command Window ... ') disp(' ') disp(' ') x0=[0.1 0.1]; global mu for mu=0:0.01:2; pause(0.01) [t,Q] = ode45(@vdpeqMU,[0 60],x0); subplot(121); plot(t,Q(:,1),'-',t,Q(:,2),'r-.'); xlabel('time t'); ylabel('solution y_1 and y_2'); title(['Van der Pol with 0 \leq \mu \leq 2: \mu= ', num2str(mu)]); subplot(122); plot(Q(:,1),Q(:,2)); xlabel('y_1'); ylabel('y_2'); end % "Complex and Chaotic Nonlinear Dynamics. % Advances in Economics and Finance, % Mathematics and Statistics" % T.Vialar, Springer 2009 % Copyright(c).