def polyblend(time, time_f, signal_i, signal_f):
    """A smooth blend between two levels of a signal. Suitable for
    approximating thrust variations associated with spool-up and
    spool-down, etc.
    """
    normtime = time / time_f
    scale = signal_f - signal_i
    if time < 0:
        return signal_i
    if time >= time_f:
        return signal_f
    return signal_i + scale * normtime ** 2 * (3 - 2 * normtime)
