Equivalence of finite element solution using Rayleigh Ritz method and Galerkin method for finding axial deformation of a simple cantilever beam, and on how to determine if the approximate solution found is an exact solution.

by Nasser M. Abbasi  
Student, Engineering Mechanics dept.
University of Wisconsin, Madison
oct 16, 2009

Abstract

Using a simple problem, it is shown that, using a global trial function, the Rayleigh Ritz variational method and the Galerkin method give the same solution. These solutions are compared to the exact solution. It is found that one can determine that the exact solution was reached by increasing the order of the trial function polynomial until the solution returned by Rayleigh Ritz or Galerkin method no longer changes.

The problem

A cantilever beam is loaded with traction load of q = c x (for some constant c). It is fixed on the left side. We need to find axial deformation u (x)

"compare_ritz_to_galerkin_1.gif"

Solving using variational Ritz method

Set up the potential energy "compare_ritz_to_galerkin_2.gif" and Minimize it

"compare_ritz_to_galerkin_3.gif"

where u (x) is the  trial function . The trial function needs to satisfy only the essential conditions, which in this problem  is given as u (0) = 0, so we start by assuming a trial  function u(x).

"compare_ritz_to_galerkin_4.gif"

Since u(0)=0 , we find that "compare_ritz_to_galerkin_5.gif" hence

"compare_ritz_to_galerkin_6.gif"

This trial function has 2 degrees of freedom they are called the generalized  degrees of freedom. The  trial function could have been selected to have only one degree of freedom i.e. "compare_ritz_to_galerkin_7.gif" and this would also have worked but 2 degrees of freedom will give more accurate solution.

Start by defining the trial function

"compare_ritz_to_galerkin_8.gif"

"compare_ritz_to_galerkin_9.gif"

Make the trial function satisfy essential boundary condition

"compare_ritz_to_galerkin_10.gif"

"compare_ritz_to_galerkin_11.gif"

"compare_ritz_to_galerkin_12.gif"

"compare_ritz_to_galerkin_13.gif"

Set up the potential energy functional

"compare_ritz_to_galerkin_14.gif"

"compare_ritz_to_galerkin_15.gif"

"compare_ritz_to_galerkin_16.gif"

"compare_ritz_to_galerkin_17.gif"

"compare_ritz_to_galerkin_18.gif"

"compare_ritz_to_galerkin_19.gif"

"compare_ritz_to_galerkin_20.gif"

"compare_ritz_to_galerkin_21.gif"

"compare_ritz_to_galerkin_22.gif"

"compare_ritz_to_galerkin_23.gif"

"compare_ritz_to_galerkin_24.gif"

"compare_ritz_to_galerkin_25.gif"

Solving the problem using Galerkin method

In this method, we start with the differential equation itself and integrate it with a test function we call g (x). The  differential equation for axial deformation with traction load q(x) is  "compare_ritz_to_galerkin_26.gif", hence our starting point is to solve the integral equation

"compare_ritz_to_galerkin_27.gif"

We start by assuming a trial function "compare_ritz_to_galerkin_28.gif". Now due to u(0)=0 we find that "compare_ritz_to_galerkin_29.gif", hence "compare_ritz_to_galerkin_30.gif" Next, we do integration by parts the above integral and obtain

"compare_ritz_to_galerkin_31.gif"

But

"compare_ritz_to_galerkin_32.gif"

and now since a test function must also satisfy the essential conditions, hence g(0)=0 and also the trial function satisfies the natural boundary conditions at x=L which is that there is no load at that point, hence this means A E (du/dx) = 0 since this is the load at the end. Hence the integral becomes

"compare_ritz_to_galerkin_33.gif"

We now pick the test function g(x). In Galerkin method, "compare_ritz_to_galerkin_34.gif"hence "compare_ritz_to_galerkin_35.gif" and "compare_ritz_to_galerkin_36.gif" so now we set up the 2 equations and solve for "compare_ritz_to_galerkin_37.gif"

"compare_ritz_to_galerkin_38.gif"

"compare_ritz_to_galerkin_39.gif"

"compare_ritz_to_galerkin_40.gif"

"compare_ritz_to_galerkin_41.gif"

"compare_ritz_to_galerkin_42.gif"

Now solve for "compare_ritz_to_galerkin_43.gif" and "compare_ritz_to_galerkin_44.gif"

"compare_ritz_to_galerkin_45.gif"

"compare_ritz_to_galerkin_46.gif"

Substitute the above into the original u(x)

"compare_ritz_to_galerkin_47.gif"

"compare_ritz_to_galerkin_48.gif"

We see that this solution is the same as the one found from the Ritz method

"compare_ritz_to_galerkin_49.gif"

"compare_ritz_to_galerkin_50.gif"

Exact solution for the problem

The ODE is

A E u''[x]=-q

With the essential conditions u(0)=0 and with natural boundary condition A E u'[x]=0 at x=L. Find exact solution:

"compare_ritz_to_galerkin_51.gif"

"compare_ritz_to_galerkin_52.gif"

Compare the above solution to the one found above, we see that the approximate solution is

"compare_ritz_to_galerkin_53.gif"

while the exact solution is

"compare_ritz_to_galerkin_54.gif"

here is a plot of both solutions. Assume A = 1, c = 1, E = 1 and L = 1, we obtain

"compare_ritz_to_galerkin_55.gif"

"compare_ritz_to_galerkin_56.gif"

"compare_ritz_to_galerkin_57.gif"

How can we improve the FEM solution, can we make it match the exact solution?

Make the trial function a polynomial of higher order. Try

"compare_ritz_to_galerkin_58.gif"

and repeat Ritz method. Instead of making the same steps as above, let us write a function which accepts a trial function u(x) and returns back the solution. Find define the function

"compare_ritz_to_galerkin_59.gif"

Now we can call the above function for the trial function shown above to dtermine the values of the "compare_ritz_to_galerkin_60.gif"

"compare_ritz_to_galerkin_61.gif"

"compare_ritz_to_galerkin_62.gif"

"compare_ritz_to_galerkin_63.gif"

"compare_ritz_to_galerkin_64.gif"

We see now that the FEM solution is the same as the exact solution. We can confirm this by taking the difference between them

"compare_ritz_to_galerkin_65.gif"

"compare_ritz_to_galerkin_66.gif"

What happens if we add more terms to the trial functions? We should expect that the solution would not change. This is confirmed by the following table generated using the above function

"compare_ritz_to_galerkin_67.gif"

"compare_ritz_to_galerkin_68.gif"
"compare_ritz_to_galerkin_69.gif"
"compare_ritz_to_galerkin_70.gif"
"compare_ritz_to_galerkin_71.gif"
"compare_ritz_to_galerkin_72.gif"

Now find the solution using each of the above trial functions using Ritz method

"compare_ritz_to_galerkin_73.gif"

TrialFunction Solution
"compare_ritz_to_galerkin_74.gif" "compare_ritz_to_galerkin_75.gif"
"compare_ritz_to_galerkin_76.gif" "compare_ritz_to_galerkin_77.gif"
"compare_ritz_to_galerkin_78.gif" "compare_ritz_to_galerkin_79.gif"
"compare_ritz_to_galerkin_80.gif" "compare_ritz_to_galerkin_81.gif"
"compare_ritz_to_galerkin_82.gif" "compare_ritz_to_galerkin_83.gif"

We see from the above that as more terms added to the trial function, after the cubic polynomial, the solution no longer changes. This implies, at least in this example, that the exact solution was reached.  (Need to find a formal proof of this).

Spikey Created with Wolfram Mathematica 7.0