Model order reduction of initial and boundary value problems (IBVP) is a particularly challenging task. In this chapter we explain some interesting concepts related mostly with solid dynamics , taken as model problem to this end.

In [41] a method was developed that takes the field of initial conditions as a parameter to develop a very efficient dynamical integrator. However, the field of initial conditions (displacement, velocity) is in fact a parameter of infinite dimension, and hence hard to parameterize adequately. In this chapter we analyze how to do it in a proper way so as to render a very fast method, amenable for real-time simulation, even under very astringent conditions. Other approaches to the problem, such as a space-time one, can be found at [18], for instance.

5.1 Taking Initial Conditions as Parameters

As mentioned before, in [41] a method is developed based on PGD that acts as a sort of black box integrator in time. Given the converged displacement and velocity field of the solid at time step t, \(\varvec{u}^t\) and \(\dot{ \varvec{u}}^t\), respectively, as parameters, the method returns the displacement and velocity fields at time \(t+\triangle t\), see Fig. 5.1.

Fig. 5.1
figure 1

Sketch of the proposed method for the integration of solid dynamics in the PGD framework. Converged displacement and velocity fields at time step t are taken as parameters, so as to provide, without the need of any matrix inversion, the displacement and velocity fields at time step \(t+\triangle t\)

Once semi-discretized in space, the displacement and velocity fields are no longer of infinite dimension, but usual engineering finite element meshes involve tens of thousands to millions of degrees of freedom. This would imply to have into account millions of parameters, something out of reach even for PGD methods.

In order to avoid this enormous number of parameters, in [41] the use of Proper Orthogonal Decomposition [43, 48, 49] methods so as to employ a minimal number of parameters is proposed. In this way, initial displacement and velocity field can be optimally parameterized with a minimal number of degrees of freedom. The price to pay is to project the results of the integration at time \(t+\triangle t\) onto the POD basis so as to be taken as parameters (initial conditions) for a subsequent integration to obtain \(\varvec{u}^{t+2\triangle t}\) and \(\dot{\varvec{u}}^{t+2\triangle t}\).

We provide details of the variational formulation in the subsequent sections.

5.2 Developing the Weak Form of the Problem

We consider the general problem of solid dynamics , in which we look for the displacement field,

$$\begin{aligned} \varvec{u}: \bar{\varOmega } \times ]0,T] \times \mathcal I \times \mathcal J \rightarrow \mathbb R^3, \end{aligned}$$

where \(\mathcal I=[\varvec{u}_0^-,\varvec{u}_0^+]\) and \(\mathcal J=[\dot{\varvec{u}}_0^-,\dot{\varvec{u}}_0^+]\) represent the considered intervals of variation of initial boundary conditions, \(\varvec{u}_0\) and \(\dot{\varvec{u}}_0\), taken as parameters. To obtain a parametric solution for any initial condition (within these intervals), it is therefore necessary to define a new (triply-) weak form:

given \(\varvec{f}\), \(\varvec{g}\), \(\varvec{h}\), \(\varvec{u}_0\) and \(\dot{\varvec{u}}_0\) find \(\varvec{u}(t)\in \mathcal S_t=\{ \varvec{u} | \varvec{u}(\varvec{x},t) = \varvec{g}(\varvec{x},t),\;\varvec{x}\in \varGamma _u,\;\varvec{u} \in \mathcal H^1(\varOmega ) \}\), \(t\in [0,T]\), such that for all \(\varvec{u}^*in \mathcal V\{ \varvec{u} | \varvec{u}(\varvec{x},t) = \varvec{0},\;\varvec{x}\in \varGamma _u,\;\varvec{u} \in \mathcal H^1(\varOmega ) \}\),

$$\begin{aligned} (\varvec{u}^*,\rho \ddot{\varvec{u}}) + a(\varvec{u}^*,\varvec{u})&= (\varvec{u}^*, \varvec{f})+(\varvec{u}^*,\varvec{h})_\varGamma \end{aligned}$$
(5.1a)
$$\begin{aligned} (\varvec{u}^*,\rho \varvec{u} (0))&= (\varvec{u}^*,\rho \varvec{u}_0)\end{aligned}$$
(5.1b)
$$\begin{aligned} (\varvec{u}^*, \rho \dot{\varvec{u}}(0))&= (\varvec{u}^*,\rho \dot{\varvec{u}}_0), \end{aligned}$$
(5.1c)

where:

$$\begin{aligned} a(\varvec{u}^*,\varvec{u})&= \int _\mathcal {I} \int _\mathcal {J} \int _\varOmega \varvec{\nabla }^s \varvec{u}^*: \varvec{\mathsf C}: \varvec{\nabla }^s \varvec{u} \;d\varOmega d\dot{\varvec{u}}_0 d\varvec{u}_0, \\ (\varvec{u}^*, \varvec{f})&= \int _\mathcal {I} \int _\mathcal {J} \int _\varOmega \varvec{u}^*\varvec{f} \;d\varOmega d\dot{\varvec{u}}_0 d\varvec{u}_0,\\ (\varvec{u}^*,\varvec{h})_\varGamma&= \int _\mathcal {I} \int _\mathcal {J} \int _{\varGamma _t} \varvec{u}^*\varvec{h} \;d\varGamma d\dot{\varvec{u}}_0 d\varvec{u}_0. \end{aligned}$$

The next step is, by means of appropriate finite-dimensional approximations to \(\mathcal S_t\) and \(\mathcal V\), \(\mathcal S_t^h\) and \(\mathcal V^h\), respectively, to semi-discretize the weak form so as to obtain the following problem:

given \(\varvec{f}\), \(\varvec{g}\), \(\varvec{h}\), \(\varvec{u}_0\) and \(\dot{\varvec{u}}_0\) find \(\varvec{u}^h(t)=\varvec{v}^h + \varvec{g}^h \in \mathcal S_t^h\) (note that \(\varvec{g}(\varvec{x},t)= \varvec{u}(\varvec{x},t)\) on \(\varGamma _u\) ) such that for every \(\varvec{u^*}^h\in \mathcal V^h\),

$$\begin{aligned} (\varvec{u^*}^h,\rho \ddot{\varvec{v}}^h) + a(\varvec{u^*}^h,\varvec{v})&= (\varvec{u^*}^h, \varvec{f})+(\varvec{u^*}^h,\varvec{h})_\varGamma -(\varvec{u^*}^h,\rho \ddot{\varvec{g}}^h) - a(\varvec{u^*}^h,\varvec{g}^h),\end{aligned}$$
(5.2a)
$$\begin{aligned} (\varvec{u^*}^h,\rho \varvec{v}^h (0))&= (\varvec{u^*}^h,\rho \varvec{u}_0)-(\varvec{u^*}^h,\rho \varvec{g}^h(0)),\end{aligned}$$
(5.2b)
$$\begin{aligned} (\varvec{u^*}^h, \rho \dot{\varvec{v}}^h(0))&= (\varvec{u^*}^h,\rho \dot{\varvec{u}}_0)-(\varvec{u^*}^h,\rho \dot{\varvec{g}}^h(0)). \end{aligned}$$
(5.2c)

This provides a sort of response surface or parametric solution (thus the name computational vademecum coined in [26]) to the problem (5.1) for any initial conditions.

If we consider direct integration in time (remember that we look for an interactive method, so that this prevents us from using a space-time approach) the sought displacement field will be approximated in a PGD framework as a finite series of separable functions ,

$$\begin{aligned} \varvec{v}^h(\varvec{x}, t, \varvec{u}_0, \dot{\varvec{u}}_0 )=\left[ \sum _{i=1}^n \varvec{F}^i(\varvec{x}) \circ \varvec{G}^i(\varvec{u}_0) \circ \varvec{H}^i( \dot{\varvec{u}}_0)\right] \circ \varvec{d}(t), \end{aligned}$$
(5.3)

where the nodal coefficients \(\varvec{d}(t)\) carry out all the time-dependency of the solution and the symbol “\(\circ \)” stands for the entry-wise Hadamard or Schur multiplication of vectors .

Functions \(\varvec{F}\), \(\varvec{G}\) and \(\varvec{H}\) will be expressed in terms of low (here, three-) dimensional finite element basis functions. As usual, these are computed by means of a greedy algorithm in which one sum is computed at a time, while one product is computed in a fixed point, alternated directions algorithm. Thus, having an approximation to \(\varvec{v}^h\) converged at iteration n, the \((n+1)\)-th term is obtained as

$$\begin{aligned} \varvec{v}^{n+1}(\varvec{x}, t, \varvec{u}_0, \dot{\varvec{u}}_0 ) = \left[ \sum _{i=1}^n \varvec{F}^i(\varvec{x}) \circ \varvec{G}^i(\varvec{u}_0) \circ \varvec{H}^i( \dot{\varvec{u}}_0) + \varvec{R}(\varvec{x})\circ \varvec{S}(\varvec{u}_0)\circ \varvec{T}( \dot{\varvec{u}}_0) \right] \circ \varvec{d}(t). \end{aligned}$$

By substituting the approximations to \(\varvec{v}^h\) and \(\varvec{w}^h\) into the weak form of the problem, Eq. (5.2), we arrive at a semi-discrete problem. One of the most salient features of this method relies in its ability of advancing in time using any time integrator existing in the literature (particularly, energy and momentum conserving schemes .) Of course, any other parametric dependence, such as the one on the position of the applied load, see Chap. 3, can be considered at the same time.

Still one ingredient of the implementation is missing. Instead of considering the whole time interval ]0, T] we look for the solution within a generic time increment \(]0,\triangle t]\):

$$\begin{aligned} \varvec{v}: \bar{\varOmega } \times ]0, \triangle t] \times \mathcal I \times \mathcal J\times [h^-,h^+] \rightarrow \mathbb R^3, \end{aligned}$$

where \(\triangle t\) represents the necessary time to response prescribed by the particular envisaged application. For instance, for haptic feedback applications, a physically realistic sensation of touch needs for some 500 Hz to 1 kHz feedback rate. This implies to take \(\triangle t\) on the order of 0.001 seconds. This value \(\triangle t\) could be smaller or greater than the necessary time step amplitude needed for stability of the chosen time integrator.

5.3 Matrix Form of the Problem

5.3.1 Time Integration of the Equations of Motion

As usual, we start from the weak form of the solid dynamic equations, Eq. (5.1), i.e., finding the displacement \(\varvec{u}\in \mathcal H^1\) such that for all \(\varvec{u}^*\in \mathcal H^1_0\):

$$\begin{aligned} \int _\varOmega \varvec{u}^* \rho \varvec{\ddot{u}} d\varOmega + \int _\varOmega \varvec{\nabla }_s \varvec{u}^*: \mathbf { \mathsf {C} } : \varvec{\nabla }_s \varvec{u} d\varOmega =\int _{\varGamma _{t2}} \varvec{u}^*\cdot \varvec{t} d\varGamma . \end{aligned}$$
(5.4)

Once semi-discretized in space, we can identify a term where a mass matrix appears,

$$\varvec{M_m}=\int _\varOmega \varvec{u^*}^h \rho \varvec{\ddot{u}}^h d\varOmega , $$

and a term usually identified as the stiffness matrix

$$ \varvec{K_m}=\int _\varOmega \varvec{\nabla }_s \varvec{u^*}^h: \mathbf { \mathsf {C} }: \varvec{\nabla }_s \varvec{u}^h d\varOmega . $$

In the sequel we omit, if no risk of confusion exists, the superscript h, so that all vectors represent the set of nodal unknowns for the problem. For the integration in time of these equations we have several options. In general you can employ your favorite integration scheme. Here we are considering, both for its simplicity and good results, an energy-momentum conserving scheme developed in [15]. This scheme has two sub-steps which compute a predictor of the displacement vector at time step \(u_{t+(\triangle t/2)}\) in the first one and subsequently a correction \(u_{t+\triangle t}\) in the second sub-step.

The first sub-step has the following form:

$$\begin{aligned} \varvec{M_m} \varvec{\ddot{u}}_{t+(\triangle t/2)} + \varvec{K_m} \varvec{u}_{t+(\triangle t/2)} = \varvec{F}_{t+(\triangle t/2)}. \end{aligned}$$

Employing classical finite difference approaches for the time derivatives,

$$\begin{aligned} \varvec{\ddot{u}}_{t+(\triangle t/2)} = \frac{\varvec{\dot{u}}_{t+(\triangle t/2)} - \varvec{\dot{u}}_t}{\varDelta t /4} - \varvec{\ddot{u}}_t, \end{aligned}$$
$$\begin{aligned} \varvec{\dot{u}}_{t+(\triangle t/2)} = \frac{\varvec{u}_{t+(\triangle t/2)} - \varvec{u}_t}{\varDelta t /4} - \varvec{\dot{u}}_t. \end{aligned}$$

Applying these expressions to the first sub-step, after some simple algebra, we obtain the final expression for the sub-step 1:

$$\begin{aligned} \left[ \left[ \frac{16}{\triangle t^2} \right] \varvec{M_m} + \varvec{K_m} \right] \cdot \varvec{u}_{t+(\triangle t/2)} = \varvec{F}_{t+(\triangle t/2)} + \left[ \frac{16}{\triangle t^2} \right] \varvec{M_m} \cdot \varvec{u}_t + \left[ \frac{8}{\triangle t} \right] \varvec{M_m} \cdot \varvec{\dot{u}}_t + \varvec{M_m}\cdot \varvec{\ddot{u}}_t. \end{aligned}$$
(5.5)

The second sub-step has the following form:

$$\begin{aligned} \varvec{M_m} \varvec{\ddot{u}}_{t+\triangle t} + \varvec{K_m} \varvec{u}_{t+\triangle t} = \varvec{F}_{t+\triangle t}. \end{aligned}$$

Again, by employing classical finite differences for the time derivatives,

$$\begin{aligned} \varvec{ \ddot{u}}_{t+\triangle t} = \frac{\varvec{\dot{u}}_{t}}{\triangle t} - \left[ \frac{4}{\triangle t} \right] \varvec{\dot{u}}_{t+(\triangle t/2)} + \left[ \frac{3}{\triangle t} \right] \varvec{\dot{u}}_{t+\triangle t}, \end{aligned}$$
$$\begin{aligned} \varvec{\dot{u}}_{t+\triangle t} = \frac{\varvec{u}_{t}}{\triangle t} - \left[ \frac{4}{\triangle t} \right] \varvec{u}_{t+(\triangle t/2)} + \left[ \frac{3}{\triangle t} \right] \varvec{u}_{t+\triangle t}. \end{aligned}$$

By substituting these expressions in the second sub-step, the final formula for the sub-step 2 that the reader can find in the code included in Sect. 5.4 is:

$$\begin{aligned} \left[ \left[ \frac{9}{\triangle t^2} \right] \varvec{M_m} + \varvec{K_m} \right] \cdot \varvec{u}_{t+\triangle t} = \varvec{F}_{t+\triangle t} - \left[ \frac{19}{\triangle t^2} \right] \varvec{M_m} \cdot \varvec{u}_t - \left[ \frac{5}{\triangle t} \right] \varvec{M_m} \cdot \varvec{\dot{u}}_t + \left[ \frac{28}{\triangle t^2} \right] \varvec{M_m}\cdot u_{t+(\triangle t/2)}. \end{aligned}$$
(5.6)

The strategy depicted in the previous section, when applied to the just explained time integration scheme, implies the construction of a PGD time integrator able to provide the value of \(\varvec{u}_{t+\triangle t}\) for any value of \(\varvec{u}_t\). In that framework, \(\varvec{u}_t\) acts in fact as a parameter. But recall that \(\varvec{u}_t\) represents the vector of nodal displacements at time step t. Therefore, it can consist of several millions of degrees of freedom, something our of reach even for PGD strategies!

In order to develop a suitable strategy, it is therefore of utmost importance to adequately parameterize the field of initial displacements at the beginning of the time step. In [41] this is done by employing a reduced-order basis instead of the traditional finite element one. And to do it by means of Proper Orthogonal Decompositions . This is explained in detail in what follows.

5.3.2 Computing a Reduced-Order Basis for the Field of Initial Conditions

For the sake of completeness, we briefly review here the basics of the POD technique for the computation of a reduced-order basis for the initial displacement field of the problem. Let us first assume that we have a collection of snapshots , i.e., finite element results for problems similar to the one at hand. By similar we mean results probably for the same solid, but possibly under different conditions, applied loads, boundary conditions, ... We then store these snapshots column-wise in a matrix \(\varvec{Q}\) (more details can be found, for instance, in [54]). The next step is the computation of the so-called auto-correlation matrix,

$$\begin{aligned} \varvec{c} = \varvec{Q}\ \varvec{Q}^T. \end{aligned}$$
(5.7)

It can then be demonstrated that the best possible basis (that capturing the most of the energy of the system with the minimal number of degrees of freedom) is formed by the eigenvectors \(\varvec{\phi }\) of the problem

$$ \varvec{c} \ \varvec{\phi }=\alpha \varvec{\phi }. $$

By storing the nodal values (we assume to have N nodes in the mesh of the model) of the eigenvectors with the m biggest eigenvalues in a matrix

we can therefore project the initial system of equations onto a reduced-order one by simply doing the change of variable

$$\begin{aligned} \varvec{u}_{t} \approx \sum _{i=1}^{i=\mathtt{nrb}} \zeta ^i_{t} \ \varvec{\phi }^i \ = \ \varvec{B} \ \varvec{\zeta }_{t}, \end{aligned}$$

so that we will finally face a system of 3m equations for \(\varvec{\zeta }_t\) instead of the original 3N for \(\varvec{u}_t\). The advantage of this strategy is that usually the number of reduced basis, \(\mathtt{rnb} \ll N\) and therefore the resulting system of equations is generally much smaller.

5.3.3 Projection of the Equations onto a Reduced, Parametric Basis

For each sub-step within the time integration scheme we compute the PGD approximation to the solution \(\varvec{u}_{t+(\triangle t/2)}\) and \(\varvec{u}_{t+\triangle t}\) such that,

$$\begin{aligned}&\varvec{u}_{t+(\triangle t/2)}( \varvec{x},\varvec{\zeta }_t, \varvec{\dot{\zeta }}_t,\varvec{\ddot{\zeta }}_t, p_a, \varvec{s}) \nonumber \\&\qquad \,\,\, = \sum _{i=1}^n \varvec{N}^T(\varvec{x}) \varvec{F}_{\varvec{x}}^i \cdot \varvec{N}^T(\varvec{\zeta }_t) \varvec{F}_{\varvec{\zeta }_t}^i \cdot \varvec{N}^T(\varvec{\dot{\zeta }}_t) \varvec{F}_{\varvec{\dot{\zeta }}_t}^i \cdot \varvec{N}^T(\varvec{\ddot{\zeta }}_t) \varvec{F}_{\varvec{\ddot{\zeta }}_t}^i \cdot \varvec{N}^T(p_a) \varvec{F}_{p_a}^i \cdot \varvec{N}^T(\varvec{s}) \varvec{F}_{\varvec{s}}^i \end{aligned}$$
(5.8)
$$\begin{aligned}&\varvec{u}_{t+\triangle t}( \varvec{x},\varvec{\zeta }_t, \varvec{\dot{\zeta }}_t,\varvec{\zeta }_{t+(\triangle t/2)}, p_a, \varvec{s}) \nonumber \\&= \sum _{i=1}^n \varvec{N}^T(\varvec{x}) \varvec{F}_{\varvec{x}}^i \cdot \varvec{N}^T(\varvec{\zeta }_t) \varvec{F}_{\varvec{\zeta }_t}^i \cdot \varvec{N}^T(\varvec{\dot{\zeta }}_t) \varvec{F}_{\varvec{\dot{\zeta }}_t}^i \cdot \varvec{N}^T(\varvec{\zeta }_{t+(\triangle t/2)}) \varvec{F}_{\varvec{\zeta }_{t+(\triangle t/2)}}^i \cdot \varvec{N}^T(p_a) \varvec{F}_{p_a}^i \cdot \varvec{N}^T(\varvec{s}) \varvec{F}_{\varvec{s}}^i \end{aligned}$$
(5.9)

where \(\varvec{x}\) represents the physical space, \(\varvec{u}_t\) is the vector of displacement degrees of freedom at time step t, \(\varvec{\dot{u}}_n\) is the vector of velocity degrees of freedom at time step t, \(\varvec{\ddot{u}}_n\) is the vector of nodal accelerations at time step t, \(\varvec{u}_{t+(\triangle t/2)}\) is the vector of nodal displacements at time step \(t+(\triangle t/2)\), \(p_a\) is the classical loading parameter, its value varying continuously in the interval [0, 1]. It allows us to apply or not a load at a particular time step or to apply a ramp load, for instance. Finally, \(\varvec{s}\) represents the position of the load, as in Chap. 3.

We denote, as in the rest of the book, by \(\varvec{N}(\varvec{\cdot })\) the vector of finite element shape functions employed to discretize the different dimensions of the problem. Note that we are considering a solution depending on the physical space \(\varvec{x}\) plus a number of parameters \(\varvec{\zeta }=[\zeta _1, \zeta _2, \ldots , \zeta _m]\), which in this case coincide with the chosen POD degrees of freedom parameterizing the fields of initial displacements and velocities. Taking also into account that the density parameter \(\rho \) and the symmetric gradients \(\varvec{\nabla }_s\) in Eq. (5.1) depend solely on space coordinates, we can write the mass matrix , and the stiffness matrix of the problem in separated form as

$$\begin{aligned} \varvec{M_m} =&\left[ \int _{\varOmega _{\varvec{x}}} \varvec{N}^T(\varvec{x}) \rho \varvec{N}(\varvec{x}) d{\varOmega _{\varvec{x}}} \right] \cdot \left[ \int _{\varOmega _{\zeta _1}} \varvec{N}^T(\zeta _1) \varvec{N}(\zeta _1) d{\varOmega _{\zeta _1}} \right] \cdot \ldots \\&\quad \cdot \left[ \int _{\varOmega _{\zeta _m}} \varvec{N}^T(\zeta _m) \varvec{N}(\zeta _m) d{\varOmega _{\zeta _m}} \right] \cdot \left[ \int _{\varOmega _{p_a}} \varvec{N}^T(p_a) \varvec{N}(p_a) d{\varOmega _{p_a}} \right] \cdot \left[ \int _{\varOmega _{\varvec{s}}} \varvec{N}^T(\varvec{s}) \varvec{N}(\varvec{s}) d{\varOmega _{\varvec{s}}} \right] , \end{aligned}$$
$$\begin{aligned} \varvec{K_m} =&\left[ \int _{\varOmega _{\varvec{x}}} \varvec{\nabla }_s \varvec{N}^T(\varvec{x}) \mathbf {C} \varvec{\nabla }_s \varvec{N}(\varvec{x}) d{\varOmega _{\varvec{x}}} \right] \cdot \left[ \int _{\varOmega _{\zeta _1}} \varvec{N}^T(\zeta _1) \varvec{N}(\zeta _1) d{\varOmega _{\zeta _1}} \right] \cdot \ldots \\&\qquad \cdot \left[ \int _{\varOmega _{\zeta _m}} \varvec{N}^T(\zeta _m) \varvec{N}(\zeta _m) d{\varOmega _{\zeta _m}} \right] \left[ \int _{\varOmega _{p_a}} \varvec{N}^T(p_a) \varvec{N}(p_a) d{\varOmega _{p_a}} \right] \cdot \left[ \int _{\varOmega _{\varvec{s}}} \varvec{N}^T(\varvec{s}) \varvec{N}(\varvec{s}) d{\varOmega _{\varvec{s}}} \right] . \end{aligned}$$

The influence on the solution of the number of parameters m (terms in the POD basis of the initial conditions) chosen to parameterize the fields of initial conditions was deeply analyzed in [41].

The PGD final solution uses the PGD solutions for each sub-step, Eqs. (5.5) and (5.6). Starting from \(\varvec{u}_0\), \(\varvec{\dot{u}}_0\) and \(\varvec{\ddot{u}}_0\) (in fact, their projection onto the POD basis!), by using the first sub-step vademecum we obtain \(\varvec{u}_{0+1/2}\). These values are then introduced in second sub-step vademecum which in turn uses as input parameters \(\varvec{u}_0\), \(\varvec{\dot{u}}_0\) and \(\varvec{u}_{0+1/2}\) (computed in the first sub-step). The value returned by the second vademecum is \(\varvec{u}_1\). We then change the time step, and apply the new input parameters \(\varvec{u}_1\), \(\varvec{\dot{u}}_1\) and \(\varvec{\ddot{u}}_1\) in the first vademecum to obtain \(\varvec{u}_{1+1/2}\). Again, by using \(\varvec{u}_1\), \(\varvec{\dot{u}}_1\) and \(\varvec{u}_{1+1/2}\) we obtain \(\varvec{u}_2\) by using the second vademecum. This procedure is repeated for each time step of the simulation. This loop indeed runs under very astringent real time constraints, such as those of a realistic rendering.

As in previous examples, we assume for simplicity of the exposition, that the load is of unity module and acts along the vertical axis: \(\varvec{t}=\varvec{e}_k \cdot \delta (\varvec{x}-\varvec{s})\), where \(\delta \) represents the Dirac-delta function and \(\varvec{e}_k\) the unit vector along the z-coordinate axis on the top of the domain. A more general setting would need for new parameters, i.e., the components of the load vector, for instance, but it is perfectly possible in the same framework here explained.

Regarding the matrix structure of the problems given by Eqs. (5.5) and (5.6), in both of them the force vector applied at each time step, \(\varvec{F}_{n+1/2}\) and \(\varvec{F}_{n+1}\) appears. Like in the parametric problem in Chap. 3, we must consider the load in a separated form , i.e. a separated sum of products of separated functions,

$$\begin{aligned} f_{n+1/2}( \varvec{x},\varvec{\zeta }_n, \varvec{\dot{\zeta }}_n,\varvec{\ddot{\zeta }}_n, p_a, \varvec{s}) = \sum _{j=1}^m \varvec{f}_{\varvec{x}}^j \cdot \varvec{f}_{\varvec{\zeta }_n}^j \cdot \varvec{f}_{\varvec{\dot{\zeta }}_n}^j \cdot \varvec{f}_{\varvec{\ddot{\zeta }}_n}^j \cdot \varvec{f}_{p_c}^j \cdot \varvec{f}_{\varvec{s}}^j. \end{aligned}$$
(5.10)

A simple way to obtain such a decomposition is to consider as many terms j as possible nodal load locations, and to set \(\varvec{f}_{\varvec{x}}^j\), as the force modulus (here, unity). In turn, \(\varvec{f}_{p_c}^j = [0\; 1]^T\) for each j, \(\varvec{f}_{\varvec{s}}^j = \varvec{I}\) (the identity matrix) and the rest of vectors \( \varvec{f}_{\varvec{\zeta }_n}^j ,\; \varvec{f}_{\varvec{\dot{\zeta }}_n}^j,\; \varvec{f}_{\varvec{\ddot{\zeta }}_n}^j = \varvec{ 1}\), that is, the ones instruction in Matlab, a vector composed by ones in every entry. We proceed analogously for the force vector \(\varvec{f}_{n+1}\) in the second substep of the time integrator scheme.

In order to completely define the right-hand side vector, let us see how to compute the others terms in Eqs. (5.5) and (5.6). In these formulae, we find terms defined as a constant value multiplying the mass matrix \(\varvec{M_m}\) and multiplying \(\varvec{\zeta }_n, \varvec{\dot{\zeta }}_n,\varvec{\ddot{\zeta }}_n\) and \(\varvec{u}_{n+1}\). These vectorial parameters should be considered in separated form, so as to have the following form,

$$\begin{aligned}&\varvec{\zeta }_n = \varvec{\bar{ {1}}}_{\varvec{x}}\cdot \begin{bmatrix}\zeta ^{min}_n&\ldots&\zeta ^{max}_n \end{bmatrix}^T \cdot \varvec{ {1}}_{\varvec{\dot{\zeta }}_n} \cdot \varvec{ {1}}_{\varvec{\ddot{\zeta }}_n} \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \nonumber \\&\varvec{\dot{\zeta }}_n = \varvec{\bar{ {1}}}_{\varvec{x}} \cdot \varvec{ {1}}_{\varvec{\zeta }_n} \cdot \begin{bmatrix} \dot{\zeta }^{min}_n&\ldots&\dot{\zeta }^{max}_n\end{bmatrix}^T \cdot \varvec{ {1}}_{\varvec{\ddot{\zeta }}_n} \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \nonumber \\&\varvec{\ddot{\zeta }}_n = \varvec{\bar{ {1}}}_{\varvec{x}} \cdot \varvec{ {1}}_{\varvec{\zeta }_n} \cdot \varvec{ {1}}_{\varvec{\dot{\zeta }}_n} \cdot \begin{bmatrix}\ddot{\zeta }^{min}_n&\ldots&\ddot{\zeta }^{max}_n \end{bmatrix}^T \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \nonumber \\&\varvec{\zeta }_{n+1/2} = \varvec{\bar{ {1}}}_{\varvec{x}} \cdot \varvec{ {1}}_{\varvec{\zeta }_n} \cdot \varvec{ {1}}_{\varvec{\dot{\zeta }}_n} \cdot \begin{bmatrix}\zeta ^{min}_{n+1/2}&\ldots&\zeta ^{max}_{n+1/2}\end{bmatrix}^T \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \end{aligned}$$

where vector \(\varvec{\bar{{1}}}_{\varvec{x}}\) refers to the ones vector in space direction that satisfies essential boundary conditions or, equivalently, the ones vector in which entries related to nodes pertaining to the essential boundary have been replaced by zeros.

In the code reproduced below, these values of the RHS vector are computed for each reduced basis \(\mathtt{nrb}\) and at each substep, and are saved in the \(\varvec{FR1}\) and \(\varvec{FR2}\) vectors. So for substep 1,

$$\begin{aligned}&\varvec{FR1}_1^j = \varvec{\bar{ {1}}}_{\varvec{x}}\cdot \begin{bmatrix}\zeta ^{min}_n&\ldots&\zeta ^{max}_n\end{bmatrix}^T \cdot \varvec{ {1}}_{\varvec{\dot{\zeta }}_n} \cdot \varvec{ {1}}_{\varvec{\ddot{\zeta }}_n} \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \nonumber \\&\varvec{FR1}_2^j = \varvec{\bar{ {1}}}_{\varvec{x}} \cdot \varvec{ {1}}_{\varvec{\zeta }_n} \cdot \begin{bmatrix}\dot{\zeta }^{min}_n&\ldots&\dot{\zeta }^{max}_n\end{bmatrix}^T \cdot \varvec{ {1}}_{\varvec{\ddot{\zeta }}_n} \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \nonumber \\&\varvec{FR1}_3^j = \varvec{\bar{ {1}}}_{\varvec{x}} \cdot \varvec{ {1}}_{\varvec{\zeta }_n} \cdot \varvec{ {1}}_{\varvec{\dot{\zeta }}_n} \cdot \begin{bmatrix}\ddot{\zeta }^{min}_n&\ldots&\ddot{\zeta }^{max}_n\end{bmatrix}^T \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \nonumber \end{aligned}$$

where \(j=1, \ldots , \mathtt{nrb}\) refers to the number in the set of reduced basis.

Equivalently, in substep 2,

$$\begin{aligned}&\varvec{FR2}_1^j = \varvec{\bar{ {1}}}_{\varvec{x}}\cdot \begin{bmatrix}\zeta ^{min}_n&\ldots&\zeta ^{max}_n\end{bmatrix}^T \cdot \varvec{ {1}}_{\varvec{\dot{\zeta }}_n} \cdot \varvec{ {1}}_{\varvec{\ddot{\zeta }}_n} \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \nonumber \\ {}&\varvec{FR2}_2^j = \varvec{\bar{ {1}}}_{\varvec{x}} \cdot \varvec{ {1}}_{\varvec{\zeta }_n} \cdot \begin{bmatrix}\dot{\zeta }^{min}_n&\ldots&\dot{\zeta }^{max}_n\end{bmatrix}^T \cdot \varvec{ {1}}_{\varvec{\ddot{\zeta }}_n} \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \nonumber \\ {}&\varvec{FR2}_3^j = \varvec{\bar{ {1}}}_{\varvec{x}} \cdot \varvec{ {1}}_{\varvec{\zeta }_n} \cdot \varvec{ {1}}_{\varvec{\dot{\zeta }}_n} \cdot \begin{bmatrix} \zeta ^{min}_n&\ldots&\zeta ^{max}_n\end{bmatrix}^T \cdot \varvec{ {1}}_{p_c} \cdot \varvec{ {1}}_{\varvec{s}}, \end{aligned}$$

where j refers to the number of reduced basis. We use the same discretization rationale for \(\varvec{u}_n\) and \(\varvec{u}_{n+1/2}\).

To solve both substeps so as to generate the multi-parametric solution, we employ a greedy algorithm, using a fixed-point strategy, so as to compute the new terms in the sum, represented by Eqs. (5.8) and (5.9). If, within the enrichment loop, the solution is not accurate enough, the already computed approximation is improved by adding a new separated term

$$\begin{aligned} \varvec{u}_{n+1/2} = \sum _{i=1}^N \prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{N}^T(\text {var j}) \varvec{F1}_{\text {var j}}^i + \prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{N}^T(\text {var j}) \varvec{R}_{\text {var j}}^i, \end{aligned}$$
(5.11)

where N is the number of terms already for the PGD solution. This Eq. (5.11) is analogous for substep 2, with just changing \(\varvec{u}_{n+1/2}\) by \(\varvec{u}_{n+1}\), and \(\varvec{F1}_{\text {var j}}^i\) by \(\varvec{F2}_{\text {var j}}^i\).

Finally, Eq. (5.5) is solved in the code written below using the following notation:

$$\begin{aligned}&\prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{R}_j^* \left[ \left[ \frac{16}{\varDelta t^2} \right] \varvec{M_m} + \varvec{K_m} \right] \prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{R}_j \nonumber \\&\qquad = \prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{R}_j^* \cdot \left[ \varvec{F}_{n+1/2} + \left[ \frac{16}{\varDelta t^2} \right] \varvec{M_m} \cdot \varvec{FR1_1} + \left[ \frac{8}{\varDelta t} \right] \varvec{M_m} \cdot \varvec{FR1_2} + \varvec{M_m}\cdot \varvec{FR1_3} \right. \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad - \left. \sum _{i=1}^N \left[ \left[ \frac{16}{\varDelta t^2} \right] \varvec{M_m} + \varvec{K_m} \right] \prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{F1}_j^i \right] \end{aligned}$$
(5.12)

where \(\prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{R}_j^*\) represents the weight function, that within the fixed-point strategy takes a different form depending on the particular iteration. Thus if, for instance, we are computing along the k-th coordinate, assuming the others directions to be known, we have

$$\begin{aligned} \prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{R}_j^* = \prod _{j=1, j \ne k}^{3+3*\mathtt{nrb}} \varvec{R}_j \cdot \varvec{R}_k^*. \end{aligned}$$
(5.13)

These variables can be readily identified in the routine enrichment_substep1 by taking into account the following notation,

$$\begin{aligned}&\mathtt{matrix1} = \left[ \frac{16}{\varDelta t^2} \right] \varvec{M_m}, \\&\mathtt{matrix2} = \varvec{K_m}, \\&\varvec{V} = \varvec{F}_{n+1/2}, \\&\mathtt{value1} = \left[ \frac{16}{\varDelta t^2} \right] \varvec{M_m} \cdot \varvec{FR1_1}, \\&\mathtt{value2} = \left[ \frac{8}{\varDelta t} \right] \varvec{M_m} \cdot \varvec{FR1_2}, \\&\mathtt{value3} = \varvec{M_m}\cdot \varvec{FR1_3}, \\&\varvec{FV} = \varvec{F1}. \end{aligned}$$

For Eq. (5.6), the implemented routine enrichment_substep2 computes

$$\begin{aligned}&\prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{R}_j^* \left[ \left[ \frac{9}{\varDelta t^2} \right] \varvec{M_m} + \varvec{K_m} \right] \prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{R}_j \nonumber \\&\quad = \prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{R}_j^* \cdot \left[ \varvec{F}_{n+1} - \left[ \frac{19}{\varDelta t^2} \right] \varvec{M_m} \cdot \varvec{FR2_1} - \left[ \frac{5}{\varDelta t} \right] \varvec{M_m} \cdot \varvec{FR2_2} + \left[ \frac{28}{\varDelta t^2} \right] \varvec{M_m}\cdot \varvec{FR2_3} \right. \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \quad - \left. \sum _{i=1}^N \left[ \left[ \frac{16}{\varDelta t^2} \right] \varvec{M_m} + \varvec{K_m} \right] \prod _{j=1}^{3+3*\mathtt{nrb}} \varvec{F1}_j^i \right] . \end{aligned}$$

In turn, \(\prod _{j=1}^{3+3*nrb} \varvec{R}_j^*\) is defined in Eq. (5.13). The variables can be identified as,

$$\begin{aligned}&\mathtt{matrix1} = \left[ \frac{9}{\varDelta t^2} \right] \varvec{M_m}, \\&\mathtt{matrix2} = \varvec{K_m}, \\&\varvec{V} = \varvec{F}_{n+1},\\&\mathtt{value1} = \left[ \frac{19}{\varDelta t^2} \right] \varvec{M_m} \cdot \varvec{FR2_1}, \\&\mathtt{value2} = \left[ \frac{5}{\varDelta t} \right] \varvec{M_m} \cdot \varvec{FR2_2}, \\&\mathtt{value3} = \left[ \frac{28}{\varDelta t^2} \right] \varvec{M_m}\cdot \varvec{FR2_3}, \\&\varvec{FV} = \varvec{F2}. \end{aligned}$$

In next section the detailed code implmenting this strategy is provided.

5.4 Matlab Code

As always, the code begins by the main.m file, which is reproduced below. In this case, a series of previous simulations are needed so as to construct the POD basis referred to in Eq. (5.7). These simulations were carried out by us with the help of the commercial software Abaqus, although the reader can use his or her preferred code to do it. Once these simulations are done, and the POD modes computed, they are stored in memory by means of the instruction WS = load(’WorkSpaceBeam_REF.mat’,’Vreal’);, see below.

The quality of the final results will obviously depend on the similarity of this POD basis to the problem being simulated. In general, our experience indicates that with good basis, the number of POD modes necessary for a good energy conservation (i.e., avoidance of numerical dissipation) tends to be on the order of 6–8 modes.

figure a
figure b
figure c
figure d
figure e

This just presented code reads nodal coordinates and connectivity list from files gcoordBeam.dat and conecBeam.dat, respectively. If, after the execution of the program, one types

>> trisurf(tri,coors(:,1),coors(:,2),coors(:,3));

>> axis equal

in Matlab’s command line , a plot of the finite element model of the beam is obtained, see Fig. 5.2.

Fig. 5.2
figure 2

Finite element mesh for the beam dynamics problem. The beam is assumed to be encastred at \(y=0\)

As in previous examples, the code calls to the subroutine elemstiff.m, which is reproduced below.

figure f

Our particular implementation of the method makes use of the energy and momentum conserving algorithm by Bathe [15]. This algorithm makes use of a predictor-corrector algorithm, whose first sub-step is included in routine enrichment_substep1, reproduced here:

figure g

In turn, we reproduce here the second sub-step of the time integration algorithm proposed by Bathe [15]. Remember that you can use in this framework your favorite time integration scheme (Newmark, HHT, ...)

figure h

In subroutine fem3D.m we accomplish traditional FE computations regarding stiffness matrix, etc., for linear tetrahedrons.

figure i

Function evaluate_shpfunc.m computes finite element one-dimensional shape functions.

figure j
Fig. 5.3
figure 3

Results of the vibration of a beam (top) and detail of the reference solution versus the approximated one (bottom)

This same code has been employed, for instance, to generate an interactive web page that makes use very efficiently of the PGD concepts. It can be found at http://amb.unizar.es/beamdyn.htm. It represents, see Fig. 5.4, a linear elastic beam that can be interactively manipulated with the aid of the mouse. It places a vertical, unitary load on the upper surface of the beam. It can be noticed how the very efficient time integration algorithms employed for its construction make it possible to remain vibrating for very long times with minimal numerical dissipation.

Fig. 5.4
figure 4

Web implementation of the algorithm here described so as construct an interactive simulator. It represents a linear elastic beam. With the help of the mouse a vertical load is placed on the upper surface of the beam. It can be downloaded from http://amb.unizar.es/beamdyn.htm

Execution of the program produces a window with the tip displacement, see Fig. 5.3. Minimal deviation with respecto to the full-order problem solution is obtained. In any case, higher accuracy can be obtained by employing more POD modes, for instance.