function C = computeConvectionMatrix(X,T,Un)
ngaus = 2; 
zgp = [-sqrt(3)/3; sqrt(3)/3];
wgp= [1 1];
N = [(1-zgp)/2 (1+zgp)/2];
Nxi = [-1/2 1/2; -1/2 1/2];

npt = size(X,1); 
[numel,nen] = size(T); 
C = spalloc(npt,npt,3*npt); 
for ielem = 1:numel
    Te = T(ielem,:); 
    Xe = X(Te,:); 
    u_e = Un(Te);
    
    Ce = zeros(nen);
    for ig=1:ngaus
        N_ig   = N(ig,:);
        Nxi_ig = Nxi(ig,:);
        %Jacobia 
        J = Nxi_ig*Xe; 
        % Derivadas de las funciones de forma respecto a (x,y)
        Nx_ig = J\Nxi_ig; 
        % diferencial de volum
        dvolu = wgp(ig)*det(J);
        u_ig = N_ig*(u_e).^2; 
        Ce = Ce + Nx_ig'*(u_ig*Nx_ig)*dvolu; 
    end
    C(Te,Te) = C(Te,Te) + Ce;
end
