def w_lin_update(u, Lin_lhs, Lin_rhs):
    """Computes the update for the auxilary tumor dose distribution w_0 based on the current u

    Parameters
    ----------
    u : np.array of shape(None,)
        Beamlet radiation distribution 
    Lin_lhs : np.array of shape(None, u.shape[0])
        Stacked lhs of the constraints
    Lin_rhs : np.array of shape(None,)
        Stacked rhs of the constraints
   
    Returns
    -------
    np.array of shape (None,)
        update for the auxilary fluence map w_lin

    
    """
    w_lin_next = Lin_lhs.dot(u) 
    violation_indices = w_lin_next - Lin_rhs > 0
    w_lin_next[violation_indices] = Lin_rhs[violation_indices]
    return w_lin_next