Skip to main content
Post Undeleted by probably_someone
deleted 49 characters in body
Source Link
probably_someone
  • 35.8k
  • 3
  • 58
  • 98

Let $F(r)$ be any function satisfying the following properties:

  • $F(r)$ is well defined for $r\in[0,1]$.
  • $F(r)\geq 0$ for $r\in[0,1]$.
  • $F(r)$ is decreasing for $r\in[0,1]$.

Then a repulsive interaction satisfying your conditions can be built as follows:

For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:

$$a(t_{i+1})=a(t_i)+(1-\delta_{a(t_i)0})(1-\delta_{a(t_i)1})\text{sgn}(a(t_i)-b(t_i))F(|a(t_i)-b(t_i)|)$$$$a(t_{i+1})=g\bigg(a(t_i)+\text{sgn}\big(a(t_i)-b(t_i)\big)F\big(|a(t_i)-b(t_i)|\big)\bigg)$$ $$b(t_{i+1})=b(t_i)+(1-\delta_{b(t_i)0})(1-\delta_{b(t_i)1})\text{sgn}(b(t_i)-a(t_i))F(|a(t_i)-b(t_i)|)$$$$b(t_{i+1})=g\bigg(b(t_i)+\text{sgn}\big(b(t_i)-a(t_i)\big)F\big(|a(t_i)-b(t_i)|\big)\bigg)$$

where

$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$

is the usual "sign function", and

$$\delta_{yz}=\begin{cases}1 & \text{if }y=z\\ 0 & \text{if }y\neq z\end{cases}$$$$g(x)=\begin{cases}0 & \text{if }x<0\\x&\text{if }0\leq x\leq 1\\1&\text{if }x>1\end{cases}$$

is the Kronecker deltaa "limiter" function. The sign function ensures that the force is pointing the right direction to be repulsive, and the Kronecker deltas shut the force off once the agent hits$g$ function ensures that the end ofresults always fall in the unit interval.

There are an infinity of possible choices for $F$; examples include:

  • $F(r)=\mu(1-r)$
  • $F(r)=\mu(1-r^n)$
  • $F(r)=\frac{\mu}{r+\epsilon}$
  • $F(r)=e^{-\mu r}$

Let $F(r)$ be any function satisfying the following properties:

  • $F(r)$ is well defined for $r\in[0,1]$.
  • $F(r)\geq 0$ for $r\in[0,1]$.
  • $F(r)$ is decreasing for $r\in[0,1]$.

Then a repulsive interaction satisfying your conditions can be built as follows:

For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:

$$a(t_{i+1})=a(t_i)+(1-\delta_{a(t_i)0})(1-\delta_{a(t_i)1})\text{sgn}(a(t_i)-b(t_i))F(|a(t_i)-b(t_i)|)$$ $$b(t_{i+1})=b(t_i)+(1-\delta_{b(t_i)0})(1-\delta_{b(t_i)1})\text{sgn}(b(t_i)-a(t_i))F(|a(t_i)-b(t_i)|)$$

where

$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$

is the usual "sign function", and

$$\delta_{yz}=\begin{cases}1 & \text{if }y=z\\ 0 & \text{if }y\neq z\end{cases}$$

is the Kronecker delta. The sign function ensures that the force is pointing the right direction to be repulsive, and the Kronecker deltas shut the force off once the agent hits the end of the interval.

There are an infinity of possible choices for $F$; examples include:

  • $F(r)=\mu(1-r)$
  • $F(r)=\mu(1-r^n)$
  • $F(r)=\frac{\mu}{r+\epsilon}$
  • $F(r)=e^{-\mu r}$

Let $F(r)$ be any function satisfying the following properties:

  • $F(r)$ is well defined for $r\in[0,1]$.
  • $F(r)\geq 0$ for $r\in[0,1]$.
  • $F(r)$ is decreasing for $r\in[0,1]$.

Then a repulsive interaction satisfying your conditions can be built as follows:

For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:

$$a(t_{i+1})=g\bigg(a(t_i)+\text{sgn}\big(a(t_i)-b(t_i)\big)F\big(|a(t_i)-b(t_i)|\big)\bigg)$$ $$b(t_{i+1})=g\bigg(b(t_i)+\text{sgn}\big(b(t_i)-a(t_i)\big)F\big(|a(t_i)-b(t_i)|\big)\bigg)$$

where

$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$

is the usual "sign function", and

$$g(x)=\begin{cases}0 & \text{if }x<0\\x&\text{if }0\leq x\leq 1\\1&\text{if }x>1\end{cases}$$

is a "limiter" function. The sign function ensures that the force is pointing the right direction to be repulsive, and the $g$ function ensures that the results always fall in the unit interval.

There are an infinity of possible choices for $F$; examples include:

  • $F(r)=\mu(1-r)$
  • $F(r)=\mu(1-r^n)$
  • $F(r)=\frac{\mu}{r+\epsilon}$
  • $F(r)=e^{-\mu r}$
Post Deleted by probably_someone
added 177 characters in body
Source Link
probably_someone
  • 35.8k
  • 3
  • 58
  • 98

Let $F(r)$ be any function satisfying the following properties:

  • $F(r)$ is well defined for $r\in[0,1]$.
  • $F(r)\geq 0$ for $r\in[0,1]$.
  • $F(r)$ is decreasing for $r\in[0,1]$.

Then a repulsive interaction satisfying your conditions can be built as follows:

For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:

$$a(t_{i+1})=a(t_i)+(1-\delta_{a(t_i)0})(1-\delta_{a(t_i)1})\text{sgn}(a(t_i)-b(t_i))F(|a(t_i)-b(t_i)|)$$ $$b(t_{i+1})=b(t_i)+(1-\delta_{b(t_i)0})(1-\delta_{b(t_i)1})\text{sgn}(b(t_i)-a(t_i))F(|a(t_i)-b(t_i)|)$$

where

$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$

is the usual "sign map"function", and

$$\delta_{yz}=\begin{cases}1 & \text{if }y=z\\ 0 & \text{if }y\neq z\end{cases}$$

is the Kronecker delta. The sign function ensures that the force is pointing the right direction to be repulsive, and the Kronecker deltas shut the force off once the agent hits the end of the interval.

There are an infinity of possible choices for $F$; examples include:

  • $F(r)=\mu(1-r)$
  • $F(r)=\mu(1-r^n)$
  • $F(r)=\frac{\mu}{r+\epsilon}$
  • $F(r)=e^{-\mu r}$

Let $F(r)$ be any function satisfying the following properties:

  • $F(r)$ is well defined for $r\in[0,1]$.
  • $F(r)\geq 0$ for $r\in[0,1]$.
  • $F(r)$ is decreasing for $r\in[0,1]$.

Then a repulsive interaction satisfying your conditions can be built as follows:

For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:

$$a(t_{i+1})=a(t_i)+(1-\delta_{a(t_i)0})(1-\delta_{a(t_i)1})\text{sgn}(a(t_i)-b(t_i))F(|a(t_i)-b(t_i)|)$$ $$b(t_{i+1})=b(t_i)+(1-\delta_{b(t_i)0})(1-\delta_{b(t_i)1})\text{sgn}(b(t_i)-a(t_i))F(|a(t_i)-b(t_i)|)$$

where

$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$

is the usual "sign map", and

$$\delta_{yz}=\begin{cases}1 & \text{if }y=z\\ 0 & \text{if }y\neq z\end{cases}$$

is the Kronecker delta.

Let $F(r)$ be any function satisfying the following properties:

  • $F(r)$ is well defined for $r\in[0,1]$.
  • $F(r)\geq 0$ for $r\in[0,1]$.
  • $F(r)$ is decreasing for $r\in[0,1]$.

Then a repulsive interaction satisfying your conditions can be built as follows:

For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:

$$a(t_{i+1})=a(t_i)+(1-\delta_{a(t_i)0})(1-\delta_{a(t_i)1})\text{sgn}(a(t_i)-b(t_i))F(|a(t_i)-b(t_i)|)$$ $$b(t_{i+1})=b(t_i)+(1-\delta_{b(t_i)0})(1-\delta_{b(t_i)1})\text{sgn}(b(t_i)-a(t_i))F(|a(t_i)-b(t_i)|)$$

where

$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$

is the usual "sign function", and

$$\delta_{yz}=\begin{cases}1 & \text{if }y=z\\ 0 & \text{if }y\neq z\end{cases}$$

is the Kronecker delta. The sign function ensures that the force is pointing the right direction to be repulsive, and the Kronecker deltas shut the force off once the agent hits the end of the interval.

There are an infinity of possible choices for $F$; examples include:

  • $F(r)=\mu(1-r)$
  • $F(r)=\mu(1-r^n)$
  • $F(r)=\frac{\mu}{r+\epsilon}$
  • $F(r)=e^{-\mu r}$
added 177 characters in body
Source Link
probably_someone
  • 35.8k
  • 3
  • 58
  • 98

Let $F(x,r)$$F(r)$ be any function satisfying the following properties:

  • $F(x,r)$$F(r)$ is well defined for $x\in [0,1]$, $r\in[0,1]$.
  • $F(x,r)\geq 0$$F(r)\geq 0$ for $x\in[0,1]$, $r\in[0,1]$.
  • $F(0,r)=0$ for all $r$.
  • $F(1,r)=0$ for all $r$.
  • If $x\in(0,1)$ is held fixed, $F(x,r)$$F(r)$ is decreasing for $r\in[0,1]$.

Then a repulsive interaction satisfying your conditions can be built as follows:

For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:

$$a(t_{i+1})=a(t_i)+\text{sgn}(a(t_i)-b(t_i))\times F(a(t_i),|a(t_i)-b(t_i)|)$$$$a(t_{i+1})=a(t_i)+(1-\delta_{a(t_i)0})(1-\delta_{a(t_i)1})\text{sgn}(a(t_i)-b(t_i))F(|a(t_i)-b(t_i)|)$$ $$b(t_{i+1})=b(t_i)+\text{sgn}(b(t_i)-a(t_i))\times F(b(t_i),|a(t_i)-b(t_i)|)$$$$b(t_{i+1})=b(t_i)+(1-\delta_{b(t_i)0})(1-\delta_{b(t_i)1})\text{sgn}(b(t_i)-a(t_i))F(|a(t_i)-b(t_i)|)$$

where

$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$

is the usual "sign map"., and

There are infinitely many possible choices for $F$. For example, you can set $F(x,r)=\mu x(1-x)(1-r)$. In this case, the strength of the repulsive force decreases linearly with separation of $a$ and $b$ and also decreases quadratically with distance from the midpoint of the interval.$$\delta_{yz}=\begin{cases}1 & \text{if }y=z\\ 0 & \text{if }y\neq z\end{cases}$$

Or, if you're comfortable with discontinuous functions (since the conditions above don't actually require $F$ to be continuous), you can get something even simpler using $F(x,r)=\mu(1-\delta_{x0})(1-\delta_{x1})(1-r)$, where $\delta_{yz}$ is the Kronecker delta. This repulsive force has constant strength as a function of position in the interior of the interval, decreases linearly with separation of $a$ and $b$, and suddenly shuts off when the agent hits the end of the interval.

Let $F(x,r)$ be any function satisfying the following properties:

  • $F(x,r)$ is well defined for $x\in [0,1]$, $r\in[0,1]$.
  • $F(x,r)\geq 0$ for $x\in[0,1]$, $r\in[0,1]$.
  • $F(0,r)=0$ for all $r$.
  • $F(1,r)=0$ for all $r$.
  • If $x\in(0,1)$ is held fixed, $F(x,r)$ is decreasing for $r\in[0,1]$.

Then a repulsive interaction satisfying your conditions can be built as follows:

For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:

$$a(t_{i+1})=a(t_i)+\text{sgn}(a(t_i)-b(t_i))\times F(a(t_i),|a(t_i)-b(t_i)|)$$ $$b(t_{i+1})=b(t_i)+\text{sgn}(b(t_i)-a(t_i))\times F(b(t_i),|a(t_i)-b(t_i)|)$$

where

$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$

is the usual "sign map".

There are infinitely many possible choices for $F$. For example, you can set $F(x,r)=\mu x(1-x)(1-r)$. In this case, the strength of the repulsive force decreases linearly with separation of $a$ and $b$ and also decreases quadratically with distance from the midpoint of the interval.

Or, if you're comfortable with discontinuous functions (since the conditions above don't actually require $F$ to be continuous), you can get something even simpler using $F(x,r)=\mu(1-\delta_{x0})(1-\delta_{x1})(1-r)$, where $\delta_{yz}$ is the Kronecker delta. This repulsive force has constant strength as a function of position in the interior of the interval, decreases linearly with separation of $a$ and $b$, and suddenly shuts off when the agent hits the end of the interval.

Let $F(r)$ be any function satisfying the following properties:

  • $F(r)$ is well defined for $r\in[0,1]$.
  • $F(r)\geq 0$ for $r\in[0,1]$.
  • $F(r)$ is decreasing for $r\in[0,1]$.

Then a repulsive interaction satisfying your conditions can be built as follows:

For two agents $a$ and $b$, their positions at time $t_{i+1}$ are determined from their positions at time $t_i$ as follows:

$$a(t_{i+1})=a(t_i)+(1-\delta_{a(t_i)0})(1-\delta_{a(t_i)1})\text{sgn}(a(t_i)-b(t_i))F(|a(t_i)-b(t_i)|)$$ $$b(t_{i+1})=b(t_i)+(1-\delta_{b(t_i)0})(1-\delta_{b(t_i)1})\text{sgn}(b(t_i)-a(t_i))F(|a(t_i)-b(t_i)|)$$

where

$$\text{sgn}(x)=\begin{cases}1 & \text{if }x>0 \\ 0 & \text{if }x=0 \\ -1 & \text{if }x<0\end{cases}$$

is the usual "sign map", and

$$\delta_{yz}=\begin{cases}1 & \text{if }y=z\\ 0 & \text{if }y\neq z\end{cases}$$

is the Kronecker delta.

added 177 characters in body
Source Link
probably_someone
  • 35.8k
  • 3
  • 58
  • 98
Loading
Post Undeleted by probably_someone
added 177 characters in body
Source Link
probably_someone
  • 35.8k
  • 3
  • 58
  • 98
Loading
Post Deleted by probably_someone
Source Link
probably_someone
  • 35.8k
  • 3
  • 58
  • 98
Loading