Updated 19 July 2022
Reading time: 21 mins

How to Apply the Virtual Work Method to Trusses

Apply the Principle of Virtual Work to determine truss deflections
[object Object]
by Dr Seán Carroll

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 LL, in uniaxial tension under the action of a force PP. 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 | EngineeringSkills.com

Fig 1. Bar in uniaxial tension (left) and axial load versus deflection graph (right).

This means that the force PP 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.

W=PΔ2(1)W =\frac{P\:\Delta}{2} \tag{1}

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 PP 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;

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

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

U=PΔ2(3)U=\frac{P\:\Delta}{2} \tag{3}

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

E=stressstrain=P/AΔ/L(4)E = \frac{\text{stress}}{\text{strain}} = \frac{P/A}{\Delta/L} \tag{4}

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

Δ=PLEA(5)\Delta = \frac{PL}{EA} \tag{5}

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

U=PΔ2=P2L2EA(6)U=\frac{P\:\Delta}{2} = \frac{P^2L}{2EA} \tag{6}

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

PextΔ2=Pint2L2EA(7)\frac{P_{\text{ext}}\:\Delta}{2} = \frac{P_{\text{int}}^2L}{2EA} \tag{7}

where we are now distinguishing between the externally applied force, PextP_{\text{ext}} and the internal axial force, PintP_{\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 FF applied to a truss consisting of NN members, we have,

Fδ2=i=1NPi2Li2EiAi(8)\boxed{\frac{F\:\delta}{2} = \sum_{i=1}^N \frac{P_i^2\:L_i}{2E_i\:A_i}} \tag{8}

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 1kN1\:kN load to the structure. The location and direction of this 1kN1\: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 1kN1\: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,

internal work=external work(9)\text{internal work} = \text{external work} \tag{9}

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 | EngineeringSkills.com

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,

External work=Internal work=Internal change in strain energy(10)\text{External work} = \text{Internal work} = \text{Internal change in strain energy} \tag{10}

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

Wδexternal work=Peinternal change in SE(11)\overbrace{\sum W\:\delta}^{\text{external work}} = \overbrace{\sum P\:e}^{\text{internal change in SE}} \tag{11}

where WW represents an externally applied force, δ\delta is a displacement along the line of action of WW, PP is an internal axial force and ee 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 (1kN1\:kN virtual force applied) and the unknown real displacement will be the compatible displacement system. So in the previous equation:

  • WW 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.
  • PP will be the virtual internal member forces induced by the virtual 1kN1\:kN applied externally to the structure
  • ee will be the real member deformations consistent with the overall displacement of the structure (and δ\delta)

In this case, δ\delta and ee are the real compatible displacement system and WW and PP 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 | EngineeringSkills.com

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=200kN/mm2E=200\:kN/mm^2 and cross-sectional area of 2500mm22500\: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, δF\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 | EngineeringSkills.com
Fig 4. Virtual displacement δF\delta_F applied at FF.

As a result of the rigid body rotation, the unknown reaction force, VFV_F moves vertically through a distance δF\delta_F while the 100kN100\:kN force at G moves vertically through a distance 2×δF2\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,

Wδ=Pe(12)\sum W\:\delta = \sum P\:e \tag{12}

and evaluating the virtual work done by the external forces,

Wδ=VF×δF100×2δF(13)\sum W\:\delta = V_F\times \delta_F -100\times 2\delta_F \tag{13}

Note the negative sign above is due to the fact that the 100kN100\: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,

VF×δF100×2δF=0(14)V_F\times \delta_F - 100\times 2\delta_F = 0 \tag{14}
VF=200kN(15)\boxed{V_F = 200\:kN} \tag{15}

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 1kN1\:kN force and the corresponding internal forces induced.

Starting again with the virtual work equation,

Wδ=Pe(16)\sum W\:\delta = \sum P\:e \tag{16}

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

e=PILEA(17)e = \frac{P_I\: L}{EA} \tag{17}

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

WδD=PIIPILEA(18)\sum W\:\delta_D = \sum P_{II}\frac{P_I\:L}{EA} \tag{18}

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

1×δD=PIIPILEA(19)1\times \delta_D = \sum P_{II}\frac{P_I\:L}{EA} \tag{19}

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

The PIP_I real forces

The PIP_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 | EngineeringSkills.com
Fig 5. PIP_I real force system.

The PIIP_{II} virtual forces

The PIIP_{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 | EngineeringSkills.com
Fig 6. PIIP_{II} virtual force system.

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

MemberLength (m)(m)PIP_I (kN)PIIP_{II} (kN)PIPIILP_I P_{II} L (kN²m)

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

1×δD=54020(200×106)(0.0025)(20)1\times \delta_D = \frac{-54020}{(200\times 10^6)(0.0025)} \tag{20}
δD=0.108m(21)\boxed{\delta_D = -0.108\:m} \tag{21}

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 EngineeringSkills Truss Calculator

In this section we’ll compare the results obtained above using the virtual work method with the output from the EngineeringSkills 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)

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³)

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

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)

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 | EngineeringSkills.com

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 | EngineeringSkills.com

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 200kN200\:kN. The deflected shape (green line diagram) also shows an upward deflection at D (node 4).

The Virtual Work Method 9 | EngineeringSkills.com

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.108m0.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.0107m0.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 | EngineeringSkills.com

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 EngineeringSkills 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 EngineeringSkills.com (formerly DegreeTutors.com). I hope you found this tutorial helpful. After spending 10 years as a university lecturer in structural engineering, I started this site 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 me on any of the social accounts.

Dr Seán Carroll's latest courses.

Analytical Modelling of Plate and Shell Structures: Part 1 - Plates

Analytical Modelling of Plate and Shell Structures: Part 1 - Plates

A practical guide to the analysis of circular and rectangular plates under load, from first principles.

Fundamentals of Reinforced Concrete Design to Eurocode 2

Fundamentals of Reinforced Concrete Design to Eurocode 2

An introduction to ultimate limit state design for bending and shear with optional calculation automation using Python.

Modelling and Analysis of Non-linear Cablenet Structures using Python and Blender

Modelling and Analysis of Non-linear Cablenet Structures using Python and Blender

Learn how to combine parametric modelling, exploratory form-finding and iterative analysis techniques to simulate 3D tensile structures.

Non-linear Finite Element Analysis of 2D Catenary & Cable Structures using Python

Non-linear Finite Element Analysis of 2D Catenary & Cable Structures using Python

Build an iterative solution toolbox to analyse structures that exhibit geometric non-linearity due to large deflections.

Do you have some knowledge or expertise you'd like to share with the EngineeringSkills community?
Check out our guest writer programme - we pay for every article we publish.