def compute_tuple_from_generic_dict_of_dicts(generic_dict_of_dicts):
    """
    Given a SortedDict of SortedDict's (e.g., for the states or the costates) this method returns a tuple of its entries.

    :param generic_dict_of_dicts: SortedDict of SortedDict's (for example holding the states or the costates)
    :return: Returns a tuple of the dictionary entries
    """

    # form a tuple of all the state variables (because this is what we take the derivative of)
    sv_list = []
    for k in generic_dict_of_dicts:
        c_generic_dict = generic_dict_of_dicts[k]
        for m in c_generic_dict:
            sv_list.append(c_generic_dict[m])

    return tuple(sv_list)