ph x(1) > 0.111, ( , ). , , 0, ode45 .
function [value,isterminal,direction] = events(t,y)
% Locate the time when y passes through 0.111 in all
% directions and stop integration.
value = y(1) - 0.111; % Detect y=0.111
isterminal = 1; % Stop the integration
direction = 0; % All direction
options = odeset('Events',@events)
[t,y] = ode45(@ph,[0,w_max],[0,0],options);
, ph- dx=[x(2); ...], x (1), - - dx=[x(1); x(2);...]
, .