In 3D structural analysis (as well as many other applications) it is necessary to convert section properties, forces, and deflections between coordinate systems defined by individual structural members (local coordinates) and the common coordinate system defining the entire structure (global coordinates). For a 2D analysis this is straightforward, but for 3D analysis the transformation needs to be carefully defined to avoid unexpected results. Functions to perform this operation are included in the 3D frame analysis presented here previously (most recently here), but since these functions have other applications I have extracted them and added them to the IP2 spreadsheet.
Download IP2.zip with full open source code.
The new functions are glob_to_loc() and loc_to_glob, which also come in Python versions (py_glob_to_loc() and py_loc_to_glob). Use of the Python versions requires the PyXll add-in. See Installing Python, Scipy and Pyxll for more details. Details of usage are shown in the screen-shot below (also included in the download file).:
The function arguments are:
Globala or Locala: the values to be converted to the new axis system. The values may be deflections, rotations, forces, bending moments, or section properties (translational and rotational stiffness values). The Globala and Locala arrays may contain 3 or 6 elements; for instance deflections in the X, Y and Z directions, followed by rotations associated with those deflections. Global values are always listed in the order X, Y, Z. See below for the definition and order of the local axes.
- Coord: a 3 element array defining the direction of the longitudinal local axis, relative to the global axis system. In the context of a frame analysis it is the length of the beam element in the X, Y and Z directions.
- Gamma: an angle (in degrees) defining the orientation of the local axes, relative to the default alignment (see below).
- Vertax: 2 or 3, the default vertical direction of the local axes. This value defines both the vertical direction and the ordering of the local axes (see below).
There are a number of options for defining the default orientation and numbering of the local axes; the two I have chosen are:
- Vertax = 2: Local Axis 1 is aligned with the longitudinal axis of the beam, from node 1 to node 2. Axis 2 is perpendicular to Axis 1 and parallel to the X-Z plane, so the Y axis is in effect treated as vertical. Axis 3 completes the orthogonal system, being perpendicular to both Axis 1 and Axis 2. This is the system used in the book “Programming the Finite Element Method”, which is the source of many of the routines used in the frame analysis spreadsheets.
- Vertax = 3: Local Axis 3 is aligned with the longitudinal axis of the beam, from node 1 to node 2. Axis 2 is perpendicular to Axis 3 and parallel to the X-Y plane, so the Z axis is treated as vertical. Axis 1 completes the orthogonal system, being perpendicular to both Axis 3 and Axis 2. This is the system used in the program Strand7, which I have used to check the results of my spreadsheets.
The screen-shot below shows the results of generating four I-beams in Strand7, using the default local axis system:
Note that Axis 2 for all four beams is parallel to the XY Plane. Also note that by default the web of the I beams is also aligned with Axis 2.
The next screen-shot shows the result of rotating the view of the model, so that the Y axis is vertical, rather than the Z axis:
Now the webs of the horizontal members are vertical, but note that the web of the inclined member is now inclined.
The simplest way to achieve a vertical web orientation in all members is to use the Z axis as the vertical direction, and rotate the principal axes of all the beams through 90 degrees, as shown below:
The two screen-shots below show the results of the glob_to_loc function for beam aligned with the X axis, and with Vertax set to 2 and 3 respectively. The results are the same except that Local Axes 1 and 3 are swapped and the sign of the Axis 3/1 values has changed. Note that applying loc_to_glob with the appropriate Vertax value returns the original data.
Similar results are seen for a beam lying in the XY plane:
The sign of the Axis 3/1 values can be changed by applying a rotation of 90 degrees:
For an inclined beam the changing the Vertax value leaves the axial results unchanged (Axis 1/3), but the other axes have differing results, due to the differing rotations of the beams. The function results are compared with results from Strand7, showing exact agreement:
The results of the different Vertax options may be equalised by applying a rotation to one of the beams, bringing the beam principal axes back into alignment: