% Calculates the column stiffnesses Si and frame stiffness sumS, 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
%   beta = (n+1) vector of stiffness coefficients
function [sumS,Si] = Get_S_2001(P,Ec,Ic,Lc,beta)
    % Verify input
    n = length(Ec)-1;
    if (length(Ic) ~= n+1 || length(Lc)~=n+1 || length(beta)~=n+1)
        sumS = -100;
        Si = -100;
        return;
    end
    
    Si = zeros(1,n+1);
    for i=1:n+1
        Si(i)= 12*Ec(i)*Ic(i)/Lc(i)^3*beta(i);
    end
    sumS = sum(Si);
end