% *************************************************************************
% Copied from the book of Schmid and Henningson:
%
% Schmid, Peter J., and Dan S. Henningson. Stability and transition in
% shear flows. Vol. 142. Springer Science & Business Media, 2001.

function [T0,T1]=get_tees(N)

C=zeros(N+1,N+1);

for i=1:N+1
    for j=1:N+1
        
        ii=i-1;
        jj=j-1;
        
        if(rem(ii+jj,2) ==0)
            p=1/(1-(ii+jj)^2)+1/(1-(ii-jj)^2);
            C(i,j)=p;
        else
            C(i,j)=0;
        end
    end
end

T0=C;
 
% *************************************************************************

N_sh=N+1;

d1=zeros(N_sh,N_sh);

for i=0:N_sh-1
    for j=(i+1):2:(N_sh-1)
        d1(i+1,j+1)=2*j;
    end
end

d1(1,:)=d1(1,:)/2;

T1=d1'*C*d1;

end

% *************************************************************************
% *************************************************************************

