Ecuación diferencial de una barra circular
\begin{equation*} G I_{p} \frac{d^{2} \theta(x)}{d x^{2}} + m(x) = 0 \end{equation*}usando el método de Galerkin
\begin{equation*} \int_{0}^{L} R(x) W(x) \ dx = \int_{0}^{L} \bigg( G I_{p} \frac{d^{2} \theta(x)}{d x^{2}} + m(x) \bigg) W(x) \ dx = 0 \end{equation*}puede escribirse como la suma de integrales
\begin{equation*} \int_{0}^{L} G I_{p} \frac{d^{2} \theta(x)}{d x^{2}} W(x) \ dx + \int_{0}^{L} m(x) W(x) \ dx = 0 \end{equation*}integrando por partes para reducir el orden de la derivada
\begin{align*} \int u \ dv &= uv - \int v \ du \\ \int_{0}^{L} W(x) G I_{p} \frac{d^{2} \theta(x)}{d x^{2}} \ dx &= \bigg( W(x) G I_{p} \frac{d \theta(x)}{d x} \bigg) \bigg|_{0}^{L} - \int_{0}^{L} G I_{p} \frac{d \theta(x)}{d x} \frac{d W(x)}{d x} \ dx \end{align*}reemplazando
\begin{equation*} \bigg( G I_{p} \frac{d \theta(x)}{d x} W(x) \bigg) \bigg|_{0}^{L} - \int_{0}^{L} G I_{p} \frac{d \theta(x)}{d x} \frac{d W(x)}{d x}\ dx + \int_{0}^{L} m(x) W(x) \ dx = 0 \end{equation*}reordenando
\begin{equation*} \int_{0}^{L} G I_{p} \frac{d \theta(x)}{d x} \frac{d W(x)}{d x} \ dx = \int_{0}^{L} m(x) W(x) \ dx + \bigg( G I_{p} \frac{d \theta(x)}{d x} W(x) \bigg) \bigg|_{0}^{L} \end{equation*}para la solución se usará un elemento de dos nodos
\begin{align*} \theta(x) &= N_{1} \theta_{1} + N_{2} \theta_{2} \\ \frac{d \theta(x)}{d x} &= \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{2}}{d x} \theta_{2} \\ W(x) &= N_{1} \delta \theta_{1} + N_{2} \delta \theta_{2} \\ \frac{d W(x)}{d x} &= \frac{d N_{1}}{d x} \delta \theta_{1} + \frac{d N_{2}}{d x} \delta \theta_{2} \end{align*}reemplazando
\begin{equation*} \int_{0}^{L} G I_{p} \bigg( \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{2}}{d x} \theta_{2} \bigg) \bigg( \frac{d N_{1}}{d x} \delta \theta_{1} + \frac{d N_{2}}{d x} \delta \theta_{2} \bigg) \ dx = \int_{0}^{L} m(x) (N_{1} \delta \theta_{1} + N_{2} \delta \theta_{2}) \ dx + \bigg[ G I_{p} \frac{d \theta(x)}{d x} (N_{1} \delta \theta_{1} + N_{2} \delta \theta_{2}) \bigg] \bigg|_{0}^{L} \end{equation*}reemplazando $G I_{p} \frac{d \theta(x)}{d x} = M(x)$
\begin{equation*} \int_{0}^{L} G I_{p} \bigg( \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{2}}{d x} \theta_{2} \bigg) \bigg( \frac{d N_{1}}{d x} \delta \theta_{1} + \frac{d N_{2}}{d x} \delta \theta_{2} \bigg) \ dx = \int_{0}^{L} m(x) (N_{1} \delta \theta_{1} + N_{2} \delta \theta_{2}) \ dx + \bigg[ M(x) (N_{1} \delta \theta_{1} + N_{2} \delta \theta_{2}) \bigg] \bigg|_{0}^{L} \end{equation*}multiplicando
\begin{equation*} \int_{0}^{L} G I_{p} \frac{d N_{1}}{d x} \frac{d N_{1}}{d x} \theta_{1} \delta \theta_{1} + G I_{p} \frac{d N_{1}}{d x} \frac{d N_{2}}{d x} \theta_{2} \delta \theta_{1} + G I_{p} \frac{d N_{2}}{d x} \frac{d N_{1}}{d x} \theta_{1} \delta \theta_{2} + G I_{p} \frac{d N_{2}}{d x} \frac{d N_{2}}{d x} \theta_{2} \delta \theta_{2} \ dx = \int_{0}^{L} m(x) N_{1} \delta \theta_{1} + m(x) N_{2} \delta \theta_{2} \ dx + \bigg( M(x) N_{1} \delta \theta_{1} + M(x) N_{2} \delta \theta_{2} \bigg) \bigg|_{0}^{L} \end{equation*}reemplazando los límites de integración en el lado derecho
\begin{equation*} \int_{0}^{L} G I_{p} \frac{d N_{1}}{d x} \frac{d N_{1}}{d x} \theta_{1} \delta \theta_{1} + G I_{p} \frac{d N_{1}}{d x} \frac{d N_{2}}{d x} \theta_{2} \delta \theta_{1} + G I_{p} \frac{d N_{2}}{d x} \frac{d N_{1}}{d x} \theta_{1} \delta \theta_{2} + G I_{p} \frac{d N_{2}}{d x} \frac{d N_{2}}{d x} \theta_{2} \delta \theta_{2} \ dx = \int_{0}^{L} m(x) N_{1} \delta \theta_{1} + m(x) N_{2} \delta \theta_{2} \ dx + ( M(L) N_{1}(L) \delta \theta_{1} + M(L) N_{2}(L) \delta \theta_{2} ) - ( M(0) N_{1}(0) \delta \theta_{1} + M(0) N_{2}(0) \delta \theta_{2} ) \end{equation*}reordenando y agrupando
\begin{equation*} \int_{0}^{L} G I_{p} \bigg( \frac{d N_{1}}{d x} \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{1}}{d x} \frac{d N_{2}}{d x} \theta_{2} \bigg) \delta \theta_{1} + G I_{p} \bigg( \frac{d N_{2}}{d x} \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{2}}{d x} \frac{d N_{2}}{d x} \theta_{2} \bigg) \delta \theta_{2} \ dx = \int_{0}^{L} m(x) N_{1} \delta \theta_{1} + m(x) N_{2} \delta \theta_{2} \ dx + ( M(L) N_{1}(L) - M(0) N_{1}(0) ) \delta \theta_{1} + ( M(L) N_{2}(L) - M(0) N_{2}(0) ) \delta \theta_{2} \end{equation*}formando un sistema de ecuaciones
\begin{align*} \int_{0}^{L} G I_{p} \bigg( \frac{d N_{1}}{d x} \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{1}}{d x} \frac{d N_{2}}{d x} \theta_{2} \bigg) \delta \theta_{1} \ dx = \int_{0}^{L} m(x) N_{1} \delta \theta_{1} \ dx + ( M(L) N_{1}(L) - M(0) N_{1}(0) ) \delta \theta_{1} \\ \int_{0}^{L} G I_{p} \bigg( \frac{d N_{2}}{d x} \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{2}}{d x} \frac{d N_{2}}{d x} \theta_{2} \bigg) \delta \theta_{2} \ dx = \int_{0}^{L} m(x) N_{2} \delta \theta_{2} \ dx + ( M(L) N_{2}(L) - M(0) N_{2}(0) ) \delta \theta_{2} \end{align*}las constantes se simplifican en ambos lados
\begin{align*} \int_{0}^{L} G I_{p} \bigg( \frac{d N_{1}}{d x} \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{1}}{d x} \frac{d N_{2}}{d x} \theta_{2} \bigg) \ dx = \int_{0}^{L} m(x) N_{1} \ dx + M(L) N_{1}(L) - M(0) N_{1}(0) \\ \int_{0}^{L} G I_{p} \bigg( \frac{d N_{2}}{d x} \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{2}}{d x} \frac{d N_{2}}{d x} \theta_{2} \bigg) \ dx = \int_{0}^{L} m(x) N_{2} \ dx + M(L) N_{2}(L) - M(0) N_{2}(0) \end{align*}las funciones de forma tienen los siguientes valores
\begin{matrix} N_{1}(L) = 0 & N_{1}(0) = 1 \\ N_{2}(L) = 1 & N_{2}(0) = 0 \end{matrix}reemplazando
\begin{align*} \int_{0}^{L} G I_{p} \bigg( \frac{d N_{1}}{d x} \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{1}}{d x} \frac{d N_{2}}{d x} \theta_{2} \bigg) \ dx = \int_{0}^{L} m(x) N_{1} \ dx - M(0) \\ \int_{0}^{L} G I_{p} \bigg( \frac{d N_{2}}{d x} \frac{d N_{1}}{d x} \theta_{1} + \frac{d N_{2}}{d x} \frac{d N_{2}}{d x} \theta_{2} \bigg) \ dx = \int_{0}^{L} m(x) N_{2} \ dx + M(L) \end{align*}en forma matricial
\begin{equation*} \int_{0}^{L} G I_{p} \begin{bmatrix} \frac{d N_{1}}{d x} \frac{d N_{1}}{d x} & \frac{d N_{1}}{d x} \frac{d N_{2}}{d x} \\ \frac{d N_{2}}{d x} \frac{d N_{1}}{d x} & \frac{d N_{2}}{d x} \frac{d N_{2}}{d x} \end{bmatrix} dx \begin{bmatrix} \theta_{1} \\ \theta_{2} \end{bmatrix} = \int_{0}^{L} m(x) \begin{bmatrix} N_{1} \\ N_{2} \end{bmatrix} dx + \begin{bmatrix} -M(0) \\ M(L) \end{bmatrix} \end{equation*}cambiando $-M(0)$ y $M(L)$ por momentos en los nodos 1 y 2
\begin{equation*} \int_{0}^{L} G I_{p} \begin{bmatrix} \frac{d N_{1}}{d x} \frac{d N_{1}}{d x} & \frac{d N_{1}}{d x} \frac{d N_{2}}{d x} \\ \frac{d N_{2}}{d x} \frac{d N_{1}}{d x} & \frac{d N_{2}}{d x} \frac{d N_{2}}{d x} \end{bmatrix} dx \begin{bmatrix} \theta_{1} \\ \theta_{2} \end{bmatrix} = \int_{0}^{L} m(x) \begin{bmatrix} N_{1} \\ N_{2} \end{bmatrix} dx + \begin{bmatrix} M_{1} \\ M_{2} \end{bmatrix} \end{equation*}factorizando matrices
\begin{equation*} \int_{0}^{L} \begin{bmatrix} \frac{d N_{1}}{d x} \\ \frac{d N_{2}}{d x} \end{bmatrix} G I_{p} \begin{bmatrix} \frac{d N_{1}}{d x} & \frac{d N_{2}}{d x} \end{bmatrix} dx \begin{bmatrix} \theta_{1} \\ \theta_{2} \end{bmatrix} = \int_{0}^{L} m(x) \begin{bmatrix} N_{1} \\ N_{2} \end{bmatrix} dx + \begin{bmatrix} M_{1} \\ M_{2} \end{bmatrix} \end{equation*}en forma compacta
\begin{equation*} \int_{0}^{L} \mathbf{B}^{\mathrm{T}} \mathbf{D} \ \mathbf{B} \ dx \ \mathbf{\theta} = \int_{0}^{L} m \ \mathbf{N}^{\mathrm{T}} dx + \mathbf{F} \end{equation*}