def g4_upper(x, constants, variables):
    """ Constraint on the maximum ratio of isotropic to combined isotropic/kinematic hardening at saturation.

    :param np.ndarray x: Parameters of updated Voce-Chaboche model.
    :param dict constants: Defines the constants for the constraint.
    :param dict variables: Defines constraint values that depend on x.
    :return float: Value of the constraint in standard form.
    """
    iso_kin_ratio_max = constants['rho_iso_sup']
    q_inf = x[2]
    n_backstresses = int((len(x) - 6) / 2)
    sum_ck_gammak = 0.
    for i in range(n_backstresses):
        c_ind = 6 + 2 * i
        gamma_ind = 7 + 2 * i
        sum_ck_gammak += x[c_ind] / x[gamma_ind]
    return q_inf / (q_inf + sum_ck_gammak) - iso_kin_ratio_max