# Sum up vectors/directed line segments that terminate at the same point

A crude drawing of the problem I'm interested in is shown below. I want to sum over the entire space, counting all the green vectors that terminate at some particular point and ignoring all the orange vectors that don't terminate at that point. I want to do this for all possible points. I'm not sure what kind of operation this is or how it should be formally described. Is there a common name/procedure for this kind of thing? The basis for the problem is understanding how mass at some points in the space 'flows' from one point to another. Note that I have already derived a PDE/conservation law to describe this behaviour in another context, but I am interested in something more general involving this unusual kind of set up.

Here's my attempt to describe it. Let $$\mathbf{x}, \hat{\mathbf{x}} \in S$$ be points in the space. Let $$\mathbf{v}(\mathbf{x})$$ be a vector at point $$\mathbf{x}$$ pointing to some other point in $$S$$. I define a function

$$$$f(\hat{\mathbf{x}}, \mathbf{x}) = \begin{cases} 1, & \text{if}\ \hat{\mathbf{x}} + \mathbf{v}(\hat{\mathbf{x}}) = \mathbf{x} \\ 0, & \text{otherwise}, \end{cases}$$$$

such that I can define the quantity I'm interested in as some kind of sum or integral (depending on whether the space is discrete or continuous) of the form

$$$$g(\mathbf{x}) = \int_{\hat{\mathbf{x}}} f(\hat{\mathbf{x}}, \mathbf{x}) \; dS$$.$$

Any thoughts appreciated.

• @Somos I'm afraid I don't follow. Commented May 4, 2019 at 11:12
• Did you try the one dimensional case? What did you get? Commented May 4, 2019 at 11:15
• I end up imagining a function $f : X \rightarrow X$ that maps points $x \in X$ to other points $\hat{x} \in \hat{X}$. And what I want is a function $g : \hat{X} \rightarrow Y$ that takes points $\hat{x}$ and maps them to the count $y \in Y$ of points $x$ that map to $\hat{x}$. So in a 1D case we assume $X,\hat{X}$ are just the set of points on the number line, and $Y$ is just the set of natural numbers. The function $f$ maps one point on the number line to another point, and the function $g$ just counts up how many points $x$ map to another point $\hat{x}$. Commented May 4, 2019 at 11:39
• The first function resembles the non-injective non-surjective function (4th picture along) in this wiki article: en.wikipedia.org/wiki/Injective_function. Commented May 4, 2019 at 11:40
• One of my earliest numerical experiments. Given a function $f$ you find the inverse image function and then compose that with the cardinality function. This is very natural. If $f:A\to B$ then $g(b)=|f^{-1}(\{b\})|$.where $|S|$ is the cardinality of $S$. Commented May 4, 2019 at 11:49