function [ B C Egen Agen] = findBC(k,weight,nmode )
%UNTITLED4 Summary of this function goes here
%   Detailed explanation goes here

constants

[phi E A]=findphi(weight,nmode);

% E(2:3:end,:)=[];
% E(:,2:3:end)=[];
% A(2:3:end,:)=[];
% A(:,2:3:end)=[];
Egen=phi'*E*phi;
Agen=phi'*A*phi;
phi1=phi;
phi1(2:3:end,:)=[];
phi1(1:2:end,:)=-phi1(1:2:end,:);
temp=besselh(1,2,k)/(besselh(1,2,k)+i*besselh(0,2,k));
    F=real(temp);
    G=imag(temp);
    Lz=-2*pi*(-0.5*k.^2-k.*G);
    Lzdot=-2*pi*F;
    Ltheta=-2*pi*(0.5*k.^2*a+F-G.*k*(0.5-a));
    Lthetadot=-2*pi*(0.5+F*(0.5-a)+G./k);
    Mz=2*pi*(-0.5*k.^2*a-k*(a+0.5).*G);
    Mzdot=2*pi*F*(a+0.5);
    Mtheta=2*pi*(0.5*k.^2*(1/8+a^2)+F*(a+0.5)-k.*G*(a+0.5)*(0.5-a));
    Mthetadot=2*pi*(-k/2*(0.5-a)+k.*F*(a+0.5)*(0.5-a)+G./k*(a+0.5));
    Btemp=[c/2*Lzdot (c/2)^2*Lthetadot;(c/2)^2*Mzdot (c/2)^3*Mthetadot];
    Ctemp=[Lz (c/2)*Ltheta;c/2*Mz (c/2)^2*Mtheta];
    globalB=zeros(2*N,2*N);
    globalC=zeros(2*N,2*N);
    for counter=1:2:2*N
        globalB(counter:counter+1,counter:counter+1)=l*Btemp;
        globalC(counter:counter+1,counter:counter+1)=l*Ctemp;    
    end
    B=phi1'*globalB*phi1;
    C=phi1'*globalC*phi1;



end

