% Calculates gamma for columns, given:
%   ru = (n+1) vector of upper end fixity factors
%   rl = (n+1) vector of lower end fixity factors
function gamma = Get_gamma(ru,rl)
    % Verify input
    n = length(ru)-1;
    if (length(rl) ~= n+1)
        gamma = -100;
        return;
    end
    
    gamma = zeros(1,n+1);
    for i=1:n+1
        gamma(i)=(4-ru(i)*rl(i))/(ru(i)+ru(i)*rl(i)+rl(i));
    end
end