function Ta = compute_Ta_ASCE(h, systemType, units)
% compute_Ta_ASCE
% Computes approximate fundamental period Ta per ASCE 7-22 §12.8.2.1
%
% INPUTS:
%   h           = building height
%   systemType  = string:
%                 'steel_mrf'
%                 'concrete_mrf'
%                 'ebraced'
%                 'other'
%   units       = 'english' (ft) or 'metric' (m)
%
% OUTPUT:
%   Ta          = approximate period (seconds)

    arguments
        h (1,1) double {mustBePositive}
        systemType (1,:) char
        units (1,:) char
    end

    % Assign Ct and x based on system and units
    switch lower(systemType)

        case 'steel_mrf'
            x = 0.8;
            if strcmpi(units,'english')
                Ct = 0.028;
            else
                Ct = 0.0724;
            end

        case 'concrete_mrf'
            x = 0.9;
            if strcmpi(units,'english')
                Ct = 0.016;
            else
                Ct = 0.0466;
            end

        case 'ebraced'
            x = 0.75;
            if strcmpi(units,'english')
                Ct = 0.03;
            else
                Ct = 0.0731;
            end

        case 'other'
            x = 0.75;
            if strcmpi(units,'english')
                Ct = 0.02;
            else
                Ct = 0.0488;
            end

        otherwise
            error('Invalid system type.');
    end

    Ta = Ct * h^x;

end
