# Step-wise finite element formulations: can this be done?

Given the functional: $$F[\mathbf{x}]=\frac{1}{2}[\mathbf{x}^{\text{T}} * D(\mathbf{x})]-\frac{1}{2}[\mathbf{x}^{\text{T}} * \mathbf{Ax}]-\frac{1}{2}\mathbf{x}^{\text{T}}(0)\mathbf{x}(t)$$

Where $\mathbf{A}$ is symmetric, $\mathbf{x}(0)$ being the initial condition, $\mathbf{x}(t)$ is continuous, and: $$[\mathbf{f}^{\text{T}} * \mathbf{g}]=\int^{t}_0 \mathbf{f}^{\text{T}}(t-\tau)\mathbf{g}(\tau)\,\text{d}\tau$$ and: $$D\left(\cdot\right)=\frac{\text{d}}{\text{d}t}\left(\cdot\right)$$

We take the variation as: $$\delta F\left[\mathbf{x}\right]=\left.\frac{\partial}{\partial \varepsilon} F\left[\mathbf{x}+\varepsilon\delta\mathbf{x}\right]\right|_{\varepsilon=0}$$ Functional at the varied function is then: $$F\left[\mathbf{x}+\varepsilon\delta\mathbf{x}\right]=\frac{1}{2}[\mathbf{x}^{\text{T}}+\varepsilon\delta\mathbf{x}^{\text{T}} * D(\mathbf{x}+\varepsilon\delta\mathbf{x})]-\frac{1}{2}[\mathbf{x}^{\text{T}}+\varepsilon\delta\mathbf{x}^{\text{T}} * \mathbf{A}\left(\mathbf{x}+\varepsilon\delta\mathbf{x}\right)]-\frac{1}{2}\left(\mathbf{x}^\text{T}(0)+\varepsilon\delta\mathbf{x}^\text{T}(0)\right)\left(\mathbf{x}(t)+\varepsilon\delta\mathbf{x}(t)\right)$$ The individual terms being: $$\frac{1}{2}[\mathbf{x}^{\text{T}}+\varepsilon\delta\mathbf{x}^{\text{T}} * \mathbf{A}\left(\mathbf{x}+\varepsilon\delta\mathbf{x}\right)]=\frac{1}{2}[\mathbf{x}^{\text{T}}* D(\mathbf{x})]+\frac{1}{2}\varepsilon[\mathbf{x}^{\text{T}}* D(\delta\mathbf{x})]+\frac{1}{2}\varepsilon[\delta\mathbf{x}^{\text{T}}* D(\mathbf{x})]+\frac{1}{2}\varepsilon^2[\delta\mathbf{x}^{\text{T}}* D(\delta\mathbf{x})]$$ $$\frac{1}{2}[\mathbf{x}^{\text{T}}+\varepsilon\delta\mathbf{x}^{\text{T}} * \mathbf{A}\left(\mathbf{x}+\varepsilon\delta\mathbf{x}\right)]=\frac{1}{2}[\mathbf{x}^{\text{T}} * \mathbf{A}\mathbf{x}]+\frac{1}{2}\varepsilon[\mathbf{x}^{\text{T}}* \mathbf{A}\delta\mathbf{x}]+\frac{1}{2}\varepsilon[\delta\mathbf{x}^{\text{T}} * \mathbf{A}\mathbf{x}]+\frac{1}{2}\varepsilon^2[\delta\mathbf{x}^{\text{T}} * \mathbf{A}\delta\mathbf{x}]$$ $$-\frac{1}{2}\left(\mathbf{x}^\text{T}(0)+\varepsilon\delta\mathbf{x}^\text{T}(0)\right)\left(\mathbf{x}(t)+\varepsilon\delta\mathbf{x}(t))\right)=-\frac{1}{2}\mathbf{x}^\text{T}(0)\mathbf{x}(t)-\frac{1}{2}\varepsilon\mathbf{x}^\text{T}(0)\delta\mathbf{x}(t)-\frac{1}{2}\varepsilon\delta\mathbf{x}^\text{T}(0)\mathbf{x}(t)-\frac{1}{2}\varepsilon^2\delta\mathbf{x}^\text{T}(0)\delta\mathbf{x}(t)$$ We can differentiate these with respect to $\varepsilon$ and then set it to zero, adding them up leads to: $$\delta F\left[\mathbf{x}\right]=\frac{1}{2}[\mathbf{x}^{\text{T}}* D(\delta\mathbf{x})]+\frac{1}{2}[\delta\mathbf{x}^{\text{T}}* D(\mathbf{x})]-\frac{1}{2}[\mathbf{x}^{\text{T}}* \mathbf{A}\delta\mathbf{x}]-\frac{1}{2}[\delta\mathbf{x}^{\text{T}} * \mathbf{A}\mathbf{x}]-\frac{1}{2}\mathbf{x}^\text{T}(0)\delta\mathbf{x}(t)-\frac{1}{2}\delta\mathbf{x}^\text{T}(0)\mathbf{x}(t)$$ We also can say: $$\frac{1}{2}[\mathbf{x}^{\text{T}}* \mathbf{A}\delta\mathbf{x}]=\frac{1}{2}[\delta\mathbf{x}^{\text{T}}* \mathbf{A}^{\text{T}}\mathbf{x}]$$ Since $\mathbf{A}$ is symmetric, this just means that: $$\frac{1}{2}[\mathbf{x}^{\text{T}}* \mathbf{A}\delta\mathbf{x}]=\frac{1}{2}[\delta\mathbf{x}^{\text{T}}* \mathbf{A}\mathbf{x}]$$ Substituting this back into the varied functional yields: $$\delta F\left[\mathbf{x}\right]=\frac{1}{2}[\mathbf{x}^{\text{T}}* D(\delta\mathbf{x})]+\frac{1}{2}[\delta\mathbf{x}^{\text{T}}* D(\mathbf{x})]-\frac{1}{2}[\delta\mathbf{x}^{\text{T}}* \mathbf{A}\mathbf{x}]-\frac{1}{2}[\delta\mathbf{x}^{\text{T}} * \mathbf{A}\mathbf{x}]-\frac{1}{2}\mathbf{x}^\text{T}(0)\delta\mathbf{x}(t)-\frac{1}{2}\delta\mathbf{x}^\text{T}(0)\mathbf{x}(t)$$ Notice, now we have two similar terms which can be grouped, doing so yields: $$\delta F\left[\mathbf{x}\right]=\frac{1}{2}[\mathbf{x}^{\text{T}}* D(\delta\mathbf{x})]+\frac{1}{2}[\delta\mathbf{x}^{\text{T}}* D(\mathbf{x})]-[\delta\mathbf{x}^{\text{T}}* \mathbf{A}\mathbf{x}]-\frac{1}{2}\mathbf{x}^\text{T}(0)\delta\mathbf{x}(t)-\frac{1}{2}\delta\mathbf{x}^\text{T}(0)\mathbf{x}(t)$$ We can lump this into the other term which a variation: $$\delta F\left[\mathbf{x}\right]=\frac{1}{2}[\mathbf{x}^{\text{T}}* D(\delta\mathbf{x})]+\frac{1}{2}[\delta\mathbf{x}^{\text{T}}* \left(D(\mathbf{x})-2\mathbf{A}\mathbf{x}\right)]-\frac{1}{2}\mathbf{x}^\text{T}(0)\delta\mathbf{x}(t)-\frac{1}{2}\delta\mathbf{x}^\text{T}(0)\mathbf{x}(t)$$ Now, if we say that $\delta\mathbf{x}(0)=0$, we get: $$\delta F\left[\mathbf{x}\right]=\frac{1}{2}[\mathbf{x}^{\text{T}}* D(\delta\mathbf{x})]+\frac{1}{2}[\delta\mathbf{x}^{\text{T}}* \left(D(\mathbf{x})-2\mathbf{A}\mathbf{x}\right)]-\frac{1}{2}\mathbf{x}^\text{T}(0)\delta\mathbf{x}(t)$$ This is the form I would use for discretizing, but we can show which system it is stationary with respect to. Taking integration by parts on the first term yields: $$\frac{1}{2}[\mathbf{x}^{\text{T}}* D(\delta\mathbf{x})]=\frac{1}{2}\mathbf{x}^{\text{T}}(0)\delta\mathbf{x}(t)-\frac{1}{2}\mathbf{x}^{\text{T}}(t)\delta\mathbf{x}(0)+\frac{1}{2}[\delta\mathbf{x}^{\text{T}}* D(\mathbf{x})]$$ Substituting this back in yields (with $\delta\mathbf{x}(0)=0$): $$\delta F\left[\mathbf{x}\right]=[\delta\mathbf{x}^{\text{T}}* \left(D(\mathbf{x})-\mathbf{A}\mathbf{x}\right)]$$ Which implies: $$D(\mathbf{x})-\mathbf{A}\mathbf{x}=0$$ Or: $$\frac{d\mathbf{x}(t)}{dt}= \mathbf{Ax}(t)$$

Again, the first variation of this functional (with no IBP) is:

$$\delta F[\mathbf{x}]=\frac{1}{2}[\mathbf{x}^{\text{T}} * D(\delta\mathbf{x})]+\frac{1}{2}[\delta\mathbf{x}^{\text{T}} * \left(D(\mathbf{x})-2\mathbf{Ax}\right)]-\frac{1}{2}\mathbf{x}^{\text{T}}(0)\delta\mathbf{x}(t)$$

I now discretize this over the interval $\left[0,\Delta\right]$, using the approximation: $$\mathbf{x}(t)=\mathbf{x}_0 N_0(t)+\mathbf{x}_1 N_1(t)$$ $$\delta\mathbf{x}(t)=\delta\mathbf{x}_0 N_0(t)+\delta\mathbf{x}_1 N_1(t)$$ Where: $$N_0(t)=1-\frac{t}{\Delta}$$ And $$N_1(t)=\frac{t}{\Delta}$$

The result is: $$\delta F[\mathbf{x}] \approx \delta\mathbf{x}_1^{\text{T}}\left(\left(\frac{1}{2}\mathbf{I}-\frac{\Delta}{6}\mathbf{A}\right)\mathbf{x}_1-\frac{\Delta}{3}\mathbf{A}\mathbf{x}_0-\frac{1}{2}\mathbf{x}(0)\right)$$

Given that $\delta\mathbf{x}_1$ is some arbitrary discrete variation, we can say that it's coefficient must be zero: $$\left(\frac{1}{2}\mathbf{I}-\frac{\Delta}{6}\mathbf{A}\right)\mathbf{x}_1-\frac{\Delta}{3}\mathbf{A}\mathbf{x}_0-\frac{1}{2}\mathbf{x}(0)=0$$

My question is, is the following also true?:

$$\left(\frac{1}{2}\mathbf{I}-\frac{\Delta}{6}\mathbf{A}\right)\mathbf{x}_{i+1}-\frac{\Delta}{3}\mathbf{A}\mathbf{x}_i-\frac{1}{2}\mathbf{x}(0)=0$$

• I can provide an example if need be, I just don't want to bias the answer with any specific cases. Also, if anything is unclear, please let me know; I can explain or correct anything. – Ron Mar 3 '15 at 20:30
• This isn't exactly clear. What is $\mathcal{L}$? What are $\boldsymbol{x}_0$, etc.? What are $N_0(t)$, etc.? I feel like you've left too much out. – Bill Barth Mar 4 '15 at 1:46
• @BillBarth: Sure. $\mathcal{L}$ is just the integrand, I didn't want to specify too much what it was, but the idea is that the variation of this integrand is stationary at the given system. $\mathbf{x}_0$ and $N_0(t)$ are associated coefficients and shape functions. – Ron Mar 4 '15 at 2:17
• You should really write out a more concrete example. – Bill Barth Mar 4 '15 at 3:45
• You define your functional $I[x]$, yet $x$ doesn't even occur on the right-hand side. What are these objects you talk about? In which spaces do they live? You have to be more precise. – cfh Mar 4 '15 at 12:27

## 1 Answer

(too many comments, so I'll continue here)

I assume you're referring to equation (4.40) in http://www.dic.units.it/perspage/tonti/DEPOSITO/Initial.pdf. In this case the answer is yes, it is possible: Due to the specific integral formulation based on convolution, the first variation of (4.40) leads to the initial value problem $$x'(t) = Ax(t)$$ with $x(0)$ given. You can then discretize this equation with a standard Galerkin method; the one you are trying to get is equivalent to a Crank-Nicolson time stepping method.

In principle, you can also go the other way around as you are proposing: Discretize the functional, and then take discrete variations. Depending on the discretisation, you end up with different time stepping methods, but often there's one choice that leads to a standard time stepping method such as Crank-Nicolson. Whether that is possible in this case, I'm not sure -- the Crank-Nicolson method is equivalent to a Petrov-Galerkin method (i.e., trial and test functions come from different spaces; continuous piecewise linear and discontinuous piecewise constant, in this case), which means there can be no variational formulation (since the test functions come from variations of the trial functions, which means they have to live in the same space).

As regards your specific question: No, this is unlikely to be true, since the initial condition shouldn't appear there. To get the next time step, you need to explicitly compute variations with respect to $\delta x_2$ (and so forth).

(Note that in the definition of your functional, $t$ should really be $T$ (the end time), otherwise the functional makes no sense. (This means that $f^T*g$ is not really the convolution of $f$ and $g$ (which would be a function), but a related bilinear form (and hence a real number).) That means you need to be careful when taking variations not to mix up $t$ and $T$. Also, the $x(0)$ in your formulation is a fixed initial condition, better denoted by $x_0$. Since $x(0)=x_0$ is fixed, there can be no variation at $t=0$, i.e., $\delta x(0) = 0$.)

• Thank you for naming the associated numerical methods. I was unfamiliar with them and looking them up to get a better understanding will help. I was truly confused about what to do with the $\mathbf{x}(0)$ in the formulation. Whether or not I should evaluate the discretization ($\mathbf{x}_0 N_0(t)+\mathbf{x}_1 N_1(t)$) at $t=0$ for the last constant term was unclear to me. – Ron Mar 5 '15 at 7:15
• I'm currently working on the results of using the discretization $\mathbf{x}(t)=\mathbf{x}_i N_i(t)+\mathbf{x}_{i+1} N_{i+1}(t)$ for $\left[t_i,t_{i+1}\right]$ to see if what I posed was indeed true. Also, in the formulation I presented, $t$ was meant to be a terminal time, my mistake for not noting that! Once I figure it out, I'll come back here and amend what I have here/take care of the question. – Ron Mar 5 '15 at 7:16
• Also, Tonti made a mistake in 4.40, it should be noted that there is a derivative missing there. And thank you for the help! – Ron Mar 5 '15 at 7:21