What would be a more compact way to write this equation

55 Views Asked by At

I have an equation $$E=\frac{1}{2}k(\varphi_1-\varphi_2)^2+\frac{1}{2}k(\varphi_2+\varphi_3)^2+\frac{1}{2}k(\varphi_4-\varphi_3)^2$$ that looks quite compact already but the problem is that the equation above is written for $n=4$. Notice that for each $n$ the equation has $n-1$ terms where the middle one is also a sum of variables. Also note that later in my calculations i am calculating derivatives of $E$, meaning that it is NOT the same if I write $(x-y)^2$ or $(y-x)^2$.

How would I write $E$ in a more compact way? Probably with some combination of sums. For example: If $n=10$ than $$E=\frac{1}{2}k(\varphi_1-\varphi_2)^2+\frac{1}{2}k(\varphi_3-\varphi_3)^2+\frac{1}{2}k(\varphi_3-\varphi_4)^2+\frac{1}{2}k(\varphi_4-\varphi_5)^2+\frac{1}{2}k(\varphi_5+\varphi_6)^2+\frac{1}{2}k(\varphi_7-\varphi_6)^2+\frac{1}{2}k(\varphi_8-\varphi_7)^2+\frac{1}{2}k(\varphi_9-\varphi_8)^2+\frac{1}{2}k(\varphi_{10}-\varphi_9)^2$$

which becomes very ... yeah.

1

There are 1 best solutions below

1
On

you can write it in this way:

$E={\cfrac{k}{2}} \left[ \left( \sum\limits_{i=1}^{n-1} ({\varphi}_i-{\varphi}_{i+1})^2 \right) + 4*{\varphi}_{\lfloor{n/2}\rfloor}*{\varphi}_{{\lfloor{n/2}\rfloor}+1} \right]$

or equivalently:

$E=k \left[{\cfrac{{\varphi}_1^2+{\varphi}_n^2}{2}} + \left( \sum\limits_{i=2}^{n-1} {\varphi}_i^2 \right) - \left( \sum\limits_{i=1}^{n-1} {\varphi}_i*{\varphi}_{i+1} \right) + 2*{\varphi}_{\lfloor{n/2}\rfloor}*{\varphi}_{{\lfloor{n/2}\rfloor}+1} \right]$