Why isn't the total potential energy of an elastic system equal to zero? I'm studying FEM. My book says that "the work of internal forces is equal the the work done by external forces" and it states it in an equation Wi=We.
But then it somehow starts discussing potential energy of external and internal forces, and somehow it turns out their sum is not 0. I'm having trouble understanding this. Later in the book it goes on to say that "an element is in the state of balance when the first variation of the total potential energy is equal to 0".
So my question is why isn't the potential energy from external forces equal to the potential energy of internal forces? Or in other way, why isn't their sum equal to zero?
Just to confirm I am correct about it I did some research and found a paper online with an example which indeed confirms that the potential energy isn't zero:

 A: 
the work of internal forces is equal the the work done by external
forces

It is valid when the initial state and the final state are static, and there is no friction or damping to take some energy as heat.
For example: a vertical spring fixed on the ceiling with a hook in the other end. A weight $mg$ is placed at the hook and the system evolves.
Initially the hook has a net force downwards $mg$ and starts accelerating.
When it comes to the point $x = \Delta x$ where $mg + k\Delta x = 0$, (the net force is zero), it has momentarily a constant velocity.
The spring is further strechted until the displacement (by symmetry if the spring is linear) reaches $2\Delta x$. At this point the spring is momentarily at rest.
The work done by the weight is $W_e = 2mg\Delta x$ because the force is constant.
The work done by the spring is $W_i = \frac{1}{2}k(2\Delta x)^2$
But $mg = -k\Delta x$ (where the net force is zero).
So, $W_e = -2k\Delta x^2$ and $W_e + W_i = 0$
But that is not an equilibrium position, which is normally the desired solution. We can get it by taking the sum of the work done by the weight and by the spring $(W_e + W_i)$ at any point $x$, deriving and equating to zero:
$P = mgx + \frac{1}{2}kx^2$
$$0 = \frac{\partial P}{\partial x} = mg + kx => mg = -kx$$
which is reached when $x = \Delta x$.
Note that in this point the work done by the external force $mg\Delta x = k\Delta x^2$ is 2 times the work done by the internal forces: $\frac{1}{2}k\Delta x^2$
