function [f] = zcf2(xc,xd,t)
%
%  Zero-crossing function of [H9.14]
%
R2 = 50e3;
L1 = 1.5e-3;
C1 = 1e-6;
V0 = 10;
p = 50;
tp = 1/p;
%
global h Ron Goff
%
uR = xc(1);
i0 = xc(2);
m0 = xd(1);
%
U0 = V0*sin(2*pi*t/tp);
iR = uR/R2;
s = i0/(m0*Goff + (1 - m0));
iC = i0 - iR;
uD = (m0 + (1 - m0)*Ron)*s;
uL = U0 - uD - uR;
duR = iC/C1;
di0 = uL/L1;
%
f = s;
%
return