1 Introduction

The confluence of new manufacturing technologies, such as lithography and 3D-printing, novel stimuli-responsive materials, also called smart materials, and the development of fluidic, electric and magnetic driven actuator mechanisms is enabling a deep shift from conventional hard robotics to soft robotics during the last few decades [1, 2]. The range of potential applications of this new generation of robots is large and includes, among many others, exo-suits for rehabilitation of patients or assisting the elderly [3], surgical assistance [4], and ocean exploration [5].

Many recent survey articles have addressed several key areas of this multidisciplinary field, e.g. associated manufacturing technologies [6], applications [7] and control strategies [8]. However, as indicated in [9], “lack of simulation and analysis tools are likely to dampen progress in this field". This review article is intended to provide a survey on some relevant mathematical aspects that hopefully could be of help to stimulate further research in numerical simulation, analysis and control of soft robots. In this regard, this paper complements existing survey papers in the field of soft robotics.

The literature on control of hyperelastic materials adopting a rigorous mathematical prism is relatively scarce and reduces to the case of open-loop, steady-state, control systems. Indeed, in [10] sufficient conditions are provided to prove the existence of solutions for a "design of implants" problem which is formulated as a control problem on a hyperelastic body using a tracking type objective functional. The article [11] focuses on modeling and numerical algorithms for two control problems where controls act on the system as internal pressure and fiber tension. Following [10], existence of solutions for those problems, with uncertain material properties, is established in [12]. The case in which the metric involves distance functions has been considered for the first time in this context in [13]. A combined design-control problem for hard magnetics soft materials is studied in detail in [14]. It is also worth mentioning [15], where an existence result of optimal solutions for an elastic contact problem in the regime of finite deformations is proved.

This paper is mainly addressed to an audience with some mathematical background. Even so, many parts of the article are written in a non-technical language in order to make the paper accessible to researchers more interested in applications and who aim at learning how Mathematics could contribute along this exciting and promising multidisciplinary field. The focus here is not placed on specific prototypes of soft robots, some of which require very simple mathematical tools, but on a general overview of mathematical modeling, analysis and control of soft smart materials.

2 Mathematical modeling and analysis of soft materials

Some common features of soft materials are the following:

  • They are made of soft smart materials, e.g.:

    1. 1.

      Dielectric Elastomers (DEs) (Fig. 1)

    2. 2.

      Magneto-active Polymers (Fig. 2)

  • They are biologically inspired, e.g., human tissue like muscles, tendons, fibers...,

  • its compliance (or rigidity) matches with typical biological compliance, what facilitates interaction with humans, and

  • they are actuated (controlled) by electric or magnetic fields, pressure difference (pneumatic artificial muscles), tension along fibers, etc.

Fig. 1
figure 1

Schematic representation of a dielectric elastomer

Fig. 2
figure 2

Soft polymeric matrices with hard magnetic particles embedded

From the point of view of mathematical modeling, the two main properties of soft materials are: (1) all material points may be deformed, i.e., a soft material is a continuum and so it has an infinite number of Degrees of Freedom, and (2) soft materials have a nonlinear behavior. As a consequence, nonlinear continuous mechanics (in particular, hyperelasticity) is the right physical theory to model these materials.

2.1 A brief review on nonlinear continuum mechanics

Let \(\Omega _0\subset {\mathbb {R}}^N\), \(N=2,3\), be an open, bounded and connected domain which represents the reference (or non deformed) configuration of an elastic body. The deformation of the body \(\Omega _0\) is defined through the mapping \(\varvec{\Phi }:\Omega _0\rightarrow {\mathbb {R}}^N\), which is assumed to be sufficiently smooth, injective and orientation preserving. The mapping \(\varvec{\Phi }\) links a material particle from the reference configuration \(\varvec{X}\in \Omega _0\) to a particle in the deformed configuration \(\varvec{x}\in \Omega \) according to \(\varvec{x} = \varvec{\Phi }\left( \varvec{X}\right) \) and \(\Omega =\varvec{\Phi }(\Omega _0)\) (see Fig. 3).

Fig. 3
figure 3

The mapping \(\varvec{\Phi }\) between reference \(\Omega _0\) and deformed \(\Omega \) configurations. Boundary \(\Gamma _0=\Gamma _{0_D}\cup \Gamma _{0_N}\) in the deformed configuration and its deformed counterpart \(\Gamma =\Gamma _D\cup \Gamma _N\). Picture taken from [13]

2.1.1 Kinematics

Associated with the deformation mapping \(\varvec{\Phi }\), the three important kinematics variables are: (i) the deformation gradient

$$\begin{aligned} \varvec{F}: \Omega _0\rightarrow {\mathbb {R}}^{N\times N},\quad \varvec{F} = \varvec{\nabla }_0\varvec{\Phi }(\varvec{X}), \end{aligned}$$

where \(\varvec{\nabla }_0(\bullet )\) is the material gradient operator with respect to \(\varvec{X}\in \Omega _0\), which accounts for deformations along curves, (ii) the Jacobian \(J = \det \varvec{F}\), that quantifies volumetric changes, and (iii) the co-factor \( \varvec{H} = J\varvec{F}^{-T} \), that measures deformations along surfaces. Here, \(\varvec{F}^{-T}\) denotes the inverse of the transpose of \(\varvec{F}\).

To avoid interpenetration of matter, the orientation-preserving condition \(J\left( \varvec{X}\right) >0\) a.e. \(\varvec{X}\in \Omega _0\) is imposed.

2.1.2 Constitutive equations: the deterministic case

In nonlinear elasticity, the constitutive information is encapsulated in a stored energy density \(e=e(\varvec{F}):{\Omega _0}\rightarrow {\mathbb {R}}\). In this paper, we consider strain energy functions of the form

$$\begin{aligned} e(\varvec{F}) = W_{\text {elastic}}(\varvec{F},\varvec{H},J), \end{aligned}$$
(1)

with W a convex multi-variable function with respect to \(\{\varvec{F},\varvec{H},J\}\). In other words, we consider stored energy functions which are polyconvex [16]. In addition, we require the strain energy function \(e(\varvec{F})\) to satisfy the coercivity inequality, i.e.,

$$\begin{aligned} W_{\text {elastic}}(\varvec{F},\varvec{H},J)\ge \alpha (\Vert \varvec{F}\Vert ^2+\Vert \varvec{H}\Vert ^2+J^2)+\beta ,\quad \alpha >0, \beta \in {\mathbb {R}}. \end{aligned}$$
(2)

A general class of materials which complies with both conditions in (1) and (2) is that of Mooney-Rivlin materials, whose stored energy density takes the form

$$\begin{aligned} \begin{array}{ll} W_{\text {MR}}(\varvec{F},\varvec{H},J) &{} =\mu _1\Vert \varvec{F}\Vert ^2+\mu _2\Vert \varvec{H}\Vert ^2+\mu _3\left( J-1\right) ^2\\ &{}\quad -2(\mu _1 + 2\mu _2)\log (J)-3(\mu _1 + \mu _2), \end{array} \end{aligned}$$
(3)

where \(\Vert \bullet \Vert \) is the Frobenius norm induced by the inner product \(\varvec{A}:\varvec{B}:=\text {tr }\varvec{A}^T\varvec{B}\) of matrices \(\varvec{A},\varvec{B}\in {\mathbb {R}}^{N\times N}\). The model parameters \(\{\mu _1, \mu _2, \mu _3\}\) are positive and related to shear \(\mu \) and bulk \(\kappa \) moduli by

$$\begin{aligned} \mu _1+\mu _2=2\mu ;\qquad 4\mu _2+\mu _3=\kappa -\frac{2}{3}\mu . \end{aligned}$$

We assume that the boundary \(\Gamma _0\) of \(\Omega _0\) is smooth and it is decomposed into two (also smooth) disjoint parts: \(\Gamma _{0_D}\) and \(\Gamma _{0_N}\). On the Dirichlet boundary \(\Gamma _{0_D}\), it is imposed \(\varvec{\Phi } = \bar{\varvec{\Phi }}\) for a given deformation \(\bar{\varvec{\Phi }}: \Omega _0 \rightarrow \mathbb {R}^N\), while on \(\Gamma _{0_N}\) we impose a stress-free boundary condition. We let

$$\begin{aligned} \mathbb {V}_D:= \left\{ \varvec{\Phi } \in H^1 (\Omega _0, \mathbb {R}^N) :\varvec{\Phi } = \bar{\varvec{\Phi }} \text { on } \Gamma _{0_D} \right\} . \end{aligned}$$
(4)

2.1.3 Constitutive equations: the stochastic case

Soft materials often exhibit intrinsic variability in their elastic responses under large strains. Thus, accuracy and realism with respect to the physical response of a deformable soft material requires the incorporation of relevant sources of uncertainty in the numerical model. In this sense, a framework, based on information theory, for the modeling of stochastic Mooney-Rivlin class of stored energy functions is presented in [17, 18]. The proposed models are almost surely consistent with the theory of nonlinear elasticity and are able to mimic the mean behavior and variability that are typically encountered in the experimental characterization of biological tissues. Thus, as an example, a random model proposed in [17, 18] suggests replacing the deterministic model parameters \(\{\mu _1, \mu _2, \mu _3\}\) by its random counterparts

$$\begin{aligned} \mu _1 (\omega ) = \frac{\mu (\omega ) U}{2},\quad \mu _2(\omega )=\frac{\mu (\omega )(1-U)}{2},\quad \mu _3(\omega )=\mu (\omega )\left( 2 U-\frac{8}{3}\right) + \kappa (\omega ), \end{aligned}$$

where where \(\{\mu (\omega ), \kappa (\omega )\}\) are stochastically independent random variables of Gamma-type, and U is a suitable Beta distributed random variable.

The case in which the model parameters are represented by means of random fields has also been considered in [19].

2.2 Actuated soft materials

Soft materials may be actuated by different mechanisms, e.g. by means of electric or magnetic fields. These actuation modes may produce internal pressure changes that eventually induce complex shape-morphing configurations.

As an illustration on how to incorporate these actuation modes into the corresponding mathematical models, we consider next the cases of turgor-pressure control, magnetic-driven actuation and tension control along fibers.

2.2.1 Turgor-pressure

Turgor pressure is the pressure exerted by a fluid (e.g. water) against the cell wall [20]. This is the mechanism that is activated in the tendril when a sunflower receives the light of the sun and it allows for the sunflower to follow the tour of the sun.

Let \(u(\varvec{X}):\Omega _0\rightarrow \mathbb {R}\) be a pressure field. As indicated in [10], the induced energy density is

$$\begin{aligned} W_{\text {turgor}}(u, J)= u(\varvec{X})\left( -1+J\right) . \end{aligned}$$

Notice that this energy density depends on the Jacobian J, as could not be otherwise, since volumetric changes inside the domain \(\Omega _0\) take place.

Thus, the total action of the actuated soft material is

$$\begin{aligned} W_{\text {total}}(\varvec{\Phi },u):=W_{\text {elastic}}(\varvec{F}, \varvec{H},J)-W_{\text {turgor}}(u, J). \end{aligned}$$

From Hamilton’s principle, for a fixed \(u\in L^2(\Omega _0)\), it is concluded that equilibrium configurations are minimizers of the functional

$$\begin{aligned} \Pi _{\text {turgor}} \left( \varvec{\Phi }, u\right) :=\int _{\Omega _0} W_{\text {total}}\left( \varvec{\Phi }, u\right) d\varvec{X} \end{aligned}$$

over a suitable class of admissible deformations (to be specified later on).

2.2.2 Magnetic-driven actuation

Hard Magnetic Soft Materials (HMSMs) are comprised of a very soft polymeric matrix where magnetically hard particles such as neodymium-iron-boron (NdFeB) magnets are embedded. These are enabled to retain a high residual flux density \(\mu _0^{-1}\varvec{B}_0^r\), where magnetic permeability is approximately equal to that of vacuum \(\mu _0\). The application of a second magnetic flux density \(\varvec{B}^a\) can induce complex shape morphing configurations.This external magnetic field may be applied by using a Helmholtz coil device (see Fig. 4 for an illustrative scheme).

Fig. 4
figure 4

An initially flat HMSM (or Magnetic Elastomer ME) is placed in between two Helmholtz coils. The inner magnetic particles embedded within the ME have been previously magnetized until saturation, exhibiting a distribution of remnant magnetization \(\varvec{B}_0^r\). Each coil carries an equal current that generates a nearly uniform magnetic field \(\varvec{B}^a \) between the Helmholtz coils. The interaction between \(\varvec{B}_0^r\) and \(\varvec{B}^a\) leads to a potentially complex shape morphing configuration of the ME. Picture taken from [14]

In [21] it is proposed that the induced Helmholtz free energy density is given by

$$\begin{aligned} W_{\text {magnet}}(\varvec{F}, \varvec{B}_0^r, \varvec{B}^{{a}})= \frac{1}{\mu _0}\varvec{F}\varvec{B}_0^r\cdot \varvec{B}^{{a}} \end{aligned}$$

so that the total action of the actuated soft material is

$$\begin{aligned} W_{\text {total}}(\varvec{\Phi },\varvec{B}_0^r, \varvec{B}^{{a}}):=W_{\text {elastic}}(\varvec{F}, \varvec{H},J)-W_{\text {magnet}}(\varvec{F}, \varvec{B}_0^r, \varvec{B}^{{a}}). \end{aligned}$$

For fixed \((\varvec{B}_0^r, \varvec{B}^{{a}})\in L^2\left( \Omega _0; {\mathbb {R}}^N\right) \times L^2\left( \Omega _0; {\mathbb {R}}^N\right) \), equilibrium configurations are minimizers of

$$\begin{aligned} \Pi _{\text {magnet}} \left( \varvec{\Phi }, \varvec{B}_0^r, \varvec{B}^{{a}} \right) :=\int _{\Omega _0} W_{\text {total}}\left( \varvec{\Phi }, \varvec{B}_0^r, \varvec{B}^{{a}}\right) d\varvec{X}. \end{aligned}$$

2.2.3 Tension control along fibers

Contractions and extensions of muscle fibers are responsible for large deformations in humans and animals. Those fibers are oriented in a given direction. So, let \(\textbf{a}=\textbf{a}(\varvec{X}):\Omega _0\rightarrow {\mathbb {R}}^N\) be a unitary vector field indicating the fibers direction, and let \(u=u(\varvec{X}):\Omega _0\rightarrow {\mathbb {R}}\) be a tension field. The induced energy density is

$$\begin{aligned} W_{\text {fiber}}(u, \varvec{F})= \frac{1}{2} u(\varvec{X} )\Vert \textbf{F}\, \textbf{a}(\varvec{X} )\Vert ^2. \end{aligned}$$

Notice that, since in this case the deformations occur along curves, the deformation gradient \(\varvec{F}\) appears in the fibers energy density.

Analogously to the two preceding cases, the total action of the actuated soft material is

$$\begin{aligned} W_{\text {total}}(\varvec{\Phi },u):=W_{\text {elastic}}(\varvec{F}, \varvec{H},J)-W_{\text {fiber}}(u, \varvec{F}). \end{aligned}$$

For a fixed \(u\in L^2(\Omega _0)\), equilibrium configurations are minimizers of

$$\begin{aligned} \Pi _{\text {fiber}} \left( \varvec{\Phi }, u\right) :=\int _{\Omega _0} W_{\text {total}}\left( \varvec{\Phi }, u\right) d\varvec{X}. \end{aligned}$$

2.3 Existence of equilibrium configurations

In order to make mathematically precise the formulation for the problem of existence of minimizers for the functionals \(\Pi _{\text {turgor}}\), \(\Pi _{\text {magnet}}\) and \(\Pi _{\text {fiber}}\) above, the class of admissible deformations is defined by

$$\begin{aligned} \mathbb {U}:= \left\{ \varvec{\Phi }\in \mathbb {V}_D :\varvec{\Phi } \text { is injective a.e. and } \int _{\Omega _0}W_{\text {total}}\left( \varvec{\Phi }, u\right) d\varvec{X} < \infty \right\} , \end{aligned}$$
(5)

where \(\mathbb {V}_D \) is given by (4).

As an illustration, let us consider the case of the functional \(\Pi _{\text {fiber}}\), the idea of the proof on the existence of minimizers being very similar for the cases of turgor-pressure and magnetic-driven actuations. For simplicity, we also restrict our analysis to the case of Mooney-Rivlin-type soft materials.

Proposition 1

[13] Set \(u\in L^{2}\left( \Omega _0\right) \) and assume that \(\sup _{\varvec{x}\in \Omega _0}u(\varvec{X})\le 2\mu _1\), where \(\mu _1\) is the first material parameter in the Mooney-Rivlin elastic energy density (3). Then there exists a minimizer \(\varvec{\Phi }\) of the functional \(\Pi _{\textrm{fiber}}\) over the class \(\mathbb {U}\).

The idea of the proof is to apply Ball’s polyconvexity theory, precisely Theorem 7.7-1 in [22]. To this end, the important conditions that the density \(W_{\text {total}}\) has to satisfy are polyconvexity and coerciveness. Both conditions are satisfied whenever the assumption on u is satisfied since, in that case, \(W_{\text {total}}\) is positive and for quadratic forms positivity is equivalent to convexity. Also, from that assumption it follows that \(W_{\text {total}}\) is coercive.

3 Mathematical modeling and analysis of optimal control of soft materials

Before the manufacturing of a soft robot, the study of potential capabilities of new smart soft materials is a pertinent issue. This task may be carried out with the help of numerical simulations obtained from suitable formulations of optimal control problems.

For a fixed actuation mode u, the induced deformation is obtained by solving the minimization problems stated in Subsection 2.2. By using the standard notation of mathematical optimal control theory \(u=u(\varvec{X})\) is the so-called control variable and its associated deformation mapping \(\varvec{\Phi }=\varvec{\Phi }(u)\in \mathbb {U}\) is the state variable. The desired capability to be analyzed, typically expressed in terms of reaching a given target configuration, is incorporated in the formulation of the control problem trough a suitable cost functional.

3.1 Cost functionals

Reaching a desired target deformation may be expressed by providing a target deformation mapping or a target domain. The latter case is more natural and flexible as, on the one hand, many different deformation mappings may lead to the same target domain, and, on the other hand, expressing the problem in terms of domains (without specifying mappings that represent those domains) enables a different computational framework for both the non deformed domain and the target one. Nonetheless, as will be shown later on, the computational burden in the latter case is higher than in the former one.

Let us now briefly describe both formulations.

3.1.1 Tracking-type in surface displacements

For a given admissible target deformation \(\varvec{\Phi }_{\text {target}}\), the goal is to find a control u that minimizes the \(L^2\)-distance between the target deformation and the deformation associated to the control u. This can be expressed through the cost functional

$$\begin{aligned} J_1(u)=\frac{1}{2}\int _{\Gamma _0} \Vert \varvec{\Phi }\left( \varvec{X}, u \right) -\varvec{\Phi }_{\text {target}}\left( \varvec{X} \right) \Vert ^2 \, d\varvec{X}. \end{aligned}$$

Fig. 5 (Left) shows the range of the target configuration and the non deformed domain. The left part of the domain is kept fixed. The right hand side part \(\Gamma _{0}\) is the only part of the domain that one aims at deforming to reach the considered deformation. Figure 5 (Right) shows a possible optimal deformation.

Fig. 5
figure 5

(Left) Problem configuration. (Right) A possible deformation \(\varvec{\Phi }(u)\) that minimizes the \(L^2\)-distance to \(\varvec{\Phi }_{\text {target}}\). Picture taken from [12]

3.1.2 A Hausdorff distance-based cost functional

In this case, the datum is not a mapping but a target domain \(\Omega _{\text {target}}\). To compare similarities between domains, distance functions may be used, e.g. the Hausdorff distance. In that case, the cost functional takes the form

$$\begin{aligned} J_2(u)= \max \left\{ \sup _{\varvec{x}\in \Omega _{\text {target}}}d_{\Omega (u)}\left( \varvec{x}\right) ,\sup _{\varvec{x}\in \Omega (u)}d_{\Omega _{\text {target}}}\left( \varvec{x}\right) \right\} , \end{aligned}$$
(6)

where \(d_{\Omega }\left( \varvec{x}\right) :=\inf _{\textbf{y}\in \Omega }\Vert \textbf{y}-\varvec{x}\Vert \quad \text {if} \quad \Omega \ne \varnothing \quad \text {and}\quad +\infty \quad \text {if}\quad \Omega =\varnothing .\)

Figure 6 shows both the initial or non deformed domain (in green color) and the target domain (in transparent).

Fig. 6
figure 6

Target domain \(\Omega _{\text {target}}\) (transparent). Non deformed domain \(\Omega _0\) (green). Picture taken from [13]

3.2 Well-posedness of optimal control problems

From now on in this section the focus is placed on the more challenging functional \(J_2(u)\), as given by (6).

Since the Hausdorff distance is not differentiable, a regularization of it is in order. To this end, we proceed as follows:

First, to approximate the two suprema we rely on the fact that the \(L^{\infty }\)-norm may be approximated by the \(L^p\)-norm for p large enough. Thus,

$$\begin{aligned} \sup _{\varvec{x}\in \Omega _{\text {target}}} d_{\Omega (u)}\left( \varvec{x}\right) = \lim _{\beta \rightarrow +\infty }\left( \frac{1}{\vert \Omega _{\text {target}}\vert } \int _{\Omega _{\text {target}}} d_{\Omega (u)}^{\beta } \left( \varvec{x}\right) d\varvec{x}\right) ^{1/\beta }. \end{aligned}$$

Second, for \(\varphi : {\mathbb {R}}^+\rightarrow {\mathbb {R}}^{+}\), with \(\varphi \) strictly decreasing one has

$$\begin{aligned} \sup _{\varvec{y}\in \Omega (u)}\varphi \left( \Vert \varvec{y}-\varvec{x}\Vert \right) = \varphi \left( \inf _{\varvec{y}\in \Omega (u)}\Vert \varvec{y}-\varvec{x}\Vert \right) = \varphi \left( d_{\Omega (u)}(\varvec{x})\right) . \end{aligned}$$

Moreover, if \(\varphi \) is strictly positive and continuous, then

$$\begin{aligned} d_{\Omega (u)}\left( \varvec{x}\right) = \lim _{\alpha \rightarrow +\infty }\varphi ^{-1}\left( \left( \frac{1}{\vert \Omega (u)\vert } \int _{\Omega \left( u\right) }\varphi ^{\alpha }\left( \Vert \varvec{y}-\varvec{x}\Vert \right) \, d\varvec{y}\right) ^{1/\alpha }\right) . \end{aligned}$$

Finally, an approximation of the maximum of two numbers is obtained from the inequalities

$$\begin{aligned} 2^{\frac{-1}{2\gamma }} \max \{a_1, a_2 \} \le 2^{\frac{-1}{2\gamma }} \left( a_1^{\gamma } + a_2^{\gamma } \right) ^{1/\gamma } \le 2^{\frac{1}{2\gamma }} \max \{a_1, a_2 \},\quad \gamma >0. \end{aligned}$$

Putting all things together, the Hausdorff distance functional (6) is replaced by the smooth approximation

$$\begin{aligned} {\tilde{\rho }}_H \left( \Omega \left( u\right) ,\Omega _{\text {target}}\right) = \left( \frac{{\tilde{d}}_{\Omega _{\text {target}}, \Omega (u)}^{\gamma } + {\tilde{d}}_{\Omega (u), \Omega _{\text {target}}}^{\gamma }}{\sqrt{2}} \right) ^{1/\gamma }, \end{aligned}$$
(7)

where, for \(\varvec{y} \in \Omega _{\text {target}} \),

$$\begin{aligned} {\tilde{d}}_{\Omega _{\text {target}}, \Omega (u)}:= \left( \frac{1}{\vert \Omega _{\text {target}}\vert } \int _{\Omega _{\text {target}}} {\tilde{d}}_{\Omega (u)} ^{\beta } (\varvec{y}) \, d \varvec{y} \right) ^{1/\beta },\quad {\tilde{d}}_{\Omega (u)} \left( \varvec{y}\right) = \varphi ^{-1}\left( {\mathcal {I}}_{\Omega (u)}(\varvec{y}) \right) , \end{aligned}$$

and

$$\begin{aligned} {\mathcal {I}}_{\Omega (u)}(\varvec{y})=\left( \frac{1}{\vert \Omega (u)\vert }\int _{\Omega (u)}\varphi ^{\alpha }\left( \Vert \varvec{y}-\varvec{x}\Vert \right) \,d\varvec{x}\right) ^{1/\alpha }. \end{aligned}$$

We are now in a position to formulate a well-posed Optimal Control Problem (OCP):

$$\begin{aligned} \left\{ \begin{array}{ll} \text {Minimize in } u: &{} {\mathcal {J}}(u):= {\tilde{\rho }}_H \left( \Omega \left( u\right) ,\Omega _{\text {target}}\right) +\frac{M}{2}\int _{\Omega _0}u^2\, d\varvec{X}+\frac{\varepsilon }{2}\int _{\Omega _0}\vert \nabla u\vert ^2 \, d\varvec{X} \\ \text {subject to} &{} \\ &{} u\in H^1\left( \Omega _0\right) , \sup _{\varvec{x}\in \Omega _0}u(\varvec{X})\le 2\mu _1 \\ &{} \\ &{} \varvec{\Phi } \text { is a minimizer of } \Pi _{\text {fiber}} \text { in } \mathbb {U}. \end{array} \right. \end{aligned}$$
(8)

Remark 1

Regularization in the control variable and its gradient is a mathematical property that ensures strong convergence in \(L^2\) of a minimizing sequence of controls. Even though this regularization makes sense from a physical point of view, it is not very convenient at the numerical viewpoint as the solution of (OCP) depends on the parameters M and \(\varepsilon \).

Theorem 2

(Existence of optimal controls) There exists an optimal tension filed \(u(\varvec{X})\) for (OCP).

The proof follows the lines of the Direct Method of Calculus of Variations. The reader is referred to [13, Th. 4.2] for the details.

4 Numerics

As indicated in Remark 1, instead of solving (OCP), at the numerical viewpoint is more convenient to solve the following Numerical Optimal Control Problem:

$$\begin{aligned} (NOCP)\left\{ \begin{array}{ll} \text {Minimize in } u: &{} {\mathcal {J}}(u):= {\tilde{\rho }}_H \left( \Omega \left( u\right) ,\Omega _{\text {target}}\right) \\ \text {subject to} &{} \\ &{} u(\varvec{X})\le 2\mu _1, \quad \forall \varvec{X}\in \Omega _0 \\ &{} \\ &{} \begin{array}{lll} DIV\left( \varvec{P}\left( \varvec{F},u\right) \right) =0 &{} \text {in} &{} \Omega _0\\ \varvec{P}\left( \varvec{F},u\right) \cdot \varvec{N}=0 &{} \text {on} &{} \Gamma _{0N} \\ \varvec{\Phi }=\varvec{\Phi }_0 &{} \text {on} &{} \Gamma _{0D}. \end{array} \end{array} \right. \end{aligned}$$
(9)

Notice that the constraint \(\varvec{\Phi }=\arg \min \left\{ \varvec{\Pi }_{\text {fiber}}\left( \hat{\varvec{\Phi }}, u\right) , \hat{\varvec{\Phi }}\in \mathbb {U}\right\} \) has been replaced by its associated Euler-Lagrange equation. Also, the regularization terms on the control variable have been removed. This avoids the tuning of the associated parameters M and \(\varepsilon \). Moreover, numerical simulation results show smooth optimal controls.

Here above in (NOCP), \(\varvec{P}\left( \varvec{F},u\right) =\nabla _{\varvec{F}}W_{\text {elastic}}(\varvec{F})-u\varvec{F}\varvec{a}\otimes \varvec{a}\) is the first Piola-Kirchhoff stress tensor.

4.1 Numerical resolution method

We advocate for a gradient-based optimization method and use the formal Lagrangian method to compute a descent direction. To this end, the three main numerical ingredients are: (i) the numerical approximation of the direct problem (which is a nonlinear system of PDEs that can be approximated by using a Newton–Raphson method and finite-elements), (ii) the resolution of its associated (linear) adjoint problem, and (iii) a continuous gradient is then expressed in terms of the adjoint state. These problems take the form:

  • Direct problem (in variational form): find \(\varvec{\Phi }\in \mathbb {V}_D\) such that

    $$\begin{aligned} \int _{\Omega _0} \varvec{P}\left( \nabla \varvec{\Phi },u\right) :\nabla \textbf{v}\,d\varvec{X}=0\quad \forall \textbf{v}\in \mathbb {V}_D. \end{aligned}$$
  • Adjoint problem (in variational form): find \(\textbf{p}\in \mathbb {V}_D\) such that

    $$\begin{aligned} \int _{\Omega _0}\nabla \textbf{p}: \mathbf {{\mathcal {C}}}\left( \nabla \varvec{\Phi },u\right) : \nabla \textbf{v}\, d\varvec{X} =-\frac{\partial {\mathcal {J}}}{\partial \varvec{\Phi }}\left( \varvec{\Phi },u\right) \left( \textbf{v}\right) \quad \forall \textbf{v}\in \mathbb {V}_D, \end{aligned}$$

    where \({\mathcal {C}}_{ijkl}=\left( \nabla ^2_{\varvec{F}\varvec{F}}W_{\text {elastic}}\left( \varvec{F}\right) \right) _{ijkl}-u\delta _{ij}a_ka_l\) is the fourth-order elasticity tensor.

  • Descent direction: \(-\varvec{F}\varvec{a}\otimes \varvec{a}:\nabla \varvec{p}\).

Since the cost functional \({\mathcal {J}}\) is a shape functional, its derivative, that appears in the right-hand side of the adjoint equation, is computed by using the concept of shape derivative. It is also worthwhile to mention that the computation of the cost functional and its sensitivity involve the numerical approximation of double integrals. See [13] for more details on this passage.

The numerical algorithm is then structured as shown in Algorithm 1.

Algorithm 1
figure a

Gradient-based descent algorithm

4.2 Numerical experiments

4.2.1 Fiber tension-driven control

The data for this experiment are:

  • \(\begin{array}{ll} W_{\text {elastic}}(\varvec{F},\varvec{H}, J) &{} = \mu _1 \Vert \varvec{F}\Vert ^2 + \mu _2 \Vert \varvec{H}\Vert ^2 + \mu _3 \left( \Vert \varvec{F}\varvec{f}\Vert ^2 + \Vert \varvec{H}\varvec{f}\Vert ^2\right) \\ &{} + \mu _4 \left( J-1\right) ^2 + 2\left( \mu _1+2\mu _2+\mu _3\right) \log (J) +\left( \mu _1 + \mu _2+\frac{2\mu _3}{3}\right) \end{array} \)

  • \(\varvec{f} = \frac{\sqrt{2}}{2}\left( 1, 1, 0\right) ^T\)

  • \(\left\{ \mu _1, \mu _2, \mu _3, \mu _4\right\} = 10^5\left\{ 1, 0.2, 3, 10\right\} \)

  • \(\textbf{a}=\left( 1, 0, 0\right) \) fiber direction.

Fig. 6 displays the problem configuration that includes the non deformed domain and the target one. Figures 7 and 8 show simulation results for the numerical resolution of problem (NOCP).

Fig. 7
figure 7

Evolution of the domain \(\Omega (u_k)\) for various optimisation iterations. The transparent domain represents the target configuration \(\Omega _{\text {target}}\). Picture taken from [13]

Fig. 8
figure 8

Contour plot distribution of the control variable \(u_k(\varvec{X})\) for various iterations. Picture taken from [13]

4.2.2 Magnetic-driven optimal design and control

This section presents two numerical experiments for the following problem of optimal control and design of a HMSM:

$$\begin{aligned} (ODC)\left\{ \begin{aligned} \text {Minimize in } \left( \varvec{B}_0^r, B^a\right) :&\,\,\,\, {{\mathcal {J}}}\left( \varvec{B}_0^r,{B}^{{a}}\right) :=\int _{\Gamma _0}\Vert \varvec{\Phi }\left( \varvec{B}_0^r, {B}^{{a}}\right) -\varvec{\Phi }_{\text {target}}\Vert ^2\, d\varvec{X} \\ \text {subject to}&\left\{ \begin{aligned}&\varvec{B}_0^r\in L^2\left( \Omega _0\right) \\&\Vert \varvec{B}_0^r(\varvec{X})\Vert =C_1\quad \text {a.e. } \varvec{X}\in \Omega \\&{B}^{{a}}\le C_2 \\&\varvec{\Phi }\left( \varvec{B}_0^r, {B}^{{a}}\right) \text { is a minimizer of } \Pi _{\text {magnet}}.\end{aligned}\right. \end{aligned} \right. \end{aligned}$$

Notice that \(\varvec{B}_0^r\) is a design variable as it represents the orientation of the remnant magnetic field in the magnetic elastomer, and \(B^{a}\) is the applied external magnetic field, which acts as a control variable.

Figure 9 shows a typical T configuration and a petal example. Simulation results derived from the numerical approximation of problem (ODC) are displayed in Fig. 10.

Fig. 9
figure 9

Material parameters: \(\mu _1=50\) kPa, \(\mu _2=50\) kPa, \(\mu _3= 200\) kPa.             Left: T-example, completely fixed at \(X=0\), with \(L=1\,m\) and thickness \(h=0.05\,m\); Right: petal-example, completely fixed at \(\Omega _0^5\), with thickness \(h=10^{-3}\,m\) and with \(L_1=0.13\,m\) and \(L_2=0.06\,m\). Picture taken from [14]

Fig. 10
figure 10

Top row: deformed configuration (left) and distribution of remnant magnetization \(\varvec{B}_0^r\) (right) for the T-example. Bottom row: same for the petal-example. Picture taken from [14]

4.2.3 Turgor-pressure robust optimal control with uncertain material parameters

This section addresses an academic example of a random version of the elastic energy where the deterministic set of parameters \(\left\{ \mu _1, \mu _2, \mu _3\right\} \) is replaced by a multivariate random variable \({\textbf{Z}} = \left( z_1, z_2, z_3\right) \). For simplicity, the case is considered of a discrete distribution with scenarios \({\textbf{z}}^i=\left( z^i_1,z^i_2,z^i_3 \right) \) and probabilities \(\pi _i\), \(1\le i\le m\). Thus,

$$\begin{aligned} W_{\text {elastic}}^i\left( \textbf{F}\right) := z_1^i\Vert \varvec{F}\Vert ^2+z_2^i\Vert \varvec{H}\Vert ^2+z_3^i(J-1)^2-2(z_1^i+z_2^i)\log (J)-3(z_1^i+z_2^i). \end{aligned}$$

For each pressure field \(u(\varvec{X})\in L^2\left( \Omega _0\right) \), the minimizer of

$$\begin{aligned} \Pi ^{i}_{\text {turgor}} \left( \varvec{\Phi }, u\right) :=\int _{\Omega _0} W_{\text {total}}^{i}\left( \varvec{F},\varvec{H},J,u\right) d\varvec{X} \end{aligned}$$

is denoted by \(\varvec{\Phi }^i\).

Eventually, a robust version of the turgor-pressure control problem reads as:

$$\begin{aligned} (ROC) \left\{ \begin{array}{ll} \text {Minimize in } u: &{}\quad J(u):=\frac{1}{2}\sum _{i=1}^m\pi _i\int _{\Gamma _0}\Vert \varvec{\Phi }^i(u)-\varvec{\Phi }_{\text {target}}\Vert ^2\, d\varvec{X} \\ \text {subject to} &{} \\ &{} \varvec{\Phi }^i \text { is a minimizer of } \Pi ^i_{\text {turgor}}, \quad 1\le i\le m. \end{array} \right. \end{aligned}$$

Fig. 11 shows the optimal deformations for several scenarios corresponding to stochastic nodes for Beta-type distributions and an Mooney-Rivlin-type material. Simulation results for the numerical approximation of problem (ROC) are displayed in Fig. 12.

Fig. 11
figure 11

Solutions corresponding to several stochastic nodes for Beta distributions and an Mooney-Rivlin-type material. Picture taken from [12]

Fig. 12
figure 12

a Average of the deformed configuration when the deterministic control is inserted in the random model. b Average of the deformed configuration for the robust control. Picture taken from [12]

5 Some challenging problems

The topic of mathematical modeling, analysis and control of soft smart materials can be considered to be in its infancy. Therefore, there is a large number of problems that could be addressed in the near future. Next, we propose a (non-exhaustive) list of some of them:

  • The lack of uniqueness of minimizers in polyconvex functionals is very well known in the literature. A deep study of this issue for the specific problems that arise in soft robotics is then in order.

  • Topology optimization of soft materials in multi-physics and multi-scale. The recent works in [23, 24] are the first where topology optimization has been applied for the design of actuators in the context of nonlinear electromechanics by exploring and exploiting different engineering principles. For instance, [23] addresses the design of the electrodes intercalated between the various electroactive layers of an actuator device with the aim of attaining specific target configurations; alternatively, Reference [24] aimed at optimizing the design of layers of passive materials (devoid from electromechanical interactions), acting as stiffeners attached to a thin layer of electro active material with the ultimate goal of attaining complex shape morphing configurations. However, in order to fully exploit the potential of electroactive materials, composite electroactive polymers, with complex microstructures combining different materials at the microlevel, need to be incorporated in the topology optimization problem. The computational challenge posed by this problem requires the use of machine learning techniques, capable of learning a surrogate data-driven model of the homogenised response of the composite, parametrised not just with respect to deformations, i.e. the constitutive model is nonlinear (see [25]), but also in terms of the geometrical features of the microstructure.

  • Dynamic situation: only quasi-static deformation processes (i.e., time effects and therefore viscoelasticity are neglected) have been considered so far. The extension of the proposed framework to time dependent problems must be done by considering the inherent viscoelastic response of soft materials. Time-dependent controls ought to be considered as well.

  • The case in which material parameters are modeled by means of random fields is very challenging both from the theoretical and numerical viewpoints. Indeed, at the theoretical level, the first issue that should be analyzed is if there exists a smooth selection of the solution map \(\varvec{z}\mapsto \varvec{\Phi }(\varvec{X},\varvec{z})\), where \(\varvec{z}\) is a random parameter living in a high-dimensional parameter space, and \(\varvec{\Phi }\) is the deformation mapping of the soft body. At the numerical point of view, the computational burden for the numerical approximation of the corresponding robust optimal design/control problems may be unaffordable, especially in the case of non-smooth random fields with low correlation length and/or when the cost functional or the constraints include failure-of-probability functions. Thus, the well-known phenomenon of curse of dimensionality naturally arises in this context. Deep-learning-based methods are promising tools that should be explored in detail in this situation.