def ramp(duration, initial, final):
    """Defines a linear ramp.

    f(t) = (final - initial)*t/duration + initial

    Args:
        duration (float): Duration of ramp
        initial (float): Starting value of ramp
        final (float): Ending value of ramp

    Returns:
        func: Function that takes a single parameter `t`.
    """
    m = (final - initial)/duration
    return lambda t: m*t + initial