# Virtual work of two forces, how do you know whether they are in the same direction?

L.S.

Currently for my course in Continuum Mechanics, I am asked to calculate the force potential in the configuration as shown in the picture. First I will introduce the full problem, then show my calculations. I hope somebody can help me and show my error as it is hard to get in contact with my professors.

The mechanism is made up of two solid bars, the long one has a length $$L$$, the short one a length of $$L/2$$. The reference system used is $$\{\mathbf{e}_x, \mathbf{e}_y\}$$. One end is locked along $$\mathbf{e}_x$$ and $$\mathbf{e}_y$$, the other end is only allowed to slide along $$\mathbf{e}_x$$. At the connection between the two bars, a torsion spring with a stiffness $$\kappa$$ is acting. The spring is associated with an angle $$\gamma$$ and is unstretched for an angle $$\gamma_0$$. A force $$P$$ is applied to the mechanism and a mass $$m$$ is hanging from the end of the long bar. Under the action of the forces, the mechanism moves and its movements are described using an angle $$\beta$$.

Now my task is to compute the force potential $$\mathcal{F}$$ associated with forces on the mechanism as a function of $$L$$, $$m$$, $$\beta$$.

$$$$\mathcal{F} = -W_E$$$$ $$$$W_E = W_P + W_{mg} = \int \mathbf{P} \cdot \text{d}\mathbf{r}_P + \int m\mathbf{g} \cdot \text{d}\mathbf{r}_{mg}$$$$ $$$$= \int_{\beta_0}^{\beta} \mathbf{P} \cdot \frac{\text{d}(\mathbf{r}_P)}{\text{d}\beta}\text{d}\beta + \int_{\beta_0}^{\beta} m \mathbf{g} \cdot \frac{\text{d}(\mathbf{r}_{mg})}{\text{d}\beta}\text{d}\beta$$$$

From the picture I can make out the following position- and forcevectors:

$$$$\mathbf{P} = [-P, 0]^T$$$$ $$$$\mathbf{g} = [0, -g]^T$$$$

$$$$\mathbf{r}_P = L[\cos(\beta), 0]^T \Longrightarrow \frac{\text{d}(\mathbf{r}_P)}{\text{d}\beta} = L[-\sin(\beta), 0]^T$$$$

$$$$\mathbf{r}_{mg} = L[\cos(\beta), \sin(\beta)]^T \Longrightarrow \frac{\text{d}(\mathbf{r}_{mg})}{\text{d}\beta} = L[-\sin(\beta),\cos(\beta)]^T$$$$

Now if we put this together, we now get

$$$$\mathcal{F} = -W_E = -\left(\left( PL\int_{\beta_0}^{\beta} \sin(\beta) \text{d}\beta \right)+ \left( -mgL\int_{\beta_0}^{\beta} \cos(\beta) \text{d}\beta \right)\right)$$$$

If we evaluate the integrals we get

$$$$PL\int_{\beta_0}^{\beta} \sin(\beta) \text{d}\beta = -PL \cos{\beta} \vert_{\beta=\beta_0}^{\beta}$$$$

$$$$-mgL\int_{\beta_0}^{\beta} \cos(\beta) \text{d}\beta = -mgL\sin{\beta} \vert_{\beta=\beta_0}^{\beta}$$$$

And this gives us $$$$\mathcal{F} = PL (\cos(\beta) - \cos(\beta_0)) + mgL(\sin(\beta) - \sin(\beta_0))$$$$

However the answer the textbook gives me is

$$$$\mathcal{F} = PL (\cos(\beta) - \cos(\beta_0)) - mgL(\sin(\beta) - \sin(\beta_0))$$$$

I believe I have made a mistake in the definition of the position vectors $$\mathbf{r}_p$$ and/or $$\mathbf{r}_{mg}$$, but I can't find my mistake.

$$\vec{g}=(0,-g)$$
$$\frac{d\vec{r}_{mg}}{d\beta}=L(-\sin\beta, \cos \beta)$$.
$$\vec{g}.\frac{d\vec{r}_{mg}}{d\beta}=-gL\cos \beta$$.
$$\mathcal{F}=-W_E= \underline{+} m\int \vec{g}.\frac{d\vec{r}_{mg}}{d\beta} d\beta$$
• But then you must also switch the direction of the work done by force P? Because both the work done by P and the work done by g are in the negative direction: Wp = -PL(cos(beta) - cos(beta0)), Wmg = -mgL(sin(beta) - sin(beta0)) This results in W_E = - PL(...) - mgL(...) Oct 3, 2023 at 21:32
• The signs of the forces are already taken care of in the vector representation. To confirm that one would be positive and the other negative, just see that the increase of $P$ (with $mg$ removed)would cause $\beta$ to to increase, while the increase of $mg$ (with $P$ removed) would cause $\beta$ to reduce. Oct 3, 2023 at 23:57