How to Apply the Virtual Work Method to Trusses

by Dr Seán Carroll
Updated: 19th July 2022

In this tutorial, you’ll see how we can use the virtual work method to analyse trusses and calculate truss deflections. The virtual work method is based upon the Principle of Virtual Work, which we’ll explore further below.

The Principle of Virtual Work underpins many elegant and versatile analysis procedures. We’ll focus here on how it can be applied to trusses, but we can equally use it to analyse beam and frame structures.

This tutorial will initially develop the underlying theory, starting with the concept of strain energy. This will make the jump to virtual work much easier to understand. We’ll bring it all together with a thorough worked example at the end.

1.0 Strain energy and the virtual work method

The virtual work method is an energy-based analysis method. The key to understanding how and why it works is to first understand the concept of strain energy and how it applies to axially loaded structural elements. When we understand strain energy, we can more easily expand to the broader Principle of Virtual Work and the associated analysis methods.

Let’s start by considering a simple bar, with original length L, in uniaxial tension under the action of a force P. Under the influence of this force, the bar will get longer as a result of the tensile strains that develop. So, let’s say the bar extends by a distance \Delta, Fig 1.

The Virtual Work Method 1 |
Fig 1. Bar in uniaxial tension (left) and axial load versus deflection graph (right).

This means that the force P has moved through a distance \Delta and as such, the force does work on the bar. If we assume the bar is linearly elastic, then the work done by the force, on the bar, is obtained as the area beneath the load-deflection graph.

(1)   \begin{equation*}W =\frac{P\:\Delta}{2} \end{equation*}

Based on the principle of conservation of energy, we know that energy cannot be created or destroyed, it can only be transformed from one form to another. So, the work done by the force P is transferred into stored potential energy in the bar. In other words, the internal state of stress in the bar, as a result of being compressed, results in a store of potential energy in the bar.

This is analogous to the stored energy in a spring after it has been compressed, the more work the external force does in compressing the spring, the more stored potential energy the spring has. We can summarise this energy relationship by simply stating;

(2)   \begin{equation*}\text{work done by external force, }W = \text{change in strain energy in the bar, } U\end{equation*}

where W and U represent work and strain energy respectively. So, we can say therefore that strain energy is given by,

(3)   \begin{equation*}U=\frac{P\:\Delta}{2}\end{equation*}

Since the bar is linearly elastic, we know that stress in linearly proportional to strain with Young’e modulus, E, as the constant of proportionality, therefore,

(4)   \begin{equation*}E = \frac{\text{stress}}{\text{strain}} = \frac{P/A}{\Delta/L}\end{equation*}

where A is the cross-sectional area of the bar. Rearranging, we obtain an expression for \Delta,

(5)   \begin{equation*}\Delta = \frac{PL}{EA}\end{equation*}

If we now substitute this expression for \Delta into our original expression for strain energy, we obtain,

(6)   \begin{equation*}U=\frac{P\:\Delta}{2} = \frac{P^2L}{2EA}\end{equation*}

Now we can state the conservation of energy principle as it applies to the bar, mathematically,

(7)   \begin{equation*}\frac{P_{\text{ext}}\:\Delta}{2} = \frac{P_{\text{int}}^2L}{2EA}\end{equation*}

where we are now distinguishing between the externally applied force, P_{\text{ext}} and the internal axial force, P_{\text{int}}. Of course these are numerically equal but we make the distinction for clarity.

This energy equation is equally applicable for the work done on a collection of axially loaded elements – which you and I know as a truss! So if we expand to consider a force F applied to a truss consisting of N members, we have,

(8)   \begin{equation*}\boxed{\frac{F\:\delta}{2} = \sum_{i=1}^N \frac{P_i^2\:L_i}{2E_i\:A_i}}\end{equation*}

where \delta is the distance through which the externally applied force moves. Using this equation we can easily evaluate the deflection \delta, provided we can determine all of the forces in the structure using something like the method of sections or joint resolution method.

This is a good starting point and clearly demonstrates the underlying principle of conservation of energy. But the strain energy equation is somewhat limited in its application since the only displacement we can directly evaluate is the displacement along the line of action of the externally applied force. This is where the broader Principle of Virtual Work and Virtual Work Method come in.

2.0 The Principle of Virtual Work

The Principle of Virtual Work is also based on conservation of energy. It states that when an equilibrium force system is moved by a small compatible displacement system, the work done by the applied loads is equal to the change in strain energy in the structure.

We can immediately recognise the similarity with our previous discussion of strain energy. What’s new is the introduction of two specific terms:

  • Equilibrium force system: this is simply a system of forces in equilibrium and encompasses both internal and external forces.
  • Compatible displacement system: this is a system of displacements the structure could experience.

Together the equilibrium force system and the compatible displacement system are the building blocks of the virtual work method and are what make the analysis technique more versatile than the simple strain energy analysis we developed in the previous section.

The versatility of the virtual work method comes from the fact that we can combine any equilibrium force system with any other compatible displacement system. This means that the compatible displacement system does not necessarily need to be the system of displacements that correspond to the applied external loads.

In this way, we can decouple the compatible displacement system and equilibrium force system. This means that we can select whatever compatible displacement system or equilibrium force system we like, depending on what we’re trying to solve for.

2.1 The Virtual in Virtual Work

One thing that often throws people when first learning about virtual work is the presence of the work virtual! It’s an unusual word in this context and tends to make things sound more complicated then they really are – so let’s see where it comes from.

Let’s say we want to determine the deflection at some point in our truss. In this case we would construct our analysis in the following way; we would let the real (unknown) displacement be the compatible displacement system.

To use the virtual work method, we also need an equilibrium force system. Remember, this can be any system of forces in equilibrium. So, let’s apply a 1\:kN load to the structure. The location and direction of this 1\:kN load will depend on what displacement we’re trying to find.

This external force and the internal forces it induces in the structure now serve as our equilibrium force system. With both systems established, we can apply the principle of virtual work (we’ll get to this below) and solve for the unknown displacement.

Since the 1\:kN force wasn’t actually applied to the structure in reality – we say it’s a virtual force. And since the force was virtual the work done by the force was also virtual, hence the virtual work method, it’s as simple as that! In this scenario, where the displacement is unknown, we end up with a real compatible displacement system and a virtual equilibrium force system.

Now let’s imagine the less common case where we want to use the virtual work method to identify an unknown force. In this scenario, we let the real unknown forces by the equilibrium force system and apply a virtual displacement to form the compatible displacement system.

When we apply the virtual work method, our unknown force will emerge from the analysis. Just as before, the work done by the equilibrium force system as it moved through the compatible displacement system is still virtual.

Before we move on to the details of the analysis procedure itself, we’ll clarify a couple of points about the equilibrium force system and compatible displacement system below.

2.2 The equilibrium force system

As the name suggests, the equilibrium force system is just a system of forces in equilibrium. In the context of a truss structure, the equilibrium force system is made up of the externally applied forces and the internal axial forces in the members.

Since the system of forces is in equilibrium, there is no resultant force. This means that there is no net work done by the force system as it moves through the compatible displacement system.

Another way of thinking about this is that the work done by the internal member forces is equal to the work done by the externally applied forces. This is often abbreviated to,

(9)   \begin{equation*}\text{internal work} = \text{external work}\end{equation*}

This statement will be the basis of our analysis procedure.

2.3 The compatible displacement system

The compatible displacement system is just a valid displaced configuration for the structure. For the displacements to be a valid compatible displacement system, they must satisfy two conditions:

1. The displacements must be small by comparison to the scale of the structure. This is so that we can make the assumption that the direction of all forces in the equilibrium force system remain unchanged by the deflection. Otherwise we enter the world of geometric non-linearity and our virtual work analysis will be break down.

2. The displacements must be geometrically compatible. In other words they must be a possible set of displacements that do not fundamentally alter or break the structure.

For example, an invalid set of displacements is shown in Fig 2. below. Clearly this will not work, since we’ve imposed a set of displacements that is not compatible with the original structure.

The Virtual Work Method 2 |
Fig 2. Example of an incompatible (invalid) displacement system.

3.0 The Virtual Work Method Applied to Trusses

Next we’ll set out the analysis procedure itself. As we said above, the virtual work method is based on the following statement,

(10)   \begin{equation*}\text{External work} = \text{Internal work} = \text{Internal change in strain energy}\end{equation*}

Building on what we learned about strain energy at the start of our discussion, we can restate this mathematically as,

(11)   \begin{equation*}\overbrace{\sum W\:\delta}^{\text{external work}} = \overbrace{\sum P\:e}^{\text{internal change in SE}}\end{equation*}

where W represents an externally applied force, \delta is a displacement along the line of action of W, P is an internal axial force and e is a corresponding member extension. We’re summing across all external forces and all member axial forces in this equation.

If we imagine trying to determine an unknown displacement, the equilibrium force system will be virtual (1\:kN virtual force applied) and the unknown real displacement will be the compatible displacement system. So in the previous equation:

W will be an externally applied virtual load, applied at the location and in the direction of the desired displacement.
\delta will be the real unknown displacement.
P will be the virtual internal member forces induced by the virtual 1\:kN applied externally to the structure
e will be the real member deformations consistent with the overall displacement of the structure (and \delta)

In this case, \delta and e are the real compatible displacement system and W and P are the virtual equilibrium force system. You should be able to see the versatility of this method now in comparison to the strain energy analysis we started out with. If you’re not, you will by the time we complete a numerical example below.

Decoupling the equilibrium force system and compatible displacement system – something facilitated by the principle of virtual work, affords us huge flexibility in how we construct our analysis.

4.0 Truss Analysis Example

Instead of discussing any more theory, let’s just start working our way through an actual example question. Consider the pin-jointed truss structure below subject to a single point load applied vertically at G.

The Virtual Work Method 3 |
Fig 3. Truss example question.

Our task is to use the virtual work method to determine:

  1. The reaction force at F.
  2. The vertical deflection at D.

Calculating the reaction at F using virtual work is really just for demonstration purposes. This is more readily done using simple statics. However, calculating the vertical deflection at D is where the virtual work method really comes into its own.

We can assume a Young’s modulus of E=200\:kN/mm^2 and cross-sectional area of 2500\:mm^2 for all members.

This question is taken from my Fundamentals of Virtual Work course. So you can continue reading through the solution or watch me work through the solution in the video lecture below.

4.1 Finding the unknown reaction force at F

As it’s a force we’re trying to find, we know that the equilibrium force system will be real, and the compatible displacement system will be virtual. So, we need to apply a virtual displacement, \delta_F, at F in the direction of the unknown reaction force. This will result in a rigid body rotation of DEGF, Fig 4.

The Virtual Work Method 4 |
Fig 4. Virtual displacement \delta_F applied at F.

As a result of the rigid body rotation, the unknown reaction force, V_F moves vertically through a distance \delta_F while the 100\:kN force at G moves vertically through a distance 2\times \delta_F. Remember, we’re assuming all displacements are small by comparison to the scale of the structure so we can neglect any lateral displacement of F and G as the structure rotates about D.

Restating our virtual work equation,

(12)   \begin{equation*}\sum W\:\delta = \sum P\:e\end{equation*}

and evaluating the virtual work done by the external forces,

(13)   \begin{equation*}\sum W\:\delta = V_F\times \delta_F -100\times 2\delta_F\end{equation*}

Note the negative sign above is due to the fact that the 100\:kN force is pointing in the opposite direction to the displacement, therefore the work done by the force is negative.

The internal work done which is equal to the internal change in strain energy is zero because the structure is undergoing a rigid body rotation about point D and is not experiencing any strain, therefore,

(14)   \begin{equation*}V_F\times \delta_F - 100\times 2\delta_F = 0\end{equation*}

(15)   \begin{equation*}\boxed{V_F = 200\:kN}\end{equation*}

It’s again worth emphasising that we didn’t need to employ virtual work to determine this reaction. It would have been just as easy to break the structure at D and consider equilibrium of the sub-structure DEGF.

4.2 Finding the unknown displacement at D

Of more interest is how we use the virtual work method to calculate the vertical displacement at point D. This time, since the displacement is unknown, the compatible displacement system will consist of the actual structural displacement experienced by the structure. The equilibrium force system will be virtual and consist of the virtual 1\:kN force and the corresponding internal forces induced.

Starting again with the virtual work equation,

(16)   \begin{equation*}\sum W\:\delta = \sum P\:e\end{equation*}

we recognise that each e term is the extension due to the actual loads applied to the structure,

(17)   \begin{equation*}e = \frac{P_I\: L}{EA}\end{equation*}

where P_I is the axial force in the element due to the real loads applied to the structure (100\:kN at G). This is distinct from P_{II} which we will define as the internal virtual member force induced by the virtual unit load applied at D. Letting P=P_{II} and e equal to the term defined above, we can restate the virtual work equation as,

(18)   \begin{equation*}\sum W\:\delta_D = \sum P_{II}\frac{P_I\:L}{EA}\end{equation*}

Assuming we’ve applied a virtual 1\:kN load vertically at D, we can further reduce our equation down to,

(19)   \begin{equation*}1\times \delta_D = \sum P_{II}\frac{P_I\:L}{EA}\end{equation*}

Now the problems simply boils down to evaluating the P_{I} and P_{II} member forces and evaluating the sum on the right hand side of the previous equation.

The P_I real forces

The P_I forces are easily obtained using standard truss analysis techniques such as the joint resolution method. The internal member forces are summarised in Fig. 5 below.

The Virtual Work Method 5 |
Fig 5. P_I real force system.

The P_{II} virtual forces

The P_{II} forces are obtained using the same approach and are summarised in Fig 6 below. Note that the right side of the structure, to the right of D, consists of all zero-force members, and as such, there is no change in strain energy in this part of the structure.

The Virtual Work Method 6 |
Fig 6. P_{II} virtual force system.

The only unknown in the virtual work equation at this point is \delta_D. Evaluating D is made easier by tabulating our data.

MemberLength (m)P_I\: (kN)P_{II}\:(kN)P_IP_{II}L\:(kN^2m)
\sum -54020 kN^2m
Table 1. Strain energy data

Adding up the elements in the right hand column we obtain P_IP_{II}L = -54020\:kN^2m. This can now be divided by the axial rigidity, EA, to obtain the vertical deflection at D,

(20)   \begin{equation*}1\times \delta_D = \frac{-54020}{(200\times 10^6)(0.0025)}\end{equation*}

(21)   \begin{equation*}\boxed{\delta_D = -0.108\:m}\end{equation*}

The negative sign here indicates that the deflection at D is in the opposite direction to the direction of the virtual load applied, i.e. the deflection is upwards – which makes sense qualitatively for the structure.

5.0 Validating results with the DegreeTutors Truss Calculator

In this section we’ll compare the results obtained above using the virtual work method with the output from the DegreeTutors free truss calculator. This will confirm what we’ve seen above, using a different analysis method (the calculator is based upon the direct stiffness method).

More importantly, if you use the calculator, you’ll have a way of testing solutions to practice questions you come up with yourself. We’ve seen above how to apply the theory to one question, but to really get comfortable using the virtual work method will take practice. So, let’s work through validating our results above so that you can do the same on whatever practice questions you come up with.

You can watch me walk through the process in the video below or continue reading step by step.

5.1 Defining the structure and loading

We need to define each node with a number, an x-coordinate and a y-coordinate. This is best done in a spreadsheet first. You can copy the spreadsheet data template demonstrated here. You can then copy and paste the data directly into the relevant data entry box. I’ve numbered the nodes from 1 to 7, following the same sequence as the original alphabetic annotation.

Node numberx-coord (m)y-coord (m)
Table 2. Node definitions

Next, we can define the members by first giving each a unique number and then specifying the node number and each end of the member. Young’s modulus and cross-sectional area can now also be defined for each member. You can input any value for yield stress and self-weight – these won’t be used in the calculation.

Member numberNode INode JYoung’s Modulus (N/m²)Area (m²)Yield Stress (N/m²)Self-weight (N/m³)
Table 3. Member definitions

Now we define the support conditions by stating the node number and true or false to indicate the restraint applied in the x (horizontal) and y (vertical) direction.

Node numberx-restrainty-restraint
Table 4. Restraint definitions

Finally, we need to specify the loading by stating the node number and the x-component and y-component of the force applied to that node.

Node numberFx (N)Fy (N)
Table 5. Force definitions

After the data has been copied from a spreadsheet into the relevant data entry fields, it should look something like Fig 7.

The Virtual Work Method 7 |
Fig 7. Completed data entry fields.

The structure will now also be visible in the 3D viewport, Fig. 8. The scale of the individual elements can be adjusted using the scale slider in the control panel on the right.

The Virtual Work Method 8 |
Fig 8. Structure to analyse.

After the structure has been analysed, we can investigate the results directly in the 3D viewport, Fig. 9. We can confirm the support reaction at F (node 6) is indeed 200\:kN. The deflected shape (green line diagram) also shows an upward deflection at D (node 4).

The Virtual Work Method 9 |
Fig 9. Graphical results.

We can confirm the actual value of deflection by checking the tabulated data further down the page. We can see that at node 4 the vertical deflection is indicated as 0.108\:m which is what we calculated using the virtual work method.

Interestingly, we note that there is also a lateral deflection of node 4 of 0.0107\:m. This is only a tenth of the of the vertical deflection so one could argue that it’s not significant by comparison to the vertical deflection. Clearly the virtual work method was not capable of determining this component of displacement.

The Virtual Work Method 10 |
Fig 10. Nodal displacement table.

Now that you’ve seen how to implement the virtual work method and also how to validate or check your worked solutions, you should start coming up with your own test questions to help you embed the technique and get comfortable using it.

That’s all for this tutorial, I hope you found it helpful. Please share this with anyone you think may also find it helpful.

If you want to learn more about virtual work and how to apply it to structural analysis, consider becoming an All Access Member. This will give you access to  all DegreeTutors courses including my three courses focusing on virtual work:

  1. Fundamentals of Virtual Work
  2. Mastering Virtual Work
  3. Analysing Hybrid Indeterminate Civil Engineering Structures

See you in the next one!


Dr Seán Carroll

BEng (Hons), MSc, PhD, CEng MIEI, FHEA

Hi, I’m Seán, the founder of I hope you found this tutorial helpful. After spending 10 years as a university lecturer in structural engineering, I started to help more people understand engineering and get as much enjoyment from studying it as I do. Feel free to get in touch or follow DegreeTutors on any of the social accounts.