def phase(t, alpha, goal_t, start_t, int_dt=0.001, eps=1e-10):
    """Map time to phase.

    Parameters
    ----------
    t : float
        Current time.

    alpha : float
        Value of the alpha parameter of the canonical system.

    goal_t : float
        Time at which the execution should be done.

    start_t : float
        Time at which the execution should start.

    int_dt : float, optional (default: 0.001)
        Time delta that is used internally for integration.

    eps : float, optional (default: 1e-10)
        Small number used to avoid numerical issues.

    Returns
    -------
    z : float
        Value of phase variable.
    """
    execution_time = goal_t - start_t
    b = max(1.0 - alpha * int_dt / execution_time, eps)
    return b ** ((t - start_t) / int_dt)