# Euler Lagrange double summation to single smoothed particle hydrodynamics (SPH)

From what I understand, you can derive the equations of motion from the Euler-Lagrange equations. To do so the following equation can be used:

$\displaystyle\frac{\partial L}{\partial \mathbf{r}}-\frac{\mathrm{d}}{\mathrm{d}t}\frac{\partial L}{\partial \mathbf{\dot{r}}}=0$

I am reading a Daniel Price's PhD thesis "Magnetic fields in Astrophysics"(page 42) which does this for the SPH method. I am having some trouble understanding the jump between the two lines below. On the basis that you can take the first line for granted, can you please explain how this double summation becomes a single summation and how the $\delta$ terms vanish?

The author states that they make use of the fact that $\nabla_a W_{ac}=-\nabla_a W_{ca}$

EDIT

Based on Christian Schmidt's answer this is how I think it works out:

$\displaystyle\sum_b m_b\frac{P_b}{\rho_b^2}\left(\sum_cm_c\nabla_aW_{bc}\delta_{ba}-\sum_cm_c\nabla_aW_{bc}\delta_{ca}\right)$

Considering the first term in the brackets. This will only exist when $b=a$. Similarly the second term in the brackets will only exist when $c=a$. Therefore

$\displaystyle m_a\frac{P_a}{\rho_a^2}\left(\sum_cm_c\nabla_aW_{ac}\right)-\sum_b m_b\frac{P_b}{\rho_b^2}m_a\nabla_aW_{ba}$

Changing the index on the first sum from $c$ to $b$ and making use of the fact that $\nabla_a W_{ab}=-\nabla_a W_{ba}$ in the second term

$\displaystyle m_a\sum_b\frac{P_a}{\rho_a^2}m_b\nabla_aW_{ab}+m_a\sum_b m_b\frac{P_b}{\rho_b^2}\nabla_aW_{ab}$

Which then reduces to the second line in the original question. Does this seem correct?

You have to apply the rules for calculating with deltas and summation indices.

$$m_c \nabla_a W_{bc} \delta_{ba} = m_c \nabla_a W_{ac} = m_b \nabla_a W_{ab}$$

So just remove the $\delta_{ba}$ and convert the index $b$ to $a$. Then, $c$ is a summation index, you can change its name to $b$. This is how $m_c$ vanishes in the result. Do the same with

$$-m_c \nabla_a W_{bc} \delta_{ca} = - m_c \nabla_a W_{ba}$$

Now apply the mentioned antisymmetry

$$- m_c \nabla_a W_{ba} = m_c \nabla_a W_{ab}$$

Again, $c$ is a summation index, just change it to $b$. Inserting this into the original equation should then summarize to the second line.

• Actually I can only get as far as: $\displaystyle\sum_b m_b \frac{P_b}{\rho_b^2}\sum_cm_c(\nabla_aW_{ac}-\nabla_aW_{ba})$ Can you advise where to go from there? I don't quite know how to join the summations into one. Jun 2, 2017 at 9:59
• Ok but has to be later sorry Jun 2, 2017 at 10:09
• I think I've worked it out. Can you please confirm when you have a minute? Jun 2, 2017 at 10:30
• Yes, I think that is correct. Jun 2, 2017 at 11:34