function [xdnew] = dst_eq(xc,xd,t,evt_nbr)
%
%  Discrete event model of [H9.7]
%
p = 16 + 2/3;
tp = 1/p;
%
iL = xc(1);
m0 = xd(1);
m1 = xd(2);
ms = xd(3);
%
if evt_nbr == 1,
  %
  %  The thyristor control is switched on
  %  and the next event of the same type is scheduled
  %
  m1 = 1;
  push_evt(t + tp/2,1);
end
%
if evt_nbr == 2,
  %
  %  The thyristor control is switched off
  %  and the next event of the same type is scheduled
  %
  m1 = 0;
  push_evt(t + tp/2,2);
end
%
if evt_nbr == -1,
  %
  %  A state event has occurred.  We need to toggle the diode switch
  %
  ms = not(ms);
end
%
%  We need to compute the new value of m0
%
m0 = or(ms,and(m0,not(m1)));
%
xdnew = zeros(3,1);
xdnew(1) = m0;
xdnew(2) = m1;
xdnew(3) = ms;
%
return