Keywords

10.1 Introduction

Many different types of systems, objects and equipment are susceptible to damage from lightning discharges. Lightning effects are usually analysed using lightning discharge models. Most of the engineering and electromagnetic models imply channel-base current functions. Various single and multi-peaked functions are proposed in the literature for modelling lightning channel-base currents, examples include Heidler, Heidler and Cvetic [3], Javor and Rancic [7], Javor [5, 6]. For engineering and electromagnetic models, a general function that would be able to reproduce desired waveshapes is needed, such that analytical solutions for its derivatives, integrals, and integral transformations, exist. A multi-peaked channel-base current function has been proposed in Javor [5] as a generalization of the so-called TRF (two-rise front) function from Javor [6], which possesses such properties.

In this paper we analyse a modification of such a multi-peaked function, a so-called \(p\,\)-peak analytically extended function (AEF) . Possibility of application of the AEF to modelling of various multi-peaked waveshapes is investigated. Estimation of its parameters has been performed using the Marquardt least-squares method (MLSM) , an efficient method for the estimation of non-linear function parameters, Marquardt [14]. It has been applied in many fields, including lightning research for optimizing parameters of the Heidler function in Lovric et al. [10], or the Pulse function in Lundengård et al. [11, 12].

Some numerical results are presented, including those for the Standard IEC 62305 [4] current of the first-positive strokes, and an example of a fast-decaying lightning current waveform.

10.2 The \(p\,\)-Peak Analytically Extended Function

The p-peaked AEF is constructed using the function

$$\begin{aligned} x(\beta ; t) = \left( t e^{1-t}\right) ^\beta ,~0 \le t, \end{aligned}$$
(10.1)

which we will refer to as the power exponential function. The power exponential function is qualitatively similar to the desired waveforms in the sense that it has a steeply rising initial part followed by a more slowly decaying part. The steepness of both the rising and decaying part is determined by the \(\beta \)-parameter. This is illustrated in Fig. 10.1.

Fig. 10.1
figure 1

An illustration of how the steepness of the power exponential function varies with \(\beta \)

This function is in some ways similar to the Heidler function [2] that is commonly used [4]. One feature of the Heidler function that the power exponential function does not share is that a Heidler function with a very steep rise and slow decay can be easily constructed. To construct the AEF so that it can imitate this feature we define it as a piecewise linear combinations of scaled and translated power exponential functions, the concept is illustrated in Fig. 10.2.

Fig. 10.2
figure 2

An illustration of how the steepness of the power exponential function varies with \(\beta \)

In order to get a function with multiple peaks and where the steepness of the rise between each peak as well as the slope of the decaying part is not dependent on each other, we define the analytically extended function (AEF) as a function that consist of piecewise linear combinations of the power exponential function that has been scaled and translated so that the resulting function is continuous. Given the difference in height between each pair of peaks \(I_{m_1}\), \(I_{m_2}, \ldots , I_{m_p}\), the corresponding times \(t_{m_1}\), \(t_{m_2}, \ldots , t_{m_p}\), integers \(n_q > 0\), real values \(\beta _{q,k}\), \(\eta _{q,k}\), \(1 \le q \le p+1\), \(1 \le k \le n_q\) such that the sum over k of \(\eta _{q,k}\) is equal to one, the p-peaked AEF i(t) is given by (10.2).

Definition 10.1

Given \(I_{m_q} \in \mathbb {R}\), \(t_{m_q} \in \mathbb {R}\), \(q = 1,2,\ldots ,p\) such that \(t_{m_0} = 0 < t_{m_1} \le t_{m_2} \le \ldots \le t_{m_p}\) along with \(\eta _{q,k},\,\beta _{q,k} \in \mathbb {R}\) and \(0 < n_q \in \mathbb {Z}\) for \(q = 1,2,\ldots ,p+1\), \(k = 1,2,\ldots ,n_q\) such that \(\displaystyle \sum _{k=1}^{n_q} \eta _{q,k} = 1\).

The analytically extended function (AEF), i(t), with p peaks is defined as

$$\begin{aligned} i(t) = {\left\{ \begin{array}{ll} \displaystyle { \left( \sum _{k = 1}^{q-1} I_{m_k}\right) + I_{m_q} \sum _{k = 1}^{n_q} \eta _{q,k} x_q(t)^{\beta _{q,k}^2+1}}, &{}~t_{m_{q-1}} \le t \le t_{m_q},~1 \le q \le p, \\[4mm] \displaystyle { \left( \sum _{k = 1}^{p} I_{m_k}\right) \sum _{k = 1}^{n_{p+1}} \eta _{p+1,k} x_{p+1}(t)^{\beta _{p+1,k}^2} }, &{}~t_{m_p} \le t, \end{array}\right. } \end{aligned}$$
(10.2)

where

$$\begin{aligned} x_q(t) = {\left\{ \begin{array}{ll} \displaystyle \frac{t-t_{m_{q-1}}}{\varDelta t_{m_q}} \exp \left( \displaystyle \frac{t_{m_q}-t}{\varDelta t_{m_q}}\right) ,&{} 1 \le q \le p, \\[4mm] \displaystyle \frac{t}{t_{m_q}} \exp \left( 1-\displaystyle \frac{t}{t_{m_q}}\right) , &{} q = p+1, \end{array}\right. } \end{aligned}$$

and \(\varDelta t_{m_q} = t_{m_q}-t_{m_{q-1}}\).

Sometimes the notation \(i(t;\varvec{\beta },\varvec{\eta })\) with

$$\begin{aligned}\varvec{\beta } = \begin{bmatrix} \beta _{1,1}&\beta _{1,2}&\ldots&\beta _{q,k}&\ldots&\beta _{p+1,n_{p+1}} \end{bmatrix},~\varvec{\eta } = \begin{bmatrix} \eta _{1,1}&\eta _{1,2}&\ldots&\eta _{q,k}&\ldots&\eta _{p+1,n_{p+1}} \end{bmatrix} \end{aligned}$$

will be used to clarify what the particular parameters for a certain AEF are.

Remark 10.1

The \(p\,\)-peak AEF can be written more compactly if we introduce the vectors

$$\begin{aligned} \varvec{\eta }_q= & {} [\eta _{q,1}~\eta _{q,2}~\ldots ~\eta _{q,n_q}]^\top , \end{aligned}$$
(10.3)
$$\begin{aligned} \mathbf {x}_q(t)= & {} {\left\{ \begin{array}{ll} \left[ x_q(t)^{\beta _{q,1}^2+1}~x_q(t)^{\beta _{q,2}^2+1}~\ldots ~x_q(t)^{\beta _{q,n_q}^2+1}\right] ^\top , &{}~1 \le q \le p, \\ \left[ x_q(t)^{\beta _{q,1}^2}~x_q(t)^{\beta _{q,2}^2}~\ldots ~x_q(t)^{\beta _{q,n_q}^2}\right] ^\top , &{}~q=p+1. \end{array}\right. } \end{aligned}$$
(10.4)

The more compact form is

$$\begin{aligned} i(t) = {\left\{ \begin{array}{ll} \left( \displaystyle \sum _{k = 1}^{q-1} I_{m_k}\right) + I_{m_q} \cdot \varvec{\eta }_q^\top \mathbf {x}_q(t), &{} t_{m_{q-1}} \le t \le t_{m_q},~1 \le q \le p, \\ \left( \displaystyle \sum _{k = 1}^{q} I_{m_k}\right) \cdot \varvec{\eta }_q^\top \mathbf {x}_q(t), &{} t_{m_q} \le t,~q = p+1. \end{array}\right. } \end{aligned}$$
(10.5)

If the AEF is used to model an electrical current, than the derivative of the AEF determines the induced electrical voltage in conductive loops in the lightning field. For this reason it is desirable to guarantee that the first derivative of the AEF is continuous.

Since the AEF is a linear function of elementary functions its derivative can be found using standard methods.

Theorem 10.1

The derivative of the \(p\,\)-peak AEF is

$$\begin{aligned} \frac{\mathrm {d}i(t)}{\mathrm {d}t} = {\left\{ \begin{array}{ll} \displaystyle { I_{m_q} \frac{t_{m_q}-t}{t-t_{m_{q-1}}}\,\frac{x_q(t)}{\varDelta t_{m_q}}\, \varvec{\eta }_q^\top \mathbf {B}_q\, \mathbf {x}_q(t) }, &{}~t_{m_{q-1}} \le t \le t_{m_q},~1 \le q \le p,\\[4mm] \displaystyle { I_{m_q} \frac{x_q(t)}{t} \frac{t_{m_q}-t}{t_{m_q}} \varvec{\eta }_q^\top \mathbf {B}_q\, \mathbf {x}_q(t)}, &{}~t_{m_q} \le t,~q = p + 1, \end{array}\right. } \end{aligned}$$
(10.6)

where

$$\begin{aligned} \mathbf {B}_{p+1} = \begin{bmatrix} \beta _{p+1,1}^2&0&\ldots&0 \\ 0&\beta _{p+1,2}^2&\ldots&0 \\ \vdots&\vdots&\ddots&\vdots \\ 0&0&\ldots&\beta _{p+1,n_{p+1}}^2 \end{bmatrix},~ \mathbf {B}_q = \begin{bmatrix} \beta _{q,1}^2+1&0&\ldots&0 \\ 0&\beta _{q,2}^2+1&\ldots&0 \\ \vdots&\vdots&\ddots&\vdots \\ 0&0&\ldots&\beta _{q,n_q}^2+1 \end{bmatrix}, \end{aligned}$$

for \( 1 \le q \le p\).

Proof

From the definition of the AEF (see (10.2)) and the derivative of the power exponential function (10.1) given by

$$\begin{aligned} \frac{\mathrm {d}}{\mathrm {d}t} x(\beta ;t) = \beta (1-t)t^{\beta -1} e^{\beta (1-t)}, \end{aligned}$$

expression (10.6) can easily be derived since differentiation is a linear operation and the result can be rewritten in the compact form analogously to (10.5).

Illustration of the AEF function and its derivative for various values of \(\beta _{q,k}\)-parameters is shown in Fig. 10.3.

Fig. 10.3
figure 3

Illustration of the AEF (solid line) and its derivative (dashed line) with the same \(I_{m_q}\) and \(t_{m_q}\) but different \(\beta _{q,k}\)-parameters. a \(0< \beta _{q,k} < 1\), b \(4< \beta _{q,k} < 5\), c \(12< \beta _{q,k} < 13\), d a mixture of large and small \(\beta _{q,k}\)-parameters

Lemma 10.1

The AEF is continuous and at each \(t_{m_q}\) the derivative is equal to zero.

Proof

Within each interval \(t_{m_{q-1}} \le t \le t_{m_q}\) the AEF is a linear combination of continuous functions and at each \(t_{m_q}\) the function will approach the same value from both directions unless all \(\eta _{q,k} \le 0\), but if \(\eta _{q,k} \le 0\) then \(\displaystyle \sum _{k=1}^{n_q} \eta _{q,k} \ne 1\).

Noting that for any diagonal matrix \(\mathbf {B}\) the expression

$$\begin{aligned} \varvec{\eta }_q^\top \mathbf {B}\, \mathbf {x}_q(t) = \sum _{k = 1}^{n_q} \eta _{q,k} \mathbf {B}_{kk} x_q(t)^{\beta _{q,k}^2+1},~1 \le q \le p, \end{aligned}$$

is well-defined and that the equivalent statement holds for \(q = p\) it is easy to see from (10.6) that the factor \((t_{m_q}-t)\) in the derivative ensures that the derivative is zero every time \(t = t_{m_q}\).

When interpolating a waveform with p peaks it is natural to require that there will not appear new peaks between the chosen peaks. This corresponds to requiring monotonicity in each interval. One way to achieve this is given in Lemma 10.2.

Lemma 10.2

If \(\eta _{q,k} \ge 0\), \(k = 1,\ldots ,n_q\) the AEF, i(t), is strictly monotonic on the interval \(t_{m_{q-1}}< t < t_{m_q}\).

Proof

The AEF will be strictly monotonic in an interval if the derivative has the same sign everywhere in the interval. That this is the case follows from (10.6) since every term in \(\varvec{\eta }_q^\top \mathbf {B}_q\, \mathbf {x}_q(t)\) is non-negative if \(\eta _{q,k} \ge 0\), \(k = 1,\ldots ,n_q\), so the sign of the derivative it determined by \(I_{m_q}\).

If we allow some of the \(\eta _{q,k}\)-parameters to be negative, the derivative can change sign the function might get an extra peak between two other peaks, see Fig. 10.4.

Fig. 10.4
figure 4

An example of a two-peaked AEF where some of the \(\eta _{q,k}\)-parameters are negative, so that it has points where the first derivative changes sign between two peaks. The solid line is the AEF and the dashed lines is the derivative of the AEF

The integral of the electrical current represents the charge transfer. Unlike the Heidler function the integral of the AEF is relatively straightforward to find. How to do this is detailed in Lemmas 10.3, 10.4, Theorems 10.2, and 10.3.

Lemma 10.3

For any \(t_{m_{q-1}} \le t_0 \le t_1 \le t_{m_q}\), \(1 \le q \le p\),

$$\begin{aligned} \int _{t_0}^{t_1} x_q(t)^{\beta } {\text {d}}t = \frac{e^{\beta }}{\beta ^{\beta +1}} \varDelta \gamma \left( \beta +1,\frac{t_1-t_{m_q}}{\beta \varDelta t_{m_q}},\frac{t_0-t_{m_q}}{\beta \varDelta t_{m_q}}\right) \end{aligned}$$
(10.7)

with \(\varDelta t_{m_q} = t_{m_q} - t_{m_{q-1}}\) and

$$\begin{aligned} \varDelta \gamma (\beta ,t_0,t_1) = \gamma \left( \beta +1,\beta t_1 \right) - \gamma \left( \beta +1, \beta t_0 \right) , \end{aligned}$$

where

$$\begin{aligned} \gamma (\beta ,t) = \int _{0}^{t} \tau ^{\beta -1} e^{-\tau } {\text {d}}{\!}\tau \end{aligned}$$

is the lower incomplete Gamma function [1].

If \(t_0 = t_{m_{q-1}}\) and \(t_1 = t_{m_q}\) then

$$\begin{aligned} \int _{t_{m_{q-1}}}^{t_{m_q}} x_q(t)^{\beta } {\text {d}}t = \frac{e^{\beta }}{\beta ^{\beta +1}} \gamma \left( \beta +1,\beta \right) . \end{aligned}$$
(10.8)

Proof

$$\begin{aligned} \int _{t_0}^{t_1} x_q(t)^{\beta } {\text {d}}t&= \int _{t_0}^{t_1} \left( \frac{t-t_{m_q}}{\varDelta t_{m_q}} \exp \left( 1-\frac{t-t_{m_q}}{\varDelta t_{m_q}}\right) \right) ^\beta {\text {d}}t \\&= \frac{e^{\beta }}{\beta ^{\beta +1}} \int _{t_0}^{t_1} \left( \beta \frac{t-t_{m_q}}{\varDelta t_{m_q}}\right) ^{\beta } \exp \left( 1-\beta \frac{t-t_{m_q}}{\varDelta t_{m_q}}\right) {\text {d}}t. \end{aligned}$$

Changing variables according to \(\tau = \frac{t-t_{m_q}}{\varDelta t_{m_q}}\) gives

$$\begin{aligned} \int _{t_0}^{t_1} x_q(t)^{\beta } {\text {d}}t&= \frac{e^{\beta }}{\beta ^{\beta +1}} \int _{\tau _0}^{\tau _1} \tau ^{\beta } e^{-\tau } {\text {d}}t \\&=\frac{e^{\beta }}{\beta ^{\beta +1}} \left( \gamma (\beta +1,\tau _1)-\gamma (\beta +1,\tau _0)\right) \\&= \frac{e^{\beta }}{\beta ^{\beta +1}} \varDelta \gamma (\beta +1,\tau _1,\tau _0) \\&= \frac{e^{\beta }}{\beta ^{\beta +1}} \varDelta \gamma \left( \!\beta +1,\beta \frac{t_1-t_{m_q}}{\varDelta t_{m_q}},\beta \frac{t_0-t_{m_q}}{\varDelta t_{m_q}}\!\right) \!. \end{aligned}$$

When \(t_0 = t_{m_{q-1}}\) and \(t_1 = t_{m_q}\) then

$$\begin{aligned} \int _{t_0}^{t_1} x_q(t)^{\beta } {\text {d}}t = \frac{e^{\beta }}{\beta ^{\beta +1}} \varDelta \gamma \left( \beta +1,\beta \right) \end{aligned}$$

and with \(\gamma (\beta +1,0) = 0\) we get (10.8).

Lemma 10.4

For any \(t_{m_{q-1}} \le t_0 \le t_1 \le t_{m_q}\), \(1 \le q \le p\),

$$\begin{aligned} \int _{t_0}^{t_1} i(t) {\text {d}}t = (t_1-t_0)\left( \sum _{k=1}^{q-1}I_{m_k}\right) + I_{m_q} \sum _{k=1}^{n_q} \eta _{q,k} \, g_q(t_1,t_0), \end{aligned}$$
(10.9)

where

$$\begin{aligned} g_q(t_1,t_0) = \frac{e^{\beta _{q,k}^2}}{\left( \beta _{q,k}^2+1\right) ^{\beta _{q,k}^2+1}} \varDelta \gamma \left( \beta _{q,k}^2+2,\frac{t_1 - t_{m_{q-1}}}{\varDelta t_{m_q}},\frac{t_0 - t_{m_{q-1}}}{\varDelta t_{m_q}} \right) \end{aligned}$$

with \(\varDelta \gamma (\beta , t_0, t_1)\) defined as in (10.7).

Proof

$$\begin{aligned} \int _{t_0}^{t_1} i(t) {\text {d}}t&= \int _{t_0}^{t_1} \left( \sum _{k=1}^{q-1} I_{m_k}\right) + I_{m_q} \sum _{k=1}^{n_q} \eta _{q,k} x_q(t)^{\beta _{q,k}^2+1} {\text {d}}t \\&= (t_1-t_0)\left( \sum _{k=1}^{q-1} I_{m_k}\right) + I_{m_q} \sum _{k=1}^{n_q} \eta _{q,k} \int _{t_0}^{t_1} x_q(t)^{\beta _{q,k}^2+1} {\text {d}}t \\&= (t_1-t_0)\left( \sum _{k=1}^{q-1} I_{m_k}\right) + I_{m_q} \sum _{k=1}^{n_q} \eta _{q,k} \, g_q(t_0,t_1). \end{aligned}$$

Theorem 10.2

If \(t_{m_{a-1}} \le t_a \le t_{m_a}\), \(t_{m_{b-1}} \le t_b \le t_{m_b}\) and \(0 \le t_a \le t_b \le t_{m_p}\) then

$$\begin{aligned} \int _{t_a}^{t_b} i(t) {\text {d}}t =&~ (t_{m_a}-t_a)\left( \sum _{k=1}^{a-1} I_{m_k}\right) + I_{m_a} \sum _{k=1}^{n_a} \eta _{a,k} \, g_a(t_a,t_{m_a}) \nonumber \\&+ \sum _{q=a+1}^{b-1} \left( \varDelta t_{m_q} \left( \sum _{k=1}^{q-1} I_{m_k}\right) + I_{m_q} \sum _{k=1}^{n_q} \eta _{q,k} \, \hat{g}\left( \beta _{q,k}^2+1\right) \right) \nonumber \\&+ (t_b-t_{m_b})\left( \sum _{k=1}^{b-1} I_{m_k}\right) + I_{m_b} \sum _{k=1}^{n_b} \eta _{b,k} \, g_b(t_{m_b},t_b), \end{aligned}$$
(10.10)

where \(g_q(t_0,t_1)\) is defined as in Lemma 10.4 and

$$\begin{aligned} \hat{g}(\beta ) = \frac{e^{\beta }}{\beta ^{\beta +1}}\gamma \left( \beta +1,\beta \right) . \end{aligned}$$

Proof

This theorem follows from integration being linear and Lemma 10.4.

Theorem 10.3

For \(t_{m_p} \le t_0< t_1 < \infty \) the integral of the AEF is

$$\begin{aligned} \int _{t_0}^{t_1} i(t) {\text {d}}t = \left( \sum _{k = 1}^{p} I_{m_k}\right) \sum _{k = 1}^{n_{p+1}} \eta _{p+1,k} \, g_{p+1}(t_1,t_0), \end{aligned}$$
(10.11)

where \(g_q(t_0,t_1)\) is defined as in Lemma 10.4.

When \(t_0 = t_{m_p}\) and \(t_1 \rightarrow \infty \) the integral becomes

$$\begin{aligned} \!\!\int _{t_{m_p}}^{\infty } i(t) {\text {d}}\! t = \left( \sum _{k = 1}^{p} I_{m_k}\right) \sum _{k = 1}^{n_{p+1}} \eta _{p+1,k} \, \tilde{g}\left( \beta _{p+1,k}^2\right) , \end{aligned}$$
(10.12)

where

$$\begin{aligned} \tilde{g}(\beta ) = \frac{e^\beta }{\beta ^{\beta +1}} \left( \varGamma (\beta +1) - \gamma \left( \beta +1, \beta \right) \right) \end{aligned}$$

with

$$\begin{aligned} \varGamma (\beta ) = \int _{0}^{\infty } t^{\beta -1} e^{-t} {\text {d}}\! t \end{aligned}$$

is the Gamma function [1].

Proof

This theorem follows from integration being linear and Lemma 10.4.

In the next section we will estimate the parameters of the AEF that gives the best fit with respect to some data and for this the partial derivatives with respect to the \(\beta _{m_q}\) parameters will be useful. Since the AEF is a linear function of elementary functions these partial derivatives can easily be found using standard methods.

Theorem 10.4

The partial derivatives of the p-peak AEF with respect to the \(\beta \) parameters are

$$\begin{aligned} \frac{\partial i}{\partial \beta _{q,k}} = {\left\{ \begin{array}{ll} 0,&{}~0 \le t \le t_{m_{q-1}}, \\ 2 \, I_{m_q} \eta _{q,k} \, \beta _{q,k} \,h_q(t) x_q(t)^{\beta _{q,k}^2+1},&{}~t_{m_{q-1}} \le t \le t_{m_q},~1 \le q \le p, \\ 0,&{}~t_{m_q} \le t, \end{array}\right. } \end{aligned}$$
(10.13)
$$\begin{aligned} \frac{\partial i}{\partial \beta _{p+1,k}} = {\left\{ \begin{array}{ll} 0,&{}~0 \le t \le t_{m_p}, \\ 2\, I_{m_{p+1}} \eta _{p+1,k} \, \beta _{p+1,k} \, h_{p+1}(t) x_{p+1}(t)^{\beta _{p+1,k}^2},&{}~t_{m_p} \le t, \end{array}\right. } \end{aligned}$$
(10.14)

where

$$\begin{aligned} h_q(t) = {\left\{ \begin{array}{ll} \ln \left( \displaystyle \frac{t-t_{m_{q-1}}}{\varDelta t_{m_q}}\right) - \displaystyle \frac{t-t_{m_{q-1}}}{\varDelta t_{m_q}} + 1, &{}~1 \le q \le p, \\[4mm] \ln \left( \displaystyle \frac{t}{t_{m_q}}\right) - \displaystyle \frac{t}{t_{m_q}} + 1, &{}~q = p+1. \end{array}\right. } \end{aligned}$$

Proof

Since the \(\beta _{q,k}\) parameters are independent, differentiation with respect to \(\beta _{q,k}\) will annihilate all terms but one in each linear combination. The expressions (10.13) and (10.14) then follow from the standard rules for differentiation of composite functions and products of functions.

10.3 Least Square Fitting Using MLSM

10.3.1 The Marquardt Least-Squares Method

The Marquardt least-squares method, also known as the Levenberg-Marquardt algorithm or damped least-squares, is an efficient method for least-squares estimation for functions with non-linear parameters that was developed in the middle of the 20th century (see [9, 14]).

The least-squares estimation problem for functions with non-linear parameters arises when a function of m independent variables and described by k unknown parameters needs to be fitted to a set of n data points such that the sum of squares of residuals is minimized.

The vector containing the independent variables is \(\mathbf {x} = (x_1, \ldots , x_n)\), the vector containing the parameters \(\varvec{\beta } = (\beta _1, \ldots , \beta _k)\) and the data points

$$\begin{aligned} \left( Y_i, X_{1i}, X_{2i}, \ldots , X_{mi}\right) = \left( Y_i, \mathbf {X}_i\right) ,~i=1,2,\ldots ,n. \end{aligned}$$

Let the residuals be denoted by \(E_i = f(\mathbf {X}_i; \varvec{\beta }) - Y_i\) and the sum of squares of \(E_i\) is then written as

$$\begin{aligned} S = \sum _{i=1}^{n} \left[ f(\mathbf {X}_i;\varvec{\beta }) - Y_i\right] ^2, \end{aligned}$$

which is the function to be minimized with respect to \(\varvec{\beta }\).

The Marquardt least-square method is an iterative method that gives approximate values of \(\varvec{\beta }\) by combining the Gauss–Newton method (also known as the inverse Hessian method) and the steepest descent (also known as the gradient) method to minimize S. The method is based around solving the linear equation system

$$\begin{aligned} \left( \mathbf {A}^{*(r)}+\lambda ^{(r)}\mathbf {I}\right) \mathbf {\delta }^{*(r)} = \mathbf {g}^{*(r)}, \end{aligned}$$
(10.15)

where \(A^{* (r)}\) is a modified Hessian matrix of \(\mathbf {\mathbf {E}(\mathbf {b})}\) (or \(f(\mathbf {X}_i;\mathbf {b})\)), \(\mathbf {g}^{*(r)}\) is a rescaled version of the gradient of S, r is the number of the current iteration of the method, and \(\lambda \) is a real positive number sometimes referred to as the fudge factor [15]. The Hessian, the gradient and their modifications are defined as follows:

$$\begin{aligned} \mathbf {A} = \mathbf {J}^\top \mathbf {J}, \end{aligned}$$
$$\begin{aligned} \mathbf {J}_{ij} = \frac{\partial f_i}{\partial b_j} = \frac{\partial E_i}{\partial b_j},~i=1,2,\ldots ,m;~j=1,2,\ldots ,k, \end{aligned}$$

and

$$\begin{aligned} (\mathbf {A}^*)_{ij} = \frac{a_{ij}}{\sqrt{a_{ii}}\sqrt{a_{jj}}}, \end{aligned}$$

while

$$\begin{aligned} \mathbf {g} = \mathbf {J}^\top (\mathbf {Y}-\mathbf {f}_0),~\mathbf {f_0}_i = f(\mathbf {X}_i,\mathbf {b},\mathbf {c}),~ \mathbf {g}_i^* = \frac{\mathbf {g}_i}{a_{ii}}. \end{aligned}$$

Solving (10.15) gives a vector which, after some scaling, describes how the parameters \(\mathbf {b}\) should be changed in order to get a new approximation of \(\varvec{\beta }\),

$$\begin{aligned} \mathbf {b}^{(r+1)} = \mathbf {b}^{(r)} + \mathbf {\delta }^{(r)},~\mathbf {\delta }^{(r)} = \frac{\mathbf {\delta }^{*(r)}_i}{\sqrt{a_{ii}}}. \end{aligned}$$
(10.16)

It is obvious from (10.15) that \(\mathbf {\delta }^{(r)}\) depends on the value of the fudge factor \(\lambda \). Note that if \(\lambda = 0\), then (10.15) reduces to the regular Gauss–Newton method [14], and if \(\lambda \rightarrow \infty \) the method will converge towards the steepest descent method [14]. The reason that the two methods are combined is that the Gauss–Newton method often has faster convergence than the steepest descent method, but is also an unstable method [14]. Therefore, \(\lambda \) must be chosen appropriately in each step. In the Marquardt least-squares method this amounts to increasing \(\lambda \) with a chosen factor v whenever an iteration increases S, and if an iteration reduces S then \(\lambda \) is reduced by a factor v as many times as possible. Below follows a detailed description of the method using the following notation:

$$\begin{aligned} S^{(r)} = \sum _{i=1}^{n} \left[ Y_i - f(\mathbf {X}_i,\mathbf {b}^{(r)},\mathbf {c}) \right] ^2, \end{aligned}$$
(10.17)
$$\begin{aligned} S\left( \lambda ^{(r)}\right) = \sum _{i=1}^{n} \left[ Y_i - f(\mathbf {X}_i,\mathbf {b}^{(r)}+\mathbf {\delta }^{(r)},\mathbf {c}) \right] ^2. \end{aligned}$$
(10.18)

The iteration step of the Marquardt least-squares method can be described as follows:

\(\bullet \) :

Input: \(v > 1\) and \(\mathbf {b}^{(r)}\), \(\lambda ^{(r)}\).

\(\triangleleft \) :

Compute \(S\left( \lambda ^{(r)}\right) \).

\(\bullet \) :

If \(\lambda {(r)} \ll 1\) then compute \(S\left( \frac{\lambda ^{(r)}}{v}\right) \), else go to \(\triangleright \).

\(\bullet \) :

If \(S\left( \frac{\lambda ^{(r)}}{v}\right) \le S^{(r)}\) let \(\lambda ^{(r+1)} = \frac{\lambda ^{(r)}}{v}\).

\(\triangleright \) :

If \(S\left( \lambda ^{(r)}\right) \le S^{(r)}\) let \(\lambda ^{(r+1)} = \lambda {(r)}\).

\(\bullet \) :

If \(S\left( \lambda ^{(r)}\right) > S^{(r)}\) find the smallest integer \(\omega > 0\) such that \(S\left( \lambda ^{(r)} v^\omega \right) \le S^{(r)}\), and then set \(\lambda ^{(r+1)} = \lambda ^{(r)} v^\omega \).

\(\bullet \) :

Output: \(\mathbf {b}^{(r+1)} = \mathbf {b}^{(r)} + \mathbf {\delta }^{(r)}\), \(\mathbf {\delta }^{(r)}\).

This iteration step is also described in Fig. 10.5. Naturally, some condition for what constitutes an acceptable fit for the function must also be chosen. If this condition is not satisfied the new values for \(\mathbf {b}^{(r+1)}\) and \(\lambda ^{(r+1)}\) will be used as input for the next iteration and if the condition is satisfied the algorithm terminates. The quality of the fitting, in other words the value of S, is determined by the stopping condition and the initial values for \(\mathbf {b}^{(0)}\). The initial value of \(\lambda ^{(0)}\) affects the performance of the algorithm to some extent since after the first iteration \(\lambda ^{(r)}\) will be self-regulating. Suitable values for \(\mathbf {b}^{(0)}\) are challenging to find for many functions f and they are often, together with \(\lambda ^{(0)}\), found using heuristic methods.

Fig. 10.5
figure 5

The basic iteration step of the Marquardt least-squares method, definitions of computed quantities are given in (10.16), (10.17) and (10.18)

10.3.2 Estimating Parameters for Underdetermined Systems

For the Marquardt least-squares method to work one data point per unknown parameter is needed, \(m = k\). It can still be possible to estimate all unknown parameters if there is insufficient data, \(m < k\).

Suppose that \(k-m = p\) and let \(\gamma _j = \beta _{m+j}\), \(j = 1,2,\ldots ,p\). If there are at least p known relations between the unknown parameters such that \(\gamma _j = \gamma _j(\beta _1,\ldots ,\beta _{m})\) for \(j = 1,2,\ldots ,p\) then the Marquardt least-squares method can be used to give estimates on \(\beta _1, \ldots , \beta _m\) and the still unknown parameters can be estimated from these. Denoting the estimated parameters \(\mathbf {b} = (b_1,\ldots ,b_m)\) and \(\mathbf {c} = (c_1, \ldots , c_p)\) the following algorithm can be used:

\(\bullet \) :

Input: \(v > 1\) and initial values \(\mathbf {b}^{(0)}\), \(\lambda ^{(0)}\).

\(\bullet \) :

\(r = 0\)

\(\triangleleft \) :

Find \(\mathbf {c}^{(r)}\) using \(\mathbf {b}^{(r)}\) together with extra relations.

\(\bullet \) :

Find \(\mathbf {b}^{(r+1)}\) and \(\mathbf {\delta }^{(r)}\) using MLSM.

\(\bullet \) :

Check chosen termination condition for MLSM, if it is not satisfied go to \(\triangleleft \).

\(\bullet \) :

Output: \(\mathbf {b}\), \(\mathbf {c}\).

The algorithm is illustrated in Fig. 10.6.

Fig. 10.6
figure 6

Schematic description of the parameter estimation algorithm

In order to fit the AEF it is sufficient that \(k_q \ge n_q\). Suppose we have some estimate of the \(\beta \)-parameters which is collected in the vector \(\mathbf {b}\). It is then fairly simple to calculate an estimate for the \(\eta \)-parameters, see Sect. 10.3.4, which we collect in \(\mathbf {h}\). We can then define a residual vector by \((\mathbf {E})_k = i(t_{q,k};\mathbf {b},\mathbf {h}) - i_{q,k}\) where \(i(t;\mathbf {b},\mathbf {h})\) is the AEF with the estimated parameters.

The \(\mathbf J \) matrix can in this case be described as

$$\begin{aligned} \mathbf {J} = \begin{bmatrix} \left. \frac{\partial i}{\partial \beta _{q,1}} \right| _{t=t_{q,1}}&\left. \frac{\partial i}{\partial \beta _{q,2}} \right| _{t=t_{q,1}}&\ldots&\left. \frac{\partial i}{\partial \beta _{q,n_q}} \right| _{t=t_{q,1}} \\ \left. \frac{\partial i}{\partial \beta _{q,1}} \right| _{t=t_{q,2}}&\left. \frac{\partial i}{\partial \beta _{q,2}} \right| _{t=t_{q,2}}&\ldots&\left. \frac{\partial i}{\partial \beta _{q,n_q}} \right| _{t=t_{q,2}} \\ \vdots&\vdots&\ddots&\vdots \\ \left. \frac{\partial i}{\partial \beta _{q,1}} \right| _{t=t_{q,k_q}}&\left. \frac{\partial i}{\partial \beta _{q,2}} \right| _{t=t_{q,k_q}}&\ldots&\left. \frac{\partial i}{\partial \beta _{q,n_q}} \right| _{t=t_{q,k_q}} \\ \end{bmatrix}, \end{aligned}$$
(10.19)

where the partial derivatives are given by (10.13) and (10.14).

10.3.3 Fitting with Data Points as Well as Charge Transfer and Specific Energy Conditions

By considering the charge transfer at the striking point, \(Q_0\), and the specific energy, \(W_0\), two further conditions need to be considered:

$$\begin{aligned} Q_0 = \int _{0}^{\infty } i(t) {\text {d}}t, \end{aligned}$$
(10.20)
$$\begin{aligned} W_0 = \int _{0}^{\infty } i(t)^2 {\text {d}}t. \end{aligned}$$
(10.21)

First we will define

$$\begin{aligned} Q(\mathbf {b},\mathbf {h}) = \int _{0}^{\infty } i(t;\mathbf {b},\mathbf {h}) {\text {d}}t, \\ W(\mathbf {b},\mathbf {h}) = \int _{0}^{\infty } i(t;\mathbf {b},\mathbf {h})^2 {\text {d}}t. \end{aligned}$$

These two quantities can be calculated as follows.

Theorem 10.5

$$\begin{aligned} Q(\mathbf {b},\mathbf {h}) =~ \sum _{q=1}^{p} \left( \varDelta t_{m_q} \left( \sum _{k=1}^{q-1} I_{m_k}\right) + I_{m_q} \sum _{k=1}^{n_q} \eta _{q,k} \, \hat{g}(\beta _{q,k}^2+1) \right) \nonumber \\ {}+ \left( \sum _{k = 1}^{p} I_{m_k}\right) \sum _{k = 1}^{n_{p+1}} \eta _{p+1,k} \, \tilde{g}(\beta _{p+1,k}^2), \end{aligned}$$
(10.22)
(10.23)

where \(\hat{g}(\beta )\) and \(\tilde{g}(\beta )\) are defined in Theorems 10.2 and 10.3.

Proof

Formula (10.22) is found by combining (10.10) and (10.12). Formula (10.23) is found by noting that

$$\begin{aligned} \left( \sum _{k=1}^{n} a_k \right) ^2 = \sum _{k=1}^{n} a_k^2 + \sum _{r=1}^{n-1} \sum _{s=r+1}^{n} a_r\,a_s, \end{aligned}$$

and then reasoning analogously to the proofs for (10.10) and (10.12).

We can calculate the charge transfer and specific energy given by the AEF with formula (10.22) and (10.23), respectively, and get two additional residuals \(E_{Q_0} = Q(\mathbf {b},\mathbf {h}) - Q_0\) and \(E_{W_0} = W(\mathbf {b},\mathbf {h}) - W_0\). Since these are global conditions this means that the parameters \(\varvec{\eta }\) and \(\varvec{\beta }\) no longer can be fitted separately in each interval. This means that we need to consider all data points simultaneously.

The resulting \(\mathbf J \)-matrix is

$$\begin{aligned} \mathbf {J} = \left[ \begin{array}{cccccccccccccccc} &{} \mathbf {J_1} &{}&{} \ldots &{}&{} 0 \\ &{} \vdots &{}&{} \ddots &{}&{} \vdots \\ &{} 0 &{}&{} \ldots &{}&{} \mathbf {J_{p+1}} \\ \frac{\partial E_{Q_0}}{\partial \beta _{1,1}} &{} \ldots &{} \frac{\partial E_{Q_0}}{\partial \beta _{1,n_1}} &{} \ldots &{} \frac{\partial E_{Q_0}}{\partial \beta _{p+1,1}} &{} \ldots &{} \frac{\partial E_{Q_0}}{\partial \beta _{p+1,n_{p+1}}} \\ \frac{\partial E_{W_0}}{\partial \beta _{1,1}} &{} \ldots &{} \frac{\partial E_{W_0}}{\partial \beta _{1,n_1}} &{} \ldots &{} \frac{\partial E_{W_0}}{\partial \beta _{p+1,1}} &{} \ldots &{} \frac{\partial E_{W_0}}{\partial \beta _{p+1,n_{p+1}}} \end{array} \right] , \end{aligned}$$
(10.24)

where

$$\begin{aligned} \mathbf {J}_q = \begin{bmatrix} \left. \frac{\partial i}{\partial \beta _{q,1}} \right| _{t=t_{q,1}}&\left. \frac{\partial i}{\partial \beta _{q,2}} \right| _{t=t_{q,1}}&\ldots&\left. \frac{\partial i}{\partial \beta _{q,n_q}} \right| _{t=t_{q,1}} \\ \left. \frac{\partial i}{\partial \beta _{q,1}} \right| _{t=t_{q,2}}&\left. \frac{\partial i}{\partial \beta _{q,2}} \right| _{t=t_{q,2}}&\ldots&\left. \frac{\partial i}{\partial \beta _{q,n_q}} \right| _{t=t_{q,2}} \\ \vdots&\vdots&\ddots&\vdots \\ \left. \frac{\partial i}{\partial \beta _{q,1}} \right| _{t=t_{q,k_q}}&\left. \frac{\partial i}{\partial \beta _{q,2}} \right| _{t=t_{q,k_q}}&\ldots&\left. \frac{\partial i}{\partial \beta _{q,n_q}} \right| _{t=t_{q,k_q}} \\ \end{bmatrix} \end{aligned}$$

and the partial derivatives in the last two rows are given by

$$\begin{aligned} \frac{\partial Q}{\partial \beta _{q,s}} =&{\left\{ \begin{array}{ll} 2 \, I_{m_q} \eta _{q,s} \, \beta _{q,s} \left. \displaystyle \frac{{\text {d}} \hat{g}}{{\text {d}} \beta }\right| _{\beta = \beta _{q,s}^2+1},&{}~1 \le q \le p, \\ 2 \, I_{m_p} \eta _{p+1,s} \, \beta _{p+1,s} \left. \displaystyle \frac{{\text {d}} \tilde{g}}{{\text {d}} \beta }\right| _{\beta = \beta _{p+1,s}^2},&{}~ q = p+1. \end{array}\right. } \end{aligned}$$

For \(1 \le q \le p\)

$$\begin{aligned} \frac{\partial W}{\partial \beta _{q,s}} = 2 \left( \displaystyle \sum _{k=1}^{q-1} I_{m_k}\right) I_{m_q} \eta _{q,s} \, \beta _{q,s} \left. \displaystyle \frac{{\text {d}} \hat{g}}{{\text {d}} \beta }\right| _{\beta = \beta _{q,s}^2+1} \\ + \, 4 \, I_{m_q}^2 \eta _{q,s} \beta _{q,s} \left( \eta _{q,s} \left. \displaystyle \frac{{\text {d}} \hat{g}}{{\text {d}} \beta }\right| _{\beta = 2\beta _{q,s}^2+2} + \displaystyle \sum _{\mathop {k \ne s}\limits ^{k=1}}^{n_q} \eta _{q,k} \left. \displaystyle \frac{{\text {d}} \hat{g}}{{\text {d}} \beta }\right| _{\beta = \beta _{q,s}^2+\beta _{q,k}^2+2} \right) \end{aligned}$$

and

$$\begin{aligned} \frac{\partial W}{\partial \beta _{p+1,s}} =&~ 4 \left( \sum _{k=1}^{p} I_{m_k} \right) \, \eta _{p+1,s} \beta _{p+1,s} \\&\left( \eta _{p+1,s} \left. \displaystyle \frac{{\text {d}} \tilde{g}}{{\text {d}} \beta }\right| _{\beta = 2\beta _{p+1,s}^2} + \displaystyle \sum _{\mathop {k \ne s}\limits ^{k=1}}^{n_q} \eta _{p+1,k} \left. \displaystyle \frac{{\text {d}} \tilde{g}}{{\text {d}} \beta }\right| _{\beta = \beta _{p+1,s}^2+\beta _{p+1,k}^2} \right) . \end{aligned}$$

The derivatives of \(\hat{g}(\beta )\) and \(\tilde{g}(\beta )\) are

$$\begin{aligned} \frac{{\text {d}}\! \hat{g}}{{\text {d}}\! \beta } = \frac{e^{\beta }}{\beta ^{\beta +1}}\left( \varGamma (\beta +1)\big (\varPsi (\beta +1)+\ln (\beta )\big ) - G(\beta ) - \frac{\gamma (\beta +1,\beta )}{\beta }\right) +1,~~~ \nonumber \\ \end{aligned}$$
(10.25)
$$\begin{aligned} \frac{{\text {d}}\! \tilde{g}}{{\text {d}}\! \beta } = \frac{e^{\beta }}{\beta ^{\beta +1}} \left( G(\beta ) -\frac{\varGamma (\beta +1)-\gamma (\beta +1,\beta )}{b}\right) - 1,~~~ \nonumber \\ \end{aligned}$$
(10.26)

where \(\varGamma (\beta )\) is the Gamma function, \(\varPsi (\beta )\) is the digamma function, see [1], and \(G(\beta )\) is a special case of the Meijer G-function and can be defined as

$$\begin{aligned} G(\beta ) = G^{3,0}_{2,3} \left( \beta \left| \begin{matrix} 1,1 \\ 0,0,\beta + 1 \end{matrix} \right. \right) \end{aligned}$$

using the notation from [16]. When evaluating this function it might be more practical to rewrite G using other special functions

$$\begin{aligned} G(\beta ) = G^{3,0}_{2,3} \left( \beta \left| \begin{matrix} 1,1 \\ 0,0,\beta +1 \end{matrix} \right. \right) = \; {\frac{\beta ^{\beta +1}}{\left( \beta +1\right) ^2}} \,{_2F_2}(\beta +1,\beta +1;\,\beta +2,\beta +2;\,-\beta ) \\ + \left( \ln (\beta ) - \varPsi (\beta ) - \frac{1}{b} \right) \frac{\pi \,\csc \left( \pi \beta \right) }{\varGamma \left( -\beta \right) }, \end{aligned}$$

where

$$\begin{aligned} {_2F_2}(\beta +1,\beta +1;\,\beta +2,\beta +2;\,-\beta ) = \sum _{k=0}^{\infty } (-1)^k \beta ^k \frac{(\beta +1)^2}{(\beta +k+1)^2} \\ = \frac{\beta ^2 + 2 \beta + 1}{\beta } \left( \frac{1}{\beta ^2} - \sum _{k=0}^{\infty } \frac{(-b)^k}{(b+k)^2} \right) \end{aligned}$$

is a special case of the hypergeometric function. These partial derivatives were found using software for symbolic computation [13].

Note that all \(\eta \)-parameters must be recalculated for each step, how this is done is detailed in the Sect. 10.3.4.

10.3.4 Calculating the \(\eta \)-Parameters from the \(\beta \)-Parameters

Suppose that we have \(n_q-1\) points \((t_{q,k},i_{q,k})\) such that

$$\begin{aligned} t_{m_{q-1}}< t_{q,1}< t_{q,2}< \ldots< t_{q,n_q-1} < t_{m_q}. \end{aligned}$$

For an AEF that interpolates these points it must be true that

$$\begin{aligned} \sum _{k=1}^{q-1} I_{m_k} + I_{m_q} \sum _{s=1}^{n_q} \eta _{q,s} x_q(t_{q,k})^{\beta _{q,s}} = i_{q,k},~k=1,2,\ldots ,n_q-1. \end{aligned}$$
(10.27)

Since \(\eta _{q,1} + \eta _{q,2} + \ldots + \eta _{q,n_q} = 1\) equation (10.27) can be rewritten as

$$\begin{aligned} I_{m_q} \sum _{s=1}^{n_q-1} \eta _{q,s} \left( x_q(t_{q,k})^{\beta _{q,s}} - x_q(t_{q,k})^{\beta _{q,n_q}} \right) = i_{q,k} - x_q(t_{q,k})^{\beta _{q,n_q}} - \sum _{s=1}^{q-1} I_{m_s} \end{aligned}$$
(10.28)

for \(k=1,2,\ldots ,n_q-1\). This can easily be written as a matrix equation

$$\begin{aligned} I_{m_q} \tilde{X}_q {\tilde{\varvec{\eta }}_q} = {\tilde{\mathbf {i}}}_q, \end{aligned}$$
(10.29)

where

$$\begin{aligned} {\tilde{\varvec{\eta }}_q} = \begin{bmatrix} \eta _{q,1}&\eta _{q,2}&\ldots&\eta _{q,n_q-1} \end{bmatrix}^\top , \\ \left( {\tilde{\mathbf {i}}}_q \right) _k = i_{q,k} - x_q(t_{q,k})^{\beta _{q,n_q}} - \sum _{s=1}^{q-1} I_{m_s}, \\ \left( \tilde{X}_q\right) _{k,s} = \tilde{x}_q(k,s) = x_q(t_{q,k})^{\beta _{q,s}} - x_q(t_{q,k})^{\beta _{q,n_q}}, \end{aligned}$$

with \(x_q(t)\) given by (10.4).

When all \(\beta _{q,k}\), \(k = 1,2,\ldots ,n_q\) are known then \(\eta _{q,k}\), \(k = 1,2,\ldots ,n_q-1\) can be found by solving (10.29) and \(\eta _{q,n_q} = 1 - \displaystyle \sum _{k=1}^{n_q-1} \eta _{q,k}\).

If we have \(k_q > n_q - 1\) data points than the parameters can be estimated with the least-squares solution to (10.29), more specifically the solution to

$$\begin{aligned} I_{m_q}^2 \tilde{X}_q^\top \tilde{X}_q {\tilde{\varvec{\eta }}_q} = \tilde{X}_q^\top {{\tilde{\mathbf {i}}}}_q. \end{aligned}$$

If we wish to guarantee monotonicity in an interval by forcing \(\eta _{q,k} > 0\), \(k \in \{1,2,\ldots ,n_q \}\) (see Lemma 10.2) this becomes a so-called nonnegative least squares problem that can also be solved effectively with well known algorithms, e.g. [8].

10.3.5 Explicit Formulas for a Single-Peak AEF

Consider the case where \(p = 1\), \(n_1 = n_2 = 2\) and \(\tau = \frac{t}{t_{m_1}}\). Then the explicit formula for the AEF is

$$\begin{aligned} \frac{i(\tau )}{I_{m_1}} \!=\! {\left\{ \begin{array}{ll} \eta _{1,1} \, \tau ^{\beta _{1,1}^2+1} e^{(\beta _{1,1}^2+1)(1-\tau )} \!+ \eta _{1,2} \, \tau ^{\beta _{1,2}^2+1} e^{(\beta _{1,2}^2+1)(1-\tau )}, &{}~0\!\le \!\tau \le 1, \\ \eta _{2,1} \, \tau ^{\beta _{2,1}^2} \; e^{\beta _{2,1}^2(1-\tau )} \!+ \eta _{2,2} \, \tau ^{\beta _{2,2}^2} \; e^{\beta _{2,2}^2(1-\tau )}, &{}~1\!\le \!\tau . \end{array}\right. } \end{aligned}$$
(10.30)

Assume that four data points, \((i_k,\tau _k)\), \(k=1,2,3,4\), as well as the charge transfer and specific energy \(Q_0\), \(W_0\) are known.

If we want to fit the AEF to this data using MLSM, then (10.24) gives

$$\begin{aligned} \mathbf {J}= & {} \begin{bmatrix} f_1(\tau _1)&f_2(\tau _1)&0&0 \\ f_1(\tau _2)&f_2(\tau _2)&0&0 \\ 0&0&g_1(\tau _3)&g_2(\tau _3) \\ 0&0&g_1(\tau _4)&g_2(\tau _4) \\ \displaystyle \frac{\partial }{\partial \beta _{1,1}}Q(\varvec{\beta },\varvec{\eta })&\displaystyle \frac{\partial }{\partial \beta _{1,2}} Q(\varvec{\beta },\varvec{\eta })&\displaystyle \frac{\partial }{\partial \beta _{2,1}}Q(\varvec{\beta },\varvec{\eta })&\displaystyle \frac{\partial }{\partial \beta _{2,2}} Q(\varvec{\beta },\varvec{\eta }) \\ \displaystyle \frac{\partial }{\partial \beta _{1,1}} W(\varvec{\beta },\varvec{\eta })&\displaystyle \frac{\partial }{\partial \beta _{1,2}} W(\varvec{\beta },\varvec{\eta })&\displaystyle \frac{\partial }{\partial \beta _{2,1}} W(\varvec{\beta },\varvec{\eta })&\displaystyle \frac{\partial }{\partial \beta _{2,2}} W(\varvec{\beta },\varvec{\eta })\end{bmatrix},\\ f_k(\tau )= & {} 2\, \eta _{1,k} \, \beta _{1,k} \tau ^{\beta _{1,k}^2+1} e^{(\beta _{1,k}^2+1)(1-\tau )} \big ( \ln (\tau ) + 1 - \tau \big ), \\ \eta _{1,1}= & {} \frac{i_1}{I_{m_1}} - \tau _1^{\beta _{1,2}^2} e^{(\beta _{1,2}^2+1)(1-\tau _1)},~\eta _{1,2} = 1 - \eta _{1,1},\\ g_k(\tau )= & {} 2\, \eta _{2,k} \, \beta _{2,k} \tau ^{\beta _{2,k}^2} e^{\beta _{2,k}^2(1-\tau )} \big ( \ln (\tau ) + 1 - \tau \big ), \\ \eta _{2,1}= & {} \frac{i_3}{I_{m_1}} - \tau _3^{\beta _{2,2}^2} e^{\beta _{1,2}^2(1-\tau _3)},~\eta _{2,2} = 1 - \eta _{2,1}, \\ \varvec{\beta }= & {} \begin{bmatrix} \left( \beta _{1,1}^2+1\right)&\left( \beta _{1,2}^2+1\right)&\beta _{2,1}^2&\beta _{2,2}^2 \end{bmatrix}, \\ \varvec{\eta }= & {} \begin{bmatrix} \eta _{1,1}&\eta _{1,2}&\eta _{2,1}&\eta _{2,2} \end{bmatrix}, \\ \frac{Q(\varvec{\beta },\varvec{\eta })}{I_{m_1}}= & {} \, \sum _{s=1}^{2} \eta _{1,s} \frac{e^{\beta _{1,s}^2}}{\left( \beta _{1,s}^2+1\right) ^{\beta _{1,s}^2+1}}\gamma \left( \beta _{1,s}^2+2,\beta _{2,s}^2+1\right) \nonumber \\&+ \sum _{s=1}^{2} \eta _{2,s} \frac{e^{\beta _{2,s}^2-1}}{\beta _{2,s}^{2\beta _{2,s}^2}} \left( \varGamma \left( \beta _{2,s}^2+1\right) - \gamma \left( \beta _{2,s}^2+1,\beta _{2,s}^2\right) \right) , \\ \frac{\partial Q}{\partial \beta _{q,s}}= & {} {\left\{ \begin{array}{ll} 2 \, I_{m_1} \eta _{1,s} \, \beta _{1,s} \left. \displaystyle \frac{{\text {d}}\! \hat{g}}{{\text {d}}\! \beta }\right| _{\beta = \beta _{1,s}^2+1},&{}~q = 1, \\ 2 \, I_{m_q} \eta _{p,s} \, \beta _{2,s} \left. \displaystyle \frac{{\text {d}}\! \tilde{g}}{{\text {d}}\! \beta }\right| _{\beta = \beta _{2,s}^2},&{}~ q = 2, \end{array}\right. } \end{aligned}$$

with derivatives of \(\hat{g}(\beta )\) and \(\tilde{g}(\beta )\) given by (10.25) and (10.26),

$$\begin{aligned} \widetilde{\varvec{\beta }} = \begin{bmatrix} \left( \beta _{1,1}^2+\beta _{1,2}^2+2 \right)&\left( \beta _{1,1}^2+\beta _{1,2}^2+2\right)&(\beta _{2,1}^2 + \beta _{2,2}^2)&(\beta _{2,1}^2+\beta _{2,2}^2) \end{bmatrix}, \\ \widehat{\varvec{\eta }} = \begin{bmatrix} \eta _{1,1}^2&\eta _{1,2}^2&\eta _{2,1}^2&\eta _{2,2}^2 \end{bmatrix},~\widetilde{\varvec{\eta }} = \begin{bmatrix} (\eta _{1,1}\eta _{1,2})&(\eta _{1,1}\eta _{1,2})&(\eta _{2,1}\eta _{2,2})&(\eta _{2,1}\eta _{2,2}) \end{bmatrix},\\ \frac{\partial }{\partial \beta _{q,s}}W\left( \varvec{\beta },\varvec{\eta }\right) =\, 2\,\beta _{q,s}\,\frac{\partial }{\partial \beta _{q,s}} Q\left( 2\varvec{\beta },\widehat{\varvec{\eta }}\right) + \beta _{q,\big ((s - 1~\mathrm {mod}~2)+1\big )} \frac{\partial }{\partial \beta _{q,s}} Q\left( \widetilde{\varvec{\beta }},\widetilde{\varvec{\eta }}\right) . \end{aligned}$$

Remark 10.2

If we only have one datapoint such that \((c I_{m_1}, \tau _3)\), \(0< c < 1\), and one term in the decaying part, we can actually interpolate that point using the formula

$$\begin{aligned} \beta _{2} = \sqrt{\frac{1-\tau _3+\ln (\tau _3)}{\ln (c)}}. \end{aligned}$$

10.3.6 Examples of Fitting a Single-Peak AEF

Here we apply the procedure described in Sect. 10.3.5 to estimate parameters of the single-peaked AEF to fit two different one-peaked waveforms, a fast-decaying waveform [10] and the so called first-positive stroke 10/350 \({\upmu } \mathrm {s}\) from [4]. Each waveform is defined by a Heidler function and all parameters (rise/decay time ratio, \(T_1/T_2\), peak current value, \(I_{m1}\), time to peak current, \(t_{m1}\), charge transfer at the striking point, \(Q_0\), specific energy, \(W_0\), and time to \(0.1I_{m1}\), \(t_1\)) are given in Table 10.1. Data points were chosen as follows:

$$\begin{aligned} (i_1, \tau _1)&= (0.1\,I_{m_1}, t_1),&(i_3, \tau _3)&= (0.5\,I_{m_1}, t_h=t_1-0.1\,T_1+T_2), \\ (i_2, \tau _2)&= (0.9\,I_{m_1}, t_2=t_1+0.8\,T_1),&(i_4, \tau _4)&= (i (1.5\,t_h), 1.5\,t_h). \end{aligned}$$

The AEF representation of the fast-decaying waveshape is shown in Fig. 10.7. Rising and decaying parts of the first-positive stroke current in IEC 62305 [4], are shown in Fig. 10.8. Apart from the AEF (solid line), the Heidler function representation of the same waveforms (dashed line), and used data points (red solid circles) are also shown in the figures.

In Fig. 10.7 it can be noticed that the fit in the rising part is very good and the fit in the decaying part is acceptable for many purposes.

Fig. 10.7
figure 7

The normalized fast-decaying current waveshape 8/20 \({\upmu }\mathrm {s}\), represented by the AEF

From Fig. 10.8 it is clear that the fitting of the AEF can be difficult. In the rising part the fit is poor and this is due to the Heidler function rising steeply in the middle of the interval and when the steepness of the power exponential function is increased it will also move the steepest part of the slope to the right. The charge transfer Q has a low relative accuracy compared to the specific energy W but similar absolute accuracy. This is an example that in some cases a weighted least-square sum is preferable.

For both waveforms the best fit using two terms in each interval for the AEF is not better than the fit that is achieved using only a single term in each interval which can be seen in Table 10.1 since all the \(\eta \)-parameters are either 0 or 1.

Fig. 10.8
figure 8

First positive stroke 10/350 \({\upmu } \mathrm {s}\), for \(I_m=\mathrm {200~kA}\), represented by the AEF

Table 10.1 The AEF parameters for the example waveshapes

10.4 Conclusions

We have presented and examined some basic properties of a generalized version of the AEF function intended to be used for approximation of multi-peaked lightning discharge currents. Existence as well as explicit formulas of the analytical solution for the first derivative and the integral of the AEF function has been shown, which is needed in order to perform lightning electromagnetic field (LEMF) calculations based on it.

A method for finding a least square approximation using the Marquardt least square method (MLSM) that works for any number of peaks has been presented.

Two examples of parameter estimation for single-peaked waveforms, the Standard IEC 62305 first-positive stroke 10/350 \({\upmu } \mathrm {s}\) function and a fast-decaying waveform 8/20 \({\upmu } \mathrm {s}\), have been shown. An estimation of their parameters using MLSM was performed using two pairs of data points for each waveform (one pair for the rising part and one pair for the decaying part). As it can be observed from the results a good approximation is achievable but not under all circumstances.