function Exxlyr = CalcYoungMod(Ncells,l,h,wg,Emxx,Egxx,tg)
    %calcula modulo elastico en x y y
  
    %porcentaje de grafeno en la celda
    wg = wg*ones(Ncells,Ncells);      
    %wg = 0.3 + (0.7-0.3)*wg;     
    agrafcell = l*h*wg;          %relacion 1:1
    lg = sqrt(agrafcell);
    hg = lg;
    agraf = sum(sum(agrafcell));
    %arve = lrve*hrve;
    %wg_avg = agraf/arve
  
    Klayer = 0.0;
    
    for j = 1 : Ncells
      
        Kxxrow = 0.0;
        
        for i = 1 : Ncells
            lamb1 = (h-hg(i,j))/(l-lg(i,j));
            lamb2 = (h-hg(i,j))/(2*lg(i,j));
            lamb3 = 2*hg(i,j)/(l-lg(i,j));
            lamb4 = hg(i,j)/lg(i,j);
            Kxxcell = 2*Emxx*tg*lamb1*lamb2/(lamb1+2*lamb2) + Emxx*Egxx*tg*lamb3*lamb4/(Emxx*lamb3+2*Egxx*lamb4); %para las 9 celdas
            Kxxrow = Kxxrow + 1/Kxxcell;
        end
        
        Kxxrow = 1/Kxxrow;
        Klayer = Klayer + Kxxrow;
        
    end
    
    Exxlyr = Klayer*1/tg;
      
 return