Comparing Stiffness Matrices and Natural Frequencies

  • Last Post 26 April 2019
hkenan posted this 25 April 2019


I wrote a matlab code which gives the natural frequencies of a 12 Degree of Freedom Beam (2 Node). 

6 dof at first node  and 6 dof at second node (displacement x, y,z and rotation x, y z)

When i try to validate my code , ıt's seen form the table below, the first four natural frequencies is so close but the others are totally different. Because of this, i also did a static analysis and applied Force at the free end. The deflection for Ansys and Matlab is equal. So i expect that the stiffness matrix in my code is same with the stiffness matrix Ansys used. Is my expectation right?  when i try to compare the stifness matrices they are different. But they give the same result.

what am i missing?

what makes the differences between natural frequency values after four mode bigger?



Table. Left Side-1 Element Used    Right Side-10 Element Used








Order By: Standard | Newest | Votes
jj77 posted this 26 April 2019

Great to see that you are trying to understand things and are doing some FEA of your own.


Now, typically when one verifies something, especially something simple like beam vibrations, one does not need to compare to another software (Ansys in this case). Often when you work in industry you will only have one software if you are lucky, so you can not often compare to another one anyhow.


So verify your code with basic hand calculations which are available for beam bending vibrations - finally make sure we compare apples to apples.

So I assume you have used Euler Bernoulli type of formulation for your beam, then find the bending mode vibrations for that (e.g.,, and not Timoshenko. Also since the analytical Euler beam solution does not include typically rotary inertia thus use a lumped mass matrix in your code.

The first 4 modes are bending modes I assume, and they are duplicate pairs since the beam has a symmetric section (Ixx,Iyy). The next mode,nr 5 could be a longitudinal or torsional mode. Now the longitudinal mode is also available in books and easy to calculate by hand. You can find the fundamental frequencies of these two modes on books on vibration.


For the higher bending modes, say nr 7 and 8, compare them again to the above mentioned hand calcs (Euler Bernoulli), and see if they are close



Try that and see what you come up with,


Also post some screenshots and some more info on the beam section length, properties and so on

  • Liked by
  • hkenan
  • peteroznewman
hkenan posted this 26 April 2019

Thank you for your response jj77.


After this post, i found out that the stiffness matrix ı used does not include warping and shear deformation effect.

As seen from the mode shapes, 5th and 6th modes are warping of section mode(torsional) and longitudinal mode, respectively. 

Now, im trying to add warping and shear def. effect and fix an insignificiant mistake i saw in the code.

I will update and add some screenshots as soon as i fixed the mistakes.