OpenSees Cloud

OpenSees AMI

Transformation Cross-Training

Original Post - 13 Aug 2023 - Michael H. Scott

Visit Structural Analysis Is Simple on Substack.


Athletes often cross-train in secondary activities in order to improve performance in their primary sport. For example, football players may practice ballet in order to improve their flexibility and endurance.

Using OpenSees, you practically have to be a mathlete to understand the geometric transformation in three dimensions. But instead of fumbling your way through space frame analysis, never understanding the “vector in the x-z plane”, it’s worthwhile to cross-train in two dimensions.

The steps for defining local x, y, and z axes for three-dimensional frame elements is:

  1. Local x is the unit vector pointing from node I to node J
  2. A vector in the x-z plane, v, is specified by the user
  3. Local y is v cross x (make into a unit vector)
  4. Local z is x cross y

We can apply these same steps to two-dimensional elements.

For two-dimensional elements, x=[c,s,0], which can be computed from the nodal coordinates (step 1).

Frame element orientation in 2D

Note that \(\theta\) is for conceptual convenience–you never need to calculate the angle.

For two-dimensional elements, the vector v is defined automatically as [0,0,1] (step 2), pointing directly at you, perpendicular to the X-Y plane. Then, applying steps 3 and 4, you get y = v cross x = [-s,c,0] and z = x cross y = [0,0,1]. There’s no need to go through the cross-product calculations for two-dimensional models–y will always be [-s,c,0] and z will always be [0,0,1].

But can you apply any vector in the x-z plane to two-dimensional models? Yes, yes you can. As long as v is defined as a linear combination of [c,s,0] and [0,0,1], steps 3 and 4 should yield the expected y and z vectors.

For example, v=[c,s,1]. Execute steps 3 and 4 and you’ll get y=[-s,c,0] and z=[0,0,1].

How about v=[-c,-s,1]? Steps 3 and 4 will also give you y=[-s,c,0] and z=[0,0,1].

Try steps 3 and 4 with v=[5c,5s,10]. You will get the expected result, just don’t forget to make y a unit vector.

What happens if v has a negative Z component, e.g., v=[c,s,-1]? Carrying out steps 3 and 4 will flip the y axis and make z point in to instead of out of the plane. As a result, end moments will be positive clockwise instead of counter-clockwise.

And finally, what happens if v is not a linear combination of [c,s,0] and [0,0,1], e.g., v=[s,c,1]? In this case, steps 3 and 4 will reveal the y axis pointing out of the X-Y plane and z not equal to [0,0,1], i.e., the element has spun out of the plane.

Elements potentially spinning out of the X-Y plane is why we don’t let users specify a vector in the x-z plane for two-dimensional elements. Not only is the input unnecessary, errors would ensue.

Run through these vector calculations yourself. Doing so should give you a better understanding of the geometric transformation in three dimensions.