% Calculates the load factor, phi, for columns, given:
%   P = (n+1) vector of total axial load
%   Ec = (n+1) vector of column moduli
%   Ic = (n+1) vector of column inertia
%   Lc = (n+1) vector of column lengths
function phi = Get_phi(P,Ec,Ic,Lc)
    % Verify input
    n = length(P)-1;
    if (length(Ec) ~= n+1 || length(Ic)~=n+1 || length(Lc)~=n+1)
        phi = -100;
        return;
    end
    
    phi = zeros(1,n+1);
    for i=1:n+1
        phi(i)= Lc(i)*sqrt(P(i)/Ec(i)/Ic(i));
    end
end