Quick answer. In a 2D frame each joint has three degrees of freedom (horizontal and vertical displacement, and rotation), and each member has a 6×6 matrix combining axial stiffness \(EA/L\) with bending stiffness \(EI/L^3\). Rotate each member matrix to global axes, assemble, remove the supported degrees of freedom, and solve \(\mathbf{K}_{ff}\mathbf{u}_f=\mathbf{F}_f\). Member end forces come from \(\mathbf{f}=\mathbf{k}\,\mathbf{u}_{local}\), and the reactions are the end forces at the supports.
1. The beam-column element
In the member’s own axes (\(x'\) along the member) the six degrees of freedom are \((u_i,v_i,\theta_i,u_j,v_j,\theta_j)\), and the element matrix combines a truss bar and a beam:
$$\mathbf{k}'=\begin{bmatrix}\frac{EA}{L} & 0 & 0 & -\frac{EA}{L} & 0 & 0\\ 0 & \frac{12EI}{L^3} & \frac{6EI}{L^2} & 0 & -\frac{12EI}{L^3} & \frac{6EI}{L^2}\\ 0 & \frac{6EI}{L^2} & \frac{4EI}{L} & 0 & -\frac{6EI}{L^2} & \frac{2EI}{L}\\ -\frac{EA}{L} & 0 & 0 & \frac{EA}{L} & 0 & 0\\ 0 & -\frac{12EI}{L^3} & -\frac{6EI}{L^2} & 0 & \frac{12EI}{L^3} & -\frac{6EI}{L^2}\\ 0 & \frac{6EI}{L^2} & \frac{2EI}{L} & 0 & -\frac{6EI}{L^2} & \frac{4EI}{L}\end{bmatrix}.$$For a member inclined at angle \(\theta\) (\(c=\cos\theta,\ s=\sin\theta\)) the matrix is rotated into global axes with \(\mathbf{k}=\mathbf{T}^{T}\mathbf{k}'\mathbf{T}\), where
$$\mathbf{T}=\begin{bmatrix}\mathbf{R} & \mathbf{0}\\ \mathbf{0} & \mathbf{R}\end{bmatrix},\qquad \mathbf{R}=\begin{bmatrix}c & s & 0\\ -s & c & 0\\ 0 & 0 & 1\end{bmatrix}.$$2. The procedure
- Number the joints and members, and give each member its \(E\), \(A\), \(I\) and direction.
- Form each local matrix \(\mathbf{k}'\) and rotate it to global axes.
- Add every member matrix into the global matrix \(\mathbf{K}\) at the three degrees of freedom of its two joints.
- Remove the rows and columns of supported degrees of freedom (a fixed support removes all three).
- Solve \(\mathbf{K}_{ff}\mathbf{u}_f=\mathbf{F}_f\) for the joint displacements and rotations, including the sway of the frame.
- For each member, rotate the displacements back to local axes and compute the end forces \(\mathbf{f}'=\mathbf{k}'\mathbf{u}'\) (plus fixed-end forces for loads along members).
- Read the reactions from the end forces of the members that meet at each support, and check equilibrium.
3. Worked example: a fixed-base portal frame
A steel portal frame (\(E=210\) GPa) has two 4 m columns (\(A=7808\ \mathrm{mm^2}\), \(I_c=5.696\times10^{-5}\ \mathrm{m^4}\)) and a 6 m beam (\(A=7273\ \mathrm{mm^2}\), \(I_b=1.627\times10^{-4}\ \mathrm{m^4}\)). Both bases are fixed and a wind load \(H=50\) kN acts horizontally at joint 2. The free degrees of freedom are \((u,v,\theta)\) at joints 2 and 3, so \(\mathbf{K}_{ff}\) is a 6×6 matrix and the solution gives the sway directly.
Before trusting a computer result, compare it with a hand method. Neglecting axial deformation, the slope-deflection solution for a sway portal depends on the stiffness ratio
$$k=\frac{I_b/L}{I_c/h}=\frac{1.627\times10^{-4}/6}{5.696\times10^{-5}/4}=1.904,\qquad M_{base}=\frac{Hh}{2}\cdot\frac{3k+1}{6k+1}=54.0\ \text{kN m},\qquad M_{knee}=\frac{Hh}{2}\cdot\frac{3k}{6k+1}=46.0\ \text{kN m},$$with each column carrying a shear \(H/2=25\) kN. The stiffness solution, which keeps axial deformation, gives:
| Quantity | StiffStruct | Hand check |
|---|---|---|
| Sway of the beam (horizontal displacement of joints 2 and 3) | 13.91 mm and 13.81 mm | – |
| Base moment, left and right column | 54.22 and 53.89 kN·m | 54.0 kN·m |
| Horizontal reaction, left and right base | 25.07 and 24.93 kN | 25.0 kN each |
| Vertical reactions (overturning pair) | −15.31 and +15.31 kN | \((Hh-M_A-M_D)/L\) |
| Equilibrium residual | < 1×10−9 kN | – |
The base moments differ from the hand value by under 0.4%, because the slope-deflection formula ignores the small axial shortening of the columns. The vertical reactions check by statics: the wind overturning moment \(Hh=200\) kN·m is resisted by the two base moments (about 108 kN·m together) and the vertical couple \(15.31\times6=91.9\) kN·m, and \(108.1+91.9=200\).
Solving the example in your browser…
4. Common mistakes in frame analysis
- Forgetting a degree of freedom. Every joint has three; a fixed support removes all three, a pin removes only the two translations.
- Mixing local and global axes. End forces are computed in member axes, but displacements are assembled in global axes: rotate back before multiplying.
- Ignoring the load on the member. A distributed load on a beam must be converted to fixed-end forces, and the reactions must include them.
- Unit inconsistency. \(EI\) must be in the same force and length units as the loads (for example kN and m).
Solve this frame, or your own, in StiffStruct
Open the portal frame with its bending moment diagram and matrices, or draw a frame of your own with columns, beams, supports and loads.
Frequently asked questions
What is the difference between a truss and a frame in the stiffness method?
A truss member has two degrees of freedom per joint and only axial stiffness. A frame member also resists bending, so it has three degrees of freedom per joint (including rotation) and the 6×6 matrix above, with joints that can transmit moment.
How does the stiffness method capture sway?
The horizontal joint displacements are ordinary unknowns, so sway is solved for automatically. Hand methods such as slope-deflection need an extra sway equation, which the matrix method does not.
Is axial deformation included?
Yes. The matrix contains the axial terms \(EA/L\), which is why StiffStruct’s results differ slightly from hand formulas that neglect axial deformation.
What changes for a 3D frame?
Each joint has six degrees of freedom and each member a 12×12 matrix with bending about both axes and torsion. StiffStruct solves 3D frames with the same procedure.