def storage_intra_max_rule(backend_model, loc_tech, timestep):
    """
    When clustering days, to reduce the timeseries length, set limits on
    intra-cluster auxiliary maximum storage decision variable.
    `Ref: DOI 10.1016/j.apenergy.2018.01.023 <https://doi.org/10.1016/j.apenergy.2018.01.023>`_

    .. container:: scrolling-wrapper

        .. math::

            \\boldsymbol{storage}(loc::tech, timestep) \\leq
            \\boldsymbol{storage_{intra\\_cluster, max}}(loc::tech, cluster(timestep))
            \\quad \\forall loc::tech \\in loc::techs_{store}, \\forall timestep \\in timesteps

    Where :math:`cluster(timestep)` is the cluster number in which the timestep
    is located.
    """
    cluster = backend_model.__calliope_model_data['data']['timestep_cluster'][timestep]
    return (
        backend_model.storage[loc_tech, timestep] <=
        backend_model.storage_intra_cluster_max[loc_tech, cluster]
    )