File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ <h3>4. Position correction:</h3>
141141 The position correction for a particle is determined using the Lagrange multiplier:
142142 $$\begin{align*}
143143 \Delta \mathbf x_{i_1} &= \frac{1}{m_{i_1}} \frac{\partial C_i}{\partial \mathbf x_{i_1}} \lambda_i = -\frac{\frac{1}{m_{i_1}}}{\frac{1}{m_{i_1}} + \frac{1}{m_{i_2}}}(\|\mathbf{x}_{i_1} - \mathbf{x}_{i_2}\|-d)\frac{\mathbf{x}_{i_1}- \mathbf{x}_{i_2}}{\|\mathbf{x}_{i_1} - \mathbf{x}_{i_2}\|} \\
144- \Delta \mathbf x_{i_2} &= \frac{1}{m_{i_2}} \frac{\partial C_i}{\partial \mathbf x_{i_2}} \lambda_i = +\frac{\frac{1}{m_{i_2 }}}{\frac{1}{m_{i_1}} + \frac{1}{m_{i_2}}}(\|\mathbf{x}_{i_1} - \mathbf{x}_{i_2}\|-d)\frac{\mathbf{x}_{i_1}- \mathbf{x}_{i_2}}{\|\mathbf{x}_{i_1} - \mathbf{x}_{i_2}\|}
144+ \Delta \mathbf x_{i_2} &= \frac{1}{m_{i_2}} \frac{\partial C_i}{\partial \mathbf x_{i_2}} \lambda_i = +\frac{\frac{1}{m_{i_1 }}}{\frac{1}{m_{i_1}} + \frac{1}{m_{i_2}}}(\|\mathbf{x}_{i_1} - \mathbf{x}_{i_2}\|-d)\frac{\mathbf{x}_{i_1}- \mathbf{x}_{i_2}}{\|\mathbf{x}_{i_1} - \mathbf{x}_{i_2}\|}
145145 \end{align*}$$
146146 and the correction is applied to update $\mathbf x^*$ as
147147 $$\mathbf x^* := \mathbf x^* + \Delta \mathbf x.$$
@@ -302,7 +302,7 @@ <h3>References</h3>
302302 gradC_x = dx / dl ;
303303 gradC_y = dy / dl ;
304304 let K = ( gradC_x * gradC_x + gradC_y * gradC_y ) / this . mass ;
305- if ( i != 0 )
305+ if ( ( this . isActive ( index1 ) && this . isActive ( index2 ) ) )
306306 K = 2 * K ;
307307
308308 // comute Lagrange multiplier
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ <h3>References</h3>
325325 gradC_x = dx / dl ;
326326 gradC_y = dy / dl ;
327327 let K = ( gradC_x * gradC_x + gradC_y * gradC_y ) / this . mass ;
328- if ( i != 0 )
328+ if ( ( this . isActive ( index1 ) && this . isActive ( index2 ) ) )
329329 K = 2 * K ;
330330 K += alpha_tilde ;
331331
You can’t perform that action at this time.
0 commit comments