jjj=0
i=0;
c2=50e-12;
l2=0.15;
k=.1;
%c1=0.6e-6; % drsstc
c1=7.1e-005 %offline
foffline=700;
%f=1/sqrt(l2*c2);
f=365000
%for f = 350000:1000:367000
l1=l2*c2/c1;
l2e=l2*(1-k^2);
l1e=l2*k^2;
n2=l2*k^2/l1;
c1e=c1/n2;
n=sqrt(n2);
%for k=0.1:.01:.28
   i=i+1;
   r=.000875*n; %OLTC
   %r=.007*n; % DRSSTC
   %drv=400*n; %DRSSTC
   drv=0; %oltc
   %vd=4*n; %drsstc
   vd=2*n; %oltc
   jjj=jjj+1;
   sim 'tc'
   outenergy=(v2.*v2*c2*.5);
   outl=(l2*current2.*current2/2);
   inl=(l1*current.*current/2);
    pe=v1.*v1*c1e/2;
    tote=(outenergy+outl+inl+pe);
    ce=foffline^2*.5*c1
    eff=tote./ce;
    eff2=(outenergy./ce);
    se=size(eff);
    keep(jjj)=min(eff(100:se));
    keep2(jjj)=max(eff2(100:se));
    fv(jjj)=f;
   
%end
%end