% Calculate equivalent stiffness
%  kb = (n) vector of beam axial stiffnes (N/m)
%  kc - (n+1) vector of column stiffness (N/m)
%  Kb = (n+1), bracing stiffness of frame (N/m)
function [Seq] = Get_Seq_axial(kc,kb,Kb)
    
    % Verify input
    n = length(kb);
    if (length(kc) ~= n+1 || length(Kb)~=n+1)
        Seq = -100;
        return;
    end

    % Assume the first column takes the load
    Seq = kc(n+1)+Kb(n+1);
    for j = n:-1:1
        Seq = Series(Seq,kb(j));
        Seq = Seq + kc(j) + Kb(j);
    end
    
end

% Series stiffness calculation
function [keq] = Series(k1,k2)
    keq = (1/k1 + 1/k2)^(-1);
end