<p>The damping force you mentioned <span class="math-container">$f=-k \frac{\dot{l} \cdot l}{|l|} \frac{l}{|l|}$</span> is a special case of <span class="math-container">$f=-k \dot{C} \frac{\partial C}{\partial \mathbf{x}}$</span>.</p>

<p>Let
<span class="math-container">$$
\begin{align}
C(\mathbf{x}) &amp;= \lVert\mathbf{l}\rVert-l_0 \\
\mathbf{l} &amp;= \mathbf{x}_1 - \mathbf{x}_2 \\
\mathbf{\dot{l}} &amp;= \mathbf{v}_1 - \mathbf{v}_2 \\
\mathbf{v} &amp;= \dot{\mathbf{x}} = \begin{pmatrix}\mathbf{v}_1 \\ \mathbf{v}_2\end{pmatrix}
\end{align}
$$</span>
where <span class="math-container">$l_0$</span> is the rest length of the spring, and <span class="math-container">$\mathbf{x}_1$</span>, <span class="math-container">$\mathbf{x}_2$</span> are the positions of two end points.
The damping force is
<span class="math-container">$$
\begin{align}
\mathbf{f} &amp;= -k \dot{C} \frac{\partial C}{\partial \mathbf{x}} \\
&amp;= -k (\frac{\partial C}{\partial \mathbf{x}})^T \dot{\mathbf{x}} \frac{\partial C}{\partial \mathbf{x}}\\
&amp;= -k (\mathbf{l}^T\mathbf{l})^{-1/2} \mathbf{l}^T \begin{pmatrix}\mathbf{I}&amp; -\mathbf{I} \end{pmatrix} \dot{\mathbf{x}} (\mathbf{l}^T\mathbf{l})^{-1/2} \begin{pmatrix}\mathbf{I}&amp; -\mathbf{I} \end{pmatrix}^T \mathbf{l} \\
&amp;= -k (\mathbf{l}^T\mathbf{l})^{-1} \begin{pmatrix}\mathbf{l}^T&amp; -\mathbf{l}^T \end{pmatrix} \mathbf{v} \begin{pmatrix}\mathbf{l} \\ -\mathbf{l} \end{pmatrix}\\
&amp;= -k \frac{(\mathbf{l}\cdot \mathbf{\dot{l}}) }{\lVert \mathbf{l} \rVert^2}
\begin{pmatrix}\mathbf{l} \\ -\mathbf{l} \end{pmatrix}
\end{align}
$$</span></p>

<p>This matches your damping force equation. The <span class="math-container">$-\mathbf{l}$</span> part is just the force for the other particle, which has the opposite direction as expected. Bold letters are used to denote vector quantities.</p>

<p>As mentioned in [baraff98], this damping force is along the direction <span class="math-container">$\frac{\partial C}{\partial \mathbf{x}}$</span>,
and its magnitude is the projected component of velocity <span class="math-container">$\frac{\partial C}{\partial \mathbf{x}}^T \mathbf{v}=\frac{\partial C}{\partial \mathbf{x}}^T \mathbf{\dot{x}}=\dot{C}$</span>.</p>

CC BY-SA 4.0
2019-02-26T06:44:38.757Z
2019-02-26T06:44:38.757Z
TheBusyTypist
<p>Supposing a behavior function $C(x_1, \ldots, x_n)$, then we have a scalar potential energy function  </p>

<p>$E = \frac{k_s}{2}C\cdot C$ where $k_S$ is stiffness constant.</p>

<p>Hence, the force is as follows $f_i = -\frac{\partial E}{\partial x_i} = -k_sC\frac{\partial C}{\partial x_i}$ </p>

<p>I caught up so far, but couldn't understand when adding damping.</p>

<p>The paper read $f_i = (-k_sC - k_d\dot{C})\frac{\partial C}{\partial x_i}$ , where $k_d$ is damping constant and $\dot{C}$ is derivative of $C$.</p>

<p>How to derive the damping part?</p>

<p>I know damping equation is $f_d = -k_dv$, </p>

<p>In detail, supposing there are two end of points in a spirng, called $p_a, p_b$.</p>

<p>then the damping force $f_d = -k_d\frac{\dot{l}\cdot l}{|l|}\frac{l}{|l|}$ in 3D sapce ($\dot{l}$ is $v_a - v_b$, $l = p_a - p_b$)</p>

<p>However, I could not correspond this equation to the above damping part.</p>

CC BY-SA 3.0
2018-01-22T11:59:40.660Z
What 'paper' are you referring to?  Where is this derivation coming from?
gilgamec
CC BY-SA 3.0
2018-01-23T03:29:49.097Z
https://www.pixar.com/assets/pbm2001/pdf/notesc.pdf (Page C10) $//$
http://run.usc.edu/cs599-s10/cloth/baraff-witkin98.pdf (is also using the equation)
shashack
<physics><simulation><particles>
Spring damping in Energy Function
shashack
# Spring damping in Energy Function

(Asked by: username_0 on 2018-01-21)

Supposing a behavior function $C(x\_1, \ldots, x\_n)$, then we have a scalar potential energy function

$E = \frac{k\_s}{2}C\cdot C$ where $k\_S$ is stiffness constant.

Hence, the force is as follows $f\_i = -\frac{\partial E}{\partial x\_i} = -k\_sC\frac{\partial C}{\partial x\_i}$

I caught up so far, but couldn't understand when adding damping.

The paper read $f\_i = (-k\_sC - k\_d\dot{C})\frac{\partial C}{\partial x\_i}$ , where $k\_d$ is damping constant and $\dot{C}$ is derivative of $C$.

How to derive the damping part?

I know damping equation is $f\_d = -k\_dv$,

In detail, supposing there are two end of points in a spirng, called $p\_a, p\_b$.

then the damping force $f\_d = -k\_d\frac{\dot{l}\cdot l}{|l|}\frac{l}{|l|}$ in 3D sapce ($\dot{l}$ is $v\_a - v\_b$, $l = p\_a - p\_b$)

However, I could not correspond this equation to the above damping part.

**Tags:** physics, simulation, particles

> **Comments:**
> **username_1**: What 'paper' are you referring to?  Where is this derivation coming from?  
> **username_0**: https://www.pixar.com/assets/pbm2001/pdf/notesc.pdf (Page C10) $//$ http://run.usc.edu/cs599-s10/cloth/baraff-witkin98.pdf (is also using the equation)  

---

## 1 answers

### Answer by username_2 on 2019-02-26. Score: 1 | Accepted answer

The damping force you mentioned $f=-k \frac{\dot{l} \cdot l}{|l|} \frac{l}{|l|}$ is a special case of $f=-k \dot{C} \frac{\partial C}{\partial \mathbf{x}}$.

Let
$$
\begin{align}
C(\mathbf{x}) &= \lVert\mathbf{l}\rVert-l\_0 \\
\mathbf{l} &= \mathbf{x}\_1 - \mathbf{x}\_2 \\
\mathbf{\dot{l}} &= \mathbf{v}\_1 - \mathbf{v}\_2 \\
\mathbf{v} &= \dot{\mathbf{x}} = \begin{pmatrix}\mathbf{v}\_1 \\ \mathbf{v}\_2\end{pmatrix}
\end{align}
$$
where $l\_0$ is the rest length of the spring, and $\mathbf{x}\_1$, $\mathbf{x}\_2$ are the positions of two end points.
The damping force is
$$
\begin{align}
\mathbf{f} &= -k \dot{C} \frac{\partial C}{\partial \mathbf{x}} \\
&= -k (\frac{\partial C}{\partial \mathbf{x}})^T \dot{\mathbf{x}} \frac{\partial C}{\partial \mathbf{x}}\\
&= -k (\mathbf{l}^T\mathbf{l})^{-1/2} \mathbf{l}^T \begin{pmatrix}\mathbf{I}& -\mathbf{I} \end{pmatrix} \dot{\mathbf{x}} (\mathbf{l}^T\mathbf{l})^{-1/2} \begin{pmatrix}\mathbf{I}& -\mathbf{I} \end{pmatrix}^T \mathbf{l} \\
&= -k (\mathbf{l}^T\mathbf{l})^{-1} \begin{pmatrix}\mathbf{l}^T& -\mathbf{l}^T \end{pmatrix} \mathbf{v} \begin{pmatrix}\mathbf{l} \\ -\mathbf{l} \end{pmatrix}\\
&= -k \frac{(\mathbf{l}\cdot \mathbf{\dot{l}}) }{\lVert \mathbf{l} \rVert^2}
\begin{pmatrix}\mathbf{l} \\ -\mathbf{l} \end{pmatrix}
\end{align}
$$

This matches your damping force equation. The $-\mathbf{l}$ part is just the force for the other particle, which has the opposite direction as expected. Bold letters are used to denote vector quantities.

As mentioned in [baraff98], this damping force is along the direction $\frac{\partial C}{\partial \mathbf{x}}$,
and its magnitude is the projected component of velocity $\frac{\partial C}{\partial \mathbf{x}}^T \mathbf{v}=\frac{\partial C}{\partial \mathbf{x}}^T \mathbf{\dot{x}}=\dot{C}$.


---

