Classical Mechanics – Spring Potential Energy Formula in 2D Case

classical-mechanicspotential energyspring

In 1D case, the potential energy of a spring can be determined by

$$U = \frac{1}{2} k (x-x_0)^2$$

where $x$ and $x_0$ are final and initial spring lengths measured in x-axis respectively. I am trying to find a 2D version of this formula.

I started with 2D version of Hooke's law

$$\vec{F} = – k (l – l_0) \cos(\theta) \hat{x} + – k (l – l_0) \sin(\theta)\hat{y}$$

where $l$ and $l_0$ are final and initial spring lengths respectively independent of axis and $\theta$ is angle with respect to positive x-axis.

I know that potential energy can be found by this relation: $\vec{F}=-\nabla U$. Therefore

$$- k (l – l_0) \cos(\theta) \hat{x} + – k (l – l_0) \sin(\theta)\hat{y} = – \frac{dU}{dx} \hat{x} + – \frac{dU}{dy} \hat{y}$$

However when I calculate $U$, I get conflicting results,

$$U_1 = k (l – l_0) \cos(\theta) x$$

$$U_2 = k (l – l_0) \sin(\theta) y$$

Which part I did wrong? What is the correct version of 2D spring potential energy formula?

Best Answer

When you get to the point $$ - k (l - l_0) \cos(\theta) \hat{x} + - k (l - l_0) \sin(\theta)\hat{y} = - \frac{dU}{dx} \hat{x} - \frac{dU}{dy} \hat{y}\,, $$ those total derivatives should really be partial derivatives. In addition, $l$ and $\theta$ are coordinates. The upshot then is that you can't solve the component differential equations by pretending that the components are constant.

Instead, note that $x=l\cos\theta$, $y=l\sin\theta$, and so $x_0=l_0\cos\theta$ and $y_0=l_0\sin\theta$, in which case you get the two differential equations, $$ \frac{\partial U}{\partial x} = -k (x-x_0)\,,~~~~~~~ \frac{\partial U}{\partial y} = -k (y-y_0)y\,. $$ Solving the first, we get $$ U(x, y) = -\frac{1}{2}k (x-x_0)^2 + f(y)\,, $$ where $f(y)$ is some function of $y$. We have to bring out this integration constant because of the partial derivatives. For the other equation, we solve to get $$ U(x, y) = -\frac{1}{2}k (y-y_0)^2 + g(x)\,, $$ where again the integration "constant" $g(x)$ comes out because the partial derivative of $g(x)$ with respect to $y$ is zero. We can then identify $g(x)$ as $-k(x-x_0)^2/2$ and $f(y)$ as $-k(y-y_0)^2/2$, leaving $$ U(x,y) = -\frac{1}{2}k (x-x_0)^2 -\frac{1}{2}k (y-y_0)^2 = -\frac{1}{2}k ((x-x_0)^2+(y-y_0)^2)\,. $$