## Finite Elements

### Week 6

(a) Starting with Equation (9.52), $$\frac{\delta^2 u}{\delta t^2} = v^2 \frac{\delta^2 u}{\delta x^2} + \gamma \frac{\delta}{\delta t} \frac{\delta^2 u}{\delta x^2}$$ Using the steps between (9.23) and (9.24) as reference, $$\int_0^1 \Bigl(\frac{\delta^2 u}{\delta t^2} - v^2 \frac{\delta^2 u}{\delta x^2} - \gamma \frac{\delta}{\delta t} \frac{\delta^2 u}{\delta x^2}\Bigr) \varphi_j dx = 0$$ $$\sum_i \int_0^1 \Bigl(\frac{d^2 a_i}{d t^2} \varphi_i \varphi_j - v^2 a_i \varphi_j \frac{d^2 \varphi_i}{d x^2} - \gamma \varphi_j \frac{d a_i}{dt} \frac{d^2 \varphi_i}{d x^2}\Bigr) dx = 0$$ We can then integrate by parts, such as in (9.25). $$\sum_i \frac{d^2 a_i}{dt^2} \int_0^1 \varphi_i \varphi_j dx + \sum_i \frac{da_i}{dt} \int_0^1 \Bigl(\gamma \frac{d \varphi_i}{dx} \frac{d \varphi_j}{dx} dx - \gamma \varphi_j \frac{d \varphi_i}{dx} \Biggr|_0^1 \Bigr) + \sum_i a_i \int_0^1 \Bigl(v^2 \frac{d \varphi_i}{dx} \frac{d \varphi_j}{dx} dx - v^2 \varphi_j \frac{d \varphi_i}{dx} \Biggr|_0^1 \Bigr) = 0$$ Matrices A, B, and C are defined as follows: $$\mathbf{A}_{ij} = \int_0^1 \varphi_i \varphi_j dx$$ $$\mathbf{B}_{ij} = \int_0^1 \Bigl(\gamma \frac{d \varphi_i}{dx} \frac{d \varphi_j}{dx} dx - \gamma \varphi_j \frac{d \varphi_i}{dx} \Biggr|_0^1 \Bigr)$$ $$\mathbf{C}_{ij} = \int_0^1 \Bigl(v^2 \frac{d \varphi_i}{dx} \frac{d \varphi_j}{dx} dx - v^2 \varphi_j \frac{d \varphi_i}{dx} \Biggr|_0^1 \Bigr)$$ This leaves us with a simple equation. $$\mathbf{A} \frac{d^2 a_i}{dt^2} + \mathbf{B} \frac{da_i}{dt} + \mathbf{C} a_i = 0$$
(b) We know from (9.8) that $$\varphi_i = \begin{cases} \frac{x-x_{i-1}}{x_i-x_{i-1}}, \ x_{i-1} \le x \lt x_i \\[3ex] \frac{x_{i+1}-x}{x_{i+1}-x_i}, \ x_i \le x \lt x_{i+1} \\[3ex] 0, \ x \lt x_{i-1} \ \text{or} \ x \ge x_{i+1} \end{cases}$$ We also know that $$\varphi_i(x_i) = 1 \ \text{and} \ \varphi_j(x_i) = 0 \ \text{for all} \ i \ne j$$ Therefore, all terms in the A matrix will be 0 except along the diagonal, where i = j, and along the off-diagonals, making it a tridiagonal matrix. Let's redefine h as $$h = x_i - x_{i-1} \ \text{or} \ h = x_{i+1} - x_i$$ Which gives us $$\varphi_i = \begin{cases} \frac{x-x_{i-1}}{h}, \ x_{i-1} \le x \lt x_i \\[3ex] \frac{x_{i+1}-x}{h}, \ x_i \le x \lt x_{i+1} \\[3ex] 0, \ x \lt x_{i-1} \ \text{or} \ x \ge x_{i+1} \end{cases}$$ Since we are using the same step size, this works out. Now, we must integrate by parts due to the piecewise function. $$\int_0^{x_{i-1}} \bigl( 0 \bigr)^2dx + \int_{x_{i-1}}^{x_i} \Bigl( \frac{x-x_{i-1}}{h} \Bigr)^2 dx + \int_{x_i}^{x_{i+1}} \Bigl( \frac{x_{i+1}-x}{h} \Bigr)^2 dx + \int_{x_{i+1}}^1 \bigl( 0 \bigr)^2 dx$$ $$\frac{1}{h^2} \int_{x_{i-1}}^{x_i} \bigl( x - x_{i-1} \bigr)^2 dx + \frac{1}{h^2} \int_{x_{i}}^{x_{i+1}} \bigl( x_{i+1} - x \bigr)^2 dx$$ $$\frac{1}{h^2} \Bigl( \frac{(x-x_{i-1})^3}{3} \Biggr|_{x_{i-1}}^{x_i} - \frac{(x_{i+1}-x)^3}{3} \Biggr|_{x_i}^{x_{i+1}} \Bigr)$$ $$\frac{1}{h^2} \Bigl[ \Bigl( \frac{(x_i-x_{i-1})^3}{3} - \frac{(x_{i-1}-x_{i-1})^3}{3} \Bigr) - \Bigl( \frac{(x_{i+1}-x_{i+1})^3}{3} - \frac{(x_{i+1}-x_i)^3}{3} \Bigr) \Bigr]$$ $$\frac{1}{h^2} \Bigl( \frac{h^3}{3} + \frac{h^3}{3} \Bigr) = \frac{2h^3}{3h^2} = \frac{2h}{3}$$ By using similar steps, we can solve for the diagonal of B and C. $$\frac{d \varphi_i}{dx} \frac{d \varphi_i}{dx} = \frac{1}{h^2}$$ $$\int_{x_{i-1}}^{x_i} \frac{\gamma}{h^2}dx + \int_{x_i}^{x_{i+1}} \frac{\gamma}{h^2}dx= \frac{\gamma}{h^2}(x_i-x_{i-1}) + \frac{\gamma}{h^2}(x_{i+1}-x_i)= \frac{\gamma}{h} + \frac{\gamma}{h} = \frac{2 \gamma}{h}$$ $$\int_{x_{i-1}}^{x_i} \frac{v^2}{h^2}dx + \int_{x_i}^{x_{i+1}} \frac{v^2}{h^2}dx= \frac{v^2}{h^2}(x_i-x_{i-1}) + \frac{v^2}{h^2}(x_{i+1}-x_i)= \frac{v^2}{h} + \frac{v^2}{h} = \frac{2 v^2}{h}$$
First off, we must set our boundary conditions on the end of the beam. We can say that $$u(0)=0 \quad \dot{u}(0)=0$$ but we can't make any assumptions about u(L) because we will be putting a force on the beam at position L.