def physicond(amp, t_phi, t_th):
    """ Function enforcing the physical conditions of the system. Namely,
    the perturbation in temperature cannot be a negative one. Thus function
    assures a positive or null amplitude,
    positive or null characteristic times,
    and quicker rising exponential than the decaying exponential.

    Parameters
    ----------
    amp : float
        Amplitude of the exponential pulse.
    t_phi : float
        Characteristic time of the decaying exponential.
    t_th : float
        Characteristic time of the rising (thermalisation) exponential.

    Returns
    -------
    Same as parameters with physical constraints applied.
    """
    # no negative amplitude
    if amp <= 0 :
        amp = 0

    # no negative char. time
    if t_th <= 0:
       t_th = 1e-20

    # rising time shorter than decay time
    if t_phi <= t_th:
        t_phi = t_th

    return amp, t_phi, t_th