function mlcle(TSkip,TFull,StepLen,opts,p,xstart)
%compute Lyaponov exponents for the MLC circuit

xs=xstart;
xs(4:12)=eye(3);
%opts=odeset('RelTol',1e-3,'MaxStep',1e-2);
opts=odeset('RelTol',1e-3);
[t,x] = ode45(@mlcVERHS,[0 TSkip],xs,opts,p);

xs=x(end,:);
xs(4:12)=eye(3);
lambdaSum=zeros(3,1);
T=0; 
while T<TFull
  [t,x] = ode45(@mlcVERHS,[0 StepLen],xs,opts,p);
  T=T+StepLen;
  xs=x(end,:);
  J=reshape(xs(4:12),3,3);
  [Q,R] = qr(J);
  lambdaSum=lambdaSum+log(abs(diag(R)));
  lambda=lambdaSum/(T);
  xs(4:12)=Q;
end
disp(sprintf('Step: %7.5f, t: %7.5f, %7.5f, %7.5f, %7.5f',StepLen,T,lambda(1),lambda(2),lambda(3)))

