Skip to main content

An optimal control problem for single-spot pulsed laser welding


We consider an optimal control problem for a single-spot pulsed laser welding problem. The distribution of thermal energy is described by a quasilinear heat equation. Our emphasis is on materials which tend to suffer from hot cracking when welded, such as aluminum alloys. A simple precursor for the occurrence of hot cracks is the velocity of the solidification front. We therefore formulate an optimal control problem whose objective contains a term which penalizes excessive solidification velocities. The control function to be optimized is the laser power over time, subject to pointwise lower and upper bounds. We describe the finite element discretization of the problem and a projected gradient scheme for its solution. Numerical experiments for material data representing the EN AW 6082-T6 aluminum alloy exhibit interesting laser pulse patterns which perform significantly better than standard ramp-down patterns.

1 Introduction

Pulsed laser welding is a standard technology to merge metal or thermoplastic components. Its advantages are the narrow spatial concentration and high peak power of the heat source, as well as the opportunity to quickly and frequently adjust the laser power in time. However, in comparison to continuous wave laser processes, pulse laser welding is reported to have an elevated tendency to produce hot cracks during the solidification phase due to higher cooling and thus strain rates. While small hot cracks do not necessarily affect the strength of the welding seam, they may impair the air- and water-tightness. Avoiding hot cracks is particularly difficult for the welding of certain aluminum alloys, e. g., some of the 2XXX, 5XXX and most of the 6XXX series, which remains a challenging engineering problem [3, 10, 19].

Previous analyses have shown the potential to reduce hot cracking by varying the laser power profile in pulsed laser welding; see, e. g., [3, 9]. In this paper, we propose an optimal control approach to find power profiles which are optimal in a certain sense. We concentrate on single-spot pulsed laser welding problems with a view towards aluminum alloy welding. Since welding seams consist of multiple, partially overlapping welding spots, this work constitutes a significant first step towards the optimization of entire welding seams.

In order to obtain a sufficiently realistic forward model of heat distribution, we need to take into account several physical effects, including temperature dependent heat capacity and thermal conductivity, the enthalpy of fusion and convective heat transfer. From the mathematical point of view, this results in a quasilinear heat equation. Evaporation of metal will be disregarded, as well as fluidic motion inside the weld pool. The thermal energy incurred through the laser into the welded component is modeled through a heat flux boundary condition. Our objective or cost functional takes into account, among other things, the speed of solidification in order to avoid or reduce the appearance of the hot cracks.

The emphasis of our contribution lies with the description of the quasilinear heat equation model, the formulation of an appropriate cost function, as well as the numerical solution of a discretized version of the optimal control problem by a projected gradient descent scheme. One of the terms of the objective functional which penalizes excessive solidification velocities is rather non-standard and was designed specifically for this problem.

The material is structured as follows. In Sect. 2, we discuss the quasilinear heat equation representing the forward model. The optimal control problem is described in Sect. 3. Its discretization is detailed in Sect. 4, where we also present a reduction of the three-dimensional setup to the radially symmetric case. Section 5 is devoted to the presentation of optimized laser pulse profiles under various conditions.

2 Modelling

The aim of this section is to derive step-by-step a mathematical model for a single-spot pulsed laser welding problem of aluminum alloys in a cylindrical domain. To this end, let \(\Omega \subset \mathbb{R}^{3}\) be an open, orthogonal circular cylinder and \(\Gamma = \bigcup_{i=1}^{4} \Gamma _{i}\) be its boundary surface (see Fig. 1). Here \(\Gamma _{1}\) is the portion of the boundary affected by the laser beam radiation. We denote by \(\theta (x,t)\) the temperature at the point \(x \in \Omega \) at time \(t \in [0,T]\).

Figure 1
figure 1

Cylinder Ω and its boundaries

We are going to describe the temperature evolution inside Ω, and hence the evolution of the welding process, as a solution to a boundary value problem based on the quasilinear heat equation. The applied nature of the problem provides a few modelling challenges such as temperature dependent properties of the material, liquid/solid phase transition, and a combination of multiple heat transfer mechanisms. These challenges are sequentially addressed in the following subsections, resulting in a complete model.

2.1 Enthalpy of fusion and volumetric effective heat capacity

Unlike standard heat dissipation problems when the considered material remains in the same state of matter and its physical properties remain essentially uniform, we deal with a phase transition during the heating and the cooling stages. These phase transitions are accompanied by an absorption or a release of energy. The required amount of additional energy needed to be provided to a specific quantity of the substance to change its state from a solid to a liquid (at constant pressure) is called the enthalpy of fusion or the (latent) heat of fusion. For the opposite transition from a liquid to a solid state the heat of solidification has the same absolute value but its sign is reversed.

These phenomena are often modeled in terms of the classical Stefan problem, which is a particular kind of a boundary value problem describing the evolution of a moving boundary between two phases of a material undergoing a phase change; see for instance [8]. In addition to the underlying heat equation, initial and boundary conditions, the Stefan condition is required to provide the energy balance on the phase transition interface. However, in the present paper we use another approach to integrate the enthalpy of fusion into the boundary value problem. Due to the mixed composition of aluminum alloys, we have a wide temperature corridor (rather than a single melting temperature) within which the material melts from a solid to a liquid state. The temperature below which the material is fully solid is called solidus. The temperature above which the material is fully liquid is called liquidus. In the current study we consider \(\text{solidus} = {858}\) K and \(\text{liquidus} = {923}\) K as reference values.

Considering the above, it becomes more natural in our case to embed the enthalpy of fusion directly into the heat equation by means of the heat capacity coefficient. In a standard heat dissipation problem with no phase transition, the heat capacity coefficient \(c(\theta )\) is a temperature dependent function such that \(\int _{\theta _{0}}^{\theta _{1}} c(\theta ) \,\mathrm{d}\theta \) describes the amount of energy required to heat a unit mass of the material from temperature \(\theta _{0}\) to temperature \(\theta _{1}\). In the present model we substitute the heat capacity with an effective heat capacity denoted by \(c_{\text{eff}}(\theta )\). The latter coefficient coincides with \(c(\theta )\) outside the solidus–liquidus temperature corridor but has significantly higher values inside, which is meant to achieve the same equality: the total amount of energy required to heat a unit mass of the material from temperature \(\theta _{0}\) to temperature \(\theta _{1}\) (including the enthalpy of fusion if applicable on the interval) is given by the integral \(\int _{\theta _{0}}^{\theta _{1}} c_{\text{eff}}(\theta ) \,\mathrm{d}\theta \).

Another effect to be taken into account is that the density ρ of aluminum alloys changes significantly over the temperature regime under consideration due to thermal expansion and contraction. However, considering variable volume of the material would lead to a free boundary problem, which significantly increases the complexity of the model. We therefore take volume changes into account through a temperature dependent density. Overall, this leads to an effective volumetric heat capacity \(s(\theta ) = c_{\mathrm{eff}}(\theta ) \rho (\theta )\) in our heat equation.

For the aluminum alloys under consideration, reference values of volumetric heat capacity are given in both the fully solid and the fully liquid state of matter. These values show a good linear approximability within a fixed state of matter. Therefore, we construct \(s(\theta )\) using the following procedure:

  1. (i)

    We perform a linear least-squares approximation to the experimental data independently in the solid and in the liquid state of matter.

  2. (ii)

    We choose a \(C^{1}\) cubic spline by filling the liquidus–solidus temperature gap with the uniquely defined cubic polynomial.

  3. (iii)

    In the liquidus–solidus interval, we add without loss of smoothness a cubic spline (consisting of two cubic polynomials) whose integral over the considered interval is equal to the enthalpy of fusion of the selected alloy.

We do not present the above procedure in terms of cumbersome formulas but limit ourselves here to a plot of the resulting effective volumetric heat capacity function; see Fig. 2 (left).

Figure 2
figure 2

Effective volumetric heat capacity \(s(\theta )\) and effective thermal conductivity \(\kappa (\theta )\) constructed using a spline fitting procedure

2.2 Effective thermal conductivity

Convective heat transfer in the liquid phase becomes the next modeling challenge caused by the phase transition. Due to the Marangoni effect, see [12, 13], once the solidus point is passed, the heat transfer in the melting pool significantly increases in radial direction and decreases in axial direction (see Fig. 1 for the coordinate axes). In order to not include the convection term into the core equation we approximate linearly the thermal conductivity coefficient \(\kappa (\theta )\) to its measured values in the solid state, and then extrapolate it (separately for the radial and the axial directions) to the temperatures above the liquidus with experimentally selected constants. Convective heat transfer in the angular direction is assumed to be zero. As a result, we have a matrix-valued effective thermal conductivity function \(\kappa (\theta ) = \operatorname{diag}(\kappa _{\mathrm{ax}}(\theta ), \kappa _{ \mathrm{rad}}(\theta ), 0)\) in diagonal form in a cylindrical coordinate system.

The exact algorithm used for constructing \(\kappa (\theta )\) (and also \(s(\theta )\)) can be inspected in code in [16, optipuls.coefficients]. We provide a plot of \(\kappa _{\mathrm{rad}}(\theta )\) and \(\kappa _{\mathrm{ax}}(\theta )\); see Fig. 2 (right). Numerical simulations based on these assumptions have shown reasonable correspondence to the real experiments, [2].

2.3 Boundary conditions

While some studies considered the energy introduced by the laser as a volumetric energy source, in this paper we use flux boundary conditions on the boundary part \(\Gamma _{1}\) for this purpose:

$$ \kappa \bigl(\theta (x,t)\bigr) \frac{\partial \theta (x,t)}{\partial \mathbf {n}} = - \eta \text{pd}_{\max} u(t). $$

Here η is the absorption coefficient of the material, pdmax is the power density of the laser beam, and \(u(t)\) is the control function with values in \([0,1]\). Since the power distribution of the laser beam is taken to be uniform across \(\Gamma _{1}\) in the current study, the power density is assumed to be constant and hence can be evaluated as the ratio of the maximal total power to the area of the affected spot. The absorption coefficient η is also assumed to be constant.

The cooling of the body is a result of the heat flux through the entire boundary except \(\Gamma _{3}\); see Fig. 1. For simplicity we assume zero heat flux through \(\Gamma _{3}\), which is a reasonable approximation when the radius of Ω is sufficiently large. On the remaining parts of the boundary, we distinguish convective and radiative heat fluxes modelled as

$$ \kappa \bigl(\theta (x,t)\bigr) \frac{\partial \theta (x,t)}{\partial \mathbf {n}} = h \bigl(\theta (x,t) - \theta _{\mathrm{amb}}\bigr) $$


$$ \kappa \bigl(\theta (x,t)\bigr) \frac{\partial \theta (x,t)}{\partial \mathbf {n}} = k \bigl(\theta (x,t)^{4} - \theta ^{4}_{\mathrm{amb}}\bigr), $$

respectively; see for instance [14, Chap. 3]. Here \(k = 2.26 \cdot 10^{-9}\ \mathrm{W}/ \mathrm{m} ^{2}\mathrm{K} ^{4}\) and \(h = 5\ \mathrm{W} / \mathrm{m} ^{2}\) are the radiative and the convective transfer coefficients, respectively, and \(\theta _{\mathrm{amb}}\) denotes the ambient temperature.

2.4 Summary of model equations

Let us summarize our model based on the above considerations. We recall that \(\Omega \subset \mathbb{R}^{3}\) is an open, orthogonal circular cylinder and \(\Gamma = \bigcup_{i=1}^{4} \Gamma _{i}\) is its boundary surface as shown in Fig. 1. The temperature distribution in Ω is governed by the quasilinear heat equation

$$ s\bigl(\theta (x,t)\bigr) \frac{\partial \theta (x,t)}{\partial t} = \operatorname{div} \bigl(\kappa \bigl(\theta (x,t)\bigr) \operatorname{grad}\theta (x,t) \bigr) , $$

where the temperature-dependent coefficients \(s(\theta (x,t)) = c_{\mathrm{eff}}(\theta (x,t)) \rho (\theta (x,t))\) and \(\kappa (\theta (x,t)\) are constructed as \(C^{1}\) cubic splines as detailed in reference [16, optipuls.coefficients].

Since we consider single-spot welding, the initial temperature \(\theta (x,0)\) inside Ω is assumed to be constant and equal to the ambience temperature \(\theta _{\mathrm{amb}}\):

$$ \theta (x,0) = \theta _{\mathrm{amb}} \quad\text{in } \Omega. $$

The boundary conditions for (2.1) are

$$\begin{aligned} &\kappa \bigl(\theta (x,t)\bigr) \frac{\partial \theta (x,t)}{\partial \mathbf {n}} \\ &\quad=\left\{\textstyle\begin{array}{l@{\quad}l} k (\theta (x,t)^{4} - \theta _{\mathrm{amb}}^{4}) + h (\theta (x,t) - \theta _{\mathrm{amb}}) - \eta \text{pd}_{\max } u(t) &\text{on } \Gamma _{1}, \\ k (\theta (x,t)^{4} - \theta _{\mathrm{amb}}^{4}) + h (\theta (x,t) - \theta _{\mathrm{amb}}) &\text{on } \Gamma _{2} \cup \Gamma _{4}, \\ 0 &\text{on } \Gamma _{3}. \end{array}\displaystyle \right\} \end{aligned}$$

We recall that k, h, pdmax and \(\theta _{\mathrm{amb}}\) are known constants. Moreover, \(u(t)\) is the control function we seek to determine. It takes values in \([0,1]\) and represents the fraction of the maximal laser power to be emitted as a function of time.

3 Optimal control problem

In this section we construct the objective functional as a sum of independent penalty terms. Each term serves a different purpose with relation to the single-spot welding application. As imposed by the application, the desired optimal control representing the emitted laser power profile should

  1. (1)

    provide sufficient welding penetration;

  2. (2)

    avoid hot cracking during the solidification stage;

  3. (3)

    ensure complete solidification after welding within the preselected time interval \([0,T]\);

  4. (4)

    minimize the total energy consumed by the laser.

In the following subsections we present and discuss four penalty terms designed to target of one these requirements each. We mention that similar, preliminary ideas were already presented in [1] but with little detail and discussion.

3.1 Welding penetration penalty

In order to guarantee the successful completion of the welding stage we must ensure that the melting pool has reached a certain predefined depth. At the same time, exceeding of this depth would result in an unnecessary increase in energy consumption and the time required for cooling. Therefore, we select a target point \(x_{\text{target}}\) on the symmetry axis of Ω and a target temperature \(\theta _{\text{target}}\) and formulate a term which penalizes the difference between the maximal temperature reached at \(x_{\text{target}}\) and the target temperature \(\theta _{\text{target}}\):

$$ J_{\mathrm{penetration}} = \frac{\beta _{\mathrm{penetration}}}{2} \bigl(\bigl\lVert \theta (x_{\text{target}},\cdot )\bigr\rVert _{L^{p}(0,T)} - \theta _{\text{target}} \bigr)^{2} . $$

Here p is sufficiently large so that the \(L^{p}\)-norm, which is chosen for simplicity and to avoid non-differentiabilities and state constraints, approximates the \(L^{\infty}\)-norm.

3.2 Solidification velocity penalty

Our main practical goal is to avoid the appearance of hot cracks during the solidification stage. As mentioned in Sect. 1, we associate hot cracks with high velocities of the solidification front. We therefore seek to restrict the maximal velocity of the solidification front by introducing a non-standard penalty term derived below.

We begin by characterizing the velocity of a point \(x(t)\) on some moving isothermal surface in Ω; see Fig. 3. Since the temperature \(\theta (x(t),t)\) is constant, we obtain

$$ \frac{ \mathrm{d}}{ \mathrm{d}t} \theta \bigl(x(t),t\bigr) = \operatorname{grad}\theta \bigl(x(t),t\bigr) \cdot x_{t}(t) + \theta _{t}\bigl(x(t),t \bigr) = 0. $$

The derivative \(x_{t}(t)\) can be decomposed as

$$ x_{t}(t) = \alpha \bigl(x(t),t\bigr) \operatorname{grad}\theta \bigl(x(t),t\bigr) + \text{component perpendicular to } \operatorname{grad}\theta \bigl(x(t),t \bigr), $$

where \(\alpha (x(t),t)\) is a scalar function. Substituting (3.3) into (3.2), we obtain

$$ \alpha \bigl(x(t),t\bigr) = \frac{- \theta _{t}(x(t),t)}{\lVert \operatorname{grad}\theta (x(t),t)\rVert ^{2}} , $$

where \(\lVert \cdot \rVert \) denotes the Euclidean norm. Therefore, we can define the velocity of any isothermal surface passing through the point x at time t as

$$ v(x,t) :=\frac{- \theta _{t}(x,t)}{\lVert \operatorname{grad}\theta (x,t)\rVert } . $$
Figure 3
figure 3

Solidification interface and its velocity during the cooling stage (sectional view)

While the melting pool expands, \(v(x,t)\) takes negative values near the edge of the pool since \(\theta _{t} > 0\) holds. When the pool shrinks, \(v(x,t)\) has positive values. We are only interested in restricting positive velocities and only within the solidus–liquidus temperature corridor. We therefore propose the following penalty term,

$$ J_{\mathrm{velocity}} = \frac{\beta _{\mathrm{velocity}}}{2} \int _{ \Omega \times (0,T)} \max \bigl\{ v(x,t) - v_{\max }, 0 \bigr\} ^{2} \chi \bigl(\theta (x,t)\bigr) \,\mathrm{d}x \,\mathrm{d}t, $$

where \(v_{\max}\) is a predefined constant and the indicator function χ is defined as

$$ \chi (\theta ) :=\textstyle\begin{cases} 1 & \text{where solidus } \le \theta \le \text{ liquidus}, \\ 0 & \text{otherwise}. \end{cases} $$

3.3 Completeness of solidification

To ensure that the solidification stage is complete at the given final time T, we penalize final temperatures \(\theta (x,T)\) which are still above the solidus temperature by means of the following term,

$$ J_{\mathrm{completeness}} = \frac{\beta _{\mathrm{completeness}}}{2} \int _{\Omega} \max \bigl\{ \theta (x, T) - \text{solidus}, 0 \bigr\} ^{2} \,\mathrm{d}x. $$

3.4 Energy consumption penalties

The consumption of energy in the process is taken into account by means of the following standard quadratic control cost term,

$$ J_{\mathrm{control}} = \frac{\beta _{\mathrm{control}}}{2} \lVert u\rVert ^{2}_{L^{2}(0,T)} . $$

Indeed, an \(L^{1}\)-norm penalty would be a more meaningful model of energy consumption. Such a term is known to induce sparsely supported controls, see for instance [5, 15, 18]. In the present application, however, optimal power profiles may then require the laser to be switched off and on again. Technical limitations require a certain amount of time before the laser can be powered up again, which is not feasible due to the brevity of the usual process times T in single-spot welding. Moreover, a waiting-time constraint would render the optimal control problem significantly more difficult.

3.5 Optimal control problem formulation

For convenience, we summarize our single-spot welding optimal control problem as follows:

$$ \left.\begin{aligned} & \text{Find a control function $u \colon [0,T] \to \mathbb{R}$ which minimizes the objective} \\ & J(u,\theta ) :=J_{\mathrm{penetration}}(\theta ) + J_{\mathrm{velocity}}(\theta ) + J_{\mathrm{completeness}}(\theta ) + J_{\mathrm{control}}(u), \\ & \text{where $\theta $ is the solution to the boundary value problem (2.1)--(2.3)} \\ & \text{and the control satisfies the constraints $0 \le u(t) \le 1$ on $[0,T]$}. \end{aligned}\right \} $$

4 Discretization and optimization scheme

In this section we describe a discretization of problem (3.8) as well as a projected gradient descent scheme for its numerical solution. Since the discretization in space is based on a finite element approach, we begin with the notion of weak solution. Notice that our definitions are informal since we do not aim to provide a thorough analysis of the forward system (2.1)–(2.3) here.

4.1 Weak formulation

As usual, the weak formulation is obtained by multiplying (2.1) by a test function, integrating by parts, and plugging in the natural boundary conditions (2.3). Abbreviating

$$ \Phi \bigl(\theta (x,t)\bigr) :=k \bigl(\theta (x,t)^{4} - \theta _{\mathrm{amb}}^{4} \bigr) + h \bigl(\theta (x,t) - \theta _{\mathrm{amb}} \bigr) , $$

we thus arrive at the notion that a function \(\theta \colon \Omega \times [0,T] \to \mathbb{R}\) is a weak solution to the boundary value problem (2.1)–(2.3) if it satisfies the initial condition (2.2) and the equality

$$\begin{aligned} &\int _{\Omega }s\bigl(\theta (x,t)\bigr) \theta _{t}(x,t) v \,\mathrm{d}x \,\mathrm{d}t + \int _{\Omega }\operatorname{grad}\theta (x,t)^{{ \mathrm{T}}}\kappa \bigl(\theta (x,t)\bigr) \operatorname{grad}v \,\mathrm{d}x \,\mathrm{d}t \\ &\quad{}+ \int _{\Gamma _{1} \cup \Gamma _{2} \cup \Gamma _{4}} \Phi \bigl(\theta (x,t)\bigr) v \,\mathrm{d}S \, \mathrm{d}t - \int _{\Gamma _{1}} \eta \text{pd}_{\max} u(t) v \,\mathrm{d}S \,\mathrm{d}t = 0 \end{aligned}$$

holds for all functions \(v \in C^{\infty}(\Omega )\) and for almost all \(t \in (0,T)\). Notice that dx denotes integration w.r.t. the volume measure and dS is w.r.t. the surface measure. Recall that the thermal conductivity \(\kappa (\theta )\) is a matrix due to different conductivities in radial and axial directions, see Sect. 2.2.

4.2 Reduction to the radially symmetric case

Up to this moment the problem was considered in \(\mathbb{R}^{3}\). However, the power density of the laser beam is taken to be radially symmetric, and there is no heat transition in Ω in the angular direction, i.e. \(\partial \theta /\partial \varphi = 0\). This motivates us to reduce the computational complexity of the problem by reducing the domain Ω to its two-dimensional radial section ω, see Fig. 4.

Figure 4
figure 4

Reduction to the radially symmetric case

From now on, we replace \(\theta (x,t)\) by \(\theta (r,z,t)\); see Fig. 1 for the coordinate axes. Thus, (4.1) turns into

$$\begin{aligned} &\int _{\omega }s\bigl(\theta (r,z,t)\bigr) \theta _{t}(r,z,t) v r \,\mathrm{d}r \,\mathrm{d}z \,\mathrm{d}t \\ &\quad{}+ \int _{\omega }\operatorname{grad}\theta (r,z,t)^{{\mathrm{T}}} \kappa \bigl( \theta (r,z,t)\bigr) \operatorname{grad}v r \,\mathrm{d}r \,\mathrm{d}z \,\mathrm{d}t \\ &\quad{}+ \int _{\gamma _{1} \cup \gamma _{2} \cup \gamma _{4}} \Phi \bigl(\theta (r,z,t)\bigr) v r \,\mathrm{d}s \, \mathrm{d}t - \int _{ \gamma _{1}} \eta \text{pd}_{\max} u(t) v r \,\mathrm{d}s \,\mathrm{d}t = 0 \end{aligned}$$

for all \(v \in C^{\infty}(\omega )\) and for almost all \(t \in (0,T)\). Notice that the gradient operator in equation (4.2) must be used in its cylindrical form, i.e.,

$$ \operatorname{grad}\theta (r,z,\varphi ) = \frac{\partial \theta}{\partial r} e_{r} + \frac{\partial \theta}{\partial z} e_{z} + \frac{1}{r} \frac{\partial \theta}{\partial \varphi} e_{\varphi}. $$

However, as mentioned before, due to the radial symmetry of the heat distribution, the \(e_{\varphi}\)-component of θ vanishes. This feature is convenient for the numerical implementation, since the standard gradient operator (in Cartesian coordinate form) can be used. In (4.2), we now denote the surface measure of the two-dimensional cross-sectional domain ω by ds. Notice that the integrals in (4.2) and in the following incur an extra factor r due to the coordinate transformation.

Similarly, two of the penalty terms in the objective in (3.8) are affected by the transition to cylindrical coordinates. Specifically, (3.5) and (3.6) now take the following forms:

$$\begin{aligned} &J_{\mathrm{velocity}} = \frac{\beta _{\mathrm{velocity}}}{2} \int _{ {\omega \times (0,T)}} \max \bigl\{ v(r,z,t) - v_{\max }, 0 \bigr\} ^{2} \chi \bigl(\theta (r,z,t)\bigr) r \,\mathrm{d}r \,\mathrm{d}z \, \mathrm{d}t, \end{aligned}$$
$$\begin{aligned} & J_{\mathrm{completeness}} = \frac{\beta _{\mathrm{completeness}}}{2} \int _{\omega} \max \bigl\{ \theta (r,z,T) - \text{solidus}, 0 \bigr\} ^{2} r \,\mathrm{d}r \,\mathrm{d}z. \end{aligned}$$

4.3 Discretization of the forward problem

We now focus on discretizing the problem in time and space in order to solve it numerically. We combine a finite element method in space with a finite difference method in time. The numerical implementation is based on the FEniCS computing platform; see [11].

Let \(N_{t}\) be the number of equidistant time steps excluding the initial state, then we denote:

$$ \begin{aligned} & \tau :=T/N_{t},\qquad u_{n} :=u(n\tau ),\qquad \theta _{n}(r,z) :=\theta (r,z,n\tau ), \\ & \theta _{n+\alpha}(r,z) :=\alpha \theta _{n+1}(r,z) + (1- \alpha ) \theta _{n}(r,z), \end{aligned} $$

where \(\alpha \in [0,1]\) determines the degree of implicitness of the time scheme.

Within the time interval \((n\tau, n\tau +\tau ]\), the coefficients and the operators of equation (2.1) are discretized as follows:

$$\begin{aligned} &s\bigl(\theta (r,z,t)\bigr) :=s(\theta _{n}),\qquad \kappa \bigl( \theta (r,z,t)\bigr) :=\kappa (\theta _{n}), \qquad\Phi \bigl(\theta (r,z,t)\bigr) :=\Phi (\theta _{n+\alpha } ) , \\ &\theta _{t}(r,z,t) :=\frac{\theta _{n+1}-\theta _{n}}{\tau},\qquad \operatorname{grad}\bigl(\theta (r,z,t)\bigr) :=\operatorname{grad}(\theta _{n+\alpha } ) . \end{aligned}$$

For the discretization in space, we employ piecewise linear, globally continuous test and trial functions on a predefined mesh of ω. Now the discretized form of equation (4.2) reads as follows,

$$\begin{aligned} & \sum_{n=0}^{N_{t}-1} \int _{\omega} s(\theta _{n}) (\theta _{n+1}- \theta _{n}) v_{n} r \,\mathrm{d}r \,\mathrm{d}z + \tau \sum _{n=0}^{N_{t}-1} \int _{\omega} \operatorname{grad}\theta _{n+ \alpha}^{{\mathrm{T}}} \kappa ( \theta _{n}) \operatorname{grad}v_{n} r \,\mathrm{d}r \,\mathrm{d}z \\ &\quad{}+ \tau \sum_{n=0}^{N_{t}-1} \int _{\gamma _{1} \cup \gamma _{2}} \Phi (\theta _{n+\alpha } ) v_{n} r \, \mathrm{d}s - \tau \sum_{n=0}^{N_{t}-1} \int _{ \gamma _{1}} \eta \text{pd}_{\max} u_{n} v_{n} r \,\mathrm{d}s = 0. \end{aligned}$$

In (4.5) we set \(\theta _{0} :=\theta _{\mathrm{amb}}\). We then solve (4.5) time step by time step for the unknown coefficient vectors \(\theta _{1}, \theta _{2}, \ldots, \theta _{N_{t}}\).

4.4 Discretization of the objective functional

To derive the discrete version of \(J_{\mathrm{penetration}}\), we discretize the \(L^{p}\)-norm in (3.1) according to

$$ \bigl\lVert \theta (x_{\text{target}},\cdot )\bigr\rVert _{L^{p}(0,T)} \approx \Biggl(\tau \sum_{n=1}^{N_{t}} \bigl\lvert \theta _{n}(0,z_{\mathrm{target}}) \bigr\rvert ^{p} \Biggr)^{1/p} = \tau ^{1/p} \bigl\lVert \bigl\{ \theta _{n}(0,z_{\mathrm{target}}) \bigr\} _{n=1}^{N_{t}} \bigr\rVert _{l^{p}} . $$

In fact, the factor \(\tau ^{1/p}\), which tends to one as p tends to infinity, can be compensated by adjusting the coefficient \(\beta _{\mathrm{penetration}}\), so we implement the following discrete version of (3.1):

$$ J_{\mathrm{penetration}} = \frac{\beta _{\mathrm{penetration}}}{2} \Biggl\{ \Biggl(\sum _{n=1}^{N_{t}} \bigl\lvert \theta _{n}(0,z_{\mathrm{target}}) \bigr\rvert ^{p} \Biggr)^{1/p} - \theta _{\mathrm{target}} \Biggr\} ^{2} . $$

A detailed discussion on the choice of p is given in Sect. 5.3.

The velocity of an isothermal surface (in fact an isothermal line after dimension reduction) can be approximated as

$$ v(\theta _{n}, \theta _{n+1}) = \frac{-(\theta _{n+1}-\theta _{n})}{\tau \lVert \operatorname{grad}\theta _{n+\alpha }\rVert } $$

and hence \(J_{\mathrm{velocity}}\) takes the following form:

$$ J_{\mathrm{velocity}} = \frac{\beta _{\mathrm{velocity}}}{2} \tau \sum _{n=0}^{N_{t}-1} \int _{\omega} \max \bigl\{ v(\theta _{n}, \theta _{n+1}) - v_{\max }, 0 \bigr\} ^{2} \chi (\theta _{n}, \theta _{n+1}) r \,\mathrm{d}r \,\mathrm{d}z $$

where the discretized indicator function χ is defined as

$$ \chi (\theta _{n}, \theta _{n+1}) :=\textstyle\begin{cases} 1 & \text{where solidus } \le \theta _{n} \text{ and } \theta _{n+1} < \text{liquidus}, \\ 0 & \text{otherwise}. \end{cases} $$

The remaining penalty terms \(J_{\mathrm{completeness}}\) and \(J_{\mathrm{control}}\) are discretized according to

$$\begin{aligned} &J_{\mathrm{completeness}} = \frac{\beta _{\mathrm{completeness}}}{2} \int _{\omega} \max \{\theta _{N_{t}} - \text{solidus}, 0 \}^{2} r \,\mathrm{d}r \,\mathrm{d}z, \end{aligned}$$
$$\begin{aligned} &J_{\mathrm{control}} = \frac{\beta _{\mathrm{control}}}{2} \tau \sum_{n=0}^{N_{t}-1} u_{n}^{2}. \end{aligned}$$

4.5 Evaluation of the gradient

In this section we briefly describe the evaluation of the gradient by means of the discrete adjoint state \(p = [p_{0}, p_{1}, \ldots, p_{N_{t}-1}]\). To this end, we introduce the Lagrangian

$$\begin{aligned} \mathcal{L}(\theta,u,p) :={}&J(\theta,u) + \sum _{n=0}^{N_{t}-1} \int _{\Omega} s(\theta _{n}) (\theta _{n+1}- \theta _{n}) p_{n} \,\mathrm{d}x \\ &{}+ \tau \sum_{n=0}^{N_{t}-1} \int _{\Omega} \operatorname{grad}\theta _{n+\alpha}^{{\mathrm{T}}} \kappa ( \theta _{n}) \operatorname{grad}p_{n} \,\mathrm{d}x \\ &{}+ \tau \sum_{n=0}^{N_{t}-1} \int _{\gamma _{1} \cup \gamma _{2}} \Phi (\theta _{n+\alpha } ) p_{n} \, \mathrm{d}s - \tau \sum_{n=0}^{N_{t}-1} \int _{ \gamma _{1}} \eta \text{pd}_{\max} u_{n} p_{n} \,\mathrm{d}s. \end{aligned}$$

The sequence of linear systems governing the discrete adjoint state is obtained from \(\partial \mathcal{L}(\theta,u,p)/\partial \theta _{n} = 0\). We do not provide the explicit formula for the adjoint equation here since in the code we derive it using FEniCS’ built-in automatic differentiation capabilities. Although the penalty terms (3.5) and (3.6) contain the non-differentiable term \(\max \{0, \cdot \}\) in their structure, the entire expressions are indeed of class \(C^{1}\) and their discrete counterparts (4.7) and (4.8) can be processed by the automatic differentiation in the naive way. The only manual differentiation required is for the penalty term \(J_{\mathrm{penetration}}\) in (4.6), since in contrast to the other terms, it cannot be split into a sum over the time steps. We added the contributions coming from this term manually to the adjoint state’s right hand side. One can find more details in [16, optipuls.core].

Finally, we differentiate \(\mathcal{L}(\theta,u,p)\) with respect to \(u = [u_{0}, u_{1}, \ldots, u_{N_{t}-1}]\) in the direction \(\delta u = [\delta u_{0}, \delta u_{1}, \ldots, \delta u_{N_{t}-1}]\) to obtain

$$ \frac{\partial \mathcal{L}(\theta,u,p)}{\partial u} \delta u = \tau \sum_{n=0}^{N_{t}-1} \biggl[\beta _{\mathrm{control}} u_{n} - \int _{\gamma _{1}} \eta \text{pd}_{\max } p_{n} \, \mathrm{d}s \biggr] \delta u_{n}. $$


$$ \operatorname{grad}_{u} \mathcal{L}(\theta, u, p) = \beta _{\mathrm{control}} u - \int _{\gamma _{1}} \eta \text{pd}_{\max} p \,\mathrm{d}s $$


4.6 Projected gradient descent scheme

To find the optimal control for the discretized counterpart of (3.8), we apply a projected gradient descent scheme with line search; see, e. g., [4, 6] or [7, Chap. 5.8.2]. To this end, we denote by \(j(u) = J(u,\theta )\) the reduced objective, which depends only on the values \(u = [u_{0}, u_{1}, \ldots, u_{N_{t}-1}]\) of the control since the solution \(\theta = [\theta _{1}, \theta _{2}, \ldots, \theta _{N_{t}}]\) to the forward system (4.5) has been inserted. Since this procedure is well known, we present only a short general outline in Algorithm 1. The norm in which the size of the gradient is evaluated is the norm represented by τ times the identity matrix. More details can be found in the implementation at [16, optipuls.optimization].

Algorithm 1
figure a

Projected gradient descent scheme

The stopping criterion was considered satisfied as soon as any of the following conditions were met:

$$ \begin{aligned}& \bigl\lVert \mathcal{P}_{A} \operatorname{grad}_{u} j (u_{\mathrm{current}})\bigr\rVert < \text{tolerance}_{\operatorname{grad}}, \\ &\lVert u_{\mathrm{trial}} - u_{\mathrm{current}}\rVert < \text{tolerance}_{\text{control}}, \\ &1 - J(u_{\mathrm{trial}}) / J(u_{\mathrm{current}}) < \text{tolerance}_{\text{descent rate}}, \\ &\text{iteration no.} > M. \end{aligned} $$

Here \(\mathcal{P}_{A}\) is the point-wise projection onto the tangent cone to the feasible set in \(L^{2}(0, T; [0,1])\) at \(u_{\mathrm{current}}\), i.e.,

$$ A_{n} = \textstyle\begin{cases} (-\infty, 0] & \text{if } (u_{\mathrm{current}})_{n} = 0, \\ (-\infty, \infty ) & \text{if } 0 < (u_{\mathrm{current}})_{n} < 1, \\ [0, \infty ) & \text{if } (u_{\mathrm{current}})_{n} = 1. \end{cases} $$

5 Numerical results

In this section we present some optimized laser pulses, i.e., numerical solutions to the discretized counterpart of the single-spot welding optimal control problem (3.8). We emphasize that all numerical results presented in this paper are fully reproducible and hence can be verified by the reader; see [17] for further instructions.

The common problem parameters shared by the numerical experiments presented in this section are provided in Table 1 (see also [17, env/]). These parameters describe the EN AW 6082-T6 aluminum alloy. These values as well the reasonable intervals for the pulse duration and maximal laser power were selected after experiments carried out by the Department of Production Technology, TU Ilmenau, Germany.

Table 1 Parameters of the numerical experiments

Notice that the target temperature \(\theta _{\text{target}}\) in Table 1 is intentionally set higher than the desired maximal temperature at the target point (\(\text{liquidus} = {923}\) K), see Sect. 5.3 for further details.

5.1 Conventional and linear rampdown pulse shapes

Conventional pulsed laser welding strategies use a rectangular laser pulse shape, i.e. the laser is working full power for a short time and is switched off immediately after. Unfortunately, this simple strategy often leads to hot cracking when applied to aluminum alloys. A so-called linear rampdown pulse shape, i.e. when the laser power is decreasing linearly after a short period of working full power, has shown its potential to obtain a crack-free welding of aluminum alloys; see [9, 19]. However, rampdown pulses are not likely to be optimal with respect to any of the criteria established in Sect. 3.

In view of this we first consider the conventional (5 ms of 1500 W) and the linear rampdown (5 ms of 1500 W, 5 ms of rampdown) pulse shapes as the initial guess \(u_{\mathrm{initial}}\) for the optimizer. In both of these experiments the maximal laser power \(P_{\text{YAG}}\) is limited by 2000 W and the total time T is limited by 12 ms. Figure 5 demonstrates the corresponding solutions to the optimal control problem obtained with Algorithm 1. The numerical reports on the corresponding simulations are presented in Table 2. Notice that an imperfect match between the evaluated welding depth and the \(J_{\text{penetration}}\) penalty is due to the p-norm approximation to the sup-norm of \(\theta (x_{\text{target}}, \cdot )\), see (5.1). We observe that in both cases, we obtain apparently locally optimal pulse shapes which differ very little from their respective initial guesses.

Figure 5
figure 5

Solutions to the optimal control problem with conventional (left) and linear rampdown (right) pulse shapes taken as initial guesses

Table 2 Numerical report on simulations with the conventional and the linear rampdown pulse shapes, and locally optimal pulse shapes * starting from corresponding initial guesses

5.2 Optimizations from zero initial guess

In the search to obtain better pulse shapes, we now begin with the trivial initial guess \(u_{\mathrm{initial}} \equiv 0\), i.e., no power radiated by the laser. With this initial guess, the target temperature is clearly not reached and the term \(J_{\mathrm{penetration}}\), see (4.6), drives the pulse shape away from its initial value. Figure 6 shows the corresponding solutions to the optimal control problem with variable maximal laser power \(P_{\text{YAG}}\) and maximal time T until a full solidification. The corresponding numerical reports are presented in Table 3.

Figure 6
figure 6

Solutions to the optimal control problem with zero initial guess with the maximal laser power varying vertically and the maximal welding time varying horizontally

Table 3 Numerical report on the series of optimizations with zero initial guess

To give the reader some idea on the performance of the optimizer, the runtime of the gradient descent procedure was measured for the problem corresponding to \(P_{\text{YAG}} = {1800}\) W, \(T = {15}\) ms. The descent terminated after 15 iterations by the “descent rate” stopping criterion and it took 175 s. The temperature state had 4837 spatial degrees of freedom. The computations were carried out on a workstation with an AMD Ryzen 9 5950X CPU.

5.3 Impact of the p-norm approximation to the sup-norm on the temperature control

The choice of the value of p in the p-norm approximation to the sup-norm has significant impact on the accuracy within which the maximal temperature at the target point \(x_{\text{target}}\) can be controlled via penalty term (3.1).

Figure 7 shows solutions to a sequence of optimal control problems employing successively increasing values of p and Table 4 shows the actual maximal temperature reached at the target point. The zero initial guess is taken for the smallest value of p and each subsequent problem utilizes the previously computed optimal control as the initial guess. In the limiting case \(p = \infty \), the penalty term (4.6) is replaced by

$$ J_{\mathrm{penetration}} = \frac{\beta _{\mathrm{penetration}}}{2} \Bigl\{ \max_{n=1, \ldots, N_{t}} \bigl\{ \theta _{n}(0,z_{\mathrm{target}}) \bigr\} - \theta _{\mathrm{target}} \Bigr\} ^{2} . $$

This term is only directionally differentiable, which however did not cause difficulties during the optimization.

Figure 7
figure 7

Solutions to a sequence of optimal control problems with variable parameter p. Zero initial guess is taken for the smallest value of p and each subsequent problem utilizes previously computed optimal control as the initial guess

Table 4 Maximal temperature at the target point depending on variable parameter p

Although higher values of p bring more accurate control of the welding penetration, they lead to a side effect which is rather undesirable for the practical application: solutions to the corresponding optimal control problems tend to demonstrate faster growth and higher peaks comparing to those evaluated for smaller values of p. Due to higher laser beam power density such power profiles can form a so-called key hole structure and therefore trigger a transition from the heat conduction welding to the deep penetration welding, see [20]. While deep penetration laser welding has its own applications, such transitions are strictly avoided in the current study.

Moreover, higher values of p used in optimizations from zero initial guess described in Sect. 5.2 lead to solutions showing higher solidification velocity rates and corresponding penalties. Therefore our strategy is to compensate smaller values of p by setting the target temperature \(\theta _{\text{target}}\) higher than the actual desired maximal temperature at the target point. As one can see from the following inequality

$$ \bigl\lVert \bigl\{ \theta _{n}(0, z_{\text{target}}) \bigr\} _{n=1}^{N_{t}} \bigr\rVert _{l^{p}} \le N_{t}^{\frac{1}{p}} \bigl\lVert \bigl\{ \theta _{n}(0, z_{\text{target}}) \bigr\} _{n=1}^{N_{t}} \bigr\rVert _{l^{ \infty}}, $$

it is enough to set \(N_{t}^{1/p} \cdot \text{liquidus}\) as the target temperature in (4.6) to ensure that the liquidus temperature was reached at the target point, however the exact value was chosen by trial and error.

5.4 Discussion of the obtained numerical results

One can see from Table 2 that the conventional pulse shape is far from being optimal since it leads to enormous solidification velocity penalties \(J_{\mathrm{velocity}}\), which dominate the total value of the objective. Even though the local minimizer reached from the conventional pulse shape as a starting point achieves a decrease in the objective by one order of magnitude, the value of the solidification penalty \(J_{\mathrm{velocity}}\) corresponding to the formation of hot cracks is still unacceptably large. On the other hand, the linear rampdown pulse shape achieves a reduction of the solidification velocity and the local minimizer reached from there is even able to keep this velocity within the permitted limit \(v_{\max}\) so that \(J_{\mathrm{velocity}}\) is zero. A successful crack-free welding of aluminum alloys using the linear rampdown pulse shape was confirmed experimentally, see [9, 19].

However, the results of optimizations with zero initial guess in Table 3 show that further optimization is still possible and the optimal pulse shapes are quite non-trivial to guess by trial and error. One can see from Table 3 and Fig. 6 that reasonably small penalty values can be obtained only if the optimizer has enough room to adjust the pulse shape in time and power dimensions, though smaller pulse durations are generally prefered in the industry since they allow faster welding.

In the pulse shapes limited by 10 ms, the small swing-ups close to the end appear as a result of compensation of the too high solidification velocity. Despite of the fact that such pulse shapes are local optimizers for the discrete version of (3.8), they do not seem reasonable for the practical application. For the optimization problem under consideration with the setup as in Table 1, the most promising optimal pulse shape would be the one obtained with a maximal laser power of 2100 W and total time of 15 ms.

Preliminary laboratory experiments carried by the Department of Production Technology, TU Ilmenau, confirmed that the pulse shapes optimized from zero initial guess can indeed be used to produce crack-free welds. These results will be presented in a separate paper.

Availability of data and materials

The data that support the findings of this study are openly available at, reference number [17].


  1. Bergmann JP, Bielenin M, Herzog RA, Hildebrand J, Riedel I, Schricker K, Trunk C, Worthmann K. Prevention of solidification cracking during pulsed laser beam welding. Proc Appl Math Mech. 2017;17(1):405–6.

    Article  Google Scholar 

  2. Bielenin M. Prozessstrategien zur Vermeidung von Heißrissen beim Schweißen von Aluminium mit pulsmodulierbaren Laserstrahlquellen. Ph.D. thesis. Technische Universität Ilmenau, Fakultät für Maschinenbau; 2021.

  3. Bielenin M, Bergmann JP. Numerical and experimental analysis of solidification cracking in pulsed laser welds of Al 6082. In: International congress on applications of lasers & Electro-optics. Laser Institute of America; 2017.

    Chapter  Google Scholar 

  4. Calamai PH, Moré JJ. Projected gradient methods for linearly constrained problems. Math Program. 1987;39(1):93–116.

    Article  MathSciNet  MATH  Google Scholar 

  5. Casas E, Herzog R, Wachsmuth G. Optimality conditions and error analysis of semilinear elliptic control problems with \({L}^{1}\) cost functional. SIAM J Optim. 2012;22(3):795–820.

    Article  MathSciNet  MATH  Google Scholar 

  6. Gafni EM, Bertsekas DP. Two-metric projection methods for constrained optimization. SIAM J Control Optim. 1984;22(6):936–64.

    Article  MathSciNet  MATH  Google Scholar 

  7. Geiger C, Kanzow C. Theorie und Numerik restringierter Optimierungsaufgaben. New York: Springer; 2002.

    Book  MATH  Google Scholar 

  8. Gupta S. The classical Stefan problem. Basic concepts. Modelling and analysis, applied mathematics and mechanics. vol. 45. Amsterdam: North-Holland; 2003.

    Book  MATH  Google Scholar 

  9. Jia Z, Zhang P, Yu Z, Shi H, Liu H, Wu D, Ye X, Wang F, Tian Y. Effect of pulse shaping on solidification process and crack in 5083 aluminum alloy by pulsed laser welding. Opt Laser Technol. 2021;134:106608.

    Article  Google Scholar 

  10. Katayama S. Solidification phenomena of weld metals. Solidification cracking mechanism and cracking susceptibility (3rd report). Weld Int. 2001;15(8):627–36.

    Article  Google Scholar 

  11. Logg A, Mardal KA, Wells GN, editors. Automated solution of differential equations by the finite element method. Berlin: Springer; 2012.

    Book  MATH  Google Scholar 

  12. Mills KC, Keene BJ, Brooks RF, Shirali A. Marangoni effects in welding. Philos Trans R Soc Lond A, Math Phys Eng Sci. 1998;356(1739):911–25.

    Article  Google Scholar 

  13. Saldi Z. Marangoni Driven Free Surface Flows in Liquid Weld Pools. Ph.D. thesis. 2012.

  14. Służalec A. Theory of thermomechanical processes in welding. Netherlands: Springer; 2005.

    Book  Google Scholar 

  15. Stadler G. Elliptic optimal control problems with \({L}^{1}\)-control cost and applications for the placement of control devices. Comput Optim Appl. 2009;44(2):159–81.

    Article  MathSciNet  MATH  Google Scholar 

  16. Strelnikov D. OptiPuls: numerical model for single spot pulsed laser beam welding. 2020.

  17. Strelnikov D. An optimal control problem for single spot pulsed laser welding. 2021.

  18. Vossen G, Maurer H. On \({L}^{1}\)-minimization in optimal control and applications to robotics. Optim Control Appl Methods. 2006;27(6):301–21.

    Article  Google Scholar 

  19. Zhang J, Weckman DC, Zhou Y. Effects of temporal pulse shaping on cracking susceptibility of 6061-T6 aluminum Nd: YAG laser welds. Weld J. 2008;87(1):18s–30s.

    Google Scholar 

  20. Zhou J, Tsai H. Developments in pulsed and continuous wave laser welding technologies. In: Handbook of laser welding technologies. Woodhead publishing series in electronic and optical materials. Amsterdam: Elsevier; 2013. p. 103–148e.

    Chapter  Google Scholar 

Download references


This work was funded by the Federal Ministry for Economic Affairs and Energy (BMWi) of Germany through IGF grant 20.826 B (project OptiPuls), which is gratefully acknowledged. The publication was supported by Heidelberg University and an open access publication fund by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation), which is gratefully acknowledged. Open Access funding enabled and organized by Projekt DEAL.

Author information

Authors and Affiliations



The authors contributed to the manuscript equally. All authors have read and approved the manuscript.

Corresponding authors

Correspondence to Roland Herzog or Dmytro Strelnikov.

Ethics declarations

Ethics approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Competing interests

The authors declare no competing interests.

Additional information


Not applicable.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Herzog, R., Strelnikov, D. An optimal control problem for single-spot pulsed laser welding. J.Math.Industry 13, 4 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: