1 Introduction

Bayesian inversion has been used in different applied and engineering problems to identify specific material parameters that either cannot be measured with usual techniques, or for which significant experimental efforts are needed to provide a reasonable estimation. In mechanical systems, the uncertainty arises from the spatial fluctuation (varying properties within space), uncertainty in the dimensional measurements, model structural errors, or misalignment of the specimen or measurement device [1]. Therefore, considering the effect of uncertainties is crucial for having a reliable model.

Markov chain Monte Carlo (MCMC) methods are among the most effective sampling techniques for obtaining knowledge and estimating posterior densities in Bayesian inversion. These methods are effective since they can be implemented easily for different scientific and engineering problems [2]. However, traditional methods are computationally inefficient in high-dimensional parameter spaces. There are effective improvements to enhance MCMC convergence to the target density. An efficient remedy is the adaptation of the proposal, which can be done locally and globally [3, 4]. In this work, we introduce some common MCMC techniques and discuss their computational features. Then, they will be used to identify the unknown material parameters in different mechanical problems.

In computational mechanics, a Bayesian framework, employing the Metropolis–Hastings algorithm was introduced in [5] to accurately capture the mechanical behavior of solids. In the context of continuum thermodynamics, a fundamental study for model calibration in solid mechanics was given in [6]. The MCMC based on the Metropolis–Hastings algorithm has been employed to facilitate the Bayesian system identification of a nonlinear dynamical system from experimentally observed acceleration time histories [7]. The delayed acceptance Metropolis–Hastings has been used in geomechanics [8, 9] to estimate the posterior density, where the forward model describes the flow in porous media with or without fractures as well as coupled hydro-mechanical processes. The Bayesian parameter identification of viscoplastic-damaging models was designed in [10] by developing a polynomial chaos expansion version of Kalman filter. This has been further evaluated with a CT-test and by considering the model error [11]. Subsequently, different Bayesian inversion models including Transitional Markov Chain Monte Carlo method and Gauss-Markov Kalman filter approach were used to compare and identify the material parameters of viscoplastic damaging materials [12]. An overview on Bayesian inversion in solid mechanics to incorporate several uncertainty sources in the model problem is provided in [1].

In this work, strong emphasis is put on identifying the material parameters involved in fracture problems based on the phase-field approach that has gained significant popularity in the past decade. The phase-field approach to fracture is rooted in the variational formulation of Griffith’s fracture [13] and the subsequent gradient-based regularization of the resulting free discontinuity problem [14, 15]. Later, from a more mechanically inclined perspective, several developments in different research groups [16,17,18,19,20,21,22,23,24,25,26] initiated a series of studies on the phase-field modeling of fracture including a wide variety of extensions and applications (see [27,28,29,30,31] for overviews). Developments that are relevant in the present study include ductile fracture [32,33,34,35,36,37] and its extensions to gradient plasticity [38, 39], the introduction of thermal effects [40,41,42], and the recent phase-field approach to fatigue [43,44,45,46,47,48,49].

Due to the complexity of these mechanical problems, an efficient parameter estimation setting provides means to enhance the accuracy and reliability of the computations. Employing Bayesian inversion enables us to calibrate the forward model and provides an accurate estimation of the model parameters. In [50], the authors use MCMC methods in ductile fracture, where a Bayesian setting is developed to infer the mechanical characteristics. Here, we use the local and global proposal adaptation to improve the MCMC efficiency and employ it in different mechanical and thermomechanical systems. The approach provides informative knowledge about the influence of the mechanical characteristics, i.e., which parameter has more effect on the system. Furthermore, the convergence study (here \({\hat{R}}\)-statistics) monitors the fast convergence of the MCMC chains to the target density and guarantees that all parameters converge accurately at the same time.

In mechanical problems, uncertainties in parameters arise from several sources, e.g., spatial variability and thermal diffusivity. As an example, the material stiffness usually presents strong spatial fluctuation. Direct estimation of these parameters is often difficult and gives rise to significant experimental efforts. Therefore, providing a robust and efficient computational framework to estimate reliable information of the mechanical parameter is of utmost importance. In [51], we presented a probabilistic method to identify the parameters in brittle fracture using the Metropolis–Hastings algorithm. Later, we extended the parameter identification to a more complicated PDE-based model for hydraulic fracture in the isotropic and anisotropic setting [9]. The efficient MCMC approach enabled us to identify several parameters at the same time. Recently, the authors extended the idea of parameter estimation to ductile materials in the context of a unified phase-field framework [50], where experimental data was considered for parameter identification.

An important part of this paper is the accompanying open-source programming codes published on zenodoFootnote 1. In recent years, we have published several studies in computational mechanics and phase-field fracture without explicitly providing codesFootnote 2. However, we strongly believe and agree with the reasons for open-source research software initiatives outlined in [53,54,55], that is, that codes must be available at some point. In order to demonstrate the problem statements, numerical experiments, implementation and documentation, we concentrate in this work on one-dimensional model problems. The purpose is two-fold: firstly, to verify the results of the current work, and secondly, to provide prototype codes of our previous published studies [49,50,51]. Together with the algorithms published in these papers, the current codes allow for extensions towards two- and three-dimensional problems.

In summary, the objectives of this work are:

  1. 1.

    To provide compact open-source codes\(^2\) for the Bayesian inversion method for one-dimensional analysis in the context of:

    1. i

      Elasticity,

    2. ii

      Heat equation with convection,

    3. iii

      Elastoplasticity,

    4. iv

      Phase-field fracture for brittle materials,

    5. v

      Phase-field fracture for ductile materials (gradient-extended plasticity),

    6. vi

      Phase-field fracture for thermoelasticity,

    7. vii

      Phase-field fatigue fracture.

  2. 2.

    To investigate convergence performance of different MCMC techniques in the aforementioned boundary value problems.

The paper is structured as follows. In Sect. 2, we introduce different MCMC techniques and compare their computational features. In Sect. 3, we introduce seven mechanical problems and employ the presented probabilistic inverse technique to precisely estimate the effective material parameters for the associated boundary value problems. Specifically, in this section, we highlight the efficiency of the MCMC techniques. An overview of the codes including convergence analysis is given in Sect. 4. Finally, some concluding remarks are elaborated in Sect. 5.

2 Parameter Estimation Based on Bayesian Inference

In this section, we review the how efficient MCMC techniques can be used to provide accurate information of material parameters. As a probabilistic model, Bayesian inversion is used to update the available information (prior knowledge) and provide more accurate data (i.e., the posterior density). As a result, a very good agreement between the measurement and the model response (as an aim of the inference) can be achieved.

First of all, we define the following statistical model

$$\begin{aligned} {\mathcal {S}}={\mathcal {L}}({\varvec{x}},\theta )+\varepsilon , \end{aligned}$$
(1)

where \({\mathcal {S}}\) denotes an n-dimensional measurement/reference vector, \({\mathcal {L}}\) refers to the model response affected by the k-dimensional model parameters \(\theta\) which belong to the random field \(\Theta\) and the position \({\varvec{x}}\), and \(\varepsilon\) is the observation error, e.g., a Gaussian independent and identically distributed error \(\varepsilon \sim {\mathcal {N}}(0,\sigma ^2\,I)\), including the parameter \(\sigma ^2\).

In Bayesian estimation, a parametric forward model (e.g., a PDE-based model) is used to update the available data (considered as random variables) based on the available information (denoting the prior knowledge). Having a measurement \({\mathcal {S}}=\mathtt {obs}\), the conditional density has the following form:

$$\begin{aligned} \pi (\mathtt {obs})= \int _{{\mathbb {R}}^n}\pi (\mathtt {obs}| \theta )\pi _0(\theta )\,\mathrm {d}\theta . \end{aligned}$$
(2)

Considering the parameter estimation setting, by a specific observation m, we strive to estimate the posterior distribution \(\pi (\theta |m)\), where prior information is available. Employing the statistical model (1), the likelihood function can be estimated as

$$\begin{aligned} \pi ({\mathcal {S}}|\theta )=L(\theta ,\sigma ^2|{\mathcal {S}})=\frac{1}{(2\pi \sigma ^2)^{n/2} }\exp \left( -\mathcal {EE}_{\mathcal {S}}/2\sigma ^2\right) \end{aligned}$$
(3)

where

$$\begin{aligned} \mathcal {EE}_{\mathcal {S}}=\sum _{j=1}^{n}[{\mathcal {S}}_j-{\mathcal {L}}_j({\varvec{x}},\theta )]^2 \end{aligned}$$
(4)

is the sum of square errors.

The random walk Metropolis (RWM) algorithm was introduced by Metropolis et al. [56]. The algorithm starts with a given initial guess \(\theta ^0\) according to the prior density. Then, based on the proposal distribution (the current state of the chain is perturbed randomly) a new candidate that depends on the chain (the previous candidates) \(\theta ^{\star }\) is proposed. The acceptance rate is computed by

$$\begin{aligned} \lambda (\theta ^{j-1},\theta ^{\star })=\min \left( 1,\frac{\pi (\theta ^{\star })}{\pi (\theta ^{j-1})}\right) , \end{aligned}$$
(5)

where the likelihood function is given in (4). Either the new candidate is accepted, or the MCMC chain follows in the current way. Here, a symmetric proposal density is used. A generalized form of the algorithm using a non-symmetric was introduced by Hastings [57], where the probability of the forward jump is not equal to the backward one. This algorithm has been widely used to estimate the desired distribution of the parameters, specifically when the problem dimensionality is low. In contrast, in the high-dimensional case, the rejection rate increases dramatically. Furthermore, since the proposal density has no tunning, the convergence is significantly slow. It will be more pronounced when an unsuitable initial guess is used. Although the algorithm is easy to implement and versatile, its computational drawbacks (mostly in multi-dimensional domains) motivate to develop improvements to the Metropolis–Hastings (MH) algorithm.

In the algorithmic treatment, we first determine a range for each parameter (based on the prior information). Considering N iterations, we assign an initial guess (prior knowledge) \(\theta ^0\) for the proposals. During the iterations (\(j=2,\,\ldots ,N\)) the next proposal \(\theta ^\star\) is estimated as

$$\begin{aligned} \theta ^\star =\theta ^{j-1}+\mathcal {COV}*\text {randn(k,1)}, \end{aligned}$$
(6)

where \(\mathcal {COV}\) denotes the Cholesky decomposition of the given proposal function and \(\text {randn(k,1)}\) is a k-dimensional normally distributed random variable. The function

$$\begin{aligned} \theta ^\star = {\texttt {check\_bound(}}\theta ^\star ,{\texttt {range)}} \end{aligned}$$
(7)

controls whether the new candidate is in the determined range. If each element of the proposal exceeds the maximum value, this element is replaced by the upper bound. If the value is less than the minimum of the range, it is replaced by the minimum. In the MH algorithm, the fixed (not adopted) covariance matrix is used during the MCMC chain. If the acceptance rate \(\lambda\) is greater than a produced random variable between 0 and 1 (rand), the proposal is accepted, and the chain is followed with the new proposal. Otherwise, we continue with the previous candidate \(\theta ^{j-1}\). A summary of the algorithm is given in Algorithm 1.

figure a

2.1 Adaptive Metropolis (AM)

The adaptive Metropolis algorithm [3] is based on tuning the proposal density. This is done based on the obtained information from the previous samples (path of the MCMC chain) by computation of the covariance function. According to the available information, we can adapt the proposal distribution as

$$\begin{aligned} V_j=K_p\text {Cov}\left( \theta ^0,\theta ^1\ldots ,\theta ^{j-1}\right) +\epsilon I_j. \end{aligned}$$
(8)

Here, the parameter \(\epsilon\) is chosen close to zero to guarantee that the covariance is positive definite, and \(K_p=\frac{2.38^2}{j}\) is chosen according to [2]. The covariance function is given by

$$\begin{aligned} \mathcal {COV}_j&=\text {Cov}(\theta ^0,\theta ^1,\ldots ,\theta ^{j})\nonumber \\&=\frac{1}{j}\left( \sum _{i=0}^{j} \theta ^i\left( \theta ^i\right) ^T-(n+1)~{\hat{\theta }}^j \left( {\hat{\theta }}^j\right) ^T\right) , \end{aligned}$$
(9)

where \({\hat{\theta }}^j=\frac{1}{j+1}\sum _{i=0}^{j}\theta ^j\), see [2]. To enhance the efficiency of the method, the proposal can be adapted after a specific number of iterations, e.g., 100. We introduce a new proposal employing the Cholesky decomposition of the covariance function (9):

$$\begin{aligned} \theta ^{*}=\theta ^{j-1}+\mathcal {COV}_j{\mathcal {I}}_j, \end{aligned}$$

where \({\mathcal {I}}_j\) is the identity matrix. In contrast to (6), we adopt the proposal iteratively (e.g., each 100 iterations). By using the updated proposal, the chain will have sufficient information from the accepted candidates which enhances the method efficiency. In this step we employ the code introduced in [4], named covupd. Finally, the acceptance/rejection probability is estimated by

$$\begin{aligned} \lambda _1 (\theta ^*|\,\theta ^{j-1})=\min \left( 1, \frac{\pi (\theta ^*|\,m)~\phi (\theta ^{j-1}|~\theta ^*)}{\pi (\theta ^{j-1}|\,m)~\phi (\theta ^*|\,\theta ^{j-1}))}\right) . \end{aligned}$$
(10)

2.2 Delayed Rejection (DR)

As previously mentioned, the MH algorithm suffers from computational disadvantages, mostly in a high-dimensional parameter space. The delayed rejection [58] is based on giving another chance to the rejected candidate by using a second stage move. For this, we change the proposal density to increase the acceptance probability of the rejected candidate. The essential parameter is \(\gamma _2\), which will be selected in the range \(\gamma _2<1\) such that the next stage has a narrower proposal function (normally, \(\gamma _2=1/5\) is chosen). The alternative proposal \(\theta ^{**}\) is chosen using the proposal function

$$\begin{aligned} \phi (\theta ^{**}|\theta ^{j-1},\theta ^*)={\mathcal {N}}(\theta ^{j-1},\gamma _2^2 V_j), \end{aligned}$$
(11)

where \(V_j\) is the covariance matrix estimated by the adaptive algorithm [58]. We use the following acceptance ratio

$$\begin{aligned}&\lambda _2(\theta ^{**}|\theta ^{j-1},\theta ^*)\nonumber \\&\quad :=\min \left( 1,\frac{\pi (\theta ^{**}|m) \phi (\theta ^*|\theta ^{**} ) \phi _2(\theta ^{j-1}|\theta ^{**},\theta ^*) [1-\lambda (\theta ^*|\theta ^{**})]}{\pi (\theta ^{j-1}|m) \phi (\theta ^*| \theta ^{j-1} ) \phi _2(\theta ^{**}|\theta ^{j-1},\theta ^*) [1-\lambda ( \theta ^*|\theta ^{j-1})]}\right) \nonumber \\&\quad =\min \left( 1,\frac{\pi (\theta ^{**}|m) \phi (\theta ^*|\theta ^{**} ) [1-\lambda (\theta ^*|\theta ^{**})]}{\pi (\theta ^{j-1}|m) \phi (\theta ^*| \theta ^{j-1} ) [1-\lambda (\theta ^*|\theta ^{j-1})]}\right) . \end{aligned}$$
(12)

The DR process can be carried out once, or at random/fixed number of iterations.

2.3 Delayed Rejection Adaptive Metropolis (DRAM)

In the DRAM algorithm, we follow two steps in order to reduce the rejected candidates and enhance the convergence. Globally, we adapt the proposal density based on the already obtained information from the chain (AM). Locally, we pursue the DR strategy that in each iteration, the rejected candidate will have at least one additional chance. In the case that the initial values are too far from the desired density (target distribution), the adaptive strategy may not be started appropriately. This is due to the large variance of a near singular covariance matrix. As a solution, the DR strategy reduces the variance in different delayed stages, so that some accepted proposals are available, enabling the AM to start appropriately. Therefore, the DRAM technique can effectively overcome the drawbacks of the MH algorithm [4]. A summary of the process is given in Algorithm 2.

figure b

The algorithm includes two important aspects

  • Increasing the acceptance rate by a local adaptation (DR).

  • Increasing MCMC chain accuracy by a global adaptation (AM).

2.4 MCMC with Ensemble-Kalman Filter (EnKF-MCMC)

As previously mentioned, a good detection of the proposal density will enhance the Markov chain movement to the target density. EnKF represents the error covariance matrix by a large stochastic ensemble of model realizations [59]. In this method, to have an accurate estimation of posterior density, a Kalman gain (similar to a weighting matrix in particle filter) is calculated employing the mean and the covariance of the prior distribution and the cross-covariance between parameters and observations. Here, we introduce another proposal distribution detection technique using an ensemble-Kalman filter [60], where one has

$$\begin{aligned} \theta ^\star =\theta ^{j-1}+\Delta \theta , \end{aligned}$$
(13)

where \(\Delta \theta\) indicates the jump of Kalman-inspired proposal. For updating the proposed candidates, we can rewrite (13) as

$$\begin{aligned} \Delta \theta ={\mathcal {K}}\left( y^{j-1}+s^{j-1}\right) . \end{aligned}$$
(14)

Here \({\mathcal {K}}\) points out the so-called Kalman gain,

$$\begin{aligned} {\mathcal {K}}={\mathcal {C}}_{\theta M}\left( {\mathcal {C}}_{MM}+{\mathcal {R}}\right) ^{-1}, \end{aligned}$$
(15)

where \({\mathcal {C}}_{\theta M}\) denotes the covariance matrix between the identified unknowns and the PDE-based model, \({\mathcal {C}}_{MM}\) is the covariance matrix of the model solution (i.e., the PDE response), and \({\mathcal {R}}\) indicates the measurement noise covariance matrix [61]. Furthermore, \(y^{j-1}\) indicates the residual of candidates with respect to the model and \(s^{j-1}\sim {\mathcal {N}}(0,{\mathcal {R}})\) refers to the density of measurement. Denoting \({\texttt {obs}}\) as an observation, \(y^{j-1}={\texttt {obs}}-f(\theta ^{j-1})\). In order to enhance the method efficiency, i.e., reduce the effect of the initial guess, different MCMC chains instead of a single chain can be employed.

After the estimation of \(\theta ^\star\), we check its bounds, and calculate its acceptance rate \(\lambda\) that determines if the new proposal is rejected or if the chain should be continued with \(\theta ^{j-1}\) (the previous candidate). We summarized the procedure in Algorithm 3. The main advantage of EnKF-MCMC lies in using the covariance between the model response and between parameters and the PDE-response. This approach increases the possibility of acceptance of the candidate noticeably.

Table 1 provides an informative summary of the computational characteristics of the discussed MCMC techniques. The MH algorithm yields a more efficient performance when compared to RWM since an asymmetric proposal density is used. Also, the implementation of the method is very simple. AM overcomes the drawback of MH by adapting the proposal based on the obtained information. The DR method improves AM, specifically when the initial guess is not suitable and a local adaptation is used. DRAM takes advantage of the benefits of both AM and DR (global and local chain adjustment). EnKF-MCMC has an effective proposal improvement and leads to significant improvements for large number of unknowns. The theoretical results show that DRAM and EnKF perform effectively compared to other methods. In the sequel, we will validate this discussion with practical examples.

Table 1 A comparison of the computational features of different MCMC methods

3 One-Dimensional Examples

In this section, we aim at describing how Bayesian inference can be employed to identify material parameters in computational mechanics. Seven different boundary value problems including complex coupled multi-field (and multi-physics) systems are considered. Moreover, compact open-source codes are provided.

In order to introduce Bayesian inference as simply as possible, one-dimensional analyses of uniaxial tests are performed. This can be extended to a multidimensional setting in a straightforward manner. Additionally, Bayesian inference codes to reproduce all the examples are given in detail.

Spatial and temporal gradients are denoted as

$$\begin{aligned} \Box '(x,t)=\frac{\partial \Box (x,t)}{\partial x} \quad {{\text {and}}}\quad {\dot{\Box }}(x,t)=\frac{\partial \Box (x,t)}{\partial t}. \end{aligned}$$

3.1 Example 1: Linear Elasticity

This example provides a brief illustrative parameter estimation based on Bayesian inference for one-dimensional linear elasticity. Specifically, we estimate Young’s modulus as the single uncertain parameter in the given problem. The observation, i.e., the reference response, is taken as the analytical solution of the governing second-order ordinary differential equation.

3.1.1 State Variables and Kinematics

Let us consider the one-dimensional boundary value problem (BVP) shown in Fig. 1a. An isothermal elastic rod is completely fixed on the left side and subjected to an imposed traction per unit area \({{{\bar{t}}}}\) on the right side. The external body force \(\rho A {{{\bar{b}}}}(x)\) has the sinusoidal form \(\rho A {{{\bar{b}}}}(x)={{{\bar{q}}}}(x)=q_0\sin (2\pi x/l)\), as shown in Fig. 1b, where \({{{\bar{b}}}}\) is a body force per unit mass. Moreover, the deformation process is assumed to be quasi-static, such that inertial effects can be neglected.

The material is assumed to obey linear elasticity in the small strain setting. Consequently, letting \({\mathcal {B}}:=[0,L]\), the displacement field \(u : {\mathcal {B}} \rightarrow {\mathbb {R}}\) constitutes the only primary variable. To elaborate the corresponding variational formulation, we employ the function space for the displacement field:

$$\begin{aligned} \begin{aligned} {\mathcal {W}}^{u}_{{\bar{u}}}:= \{u\in \mathrm {H}^1({\mathcal {B}}) \ : \ u={\bar{u}} \ \ \text {on} \ \ {\partial _D{\mathcal {B}}} \}, \end{aligned} \end{aligned}$$
(16)

In particular, we denote \({\mathcal {W}}^{u}_{0}\) when we have zero boundary condition (i.e., \(u=0\)). Additionally, the strain field is obtained as

$$\begin{aligned} \varepsilon (x)=u'(x) . \end{aligned}$$
(17)

The stress field then follows from Hooke’s law as

$$\begin{aligned} \sigma (x)=E\varepsilon (x), \end{aligned}$$
(18)

where E is Young’s modulus, assumed to be constant throughout the bar for the sake of simplicity. With these definitions at hand, the quasi-static mechanical balance problem takes the following strong form:

$$\begin{aligned} \text {Find}\;\; u(x)\quad \text {s.t.}\;: \quad EA\frac{\mathrm {d}^2u(x)}{\mathrm {d}x^2}+q_0\sin \bigg (\frac{2\pi x}{L}\bigg )=0, \end{aligned}$$
(19)

along with the Dirichlet boundary condition \(u=0\) at \(x=0\) and the Neumann boundary condition \(\mathrm {d}u/\mathrm {d}x={\bar{t}}/E\) at \(x=L\). Here, A is the cross-sectional area of the bar, assumed to be constant for simplicity. The second-order ordinary differential Eq. (19) has the exact solution for the displacement field:

$$\begin{aligned} u(x)=\frac{q_0L^2}{4EA\pi ^2}\sin \bigg (\frac{2\pi }{L}x\bigg ) +\bigg (\frac{{{\bar{t}}}}{E}-\frac{q_0L}{2\pi EA}\bigg )x \quad \forall \;0\le x\le L. \end{aligned}$$
(20)

The analytical solution is taken here as the reference response. For the numerical solution, the finite element method is employed, for which the variational formulation of the BVP is presented below.

figure c

3.1.2 Energy Quantities and Variational Principles

The strain energy density for one-dimensional linear elasticity reads

$$\begin{aligned} W_{elas}(\varepsilon ):=\frac{1}{2}E\varepsilon ^2=\frac{1}{2}E \bigg (\frac{\mathrm {d}u}{\mathrm {d}x}\bigg )^2. \end{aligned}$$
(21)

The total energy functional \({\mathcal {E}}(u)\) is then given by

$$\begin{aligned} \begin{aligned} {\mathcal {E}}(u)=\int ^{L}_{0}W_{elas}(\varepsilon )\, A \mathrm {d}{{x}} -\int ^{L}_{0} \rho A{ {{{\bar{b}}}}} u\,\mathrm {d}x - A {\bar{t}} u \, \big |_{\partial _N{\mathcal {B}}} , \end{aligned} \end{aligned}$$
(22)

where the external forces evaluated at the Neumann boundary \(\partial _N{\mathcal {B}}\equiv \{L\}\) have been used (Fig. 1a). Minimization of the energy functional (22) with respect to the displacement field leads to the following weak formulation.

Formulation 3.1

(F1: Bayesian inversion for linear elasticity) Consider a given open bounded one-dimensional bar on an interval \({\mathcal B}:=(0,L)\) with boundary \(\partial {\mathcal B}\) defined at \(x=0\) and \(x=L\), and constant \(E \ge 0\). Find \(u \in {\mathcal {W}}^u_{{\bar{u}}}\) satisfying the following Euler–Lagrange equation in weak form:

$$\begin{aligned} {\mathcal E}_u(u;\delta u)&=\int ^L_{0}\bigg [EA\bigg (\frac{\mathrm {d}u}{\mathrm {d}x} \bigg )\bigg (\frac{\mathrm {d}(\delta u)}{\mathrm {d}x}\bigg )-\rho A {\bar{b}} \delta u\bigg ]\,\mathrm {d}x \\&\quad - A {\bar{t}} \delta u \, \big |_{\partial _N{\mathcal {B}}} = 0 \quad \forall \, \delta u \in {\mathcal {W}}^{u}_{0} . \end{aligned}$$

Here, the aim of the Bayesian inversion is to determine Young’s modulus E.

Fig. 1
figure 1

Geometry and loading setup for the one-dimensional bar. a Boundary value problem and b sinusoidal body force with constant amplitude \(q_0=14\,\hbox {N/m}\)

3.1.3 Bayesian Inference

In the present example, we consider a bar of unitary length \(L = 1\) with \(x\in {\mathcal B}:=[0,1]\) that is initially unstretched, \(q_0=14\) N/m, and a unit cross-sectional area throughout the bar (\(A=1\) \(\hbox {m}^2\)). The minimum finite element size in the domain \({\mathcal B}\) is \(h=0.005\) mm. The left end (\(x=0\)) is fixed.

The statistical problem consists of identifying Young’s modulus E. Bayesian inference is then applied to determine the target value, while no specific information (other than its positivity) is available a priori.

From now on, in order to estimate the model response, the function

$$\begin{aligned} {\texttt {[response] = forwardmodel(}}\theta ^\star {\texttt {)}} \end{aligned}$$
(23)

is employed. Then, \({\texttt {response}}\) is used to calculate the likelihood of the given proposal. The main script for the present example is named \({\texttt {elasticity{\_1}}D}\). We assume Young’s modulus is between \(E=0.1\,\hbox {GPa}\) and \(E=20\,\hbox {GPa}\), the initial guess is \(\theta ^0=3\), and we use \(\sigma ^2=0.1\). As a synthetic measurement, we employ \(E=4.259\) to estimate the displacement.

Fig. 2
figure 2

Example 1. The MCMC chain of E obtained by different Bayesian techniques. Form left to right: MH, AM, and DR (the first row), and DRAM as well as EnKF (the second row)

Fig. 3
figure 3

Example 1. The posterior distribution of E obtained by different Bayesian techniques. Form left to right: MH, AM, and DR (the first row), and DRAM as well as EnKF (the second row)

As a one-dimensional Bayesian inversion (\(k=1\)), we plan to compare the performance of all methods, including the convergence of the MCMC chain, elapsed CUP time, and the convergence rate. Figure 2 shows the evolution of the MCMC chain using different Bayesian techniques. All chains converged effectively and EnKF shows a significantly lower fluctuation. As a result, as Fig. 3 illustrates that a narrow posterior distribution has been obtained using the MCMC techniques. Again, EnKF-MCMC shows a better performance (a narrower density) compared to others.

Table 2 Example 1: The median of the posterior density and its elapsed CPU time and the acceptance rate using different MCMC methods

The posterior density provides informative knowledge about the parameter. We extract the median of the accepted candidates as the inferred solution. Table 2 shows the computational features of our Bayesian inversion. Although all methods estimate the Young’s modulus with a reasonable accuracy, using DRAM and EnKF results in a more precise inference. As expected, the acceptance rate of MH is minimum and it increases by a global adaptation (adaptive Metropolis). The delayed rejection increases significantly the acceptance ratio; however, it also raises the computational time. Combining AM and DR again increases the acceptance ratio by 10%. Since we adopt the proposal every 100 iterations, AM does not noticeably increase the computational time. Regarding EnKF-MCMC, the CPU time is much higher; however, using Kalman again leads to an excellent ratio and a very low uncertainty in MCMC; see Fig. 2.

3.2 Example 2: Heat Equation with Convection Contribution

The heat equation is a convection-diffusion equation used to model heat transfer from regions of higher temperature to regions of lower temperature. Convective transport is a physical process that takes place along the streamlines in the flow field. In the second example, we apply Bayesian inversion to a one-dimensional convection-diffusion equation. Herein, the goal is to estimate thermal diffusivity and thermal velocity.

3.2.1 State Variables and Kinematics

In the context of the one-dimensional bar treated in the previous example, we now consider a thermal process occurring in a time interval \({\mathbb {T}}:=[0,T]\). In particular, at material points \(x\in {\mathcal {B}}\) and time \(t\in {\mathbb {T}}\), the BVP solution provides the temperature field \({\mathcal {T}}:{\mathcal {B}}\times {\mathbb {T}} \rightarrow {\mathbb {R}}\). To elaborate the corresponding variational formulation, we employ the function space for the temperature field

$$\begin{aligned} {\mathcal {W}}^{{\mathcal {T}}}_{\bar{{\mathcal {T}}}}:=\{{\mathcal T}\in \mathrm {H}^1({\mathcal {B}}) \ : \ {\mathcal {T}}=\bar{{\mathcal {T}}} \ \ \text {on} \ \ \partial ^{{\mathcal {T}}}_D{\mathcal {B}} \}. \end{aligned}$$
(24)

In particular, we use \({\mathcal {W}}^{{\mathcal {T}}}_{0}\) when we have zero boundary condition (\({\bar{{\mathcal T}}}=0\)). In the present one-dimensional problem, the Dirichlet boundary is set at the left boundary and the ending points (right boundary), and the problem includes the following boundary conditions:

$$\begin{aligned} {\mathcal {T}}(0,t)={\mathcal {T}}_1\qquad {\mathcal {T}}(L,t)={\mathcal {T}}_2 \quad \;\; \forall \; t>0 \;\;\text {on}\ \ {\partial ^{{\mathcal {T}}}_ D{\mathcal {B}}}, \end{aligned}$$
(25)

along with Neumann boundary conditions

$$\begin{aligned} Q\, n = {\bar{q}} \ \ \text {on}\ \ {\partial ^{{\mathcal {T}}}_N{\mathcal {B}}}, \end{aligned}$$
(26)

where Q is the thermal volume flux and \({\bar{q}}\) is the thermal transport on the Neumann boundary, where \(n=1\) for \(x=L\) and \(n=-1\) for \(x=0\), and \(\bar{{\mathcal {T}}}\) is the imposed temperature on the Dirichlet boundary. Moreover, the heat flux in (26) can be described by the negative direction of the thermal heat gradient \({{\mathcal {T}}^\prime}\) (denoting \(\frac{\partial }{\partial x}{\mathcal T}\)) through Fourier’s law of heat conduction as

$$\begin{aligned} Q =-{{{\mathcal {K}}}}\; {{\mathcal {T}}^\prime}, \end{aligned}$$
(27)

where \({{{\mathcal {K}}}}\) is the thermal conductivity.

3.2.2 Time Discretization of the Temporal Variables

In the following, we shortly comment on the time-discretization of the temporal variables. To do so, let the interval \({\mathbb {T}} := ( t_0,T)\) be discretized using the discrete time (loading) points

$$\begin{aligned} 0 = t_0< t_1< \ldots< t_n< t_{n+1}< \ldots < t_N = T, \end{aligned}$$
(28)

with the end time value \(T>0\). The parameter \(t\in {\mathbb {T}}\) denotes for rate-dependent problems the time, and for rate-independent problems an incremental loading parameter. In the following, to formulate the incremental problems, we denote the current time \(t:=t_{n+1}>0\) with known fields at \(t_n\). In order to advance the solution within a specific time step, we focus on the finite time increment \([t_n,t_{n+1}]\), where

$$\begin{aligned} \Delta t=t_{n+1}-t_{n}>0 \end{aligned}$$
(29)

denotes the time step length.

3.2.3 Strong Formulation and Variational Principles

The one-dimensional diffusion equation with convection can be written as

$$\begin{aligned} \rho \,c\,\dot{{\mathcal {T}}}+\kappa \,{{\mathcal {T}}^\prime}+{Q^\prime}=0\quad \quad \text {in}\quad {\mathcal B}\times {\mathbb {T}} \end{aligned}$$
(30)

where c is the heat capacity, \(\rho\) is the heat density, and \(\kappa\) indicates the thermal velocity.

Typically, to identify the relative importance between convection and diffusion in a heat equation, the dimensionless quantity called Péclet number is estimated by \(\mathtt {Pe}:=(\kappa \,h)/(2\,{{{\mathcal {K}}}})\), where h is the element size. This value expresses the ratio of convective to diffusive transport in a heat flow problem.

For test functions \(\delta {\mathcal {T}} \in {\mathcal {W}}^{{\mathcal {T}}}_{0}\) (see (24) with zero boundary condition), the heat problem given in (30) has the following variational form:

$$\begin{aligned}&\int _{0}^{L} \rho \, c\, \dot{{\mathcal {T}}}\delta {\mathcal {T}} \,\mathrm {d}x + \int _{0}^{L} \kappa {{\mathcal {T}}^\prime} \delta {\mathcal {T}}\,\mathrm {d}x+ \int _{0}^{L} \left( {{{\mathcal {K}}}} {{\mathcal {T}}^\prime}\right) \cdot \delta {{\mathcal {T}}^\prime}\,\mathrm {d}x\nonumber \\&\quad =\left[ {{{\mathcal {K}}}} {{\mathcal {T}}^\prime} \delta {\mathcal {T}}\right] _{0}^{L}. \end{aligned}$$
(31)

The standard variational equation (initiated from a Galerkin formulation) for the heat equation including convection and diffusion effects where convection is dominant compared with diffusion typically leads to unstable results, and thus numerical stabilization has to be used [62, 63]. More specifically, without stabilization techniques, some spurious oscillations (or wiggles) appear, which prevent the numerical solution from converging to a physical response. It can be observed that stronger convective effects lead to larger oscillations in time. It is shown for the value \(\mathtt {P{e}}> 1\), where convective response is dominating, that the solution obtained through standard FEM presents spurious oscillations [64, 65]. To remedy these shortcomings, we consider here the modified test function

$$\begin{aligned} \widetilde{\delta {\mathcal {T}}}=\delta {\mathcal {T}}+\beta _{opt}\frac{h}{2}\delta {{\mathcal {T}}^\prime}, \end{aligned}$$
(32)

where \(\beta _{opt}\) is given by

$$\begin{aligned} \beta _{opt}:=\mathrm {coth}|\mathtt {Pe}|-\frac{1}{|\mathtt {Pe}|}, \end{aligned}$$
(33)

and \(\mathrm {coth}\) indicates the hyperbolic cotangent. Observe that for the linear interpolation basis functions used for the finite element discretization, we have

$$\begin{aligned} \widetilde{\delta {{\mathcal {T}}}^\prime}=\delta {{\mathcal {T}}^\prime}, \end{aligned}$$
(34)

such that the modified weak formulation reads:

$$\begin{aligned}&\int _{0}^{L} \rho \, c\, \dot{{\mathcal {T}}}\widetilde{\delta {\mathcal {T}}} \,\mathrm {d}x + \int _{0}^{L} \kappa {{\mathcal {T}}^\prime} \widetilde{\delta {\mathcal {T}}}\,\mathrm {d}x + \int _{0}^{L} \left( {{{\mathcal {K}}}} {{\mathcal {T}}^\prime}\right) \cdot \widetilde{\delta {{\mathcal {T}}}^\prime}\,\mathrm {d}x \nonumber \\&\quad =\left[ {{{\mathcal {K}}}} {{\mathcal {T}}^\prime} \widetilde{\delta {\mathcal {T}}}\right] _{0}^{L}. \end{aligned}$$
(35)

This variational equation typically refers to the Streamline-Upwind (SU) formulation.

Table 3 Different versions of the \(\omega\)-algorithmic based on different weight functions \({{{\mathcal {G}}}}(t)\) [65, 66]

An algorithm for the update of the temperature field \({\mathcal {T}}\) in the increment \([t_n,t_{n+1}]\) results in time-discrete field variables in an incremental setting of the convection-diffusion equation. Equation (36) then becomes

$$\begin{aligned}&\int _{0}^{L} \rho \, c\, \dot{{\mathcal {T}}}\widetilde{\delta {\mathcal {T}}} \,\mathrm {d}x + \int _{0}^{L} \left( \kappa {{\mathcal {T}}^\prime}\right) ^{\omega } \widetilde{\delta {\mathcal {T}}}\,\mathrm {d}x + \int _{0}^{L} \left( {{{\mathcal {K}}}} {{\mathcal {T}}^\prime}\right) ^{\omega } \cdot \widetilde{\delta {{\mathcal {T}}}^\prime}\,\mathrm {d}x \nonumber \\&\quad =\left[ {{{\mathcal {K}}}} {{\mathcal {T}}^\prime} \widetilde{\delta {\mathcal {T}}}\right] _{0}^{L}, \end{aligned}$$
(36)

in terms of the \(\omega\)-algorithmic expressions given by

$$\begin{aligned} \dot{{\mathcal {T}}}=\frac{1}{\Delta t}({\mathcal {T}}-{\mathcal {T}}_n) \quad {{\text {and}}}\quad (\bullet )^{\omega }=(1-\omega )(\bullet )_n+\omega (\bullet ), \end{aligned}$$
(37)

with

$$\begin{aligned} \omega :=\frac{\displaystyle \int _{t_n}^{t_{n+1}}{{{\mathcal {G}}}}(t)t/\Delta t\;\mathrm {d}t}{\displaystyle \int _{t_n}^{t_{n+1}}{{{\mathcal {G}}}}(t)\;\mathrm {d}t}, \end{aligned}$$
(38)

such that \({{{\mathcal {G}}}}(t)\) is a temporal weighting function. The scalar value \(\omega\) for different variations of \({{{\mathcal {G}}}}(t)\) is given in Table 3.

Regarding the analytical solution, we will consider \({\mathcal {T}}_1=1^{\circ }\;\text {C}\) and \({\mathcal {T}}_2=0^{\circ }\;\text {C}\) in (25). Thus, the solution has the following form:

$$\begin{aligned} {\mathcal {T}}(t,x)&=\exp \bigg (\frac{\kappa }{2{\mathcal {K}}} x-\frac{K^2\,t}{4{\mathcal {K}} \rho c}\bigg )\nonumber \\&\quad \sum _{i=1}^{\infty } \sqrt{2}\,\sin (i \pi x)\,\exp \bigg (\frac{-{\mathcal {K}}(i\pi )^2\,t }{\rho c}\bigg )\,k_i\nonumber \\&\quad +\frac{1-\exp \bigg (\dfrac{\kappa }{{\mathcal {K}}} \left( x-1\right) \bigg )}{1-\exp \bigg (-\dfrac{\kappa }{{\mathcal {K}}}\bigg )} \end{aligned}$$
(39)

where

$$\begin{aligned} k_i=-\frac{(-1)^i\,4\sqrt{2} {\mathcal {K}}^2\,i\pi \sqrt{{\mathcal {K}}} \exp (-\frac{\kappa }{2{\mathcal {K}}})}{\kappa ^2+4{\mathcal {K}}^2\,(i\pi )^2{\mathcal {K}}}. \end{aligned}$$
(40)

The reader is referred to [67] for further details.

Formulation 3.2

(F2: Bayesian inversion for convection-diffusion) Consider an open bounded one-dimensional bar on an interval \({\mathcal B}:=(0,L)\) with boundary \(\partial {\mathcal B}\) defined at \(x=0\) and \(x=L\). Let constants \((\kappa ,{\mathcal {K}},\rho ,c) \ge 0\) be given with the initial conditions \({\mathcal {T}}_0= {\mathcal {T}}({x},0)\). For the loading increments \(n=1,2,\ldots , N\), find \({\mathcal {T}}:={\mathcal {T}}^n\in {\mathcal {W}}^{{\mathcal {T}}}_{0}\) satisfying the following Euler–Lagrange equation in weak form:

$$\begin{aligned} \begin{aligned} {\mathcal E}_{\mathcal {T}}({\mathcal {T}};\delta {\mathcal {T}})&= \int _{0}^{L} \rho \, c\, {({\mathcal {T}}-{\mathcal {T}}_n)} \widetilde{\delta {\mathcal {T}}} \,\mathrm {d}x\\&\quad + \int _{0}^{L} (1-\omega )\Delta t\kappa {{\mathcal {T}}^\prime}_n \widetilde{\delta {\mathcal {T}}}\,\mathrm {d}x\\&\quad + \int _{0}^{L} (1-\omega )\Delta t{\mathcal {K}} {{\mathcal {T}}^\prime}_n \cdot \widetilde{\delta {\mathcal {{T}}}^\prime}\,\mathrm {d}x\\&\quad + \int _{0}^{L} (\omega )\Delta t\kappa {{\mathcal {T}}^\prime} \widetilde{\delta {\mathcal {T}}}\,\mathrm {d}x + \int _{0}^{L} (\omega )\Delta t{\mathcal {K}} {{\mathcal {T}}^\prime} \cdot \widetilde{\delta {{\mathcal {T}}}^\prime}\,\mathrm {d}x\\&\quad -\left[ \Delta t{\mathcal {K}} {{\mathcal {T}}^\prime} \widetilde{\delta {\mathcal {T}}}\right] _{0}^{L}=0. \quad \forall \, \delta {\mathcal {T}} \in {\mathcal {W}}^{{\mathcal {T}}}_{0} \end{aligned} \end{aligned}$$

The unknown material parameters for the convection-diffusion problem denoted as \(\textsc {F2}\) then follow from the probabilistic Bayesian inversion

$$\begin{aligned} {\mathfrak {P}}\leftarrow \textsc {BI}\big (\textsc {F2}({\mathfrak {u}})\big ) \quad {{\text {with}}}\quad {\mathfrak {u}}:={\mathcal {T}} \quad {{\text {and}}}\quad {\mathfrak {P}}:=(\kappa ,{\mathcal {K}}) . \end{aligned}$$
Fig. 4
figure 4

Geometry and loading setup for the one-dimensional bar. a Example 3,4,7, b Example 2, and c Example 6

3.2.4 Bayesian Inference

For the simulation, we consider a bar of unitary length \(L = 1\) with \(x\in {\mathcal B}:=[0,1]\). The right end (\(x=1\)) is isolated, while a prescribed temperature \({{\bar{\theta }}}\) is imposed on the left end, i.e., \(x=0\); see Fig. 4b. Temperature boundary conditions are set according to (25) such that \({\mathcal {T}}_1=1^{\circ }\;\text {C}\) and \({\mathcal {T}}_2=0^{\circ }\;\text {C}\). Additionally, we set initial temperature as \({{{\mathcal {T}}}}=0\) at \(t=0\). The reference simulation is performed for \(t=0.2\) s.

The Bayesian inversion aims to determine two thermal parameters, namely (\(\kappa\), \({\mathcal {K}}\)). We set \(c=1.2\,\text {J/K}\) and \(\rho =1.6 \,\mathrm {W/m^{2}}\) and use the online MATLAB codes presented in [68]. We assume \(\kappa\) is between 5 and 20 \(\mathrm {m/s}\) with \({\mathcal {K}}\) varying from 0.5 to 2 \(\mathrm {W/mK}\) uniformly. The script \({\texttt {heat{\_}}1D}\) has a comparison between all methods considering a two-dimensional Bayesian inversion (simultaneous interference of \(\kappa\) and \({\mathcal {K}}\)). Finally, we set \(\theta ^0=(1.2,15)\) and \(\sigma ^2=0.05\). In order to provide a reference observation, we use \({\mathcal {K}}=0.9\) and \(\kappa =15\), which can be found in \({\texttt {reference.mat}}\).

Fig. 5
figure 5

Example 2. The MCMC chain of \({\mathcal {K}}\) obtained by different Bayesian techniques. Form left to right: MH, AM, and DR (the first row), and DRAM as well as EnKF (the second row)

Fig. 6
figure 6

Example 2. The MCMC chain of \(\kappa\) obtained by different Bayesian techniques. Form left to right: MH, AM, and DR (the first row), and DRAM as well as EnKF (the second row)

Fig. 7
figure 7

Example 2. The posterior distribution of \({\mathcal {K}}\) (left) and \(\kappa\) (right) obtained by different Bayesian techniques. The true values are shown with a black dashed line

Fig. 8
figure 8

Solution of the heat equation in Example 2 using the inferred values at \(t=0.2\)

We plot the evolution of the MCMC chain of \({\mathcal {K}}\) and \(\kappa\) as shown respectively in Figs. 5 and 6. MH shows a significant uncertainty in both parameters. However, EnKF and DRAM estimated \({\mathcal {K}}\) and \(\kappa\) with a low fluctuation. Figure 7 depicts a comparison between the posterior densities using all MCMC techniques. As shown, the MH method failed to estimate the parameters effectively since a wide distribution is obtained, and the estimated values are relatively far from the true values. The proposal adaptation enhanced the performance of MH; however, the results are similar to a bimodal distribution. The local adaptation (DR) gives rise to a better inference and the peak point of both distributions was located very close to the true values. In general, EnKF and DRAM showed an excellent performance.

Table 4 Example 2: The median of the posterior density of \({{\mathcal {K}}}\) and \(\kappa\) as well as the elapsed CPU time and the acceptance rate using different MCMC methods

The computational features of the methods are listed in Table 4. The median of the posterior densities of all methods are close to the true values. Here, MH and AM have a low (less than 10%) acceptance rate and EnKF has an excellent ratio. Finally, the evolution of the temperature using the estimated parameters from DRAM and EnKF is shown in Fig. 8. The results are compared with the analytical solution, where a very good agreement is observed.

3.3 Example 3: Elastoplasticity

As a third example, we apply Bayesian inversion to a one-dimensional elastoplasticity problem. Herein, the goal is to estimate Young’s modulus E, in addition to the material parameters characterizing the elastoplastic response, namely, the plastic yield strength \(\sigma _Y\) and the hardening modulus H. Moreover, due to the dissipative nature of the problem, time evolution is explicitly considered [69].

3.3.1 State Variables and Kinematics

In the context of the one-dimensional bar treated in the previous examples, we now consider an elastoplastic deformation process occurring in a time interval \({\mathbb {T}}:=[0,T]\). The strain defined in (17) is additively decomposed into an elastic part \(\varepsilon ^e\) and a plastic part \(\varepsilon ^p\):

$$\begin{aligned} \varepsilon (x,t) = \varepsilon ^e(x,t) + \varepsilon ^p(x,t). \end{aligned}$$
(41)

The plastic strain \(\varepsilon ^p:{\mathcal {B}}\times {\mathbb {T}}\rightarrow {\mathbb {R}}\) is considered as a local internal variable. Moreover, to account for phenomenological hardening effects, a hardening variable \(\alpha :{\mathcal {B}}\times {\mathbb {T}}\rightarrow {\mathbb {R}}_+\) is introduced as a second local internal variable. For simplicity, \(\alpha\) is assumed to coincide with the equivalent plastic strain, such that

$$\begin{aligned} {{\dot{\alpha }}}(x,t) = \vert {\dot{\varepsilon }}^p(x,t) \vert . \end{aligned}$$
(42)

The hardening variable starts to evolve from the initial condition \(\alpha (x,0) =0\). The elastoplastic response of the bar is thus characterized by the displacement field u, the plastic strain \(\varepsilon ^p\), and the hardening variable \(\alpha\).

With the purpose of stating variational principles, we further introduce the function spaces for the plasticity variables

$$\begin{aligned} \begin{aligned}&{\mathcal {W}}^{p}:= \mathrm {L}^2({\mathcal {B}}), \quad {\mathcal {W}}^{\alpha }_{\alpha _n,\,q} := \{ \alpha \in \mathrm {H}^1({\mathcal {B}}) \ : \ \alpha = \alpha _n + \vert q \vert ,\\&\quad q\in {\mathcal {W}}^{p} \}. \end{aligned} \end{aligned}$$
(43)

The hardening law (42) is then enforced in incremental form as \(\alpha \in {\mathcal {W}}^{\alpha }_{\alpha _n,\,\varepsilon ^p-\varepsilon ^p_n}\) and \(\alpha ^n\in {\mathcal {W}}^\alpha _{\alpha _{n-1},\,\varepsilon ^p-\varepsilon ^p_{n-1}}\). In particular, we use \({\mathcal {W}}^{u}_{0}\), and \({\mathcal {W}}^{\alpha }_{0,q}\) when we have zero boundary condition (i.e., \(u=0\), and \(\alpha _n=0\) respectively).

3.3.2 Energy Quantities and Variational Principles

Let us define the following pseudo-energy density per unit volume:

$$\begin{aligned} {W}(\varepsilon ,\varepsilon ^p,\alpha ) := {W}_{elas}(\varepsilon ,\varepsilon ^p) + {W}_{plas}(\alpha ). \end{aligned}$$
(44)

The elastic contribution is assumed to have the simple quadratic form

$$\begin{aligned} {W}_{elas}(\varepsilon ,\varepsilon ^p):= \frac{1}{2}E(\varepsilon -\varepsilon ^p)^2. \end{aligned}$$
(45)

Accordingly, the plastic contribution in (44) is assumed to have the form

$$\begin{aligned} {W}_{plas}(\alpha ) := \sigma _Y \alpha + \frac{H}{2} \alpha ^2, \end{aligned}$$
(46)

with the initial yield stress \(\sigma _Y\ge\) and the isotropic hardening modulus \(H\ge 0\). Note that \(W_{elas}\) can be viewed as a stored energy density, while \(W_{plas}\) can be viewed as a dissipated energy density, defined here as a state function.

From the strain energy density, the constitutive stress-strain relation and the generalized stress follow as

$$\begin{aligned} \sigma =\frac{\partial W_{elas}}{\partial \varepsilon }=E(\varepsilon -\varepsilon ^p) \quad {{\text {and}}}\quad s^p=-\frac{\partial W_{elas}}{\partial \varepsilon ^p}\equiv \sigma . \end{aligned}$$
(47)

The elastoplasticity model additionally requires evolution equations for the plastic strain. To this end, the yield function is first defined in terms of the generalized stress \(s^p\) and the resisting force \(R^p\) as

$$\begin{aligned} \beta :=\vert s^p \vert - R^p \quad {{\text {with}}}\quad R^p:=R^p(\alpha )= \frac{\partial {W}_{plas}}{\partial \alpha } . \end{aligned}$$
(48)

With the yield function at hand, an associative flow rule is adopted for the plastic strain, such that

$$\begin{aligned} {\dot{\varepsilon }}^p=\lambda ^p\partial _{s^p}\beta =\lambda ^p\mathrm {sign}(s^p), \end{aligned}$$
(49)

where \(\lambda ^p\ge 0\) is the plastic multiplier. The flow rule is complemented with the set of Kuhn–Tucker conditions

$$\begin{aligned} \beta \le 0 , \quad \quad \lambda ^p \ge 0, \quad \quad \text{ and } \quad \quad \beta \; \lambda ^p = 0 . \end{aligned}$$
(50)

To derive the weak form of the evolution problem, the total energy functional for the elastoplasticity model is defined as

$$\begin{aligned} \begin{aligned} {\mathcal {E}}(u,\varepsilon ^p,\alpha )&=\int ^{L}_{0} A \big [ {W}_{elas}(\varepsilon ,\varepsilon ^p)+{W}_{plas}(\alpha ) \big ]\, \mathrm {d}{{x}} \\&\quad -\int ^{L}_{0} \rho A{ {{{\bar{b}}}}} u\,\mathrm {d}x - A {\bar{t}} u \, \big |_{\partial _N{\mathcal {B}}} . \end{aligned} \end{aligned}$$
(51)

Minimization of the energy functional (22) with respect to the displacement field leads to the following weak formulation.

Formulation 3.3

(F3: Bayesian inversion for elastoplasticity) Consider an open bounded one-dimensional bar on an interval \({\mathcal B}:=(0,L)\) with boundary \(\partial {\mathcal B}\) defined at \(x=0\) and \(x=L\). Let constants (E \(,H,\sigma _Y) \ge 0\) be given with the initial conditions \(u_0= u({x},0)\) and \(\varepsilon ^p=\alpha ({x},0)\). For the loading increments \(n=1,2,\ldots , N\), find \(u:=u^n\in \mathrm {H}^1_0({\mathcal {B}})\) satisfying the following Euler–Lagrange equation in weak form:

$$\begin{aligned} {\mathcal E}_u(u,{\varvec{\varepsilon }}^p,\alpha ;\delta u)&=\int ^L_{0}\big [A\sigma \big (\varepsilon (u),\varepsilon ^p\big )\varepsilon (\delta u)-\rho A {\bar{b}} \delta u\big ]\,dv\\&\quad - A {\bar{t}} \delta u \, \big |_{\partial _N{\mathcal {B}}} = 0 \quad \forall \, \delta u \in \mathrm {H}_0^1({\mathcal {B}}), \end{aligned}$$

where \(\varepsilon ^p(x,t)\) evolves according to the evolution Eqs. (49) and (50), while \(\alpha (x,t)\) evolves according to the hardening law (42). The unknown material parameters for elastoplasticity denoted as \(\textsc {F3}\) then follow from the probabilistic Bayesian inversion

$$\begin{aligned}&{\mathfrak {P}}\leftarrow \textsc {BI}\big (\textsc {F3}({\mathfrak {u}})\big ) \quad {{\text {with}}}\quad {\mathfrak {u}}:=(u,\varepsilon ^p,\alpha ) \\&\quad \quad {{\text {and}}}\quad {\mathfrak {P}}:=(E,H,\sigma _Y) . \end{aligned}$$

One can show that the evolution Eqs. (42), (49) and (50), which completely determine the evolution of the plasticity variables \((\varepsilon ^p,\alpha )\), can also be obtained in weak from through minimization of the energy functional (51) with respect to \((\varepsilon ^p,\alpha )\). Due to the local nature of the plasticity variables in the present example, only the weak form of the mechanical balance equation is included in Formulation 3.3.

3.3.3 Bayesian Inference

In this numerical example, we consider a bar of unitary length \(L = 1\) with \(x\in {\mathcal B}:=[0,1]\) that is initially unstretched and unplasticized. Its left end is fixed, i.e., \(x=0\), while on its right end, i.e., \(x=1\), a monotonic displacement increment \(\Delta {\bar{u}}=5\times 10^{-4}\) mm is applied for 151 time steps; see Fig. 4a. We set \((\alpha ,\varepsilon ^p)=(0,0)\) at \(t=0\). Regarding the finite element mesh size, 100 elements are used. The main script is EP_1D.m and the code forwardmodel.m computes the solution with respect to the given candidates.

This problem is a good example to compare EnKF-MCMC and DRAM. The unknown ranges are mentioned in Table 5. The true values are used to produce the reference observation (reference.mat). We use \(\theta ^0=(E^0,\,H^0,\,\sigma _Y^0) =(60\,000,\,200,\,300)\). In order to implement the Bayesian inversion, we require the available range for the parameters (the prior density), for which we adopt the uniform distribution summarized in Table 5.

The inferred values were used to estimate the load-displacement curve shown in Fig. 10. Here, we use 8 000 samples to estimate the posterior density. As Fig. 9 shows, the chains estimated by the DRAM algorithm have a low uncertainty for E and \(\sigma _Y\); however, the variation for H is notable. On the other hand, the fluctuation of all unknowns in EnKF is negligible. Of course, this is an important advantage of using the Kalman filter compared to DRAM. The posterior densities verify this statement, where a wide distribution is achieved for H. For the yield stress, both methods performed similarly and have a relatively similar distribution. Also, the acceptance rate of EnKF is 98.4% and DRAM is 6.9%. The medians are summarized in Table 5, indicating the accuracy of both techniques (there is an excellent agreement between the simulations and the true values). In total, due to the higher acceptance ratio and significantly lower uncertainty (specifically of hardening), we conclude that EnKF is more suitable for the elastoplasticity example. Finally, we use the estimated values of EnKF and DRAM to plot the load-displacement curve during different time-steps; see Fig. 10.

Table 5 Example 3. The computational features and the results of the Bayesian inversion
Fig. 9
figure 9

Example 3. The evolution of the MCMC chains obtained by DRAM and EnKF for E, H, and \(\sigma _Y\) (the first row) and the corresponding pdf (the second row). The true values are shown with green dashed lines. (Color figure online)

Fig. 10
figure 10

Load-displacement curve for the elastoplasticity problem in Example 3, obtained using the inferred values

3.4 Example 4: Phase-Field Fracture for Brittle Materials

The fourth example addresses the variational phase-field modeling of brittle fracture. Starting with the work of [13, 15] and the subsequent developments [16,17,18,19, 21,22,23], this framework has gained significant popularity in the past decade due to its ability to naturally handle the complex behavior of fractured solids.

A Bayesian inversion framework was applied to phase-field modeling of brittle fracture in [51]. In the present illustrative example, we consider a one-dimensional setting, where the objective is to estimate Young’s modulus E and the fracture toughness \(G_c\) for a fixed length scale parameter (although the length scale can also be estimated).

3.4.1 State Variables and Kinematics

The response of a fracturing solid obeying a brittle phase-field model is governed by a two-field system of PDEs. In particular, at material points \(x\in {\mathcal {B}}\) and time \(t\in {\mathbb {T}}\), the solution of the coupled system provides the displacement field \(u:{\mathcal {B}} \times {\mathbb {T}} \rightarrow {\mathbb {R}}\) and the phase-field fracture variable \(d:{\mathcal {B}} \times {\mathbb {T}} \rightarrow [0,1]\). Here, \(d(x,t)=0\) and \(d(x,t)=1\) characterize an undamaged and a completely fractured material point, respectively. With the purpose of stating variational principles, we introduce the function spaces

$$\begin{aligned} \begin{aligned}&{\mathcal {W}}^{u}_{{\bar{u}}}:= \{u\in \mathrm {H}^1({\mathcal {B}}) \ : \ u={\bar{u}} \ \ \text {on} \ \ {\partial _D{\mathcal {B}}} \},\\&{\mathcal {W}}^{d}_{d_n}:= \{ d \in \mathrm {H}^1({\mathcal {B}},[0,1]) \ : \ d \ge d_n \}. \end{aligned} \end{aligned}$$
(52)

In particular, we use \({\mathcal {W}}^{u}_{0}\) and \({\mathcal {W}}^{d}_{0}\) when we have zero boundary condition (i.e., \(u=0\) and \(d=0\), respectively). Here, \({\partial _D{\mathcal {B}}}\equiv \{0,L\}\) denotes the Dirichlet boundary, with \({\bar{u}}(0,t)=0\). On the other hand, \({\mathcal {W}}^{d}_{d_n}\) is a non-empty, closed, and convex subset of \(\mathrm {H}^1({\mathcal {B}})\). This function space introduces the evolutionary character of the phase-field, incorporating an irreversibility condition in incremental form, where \(d_n\) is the damage value at a previous time instant.

3.4.2 Energy Quantities and Variational Principles

The energy density per unit volume in the present model is additively decomposed into stored elastic strain energy and crack-surface dissipated energy. In particular, one has

$$\begin{aligned} {W}(\varepsilon ,d) := {W}_{elas}(\varepsilon ,d) + {W}_{frac}(d,d'). \end{aligned}$$
(53)

The elastic contribution is assumed to have the simple quadratic form

$$\begin{aligned} {W}_{elas}(\varepsilon ,d):=\frac{1}{2}g(d)E\varepsilon ^2, \end{aligned}$$
(54)

where g(d) is a degradation function for which the usual quadratic form

$$\begin{aligned} g(d):=(1-d)^2 \end{aligned}$$
(55)

is adopted. On the other hand, the fracture contribution represents the regularized crack-surface energy density, expressed in terms of the current damage state as well as its spatial gradient, and modulated by a length scale parameter. In particular, we adopt the so-called AT-2 version of [28], where

$$\begin{aligned} {W}_{frac}(d,d') := G_c\bigg (\frac{d^2}{2l_f} + \frac{l_f}{2}d'^2\bigg ). \end{aligned}$$
(56)

In (56), \(G_c>0\) is the fracture toughness (more specifically, Griffith’s critical energy release rate) and \(l_f>0\) is the fracture length scale parameter that governs the regularization.

With the above definitions, a global energy functional is defined as

$$\begin{aligned} \begin{aligned} {\mathcal {E}}(u,d)&=\int ^{L}_{0} A \big [ {W}_{elas}(\varepsilon ,d)\\&\quad +{W}_{frac}(d,d') \big ]\, \mathrm {d}{{x}}. \end{aligned} \end{aligned}$$
(57)

Minimization of the energy functional (57) with respect to the displacement field and the crack phase-field leads to the following weak formulation.

Formulation 3.4

(F4: Bayesian inversion for phase-field brittle fracture) Consider an open bounded one-dimensional bar on an interval \({\mathcal B}:=(0,L)\) with boundary \(\partial {\mathcal B}\) defined at \(x=0\) and \(x=L\). Let constants (E \(, G_c, l_f) \ge 0\) be given with the initial conditions \(u_0= u(x,0)\) and \(d_0=d({x},0)\). For the loading increments \(n=1,2,\ldots , N\), find \(u:=u^n\in {\mathcal {W}}^u_{{\bar{u}}}\) and \(d:=d^n\in {\mathcal {W}}^d_{d_{n-1}}\) satisfying the following Euler–Lagrange equations in weak form:

$$\begin{aligned} \left\{ \begin{aligned} {\mathcal E}_u(u,d;\delta u)&=\int ^L_{0}(1-d)^2 E\varepsilon (u)\varepsilon (\delta u)\,\mathrm {d}x \\&=0 \quad \forall \,\delta u\in {\mathcal {W}}^u_0 ,\\ {\mathcal E}_d(u,d;\delta d)&= \int ^L_{0} \Big [-(1-d)E\varepsilon (u)^2\delta d + \frac{G_c}{l_f}d\,\delta d \\&\quad + l_f d'(\delta d)'\Big ]\,\mathrm {d}x \ge 0 \quad \forall \,\delta d \in {\mathcal {W}}^d_{0} . \end{aligned} \right. \end{aligned}$$

The unknown material parameters for phase-field fracture denoted as \(\textsc {F4}\) then follow from the probabilistic Bayesian inversion

$$\begin{aligned} {\mathfrak {P}}\leftarrow \textsc {BI}\big (\textsc {F4}({\mathfrak {u}})\big ) \quad {{\text {with}}}\quad {\mathfrak {u}}:=(u,d) \quad {{\text {and}}}\quad {\mathfrak {P}}:=(E,G_c) . \end{aligned}$$

The inequality in ()\(_2\) is a consequence of the irreversibility condition represented by the constraint \(d_{n}\in {\mathcal {W}}^d_{d_{n-1}}\). To resolve this issue and solve ()\(_2\) as an equality, the history field approach, proposed in [20] and widely employed in the phase-field literature, is adopted in this work.

3.4.3 Bayesian Inference

In this numerical example, we consider a bar of unitary length \(L = 1\) with \(x\in {\mathcal B}:=[0,1]\) that is initially unstretched and undamaged. Its left end is fixed, i.e., \(x=0\), while on its right end, i.e., \(x=1\), a monotonic displacement increment \(\Delta {\bar{u}}=1\times 10^{-5}\) mm is applied for 151 time steps. The example setup is shown in Fig. 4a. Regarding the finite element mesh size, 300 elements are used.

We use a two-dimensional Bayesian inversion to identify (E, \(G_c\)). The reference solution is a \(1\times 151\) vector computed by \(E=70\,500\,\text {MPa}\) and \(G_c=0.027\) kN/mm\(^2\) (the true values). For the Bayesian inference, we assume E is between 50 000 and 100 000 and \(G_c\) is between 0.02 and 0.03. As the initial guess, we set \(\theta ^0=(60\,000,0.025)\). The script name is \({\texttt {brittle\_1D.m}}\).

Using EnKF-MCMC with 1 000 iterations leads to the estimation of MCMC and also the posterior density. Figure 11 depicts the MCMC evolution for both parameters. A narrow posterior density for both unknowns points out the low uncertainty and fast convergence obtained employing EnKF-MCMC. The acceptance ratio of the chain is 12.2%. The estimated medians are \(E=70493\) and \(G_c=0.027\), which highlights the method accuracy. Finally, we use these values to estimate the load-displacement curve, and the results are shown in Fig. 12.

Fig. 11
figure 11

Example 4. The posterior densities of different parameters estimated by the EnKF method. The true values are shown with green dashed lines. (Color figure online)

3.5 Example 5: Phase-Field Fracture for Gradient-Extended Ductile Materials

In this example, the phase-field model for brittle fracture explored above is extended to the ductile case. To this end, the evolution of the phase-field variable is coupled to elastoplasticity, allowing for the initiation and propagation of ductile cracks. Initial works on this topic include [32,33,34,35,36, 38] (see [29, 50] for an overview). Moreover, to achieve a regularized plastic response, the extension to gradient-extended plasticity [27, 39] is considered, which has shown to ensure mesh-objective and physically meaningful responses in the post-critical stage.

The present Bayesian inversion framework was applied to the phase-field modeling of ductile fracture in our recent work [50], where three dimensional simulations were performed and compared to experimental observations. Herein, we present an illustrative one-dimensional example, where the objective is to estimate the parameters involved in both the elatoplasticity example (Sect. 3.2) and the brittle fracture example (Sect. 3.4).

Fig. 12
figure 12

Load-displacement curve for the brittle phase-field problem in Example 4, estimated by the inferred values

3.5.1 State Variables and Kinematics

The response of a fracturing solid obeying the present ductile phase-field model with gradient plasticity is governed by a three-field system of PDEs and a local plastic evolution equation. In particular, at material points \(x\in {\mathcal {B}}\) and time \(t\in {\mathbb {T}}\), the solution of the coupled system provides the displacement field \(u:{\mathcal {B}}\times {\mathbb {T}}\rightarrow {\mathbb {R}}\), the phase-field fracture variable \(d:{\mathcal {B}}\times {\mathbb {T}}\rightarrow [0,1]\) introduced in Sect. 3.4, and the plasticity variables \(\varepsilon ^p:{\mathcal {B}}\times {\mathbb {T}}\rightarrow {\mathbb {R}}\) and \(\alpha :{\mathcal {B}}\times {\mathbb {T}}\rightarrow {\mathbb {R}}_+\) introduced in Sect. 3.2. Being a phase-field model, as in Sect. 3.4, the constitutive state includes the gradient of Notethe crack phase-field \(d'(x,t)\). Moreover, in contrast with Sect. 3.2, we now render the equivalent plastic strain \(\alpha\) a non-local internal variable to regularize the plastic response in post-critical stages. As such, the constitutive state further includes the spatial gradient \(\alpha '(x,t)\).

Note, with the purpose of stating variational principles, we consider the function spaces (52) for the displacement field, the crack phase-field, and further for plasticity variables by (43).

3.5.2 Energy Quantities and Variational Principles

The energy density per unit volume in the present model is additively decomposed into stored elastic strain energy and the sum of plastic and crack-surface dissipation. In particular, one has

$$\begin{aligned} {W}(\varepsilon ,\varepsilon ^p,\alpha ,d,\alpha ',d')&:= {W}_{elas}(\varepsilon ,\varepsilon ^p,d) \nonumber \\&\quad + {W}_{plas}(\alpha ,d,\alpha ') + {W}_{frac}(d,d'). \end{aligned}$$
(58)

In agreement with (45) and (54), the elastic contribution reads

$$\begin{aligned} {W}_{elas}(u,\varepsilon ^p,d):=\frac{1}{2}g(d)E(\varepsilon -\varepsilon ^p)^2, \end{aligned}$$
(59)

where g(d) is the quadratic degradation function defined in (55). The stress-strain relation then reads

$$\begin{aligned} \sigma (\varepsilon ,\varepsilon ^p,d)=\frac{\partial W_{elas}}{\partial \varepsilon }=(1-d)^2E(\varepsilon -\varepsilon ^p). \end{aligned}$$
(60)

The plasticity contribution is defined as a gradient-extended damaged version of (46):

$$\begin{aligned} {W}_{plas}(\alpha ,d,\alpha ') := g(d)\bigg (\sigma _Y \alpha + \frac{1}{2}H \alpha ^2 + \frac{1}{2}\sigma _Y\,l_p\,\alpha '^2\bigg ), \end{aligned}$$
(61)

where, for simplicity, and as commonly done in the literature, the same quadratic degradation function (55) is employed to degrade the plastic energy density. Finally, the fracture contribution reads

$$\begin{aligned} {W}_{frac}(d,d') := w_0 d + \frac{1}{2} w_0 \, l_d^2\, d'^2. \end{aligned}$$
(62)

Note that, as opposed to (56), the fracture energy density is here defined as a linear function of d, representing a so-called AT-1 type formulation, where an elastic stage is included in the deformation process [29]. In (56), \(w_0>0\) is a critical fracture energy density, which can be directly related to the fracture toughness in the case of brittle fracture, while \(l_d>0\) is the fracture length scale parameter. It is worth mentioning that (61) and (62) imply that the dissipated energy in the present model is a state function.

With the above definitions, a global energy functional is defined as

$$\begin{aligned} \begin{aligned} {\mathcal {E}}(u,\varepsilon ^p,\alpha ,d)&=\int ^{L}_{0} A \big [ {W}_{elas}(\varepsilon ,\varepsilon ^p,d) + {W}_{plas}(\alpha ,d,\alpha ') \\&\quad + {W}_{frac}(d,d') \big ]\, \mathrm {d}{{x}} . \end{aligned} \end{aligned}$$
(63)

Minimization of the energy functional (63) with respect to the displacement field, the crack phase-field, and the plasticity variables leads to the following weak formulation.

Formulation 3.5

(F5: Bayesian inversion for phase-field ductile fracture with gradient plasticity) Consider an open bounded one-dimensional bar on an interval \({\mathcal B}:=(0,L)\) with boundary \(\partial {\mathcal B}\) defined at \(x=0\) and \(x=L\). Let constants (E \(,H,\sigma _Y,w_0,l_d,l_p) \ge 0\) be given with the initial conditions \(u_0= u({x},0)\), \(\varepsilon ^p_0=\varepsilon ^p({x},0)\), \(\alpha _0=\alpha ({x},0)\), and \(d_0=d({x},0)\). For the loading increments \(n=1,2,\ldots , N\), find \(u:=u^n\in {\mathcal {W}}^u_{{\bar{u}}}\), \(\varepsilon ^p={\varepsilon ^p}^n\in {\mathcal {W}}^p\), \(\alpha :=\alpha ^n\in {\mathcal {W}}^\alpha _{\alpha _{n-1},\,\varepsilon ^p-\varepsilon ^p_{n-1}}\), and \(d:=d^n\in {\mathcal {W}}^d_{d_{n-1}}\) satisfying the following Euler–Lagrange equations in weak form:

$$\begin{aligned} \left\{ \begin{aligned}&{\mathcal E}_u(u,\varepsilon ^p,\alpha ,d;\delta u)\\&\quad =\int ^L_{0}(1-d)^2 E\big (\varepsilon (u)-\varepsilon ^p\big )\varepsilon (\delta u)\,\mathrm {d}x =0 \quad \forall \,\delta u\in {\mathcal {W}}^u_0 ,\\&{\mathcal E}_\alpha (u,\varepsilon ^p,\alpha ,d;\delta \varepsilon ^p,\delta \alpha )\\&\quad = \int ^L_{0} -(1-d)^2 \Big [E\big (\varepsilon (u)-\varepsilon ^p\big )\delta \varepsilon ^p + \Big ( H\alpha + \sigma _Y \Big )\delta \alpha \\&\qquad + \sigma _Y \,l_p^2\,\alpha '(\delta \alpha )' \Big ]\,\mathrm {d}x \ge 0 \quad \forall \,\delta \varepsilon ^p \in {\mathcal {W}}^p, \quad \forall \,\delta \alpha \in {\mathcal {W}}^\alpha _{0,\,\delta \varepsilon ^p} ,\\&{\mathcal E}_d(u,\varepsilon ^p,\alpha ,d;\delta d)\\&\quad = \int ^L_{0} \Big [-(1-d)\Big (E\big (\varepsilon (u)-\varepsilon ^p\big )^2 + H\alpha ^2\\&\qquad + 2\sigma _Y\alpha + \sigma _Y\,l_p\,\alpha '^2\Big )\delta d + w_0\delta d \\&\qquad + w_0 \,l_d^2\, d'(\delta d)' \Big ]\,\mathrm {d}x \ge 0 \quad \forall \,\delta d \in {\mathcal {W}}^d_{0} . \end{aligned} \right. \end{aligned}$$

The unknown material parameters for ductile fracture denoted as \(\textsc {F5}\) then follow from the probabilistic Bayesian inversion

$$\begin{aligned}&{\mathfrak {P}}\leftarrow \textsc {BI}\big (\textsc {F5}({\mathfrak {u}})\big ) \quad {{\text {with}}}\quad {\mathfrak {u}}:=(u,\varepsilon ^p,\alpha ,d) \\&\quad \quad {{\text {and}}}\quad {\mathfrak {P}}:=(E,H,\sigma _Y,w_0,l_p) . \end{aligned}$$

As in Sect. 3.4, the history field approach [20] is employed to solve the variational inequality ()\(_3\). On the other hand, in ()\(_2\), one makes use of the relation \(\delta \alpha =\vert \delta \varepsilon ^p\vert\) and the incremental hardening law \(\alpha _{n}=\alpha _n+\vert \varepsilon ^p_{n}-\varepsilon ^p_{n-1}\vert\). This problem can be solved in a convenient way by eliminating \(\varepsilon ^p\) through the incremental flow rule \(\varepsilon ^p_{n}=\varepsilon ^p_{n-1}+(\alpha _n-\alpha _{n-1})\,\mathrm {sign}(\sigma ^{trial}_n)\), where \(\sigma ^{trial}_n:=\sigma (\varepsilon _{n},\varepsilon ^p_{n-1},d_{n})\), with \(\sigma\) given in (60); see, e.g., [50]. For loading paths without plastic flow reversals, e.g., monotonic loading with possible elastic unloading, the 1D problem is further simplified by setting \(\varepsilon ^p\equiv \alpha\).

3.5.3 Bayesian Inference

In this numerical example, we consider a bar of unitary length \(L = 1\) with \(x\in {\mathcal B}:=[0,1]\) that is initially unstretched, unplasticized and undamaged. Its left end is fixed, i.e., \(x=0\), while on its right end, i.e., \(x=1\), a monotonic displacement increment \(\Delta {\bar{u}}=5\times 10^{-4}\) mm is applied for 151 time steps; see Fig. 4a. For the spatial discretization, we use 100 elements. The main script is named ductile_1D.m.

In this example we use a four-dimensional Bayesian inversion to identify \((E,\,\sigma _Y,\,w_0,\,H)\) simultaneously. To this end, EnKF is chosen and we set an initial guess of \(E^0=60\,000\), \(\sigma _Y^0=300\), \(H^0=300\), \(w_0^0=20\). The parameter ranges are listed in Table 6 including the true values. Figure 13 shows the MCMC chains where they converge very fast. The posterior densities are depicted in Fig. 14, where for all unknowns, a narrow distribution is obtained. The medians of the MCMC chains are mentioned in Table 6, showing a very good accuracy. These values are used to plot the load-displacement curve shown in Fig. 15.

Table 6 The uniform prior distribution of the inferred parameters in Example 5 (ductile fracture) including the true values
Fig. 13
figure 13

Example 5. The evolution of the MCMC chains using EnKF for four different material parameters in ductile fracture

Fig. 14
figure 14

Example 5. The posterior density of the material parameter in ductile fracture using EnKF. The true values are shown with green dashed lines. (Color figure online)

Fig. 15
figure 15

The load-displacement curve for the ductile fracture problem in Example 5, estimated by the inferred values

In this example, following the new proposed the step-wise Bayesian inversion for ductile phase-field fracture [50], we consider four stages of Bayesian inversion to identify the parameters E (elastic stage), \(\sigma _Y\) (perfectly plastic stage), H (hardening stage), and \(w_0\) (damaging stage). The uniform prior densities including the true values are listed in Table 6. Such a step-wise Bayesian framework is computationally effective since a single parameter is estimated at each stage (and used as input in subsequent stages). The posterior densities (using the last 4 000 iterations) are illustrated in Fig. 13. The \({\hat{R}}\)-convergence of the parameters is depicted in Fig. 14 indicating the rapid convergence of all unknowns. Finally, the load-displacement curve obtained using the estimated parameters is shown in Fig. 15, indicating a typical ductile fracture process.

3.6 Example 6: Phase-Field Fracture for Thermoelastic Materials

Crack propagation due to the thermal effect occurs in different engineering problems such laser fracture, additive manufacturing, drying shrinking cracking of concrete. Here, the main challenge is the estimation of the displacements, the damage field, and temperature. In [42, 70], a fully coupled phase-field approach for solving thermo-mechanical systems was presented. This technique overcame the computational problems related to realization of sharp crack discontinuities, specifically in complex crack topologies.

The authors in [71], introduced a parallel algorithm to simulate the dynamic and quasi-static brittle fracture of thermoelastic materials including source codes. Moreover, in order to enhance the efficiency of the monolithic solver, in [70], a monolithic BFGS algorithm was implemented to solve the multi-field discretized equations.

3.6.1 State Variables and Kinematics

In this example, the given BVP is a coupled multi-field system for fracturing solids with thermal effects. Such a model can be formulated based on a coupled three-field system. In particular, at material points \(x\in {\mathcal {B}}\) and time \(t\in {\mathbb {T}}\), the BVP solution provides the displacement field \(u:{\mathcal {B}}\times {\mathbb {T}} \rightarrow {\mathbb {R}}\), the temperature field \({\mathcal {T}}:{\mathcal {B}}\times {\mathbb {T}} \rightarrow {\mathbb {R}}\), and the crack phase-field \(d:{\mathcal {B}}\times {\mathbb {T}} \rightarrow [0,1]\). Adopting the small strain hypothesis, the strain tensor is additively decomposed into an elastic part \(\varepsilon ^e\) and a thermal part \(\varepsilon ^{\mathcal {T}}\), that is,

$$\begin{aligned} \varepsilon (x,t) = \varepsilon ^e(x,t) + \varepsilon ^{\mathcal {T}}(x,t). \end{aligned}$$
(64)

For materials that expand isotropically when the temperature is increased, the thermal part can be computed as

$$\begin{aligned} \varepsilon ^{\mathcal {T}} =c({\mathcal {T}}-{\mathcal {T}}_0), \end{aligned}$$
(65)

where \({\mathcal {T}}_0\) is the initial temperature and c is the thermal expansion coefficient.

In the present one-dimensional problem, the thermal Dirichlet and Neumann boundary conditions are described by

$$\begin{aligned} {\mathcal {T}} = \bar{{\mathcal {T}}} \ \ \text {on}\ \ {\partial ^{{\mathcal {T}}}_ D{\mathcal {B}}} \quad {{\text {and}}}\quad Q\, n = {\bar{q}} \ \ \text {on}\ \ {\partial ^{{\mathcal {T}}}_N{\mathcal {B}}}, \end{aligned}$$
(66)

where Q is the thermal volume flux and \({\bar{q}}\) is the thermal transport on the Neumann boundary, where \(n=1\) for \(x=L\) and \(n=-1\) for \(x=0\), and \(\bar{{\mathcal {T}}}\) is the imposed temperature on the Dirichlet boundary. Moreover, the heat flux in (66) can be described by the negative direction of the thermal heat gradient \({{\mathcal {T}}^\prime}\) through Fourier’s law of heat conduction as

$$\begin{aligned} Q =-{{{\mathcal {K}}}}_d \;{{\mathcal {T}}^\prime}=- g(d){{\mathcal {K}}} {{\mathcal {T}}^\prime}. \end{aligned}$$
(67)

Here, \({{{\mathcal {K}}}}_d=g(d){{\mathcal {K}}}\) is the degraded thermal conductivity with the same quadratic degradation function given in (55).

To elaborate the corresponding variational formulation, we employ the function spaces (52) for the displacement and the crack phase-field, and further consider the function space (24) for the temperature field.

3.6.2 Energy Quantities and Variational Principles

Let \({\mathcal B}\subset {\mathbb {R}}\) be open and let \({\mathbb {T}} := ( t_0,T)\) with \(T>0\) being the end time value. The strong formulation of the quasi-static balance of linear momentum along with a prescribed external body force \({\bar{f}}\) satisfies

$$\begin{aligned} \begin{aligned}&\Big (E(x)g(d)(\varepsilon (x,t)-\varepsilon ^{\mathcal {T}}(x,t))\Big )' +{\bar{f}}=0 \\&\quad \forall \, u \in {\mathcal {W}}^u_{{\bar{u}}} \quad \quad \text {in} \quad {\mathcal B}\times {\mathbb {T}}. \end{aligned} \end{aligned}$$
(68)

Moreover, the energy balance statement based on the evolution of temperature yields the following strong form

$$\begin{aligned} \begin{aligned} \rho \,c\,\dot{{\mathcal {T}}}+Q'={\bar{r}}_{\mathcal {T}} \quad \quad \forall \,{\mathcal {T}} \in {\mathcal {W}}^{\mathcal {T}}_{\bar{{\mathcal {T}}}} \quad \quad \text {in} \quad {\mathcal B}\times {\mathbb {T}}, \end{aligned} \end{aligned}$$
(69)

initialized with

$$\begin{aligned} {\mathcal {T}}={\mathcal {T}}_0 \quad \quad \text {in} \quad {\mathcal B}\times {0}. \end{aligned}$$
(70)

Additionally, the global evolution equation for the crack phase-field in the rate-dependent form yields the following local statement:

$$\begin{aligned} \begin{aligned} (1-d){\mathcal {D}}-(d-l_f^2d'')=\eta _f{\dot{d}}\quad \quad \forall \, d \in {\mathcal {W}}^d_{{\bar{d}}}\quad \quad \text {in}\quad {\mathcal B}\times {\mathbb {T}}, \end{aligned} \end{aligned}$$
(71)

together with a homogeneous Neumann condition for the crack surface:

$$\begin{aligned} \partial _n{d}=0\quad \quad \text {in} \quad \partial {\mathcal B}\times {\mathbb {T}}. \end{aligned}$$
(72)

Here, we introduce a positive crack driving force \({\mathcal D}\) in \(t\in [0,t_n]\). To define \({\mathcal D}\), in agreement with (45) and (54), the elastic strain energy affected by temperature reads

$$\begin{aligned} {W}_{elas}(u,\varepsilon ^{\mathcal {T}},d):=\frac{1}{2}g(d)E (\varepsilon -\varepsilon ^{\mathcal {T}})^2, \end{aligned}$$
(73)

such that a positive crack driving force \({\mathcal D}\) can be defined as

$$\begin{aligned} {\mathcal {D}}:={\mathcal {D}}(\varepsilon ,\varepsilon ^{\mathcal {T}})=\frac{\partial W_{elas}}{\partial d}=-(1-d)E(\varepsilon -\varepsilon ^{\mathcal {T}})^2, \end{aligned}$$
(74)

where g(d) is a degradation function. The weak forms of the local statements (68), (69), and (71) induce the following formulation:

Formulation 3.6

(F6: Bayesian inversion for phase-field fracture with thermoelasticity) Consider an open bounded one-dimensional bar on an interval \({\mathcal B}:=(0,L)\) with boundary \(\partial {\mathcal B}\) defined at \(x=0\) and \(x=L\). Let the positive constants \(({{\bar{r}}_{\mathcal {T}}},{\bar{q}}, E,G_c,l_f,K,\rho ,{{\mathcal {C}}})\) be given with the initial conditions \(u_0= u({x},0)\), \({\mathcal {T}}_0={\mathcal {T}}({x},0)\), and \(d_0=d({x},0)\). For the loading increments \(n=1,2,\ldots , N\), find \(u:=u^n\in {\mathcal {W}}^u_{{\bar{u}}}\), \({\mathcal {T}}:={\mathcal {T}}^n\in {\mathcal {W}}^{{\mathcal {T}}}_{\bar{{\mathcal {T}}}}\), and \(d:=d^n\in {\mathcal {W}}^{d}_{d_n}\) satisfying the following Euler–Lagrange equations in weak form:

$$\begin{aligned} \left\{ \begin{aligned}&{\mathcal E}_u(u,{\mathcal {T}},d;\delta u)\\&\quad =\int ^L_{0}(1-d)^2 E\big (\varepsilon (u)-\varepsilon ^{{\mathcal {T}}}({\mathcal {T}})\big )\varepsilon (\delta u)\,\mathrm {d}x =0 \quad \forall \,\delta u\in {\mathcal {W}}^u_0 ,\\&{\mathcal E}_{\mathcal {T}}(u,{\mathcal {T}},d;\delta {\mathcal {T}}) \\&\quad = \displaystyle \int ^L_0 \Big [\Big ({\rho \,c}({\mathcal {T}}-{\mathcal {T}}_n) -\Delta t\;{\bar{r}}_{\mathcal {T}} \Big )s \\&\qquad + (\Delta t\;{{{\mathcal {K}}}}_d \;{{\mathcal {T}}^\prime}) \cdot (\delta {\mathcal {T}})' \Big ] \,\mathrm {d}x + {\bar{q}}\delta {\mathcal {T}}\,\big |_{\partial _N^{{\mathcal {T}}}{\mathcal {B}}} = 0, \\&\qquad \forall \,\delta {\mathcal {T}} \in {\mathcal {W}}^{\mathcal {T}}_{0},\\&{\mathcal E}_d(u,\varepsilon ^p,d;\delta d)\\&\quad = \int ^L_{0} \Big [-(1-d)E\big (\varepsilon (u)-\varepsilon ^{\mathcal {T}}({\mathcal {T}})\big )^2\delta d \\&\qquad + \frac{G_c}{l_f}d\,\delta d + l_f d'(\delta d)'\Big ]\,\mathrm {d}x \ge 0 \\&\qquad \forall \,\delta d \in {\mathcal {W}}^d_{0} . \end{aligned} \right. \end{aligned}$$

The unknown material parameters for phase-field fracture in thermoelastic materials denoted as \(\textsc {F6}\) then follow from the probabilistic Bayesian inversion

$$\begin{aligned}&{\mathfrak {P}}\leftarrow \textsc {BI}\big (\textsc {F6}({\mathfrak {u}})\big ) \quad {{\text {with}}}\quad {\mathfrak {u}}:=(u,{\mathcal {T}},d) \\&\quad \quad {{\text {and}}}\quad {\mathfrak {P}}:=(E,G_c,K,c) . \end{aligned}$$

3.6.3 Bayesian Inference

The range of the parameters and the true values are listed in Table 7. The script named \({\texttt {1D\_thermoelastic.m}}\) with EnKF is used to identify the unknown parameters. We use the load-displacement curve (estimated by the true values) as the reference observation for a time interval \(T=1\times 10^{5}\) seconds.

Table 7 The uniform prior distribution of the inferred parameters in Example 6 (phase-field fracture with thermoelasticity) including the true values
Fig. 16
figure 16

Example 6. The evolution of the MCMC chains using EnKF for four different material parameters in thermoelastic example

Fig. 17
figure 17

Example 6. The posterior density of the material parameter in thermoelastic example using EnKF. The true values are shown with green dashed lines. (Color figure online)

Fig. 18
figure 18

The load-displacement curve for the thermoelastic fracture problem in Example 6 estimated by the inferred and true values

Fig. 19
figure 19

Example 6. The evolution of displacement (top left), phase-field (top right), and the temperature (bottom) during different time steps. The last step which used for the Bayesian inversion is shown with a dashed black line

Consider a bar of unitary length \(L = 1\) with \(x\in {\mathcal B}:=[0,1]\) that is initially unstretched and undamaged. Its left end is fixed, i.e., \(x=0\), while on its right end, i.e., \(x=1\), a monotonic displacement increment \(\Delta {\bar{u}}=1\times 10^{-3}\) mm is applied for 155 time steps; see Fig. 4c. We use 99 elements for the spatial discretization. The initial values are \(G_c^0=0.05\), \(E^0=300\), \({\mathcal {K}}^0=5\times 10^{-2}\), and \(c^0=1\times 10^{-3}\). For temperature boundary condition, the one dimensional bar is restricted according to (25) such that \({\mathcal {T}}_1=1^{\circ }\;\text {C}\) and \({\mathcal {T}}_2=0^{\circ }\;\text {C}\). The reference simulation is performed for \(t=1\times 10^{5}\) s.

The evolutions of the MCMC chains for all parameters are shown in Fig. 16. The unknowns show a negligible uncertainty and converge rapidly to the true values with an acceptance rate of 71.6%. The posterior densities are illustrated in Fig. 17. The distribution of \(G_c\) and E is symmetric, and the true values are in the center (the median). The medians are shown in Table 7. We compare the load-displacement diagram using inferred and true values, as shown in Fig. 18. An excellent agreement between the curves points out the accuracy of the method.

As previously mentioned, the reference observation is chosen at the last time step. We show the displacement u, the phase-field d, and the temperature \({\mathcal {T}}\) for 100 time steps in Fig. 19.

3.7 Example 7: Phase-Field Approach to Predict Fatigue in Brittle Materials

The last example considers the phase-field approach to predict fatigue, a topic that has gained attention in the recent literature. Most works on this subject focus on brittle materials [43, 44, 72,73,74], although models for rubber [75], hydrogen-assisted fatigue [76], ductile materials [45], and ductile materials with plastic coupling [46, 49] have also been proposed. Here, we focus on the 1D formulation for the brittle case, initially addressed in [43].

The brittle fracture problem presented in Sect. 3.4 is taken as a point of departure. However, the displacements are now imposed cyclically. To account for the effect of cyclic loading, a fatigue degradation function is introduced, characterized in the simplest case by two material parameters which are hereby estimated along with Young’s modulus and the fracture toughness.

3.7.1 State Variables and Kinematics

As in Sect. 3.4, the primary fields in the present model consist of the displacement field \(u:{\mathcal {B}} \times {\mathbb {T}} \rightarrow {\mathbb {R}}\) and the non-local phase-field fracture variable \(d:{\mathcal {B}} \times {\mathbb {T}} \rightarrow [0,1]\), with the corresponding function spaces given in (52). Consequently, the fatigue mechanism does not entail the introduction of a new internal variable, but rather, of a history-dependent parameter, as will become clear below.

subsubsectionEnergy Quantities and Variational Principles

The standard phase-field model for brittle fracture, i.e., based on the regularized crack surface energy density (56), predicts crack propagation at critical stress amplitudes. As such, the model is not suitable to describe fatigue fracture under cyclic loading, which may occur at repetitive load amplitudes well below the ultimate strength of the material. To account for fracture under such conditions, Alessi et al. [43] proposed to progressively degrade the crack resisting force by means of a suitable accumulation variable, for which a measure of accumulated energy was later established [44] and adopted in subsequent works.

In the context of the above-mentioned framework, the definition of energy quantities that comply with the second law of thermodynamics, i.e., non-decreasing energy dissipation, requires a delicate treatment. Specifically, the definition of a state function representing the regularized dissipated energy due to fracture, as done in (56) and (62), is no longer possible. Instead, we must rely on a path-dependent quantity, with a fatigue degradation mechanism acting on the rate of crack-surface energy dissipation. In particular, we may define a total energy density of the form

$$\begin{aligned} {W}(\varepsilon ,d;\gamma ) := {W}_{elas}(\varepsilon ,d) + \int _0^tf(\gamma )\frac{\mathrm {d}}{\mathrm {d}t}{W}_{frac}(d,d')\,\mathrm {d}t. \end{aligned}$$
(75)

Because the crack driving force is not modified, the stored elastic strain energy (54) is again employed in the present model. On the other hand, the time derivative of the regularized fracture energy density (56) is scaled by a non-negative degradation function \(f(\gamma )\), to be defined below, which renders the dissipated energy a path-dependent quantity. Note that in (75), the second law of thermodynamics is satisfied by the non-negativity of the dissipation rate, i.e., \(f(\gamma )\frac{\mathrm {d}}{\mathrm {d}t}{W}_{frac}(d,d')\ge 0\).

In (75), we have introduced a fatigue accumulation variable \(\gamma :{\mathcal {B}}\times {\mathcal {T}}\rightarrow {\mathbb {R}}_+\) and a fatigue degradation function \(\gamma \mapsto f(\gamma )\in [0,1]\), endowed with the properties \(f(\gamma \le \gamma _c)=1\), \(f(\gamma >\gamma _c)\in [0,1]\) and \(f'(d) \ge 0\). In particular, we adopt the following form [44]:

$$\begin{aligned} f(\gamma ):={\left\{ \begin{array}{ll} 1 &{}\quad \text {if} \quad \gamma (x,t) \le \gamma _c, \\ \bigg [1-k\log \bigg (\frac{\gamma (x,t)}{\gamma _c}\bigg )\bigg ]^2 &{}\quad \text {if} \quad \gamma _c\le \gamma (x,t) \le \gamma _c10^{1/k}, \\ 0 &{}\quad \text {otherwise}, \end{array}\right. } \end{aligned}$$
(76)

where \(k>0\) is a material parameter that controls the rate of (logarithmic) decay of the fatigue degradation function, and \(\gamma _c\ge 0\) is a material threshold parameter, under which no fatigue effects are triggered. The fatigue variable \(\gamma\) is defined as an accumulation of strain energy density during loading stages. To this end, we define

$$\begin{aligned}&\gamma (x,t) :=\int _{0}^t{\dot{\vartheta }}(x,s){\bar{H}}\big ({\dot{\vartheta }}(x,s)\big )\, \mathrm {d}s, \nonumber \\&\quad \text {with} \quad \vartheta (x,t):=W_{elas}(\varepsilon ,d), \end{aligned}$$
(77)

where \({\bar{H}}\) is the Heaviside function.

In view of the path-dependent energy density (75), a total energy functional can only be approximated in incremental form. In agreement with previous incremental treatments for state-dependent dissipation potentials [77, 78], we consider the form

$$\begin{aligned} \begin{aligned} {\mathcal {E}}(u_{n+1},d_{n+1};\gamma _n)&=\int ^{L}_{0} A \big [ {W}_{elas}(u_{n+1},d_{n+1})\\&\quad +f(\gamma _n){W}_{frac}(d_{n+1},{d_{n+1}^\prime})\big ]\, \mathrm {d}{{x}} , \end{aligned} \end{aligned}$$
(78)

where the current time step is denoted with a subscript \(n+1\). Note that the pseudo-time integral in (75) has been evaluated in incremental form by fixing the fatigue variable \(\gamma\) at the previous time step. Minimization of the energy functional (78) with respect to the displacement field and the crack phase-field leads to the following weak formulation.

Formulation 3.7

(F7: Bayesian inversion for phase-field approach to fatigue) Consider an open bounded one-dimensional bar on an interval \({\mathcal B}:=(0,L)\) with boundary \(\partial {\mathcal B}\) defined at \(x=0\) and \(x=L\). Let constants (E \(,G_c,l_f,\gamma _c,k) \ge 0\) be given with the initial conditions \(u_0= u(x,0)\) and \(d_0=d({x},0)\). For the loading increments \(n=1,2,\ldots , N\), find \(u:=u^n\in {\mathcal {W}}^u_{{\bar{u}}}\) and \(d:=d^n\in {\mathcal {W}}^d_{d_{n-1}}\) satisfying the following Euler–Lagrange equations in weak form:

$$\begin{aligned} \left\{ \begin{aligned}&{\mathcal E}_u(u,d;\delta u)\\&\quad =\int ^L_{0}(1-d)^2 E\varepsilon (u)\varepsilon (\delta u)\,\mathrm {d}x =0 \quad \forall \,\delta u\in {\mathcal {W}}^u_0 ,\\&{\mathcal E}_d(u,d;\delta d)\\&\quad = \int ^L_{0} \Big [-(1-d)E\varepsilon (u)^2\delta d + f(\gamma _{n-1})\frac{G_c}{l_f}d\,\delta d \\&\qquad + f(\gamma _{n-1})l_f d'(\delta d)'\Big ]\,\mathrm {d}x \ge 0 \\&\qquad \forall \,\delta d \in {\mathcal {W}}^d_{0} . \end{aligned} \right. \end{aligned}$$
(79)

The unknown material parameters for phase-field approach to fatigue denoted as \(\textsc {F7}\) then follow from the probabilistic Bayesian inversion

$$\begin{aligned} {\mathfrak {P}}\leftarrow \textsc {BI}\big (\textsc {F7}({\mathfrak {u}})\big ) \quad {{\text {with}}}\quad {\mathfrak {u}}:=(u,d) \quad {{\text {and}}}\quad {\mathfrak {P}}:=(E,G_c,\gamma _c,k) . \end{aligned}$$

Once more, the history field approach [20] is employed here to handle the inequality constraint in (79)\(_2\).

Fig. 20
figure 20

Example 7. Cyclic displacement loading applied to the right-edge of the homogeneous uniaxial test shown in Fig. 4c

3.7.2 Bayesian Inference

In this numerical example, we consider a bar of unitary length \(L = 1\) with \(x\in {\mathcal B}:=[0,1]\) that is initially unstretched and undamaged. We set \(\gamma =0\) at \(t=0\). The left end of the bar is fixed, i.e., \(x=0\), while cyclic displacements are imposed on the right end , i.e., \(x=1\), in increments \(\Delta {\bar{u}}=2\times 10^{-4}\) mm. We consider 30 loading cycles with maximum and minimum values of 5 mm and -5 mm, respectively; see Fig. 4a. Regarding the spatial discretization, we use 300 elements. The cyclic displacement loading applied to the right-edge of the bar is shown in Fig. 20.

In order to perform the Bayesian inversion, we estimate simultaneously \((E,\,k,\,G_c,\,\gamma _c)\) (four-dimensional Bayesian inversion). The assumed ranges and true values are given in Table 8. The main script is \({\texttt {1D\_fatigue.m}}\) and we employ the DRAM algorithm to infer the materials unknowns.

Figure 21 shows the effect of different parameters on the load-displacement diagram. For materials with low Young’s modulus (e.g., ductile materials), several load cycles are needed for fracture. However, for too stiff materials (e.g., brittle materials), fewer load cycles lead to a full fracture. Regarding higher \(G_c\), as more energy is needed for fracture, more load cycles are necessary. Hence, e.g., \(G_c=0.04\,\text {MPa}\) requires more time (i.e., higher cycle number), and the difference between the peak points is more pronounced. Inversely, less \(G_c\) facilitates full fracture. As shown, the same pattern is observed for \(\gamma _c\). Finally, k is a phenomenological parameter used to calibrate the fatigue degradation process once the threshold value \(\gamma _c\) is overcome.

Table 8 The computational features and the results of the Bayesian inversion for Example 7
Fig. 21
figure 21

Example 7. The effect of different parameters on the load-displacement curve

Fig. 22
figure 22

Example 7. The left curve is a load-displacement curves of the homogeneous response for a uniaxial tests under displacement loading. The right curve is homogeneous load response versus cycle number with damage under displacement loading and the selected critical points for the Bayesian inversion (shown in red). (Color figure online)

Figure 22 shows the homogeneous response for a uniaxial test under the displacement loading displayed in Fig.4c. In order to enhance the Bayesian inference efficiency, we only select some critical points. In fact, as Fig. 21 depicts, the effect of different material unknowns on the load-displacement is more tangible on the peak points and after the fracture. Therefore, instead of all points, only these points are used for the Bayesian framework. These points are illustrated in Fig. 22. The evolutions of the MCMC chains for all parameters are shown in Fig. 23.

Fig. 23
figure 23

Example 7. The evolution of the MCMC chains for different parameters

Fig. 24
figure 24

Example 7. The posterior density for different parameters. The true values are shown with a dashed green line. (Color figure online)

Fig. 25
figure 25

Example 7. The load versus cyclic number curves of the homogeneous uniaxial tests under displacement loading using, true, inferred, and initial values

We use the DRAM algorithm to identify the parameters. Fig. 24 shows the MCMC chains of the parameters where the acceptance rate is 3.3% and all parameters converged. The initial values are \(E^0=60\,000\), \(k^0=0.4\), \(G_c^0=0.3\), and \(\gamma _c^0=0.0075\). The respective posterior densities are shown in Fig. 24, and the medians are summarized in Table 8. It seems that E and k are inferred correctly. However, the estimation of \(G_c\) and \(\gamma _c\) is not sufficiently accurate. This probably due to the similar effect of the energy parameters on the load-displacement curve, e.g., causing an overestimation of \(G_c\) and an underestimation of \(\gamma _c\) that may balanced each other. We use the inferred values (Table 8) to calculate the diagram and compare the obtained values with initial values (\(\theta ^0\)) and the reference values. As Fig. 25 shows, excluding the last peak point, all points are estimated acceptably, showing the relative accuracy of the model.

4 Overview Software Package

Bayesian inversion is a robust, simple, and efficient computational technique to provide reliable information about the model parameters and uncertainties. The mechanical models given in this work constitute relevant model problems that can be further considered in further works. The provided codes can be introduced/discussed in academic classes and can be extended to two- or three-dimensional settings. Moreover, the given examples have been considered in recent fundamental and applied studies. Of course, there are still several open questions in these fields, and we hope that the codes provided herein can be a starting point for further researches

In this section, we present an overview of the codes and discuss their performance as the forward and backward models. Here, we strive to provide a comprehensive package to review the common MCMC techniques. Table 9 shows the MCMC codes including their description. We should note that in all examples the function forwardmodel.m is the forward model and considers the response of the model problem to the given candidates. An overview of the mechanical codes is given in Table 10.

Table 9 The overview of the Bayesian inversion codes
Table 10 The overview of the one-dimensional mechanical codes

We observed that for the problems with one unknown, all MCMC techniques worked efficiently. Similar results have been achieved for a two-dimensional probabilistic problem, in case that the parameters do not correlate (heat problem). For more complicated examples, MH, AMH, and DR were not effective; therefore, DRAM and EnKF have been employed. Due to the more efficient proposal adaptation when using the Kalman filter, the acceptance rate is noticeably higher compared to DRAM. EnKF works well for phase-field problems, including brittle and ductile fracture. The obtained results for fatigue fracture were not as good as for other examples, likely due to the high correlation of the critical fracture and fatigue parameters.

Additionally, to evaluate the stability of our implementation, let us consider Example  3.5, i.e., phase-field fracture for gradient-extended ductile materials, and investigate the convergence behavior of the model problem. More specifically, we consider the residual of the staggered solution procedure. Therefore, we assume the solutions at the converged state as \({\mathfrak {U}}^k:=(u^k,\varepsilon ^{p,k},\alpha ^k,d^k)\) at iteration k, such that two options for checking the staggered residual can be defined:

  1. 1.

    Balance of equilibrium equations (weak formulation) at the converged state:

    $$\begin{aligned} \mathrm {Res}_\mathrm {Stag}^k&:= |{\mathcal E}_u({\mathfrak {U}}^k;\delta u)|+ |{\mathcal E}_\alpha ({\mathfrak {U}}^k;\delta \varepsilon ^p,\delta \alpha )|+ |{\mathcal E}_d({\mathfrak {U}}^k;\delta d)| \nonumber \\&\le {\texttt {TOL}}_\mathrm {Stag}; \end{aligned}$$
    (80)
  2. 2.

    Subsequent solutions at the converged state:

    $$\begin{aligned} \mathrm {Res}_\mathrm {Stag}^k&:= |u^k-u^{k-1}|+ |\alpha ^k-\alpha ^{k-1}|+ |d^k-d^{k-1}|\nonumber \\&\le {\texttt {TOL}}_\mathrm {Stag}. \end{aligned}$$
    (81)

We then define the staggered residual in logarithmic space as

$$\begin{aligned} \mathtt {residual}:=\log _{10}({\mathrm {Res}_\mathrm {Stag}}). \end{aligned}$$
(82)

We examine the ductile phase-field fracture model through the posterior density of the unknowns obtained with EnKF in Table 6. We set \({\texttt {TOL}}_\mathrm {Stag}=1\times 10^{-6}\). The convergence performance based on (80) is shown in Fig. 26 (left), while the alternative approximation based on (81) is shown in Fig. 26 (right). The results show that based on the user criteria, the code reaches the desired convergence state, thus suggesting a stable implementation.

Fig. 26
figure 26

Convergence behavior of the different versions of the staggered residual. Left: based on balance of equilibrium Eq. (80), and right: subsequent solutions (81) at four different loading steps \({\bar{u}}=[0.0475,0.058,0.0655,0.0725]\;mm\). For the residual value, we set \({\texttt {TOL}}_\mathrm {Stag}=1\times 10^{-6}\)

5 Conclusion

The implementation of Bayesian inversion in different benchmark mechanical problems has been studied in this work. We compared the performance of different common MCMC techniques. Random-walk MCMC and MH can be easily used; however, they could not infer the unknowns in multi-dimensional cases. Using proposal adaptation and delayed rejection (global and local adaptation) improved the Bayesian inversion. Combing both methods gives rise to an effective MCMC technique. The Kalman filter in Bayesian inference leads to an accurate estimation of the desired parameters. As observed, different material parameters can be estimated simultaneously using the probabilistic MCMC techniques. We presented a MATLAB package including all codes alongside the manuscript.

In mechanical problems, the simultaneous and accurate inference of the parameters is crucial; otherwise, the estimation is not reliable. We conclude that, despite their higher complexity, DRAM and EnKF are more suitable MCMC techniques for parameter estimation in the present examples when compared to the other presented methods. Moreover, EnKF leads to less fluctuation of MCMC in comparison with DRAM and a higher acceptance rate. Therefore, the posterior densities are relatively narrower, indicating more reliable results.