## 6 Numerical Methods and Algorithms
### Models at the Macro-Scale
#### 6.1.1 Discretization in the Space-Time Domain
Indeed, each global grid node is shared by different finite elements which all contribute to the solution of the unknown values \(\bar{s}c\) on the involved nodes. Let us denote with  
\[\left\{\bar{s}x_{I}\right\}_{I=1,\ldots,N_{nodes}}\]  
the set of such global grid nodes; then, a transformation \(\tau(i,e)\) exists that \"_maps_\" the \"_local_\" index \(i\) of the \(i\)-th node of the element \(e\) into the \"_global_\" index \(I\) of the same node (see Figure 8c). Thanks to the validity of the \"_superposition_\" property in FEM context due to the linear nature of the problem, for the global matrix \(\bar{s}M\) and the global vector \(\bar{s}f\), the following equalities are valid:  
\[\bar{s}M_{IJ} = \sum\
olimits_{e=1}^{N_{nodes}}\left(\sum\limits_{ \begin{subarray} {c}i:\\ j:\end{subarray} } \begin{subarray}{c}\tau(i\varepsilon)=I\\ \tau(j\varepsilon)=I\end{subarray} } \begin{subarray}{c}\epsilon M_{ij}\\ \end{subarray} \right) \tag{93}\] \[\bar{s}f_{I} = \sum\
olimits_{e=1}^{N_{nodes}}\left(\sum\limits_{ \begin{subarray} {c}i:\\ \tau(i\varepsilon)=I\end{subarray} } \begin{subarray}{c}\tau(i\varepsilon)=I \\ \end{subarray} \begin{array}{c}\epsilon f_{i}\end{subarray}\right) \tag{94}\]  
If \(u\) is a function defined both in space and time and the linear differential operator \(L(u)\) has the following form:  
\[L(u(x))=\frac{\partial u}{\partial t}+E(u(x)), \tag{95}\]  
where \(E(u(x))\) does not contain terms with differentiation with respect to the time variable \(t\), then Equation (92) can be rewritten as:  
\[\bar{s}\bar{M}^{\bar{s}}\dot{\mathbf{u}}+\bar{s}\bar{R}(\bar{s}\mathbf{u})^{\bar{s}} \mathbf{u}=\bar{s}f, \tag{96}\]  
where \(\mathbf{u}\) is a vector of the values assumed by the approximation \(u^{h}\) in all the nodal points of the finite elements mesh and where the symbol \(\dot{u}\) denotes the partial derivative of the function \(u\) respect to time \(t\): \(\dot{u}=\frac{\partial u}{\partial t}\). The nonlinear Equation (96) represents an approximation to the original system of partial differential equations, which is discrete in space and continuous in time. See [131; 132; 133; 134] for applications of FEM to some viscoelastic problems. See [135; 136; 125] for details about the Finite Element Method, including those details related to how the integrals used by these methods are computed. **Finite Differences**[127] The basic idea of FDM is to compute an approximation \(u^{h}\) of the solution \(u\) of (86) by mean an approximation of all the differential operators defining \(L(u(x))\). As for FEM, the major steps in the finite element formulation and analysis of a typical problem are:  
1. Discretization of the space domain into a set of nodes \(\left\{x_{I}=\left[x_{1}^{I},\ldots,x_{n}^{I}\right]\right\}_{I=1,\ldots,N_{ nodes}}\). This is accomplished by subdividing the given domain \(\bar{\Omega}=\Omega\cup\Gamma\) by mean of a grid of nodes which represent the finite difference mesh (see Figure 9a). 2. Construction of approximation statements, based on a finite difference, for all the differential operators present in \(L(u(x))\). Thanks to the use of Taylor expansion, the validity of the following relations can be demonstrated [137]: \[\frac{\partial^{n}u}{\partial x_{i}^{n}}(x) =\frac{i\Delta_{h}^{n}[u](x)}{h^{n}}+O(h)\] \[=\frac{i\
abla_{h}^{n}[u](x)}{h^{n}}+O(h)\] \[=\frac{i\kappa_{h}^{n}[u](x)}{h^{n}}+O\Big{(}h^{2}\Big{)},\] (97)where \({}_{i}\Delta_{h}^{n}[u](x)\), \({}_{i}\
abla_{h}^{n}[u](x)\) and \({}_{i}\kappa_{h}^{n}[u](x)\) are, respectively, named the \(n\)-th order forward, backward, and central differences with respect to \(x_{i}\) and are given by, respectively,  
_Forward difference_  
\[{}_{i}\Delta_{h}^{n}[u](x)=\sum_{j=0}^{n}{(-1)^{n-j}\left( \begin{array}{c}n\\ j\end{array} \right)}u\left(x+jh\delta_{j}\right) \tag{98}\]  
_Backward difference_  
\[{}_{i}\
abla_{h}^{n}[u](x)=\sum_{j=0}^{n}{(-1)^{j}\left( \begin{array}{c}n\\ j\end{array} \right)}u\left(x-jh\delta_{j}\right) \tag{99}\]  
_Central difference_  
\[{}_{i}\kappa_{h}^{n}[u](x)=\sum_{j=0}^{n}{(-1)^{j}\left(