def _check_history_parameters(history, parameters, evol_phase='UK', raise_error=True):
    """
    Check if all parameters are present in the evolution history of the model. Throws an error if this is not the case
    if raise_error is set to True. Otherwise the function will return True if all parameters are present, and False
    otherwise.
    Default behaviour is to raise a ValueError if a parameter is missing.

    :param history: the evolution history of the system
    :type history: numpy ndarray
    :param parameters: parameters that should be included
    :type parameters: list of strings
    :param evol_phase: the name of the phase that is doing the checking, used in the error message
    :type evol_phase: str
    :param raise_error: if true, raise an error, else return True if all parameters are present, False otherwise
    :type raise_error: bool
    :return: True if all parameters are present, False otherwise
    :rtype: bool
    """
    missing_parameters = []
    for par in parameters:
        if not par in history.dtype.names:
            missing_parameters.append(par)

    if len(missing_parameters) > 0 and raise_error:
        raise ValueError("""Evolution phase {} requires the following parameters {}, I could not find {} 
                            in the provided history file.""".format(evol_phase, parameters, missing_parameters))

    return len(missing_parameters) == 0