## Variational Principles: The Principle of Virtual Work

The principle of virtual work is widely used to solve a variety of continuum and solid mechanics problems. The statement of the principle of virtual work usually involves the phrase “virtual displacement field,” which is designed to engage the intuition by attempting to give a physical explanation to a mathematical statement. However, as will be shown in the following sections, the statement itself can be derived solely from mathematical, rather than physical explanations. In this section, the principle of virtual work will be presented for three applications. In the first, we will investigate the principle in its simplest form as it applies to a single degree of freedom. In the second and third, we will apply the principle to the continuum and to beams. The principle of virtual work itself is a different manifestation of the equilibrium equations, as it is an equivalent form of equilibrium. A system that is in equilibrium should satisfy the statement of the principle of virtual work and vice versa.

### The Principle of Virtual Work for a Single Degree of Freedom:

Consider the static equilibrium of a mass spring system. Assume that the force in the spring is a function of the displacement of the spring, i.e., . At equilibrium, the sum of the vertical forces is equal to zero, and the force in the spring is equal to the applied external load . Let the position of equilibrium be at (Figure 1). At equilibrium, we have:

If the position of the spring is perturbed by an arbitrary small displacement (Figure 1) and if the equilibrium equation above is multiplied by , then:

The above equation represents the statement of the principle of virtual work in a single degree of freedom system. From an equilibrium position, the external work done by the external forces during the application of a small virtual displacement is equal to the internal work done by the spring force during the application of that small virtual displacement (Figure 1).

### The Principle of Virtual Work for a Continuum:

In order to derive the equations of the virtual work, we start by the equilibrium equations in a continuum. Let be the set representing a body in its reference configuration and be the set representing the body in its current configuration. Let be an orthonormal basis set, such that and , each has coordinates: and respectively. Let be the body forces vector map. The stresses at any point inside the body at static equilibrium satisfy the following equations:

(1)

Let be an arbitrary smooth function that could be viewed as a virtual displacement defined on (Figure 2). Let be the associated strain field defined as:

and in component form:

When each of the equilibrium equations is multiplied by the corresponding component of the vector function , and then the three equations are added together (in other words, if we take the dot product between the equilibrium equations as a vector and the vector ), the following equation is obtained :

(2)

The following equality will be used:

Setting and utilizing the symmetry of , Equation 2 can now be written as :

(3)

In the next step, Equation 3 is integrated over the domain of . Therefore :

(4)

Using the divergence theorem, the first volume integral can be replaced with a surface integral. Therefore, :

(5)

Additionally, the Cauchy stress matrix is related to the external traction vectors on the surface of . Therefore, Equation 5 can be rewritten in the following form :

(6)

(7)

The left hand side is the external work done by the traction vectors on the surface and the body forces vectors during a virtual smooth displacement field . The right hand side is equal to the internal work associated with the associated virtual strain field . The following are two important observations:

- The phrase is necessary in the virtual work Equation (Equation 7).
- Equations 1 and 7 are equivalent. You can derive Equation 1 by reversing the steps above from Equation 7.

### The Principle of Virtual Work for an Euler Bernoulli Beam:

The Euler Bernoulli beam is a special example of a continuum. We can either derive the equations from Equation 7 however, we will follow the same procedure above to obtain the virtual work equations for an Euler Bernoulli beam.

The equilibrium equation of an Euler Bernoulli beam is given by:

We can assume a virtual smooth displacement field and proceed by multiplying the equilibrium equation by and integrate over the length of the beam. Therefore, :

By applying integration by parts for the integral on the left hand side of the above equation, we get

By applying integration by parts once more for the integral on the left hand side of the above equation, we get

Rearranging and utilizing the Euler Bernoulli beam equations for the shear and bending moments we reach the final virtual work expression:

(8)

Where , , , , , , , and are the boundary conditions for the shear, moment, virtual rotation and virtual displacement as shown in Figure 3. The right hand side represents the work done by the external forces during the application of a virtual smooth displacement field while the left hand side represents the internal work done by the bending moment during the application of the virtual displacement field.

The same notes regarding the principle of virtual work for a continuum apply to the Euler Bernoulli beam. The principle of virtual work equation is equivalent to the equilibrium equation. In addition, the phrase is an essential element of the principle of virtual work. I.e., the principle states that from an equilibrium position and under all possible virtual displacements, the internal virtual work is equal to the external virtual work

### The Principle of Virtual Work for a Timoshenko Beam:

Similar to the Euler Bernoulli beam, we will assume a virtual arbitrary and smooth displacement field in addition to a virtual cross section shear deformation field such that the total cross section virtual rotation is given by:

(9)

Multiplying the equilibrium equation by and integrating over the length of the beam yields :

Using integration by parts for the left hand side integral, :

Using Equation 9 to substitute for yields :

Applying the integration by parts to one of the integrals on the left hand side yields :

Finally, the statement of the virtual work principle has the following form :

Where , , , , , , , and are the boundary conditions for the shear, moment, virtual cross section rotation and virtual displacement on ends 1 and 2. The right hand side represents the work done by the external forces during the application of a virtual smooth displacement field and a virtual smooth shear deformation field while the left hand side represents the internal work done by the bending moment and shear force during the application of the virtual displacement fields.

The same notes regarding the principle of virtual work for a continuum apply to the Timoshenko beam. The principle of virtual work equation is equivalent to the equilibrium equation. In addition, the phrase is an essential element of the principle of virtual work. I.e., the principle states that from an equilibrium position and under all possible virtual displacements, the internal virtual work is equal to the external virtual work.

### Applications of the Principle of Virtual Work:

In this section, we will present three applications for the principle of virtual work. The first applications is for illustrative purposes only to show that the principle of virtual work is equivalent to the equilibrium equations. The second application was widely used to calculate deflections for statically determinate structures. It was also widely used in the past to calculate the reactions for statically indeterminate structures. However, the wide use of the computer programs to calculate the reactions and deflections have rendered the second application almost obsolete. The third application is for finding approximate solutions for continuum mechanics problems. In particular, the majority of the finite element analysis procedure for solving continuum mechanics problems are based on the principle of virtual work.

#### Application 1: Finding the Reactions of Statically Determinate Beams

A statically determinate beam is a beam whose external reactions can be obtained by solving the equilibrium equations without the need for using the constitutive equations. In case of a plane beam, the equilibrium equations: the sums of the horizontal and vertical forces, separately, are equal to zero, and the sum of moments is equal to zero. For such beams, it will be shown that the principle of virtual work can be used to generate the same equations by simply applying a virtual

displacement field that produces no internal forces. Such a displacement field that produces no internal forces is termed: “Rigid Body Displacement.” Recalling the principle of virtual work derived above for the Euler Bernoulli beams, if the arbitrary smooth displacement field is such that:

then the internal work done is equal to zero and the statement of the principle of virtual work is reduced to: From an equilibrium position, the work done by the external forces through an arbitrary and smooth displacement field is equal to zero:

See the examples and problems section for examples on this application.

#### Application 2: Finding Displacements at Specific Points for Linear Elastic Small Deformations Beams

Structural engineers often use the method of virtual work to find the displacement at specific points in statically determinate structures when the bending moment, the shearing force, and the normal force diagrams can be computed for the structure under consideration. In that procedure, the internal forces diagram for the structure is solved for twice, once with the original set of external forces and once with a unit load applied at the point of interest. Then, the displacement field from the original set of external forces is considered to be analogous to the virtual displacement field in the derivation of the equations of the Virtual Work principle for the Euler Bernoulli beam. The displacement field obtained for the structure with the applied unit load is considered to be analogous to the displacement field y. Because satisfies the boundary conditions of the structure, the work done by the reactions is equal to zero and therefore, the equation of the principle of virtual work then becomes:

where:

is the displacement field obtained through applying a unit load to the point of interest.

is the displacement field obtained for the structure with the applied loading.

is the unknown displacement at the point of interest.

However, since the bending moment diagrams for both the structure with the applied loading and the structure with a unit load applied at the point of interest, the equation can now be rewritten as follows:

If the shear and normal forces deformations are to be considered as well, the equation becomes:

where:

, , and are the bending moment, normal force and shearing force equations for the structure with the original set of forces applied to it.

, , and are the bending moment, normal force and shearing force equations for the structure with the unit load applied to the point of interest.

, , and are the bending, normal force, and shearing force stiffness for the individual beam members.

See the examples below for an example on this application.

#### Application 3: Finding Approximate Solutions

The principle of virtual work is applied by first approximating the unknown displacement field of the structure with a shape or a form with a finite number of unknown parameters. The approximate displacement field has to satisfy the boundary conditions of the structure so that the external reactions would not appear in the equations of the principle of the virtual work. Then, the virtual displacement field is applied by varying the unknown parameters. This method results in a finite number of equations that are sufficient to find the unknown parameters. In essence the possible displacement fields of the structure are restricted to a family of displacement functions that have a finite number of unknowns. See the examples and problems section for an example on this application.

### Examples and Probelms:

#### Example 1: Illustrative Example of the Principle of Virtual Work Applied to a Continuum

The Cauchy stress distribution in the shown plate is given by:

where and are the coordinates inside the plate with units of m. Find the equilibrium body forces vector applied to the plate. Find the traction forces on the boundary edges , , , and of the plate. Verify the principle of virtual work assuming a virtual displacement field , .

##### Solution:

The equilibrium body forces applied to the plate can be obtained using the equilibrium equations:

The plate is in a state of plane stress, so, the problem can be reduced to . The area vectors for the boundary edges , , , and are given by:

The traction vectors in units of on the boundary edges , , , and are given by:

Therefore,

The virtual displacement vector is:

The gradient of the virtual displacement tensor is:

The associated virtual strain is given by:

The internal virtual work can be calculated as follows:

There are five components for the external virtual work. The first one is the external virtual work due to the external body forces applied to the plate. This component is a volume integral:

The second component is the external virtual work due to the external forces acting on side . This is a surface integral and is evaluated for side where :

The third component is the external virtual work due to the external forces acting on side . This is a surface integral and is evaluated for side where :

The fourth component is the external virtual work due to the external forces acting on side . This is a surface integral and is evaluated for side where :

The fifth component is the external virtual work due to the external forces acting on side . This is a surface integral and is evaluated for side where :

Therefore, the total external virtual work is:

View Mathematica Code

x = {x1, x2, x3};

rhob1 = -Sum[D[s[[j, 1]], x[[j]]], {j, 1, 2}]

rhob2 = -Sum[D[s[[j, 2]], x[[j]]], {j, 1, 2}]

rhob3 = -Sum[D[s[[j, 3]], x[[j]]], {j, 1, 2}]

(*We will only consider the 2 dimensional matrices as all out of plane components are equal to 0*)

ustar = {a*x1 + b*x2, 0};

ustara = ustar /. x1 -> 2;

ustarb = ustar /. x2 -> 1;

ustarc = ustar /. x1 -> 0;

ustard = ustar /. x2 -> 0;

s = {{x1*x2, 5}, {5, x1}};

na = {1, 0};

nb = {0, 1};

nc = {-1, 0};

nd = {0, -1};

ta = s.na /. x1 -> 2

tb = s.nb /. x2 -> 1

tc = s.nc /. x1 -> 0

td = s.nd /. x2 -> 0

Gradustar = Table[D[ustar[[i]], x[[j]]], {i, 1, 2}, {j, 1, 2}]

estar = 1/2*(Gradustar + Transpose[Gradustar])

ststrain = Sum[s[[i, j]]*estar[[i, j]], {i, 1, 2}, {j, 1, 2}]

IVW = Integrate[ststrain, {x1, 0, 2}, {x2, 0, 1}, {x3, 0, t}]

EVWBodyForces = Integrate[rhob1*ustar[[1]], {x1, 0, 2}, {x2, 0, 1}, {x3, 0, t}]

EVWa = Integrate[(ta.ustara) /. x1 -> 2, {x2, 0, 1}, {x3, 0, t}]

EVWb = Integrate[(tb.ustarb) /. x2 -> 1, {x1, 0, 2}, {x3, 0, t}]

EVWc = Integrate[(tc.ustarc) /. x1 -> 0, {x2, 0, 1}, {x3, 0, t}]

EVWd = Integrate[(td.ustard) /. x2 -> 0, {x1, 0, 2}, {x3, 0, t}]

EVW = FullSimplify[EVWBodyForces + EVWa + EVWb + EVWc + EVWd]

#### Example 2: Illustrative Example of the Principle of Virtual Work Applied to an Euler Bernoulli Beam

A fixed ends Euler Bernoulli beam is subjected to a distributed load . Assuming that Young’s modulus, the length, and the moment of inertia for the beam are , , and , respectively, verify that the principle of virtual work applies when a virtual parabolic displacement is applied to the beam.

##### Solution:

The principle of virtual work applies to the equilibrium internal forces. So, the first step is to find the internal forces at the state of equilibrium. For this, we will solve the differential equation of equilibrium:

The integration constants , , , and can be obtained using the four boundary conditions of a fixed ends beam:

Therefore, the equilibrium displacement of the beam is:

The bending moment and the shearing force equations at equilibrium are:

The external forces acting on the ends of the beam are given by:

Note that the convention for positive end forces is shown in Figure 3. The virtual end displacements and rotations are given by:

Therefore, the internal virtual work is given by:

The external virtual work has three components, the first is the external virtual work due to the distributed load :

The second component is the external virtual work due to the reactions at end 1:

The third component is the external virtual work due to the reactions at end 2:

The total external virtual work is:

View Mathematica Code

Clear[M, y, EI, x, s] q = -5 x s = DSolve[{EI*y''''[x] == q, y[0] == 0, y'[0] == 0, y[L] == 0, y'[L] == 0}, y[x], x] y = y[x] /. s[[1]] th = D[y, x] M = FullSimplify[EI*D[y, {x, 2}]] V = FullSimplify[EI*D[y, {x, 3}]] M1 = M /. x -> 0 M2 = M /. x -> L V1 = V /. x -> 0 V2 = V /. x -> L ystar = a*x^2; thstar = D[ystar, x]; ystar1 = ystar /. x -> 0 ystar2 = ystar /. x -> L thstar1 = thstar /. x -> 0 thstar2 = thstar /. x -> L Print["IVW"] IVW = Integrate[M*D[ystar, {x, 2}], {x, 0, L}] EVWq = Integrate[q*ystar, {x, 0, L}] EVW1 = +V1*ystar1 - M1*thstar1 EVW2 = -V2*ystar2 + M2*thstar2 Print["EVW"] EVW = EVWq + EVW1 + EVW2

#### Example 3: Application 1 of the Principle of Virtual Work

The shown beam has its neutral axis aligned with the axis. Find the reactions , , and using the equilibrium equations and then using the principle of virtual work.

##### Solution:

There are three equilibrium equations which can be used to find the three unknown reactions:

Therefore, the three unknown reactions are:

The principle of virtual work can be used by applying a virtual smooth rigid body displacement to the beam. The rigid body displacement will in fact have three unknown variables. Each variable will correspond to an equilibrium of motion. In this example, the virtual vertical displacement field:

and a horizontal displacement equal to . In essence, the rigid body displacement has three variables, , , and . corresponds to moving the beam vertically upwards and will be used to write the equation of equilibrium that states that the sum of vertical forces is equal to zero. corresponds to moving the beam horizontally and will be used to write the equation of equilibrium that states that the sum of the horizontal forces is equal to zero. corresponds to rotating the beam around point 1 which will be used to write the equation of equilibrium that states that the sum of moments around point 1 is equal to zero.

The statement of virtual work of the system is:

and are the virtual displacements of points 2 and 3 and can be replaced with and so the equation becomes:

The above equation can be rearranged to have the following form:

Since the virtual displacement field is arbitrary and the statement applies for any choices of the variables , , and , then, their coefficients are equal to zero. Therefore, the three equations of equilibrium are retrieved:

Therefore, the same reactions are obtained. Note that the chosen virtual displacement field guarantees that the associated internal virtual work is equal to zero.

#### Example 4: Application 1 of the Principle of Virtual Work

The shown beam has its neutral axis aligned with the axis. Find the reactions , , and using the equilibrium equations and then using the principle of virtual work.

##### Solution:

There are three equilibrium equations which can be used to find the three unknown reactions:

Therefore, the three unknown reactions are:

The principle of virtual work can be used by applying a virtual smooth rigid body displacement to the beam. The rigid body displacement will in fact have three unknown variables. Each variable will correspond to an equilibrium of motion. In this example, the virtual vertical displacement field:

and a horizontal displacement equal to . In essence, the rigid body displacement has three variables, , , and . corresponds to moving the beam vertically upwards and will be used to write the equation of equilibrium that states that the sum of vertical forces is equal to zero. corresponds to moving the beam horizontally and will be used to write the equation of equilibrium that states that the sum of the horizontal forces is equal to zero. corresponds to rotating the beam around point 1 which will be used to write the equation of equilibrium that states that the sum of moments around point 1 is equal to zero.

The statement of virtual work of the system is:

After substituting for and integrating, the above equation can be rearranged to have the following form:

Notice that the displacement field is chosen small enough such that . The above equation can then be rearranged to have the following form:

Since the virtual displacement field is arbitrary and the statement applies for any choices of the variables , , and , then, their coefficients are equal to zero. Therefore, the three equations of equilibrium are retrieved:

Therefore, the same reactions are obtained. Note that the chosen virtual displacement field guarantees that the associated internal virtual work is equal to zero.

#### Example 5: Application 2 of the Principle of Virtual Work

Use the principle of virtual work to find the displacement at the free end of the shown cantilever beam. Assume is constant and ignore the shearing force and normal force deformations.

##### Solution:

The bending moment of the structure with the original load (distributed load) is given by the equation:

After removing the loads from the structure and applying a unit load at the point of interest, the bending moment equation for the structure with the unit load is given by the equation:

Applying the statement of virtual work as described above for this application:

Therefore:

#### Example 6: Application 3 of the Principle of Virtual Work

Use the principle of virtual work to find an approximate cubic polynomial displacement solution for the shown beam. Compare with the exact solution for and where , and are the Young’s modulus, beam’s length, and moment of inertia respectively. Ignore Poisson’s ratio.

##### Solution:

First, we will find the exact displacement shape by solving the differential equation of equilibrium. Because of symmetry, we are going to solve the equation for only half the beam with the boundary conditions shown in the figure.

The constants , , , and are integration constants and can be obtained from the four boundary conditions:

Therefore, the displacement function for is given by:

The displacement function for can be obtained by replacing with in and thus the final displacement shape has the form:

The following are two important observations about the exact solution:

- The exact solution is not differentiable at since the shear is not continuous in the middle of the beam.
- The exact solution is a polynomial of the third degree for each half.

We wish now to find an approximate solution for the displacement. We will force the solution however, to be continuous and differentiable at by assuming that the approximate solution is a cubic function applied from the whole length of the beam:

The first step in finding the appropriate coefficients , , , and is to ensure that this approximate solution satisfies the boundary conditions of displacement and rotation if any. Therefore we need to ensure:

Therefore,

Thus, the approximate displacement shape that would satisfy the boundary conditions has the form:

The associated bending moment diagram in this case has the following form:

In order to apply the principle of virtual work, a virtual displacement needs to be assumed. Since the principle of virtual work applies for any assume virtual displacement, the most general virtual displacement field within the space of possible functions will be assumed. Since we restricted the solutions to be quadratic functions satisfying the boundary conditions, the most general virtual displacement has the form:

and the associated second derivative has the form:

The internal virtual work can be calculated as follows:

On the other hand, the external virtual work has only one component due to the virtual work done by the force as the virtual displacement at the reactions is equal to zero:

Since the principle of virtual applies to any choice for and , their multipliers on both sides of the equation of virtual work have to be equal. Therefore, we get the following two equations:

Solving the above two equations yields:

Therefore, the best approximate solution that satisfies the virtual work principle is;

The approximate solution can be compared with the exact solution when . The plot of versus shows that the approximate solution under-predicts the displacement of the structure. In other words, the approximate solution gives a stiffer structure compared to the exact solution.

View Mathematica Code

Clear[y, P, X1, EI, L, yexact]; (*Exact solution*); s = DSolve[{y''''[X1] == 0, y[0] == 0, y''[0] == 0, y'[L/2] == 0, y'''[L/2] == P/2/EI}, y[X1], X1]; y1 = FullSimplify[y[X1] /. s[[1]]]; y2 = FullSimplify[y1 /. X1 -> L - X1]; yexact = Piecewise[{{y1, 0 <= X1 < L/2}, {y2, L/2 <= X1 <= L}}]; (*Approximate solution*) yapprox = a2*X1*(X1 - L) + a3*X1*(X1^2 - L^2); ystar = yapprox /. {a2 -> a2s, a3 -> a3s}; EVW = -P*ystar /. X1 -> L/2 ; IVW = Integrate[EI*D[yapprox, {X1, 2}]*D[ystar, {X1, 2}], {X1, 0, L}] ; Eq1 = Coefficient[IVW, a2s] - Coefficient[EVW, a2s] ; Eq2 = Coefficient[IVW, a3s] - Coefficient[EVW, a3s] ; s = Solve[{Eq1 == 0, Eq2 == 0}, {a2, a3}] ; yapprox = yapprox /. s[[1]] ; yp = yapprox /. {P -> 1, EI -> 1, L -> 1}; yexactp = yexact /. {P -> 1, EI -> 1, L -> 1}; Plot[{yp, yexactp}, {X1, 0, 1}, PlotLegends -> {"Approximate", "Exact"}, AxesLabel -> {"X1 (Length units)", "y (Length units)"}]

#### Problems:

- Use the principle of virtual work to find the reactions for the following statically determinate structures.

- The shown beams have Young’s modulus and moment of inertia . Verify that the virtual work principle applies:
- Assuming a virtual displacement field .
- Assuming a virtual displacement field .

where .

- The Cauchy stress distribution in the shown plate is given by:
where and are the coordinates inside the plate with units of m. Find the equilibrium body forces vector applied to the plate. Find the traction forces on the boundary edges , , , and of the plate. Verify the principle of virtual work in the following two cases:

- Assuming a virtual displacement field , .
- Assuming a virtual displacement field , .

Dear Dr. Adeeb,

Your statement” A system that is in equilibrium should satisfy the statement of the principle of virtual work and vice versa”.I am not sure I understand what you meant by “vice versa”. In a case where we have two opposite & unbalanced forces given a virtual displacement at 90 deg with these forces, the virtual work(VW) of the system of forces equal zero but the forces are not in Equilibrium. So by saying vice versa it makes me think your statement is opposite to my understanding of VW. So we can say if the system of forces is in Equilibrium —> VW=0, but if VW=0, the system is not necessarily in equilibrium.

Please let me know and Thank you in advance!

Sameer

The statement of VW states that the VW is equal to zero for every assumed displacement. Yes, the VW is zero for a virtual displacement at 90 deg with these forces, but it is not zero for a virtual displacement in the direction of the forces.

In Example 2, in equation following “Therefore, the internal virtual work is given by:” a close bracket should be added after 10*X1^3

Thank you! corrected!

In Example 6, in equation following “On the other hand, the external virtual work has only one component due to the virtual work done by the force P as the virtual displacement at the reactions is equal to zero:”, the first term INSIDE the bracket has two negative signs, one of them should be deleted.

Thank you! corrected!