Spectral Collocation Methods for Differential-Algebraic ... - Math

0 downloads 0 Views 1MB Size Report
Jul 20, 2013 - 0 = IN (A2x) + IN f2. (35). We follow the same fashion for (17) to obtain a system for xN , then subtract the system obtained from (35),.
J Sci Comput (2014) 58:499–516 DOI 10.1007/s10915-013-9755-3

Spectral Collocation Methods for Differential-Algebraic Equations with Arbitrary Index Can Huang · Zhimin Zhang

Received: 3 December 2012 / Revised: 27 May 2013 / Accepted: 10 July 2013 / Published online: 20 July 2013 © Springer Science+Business Media New York 2013

Abstract In this paper, a symmetric Jacobi–Gauss collocation scheme is explored for both linear and nonlinear differential-algebraic equations (DAEs) of arbitrary index. After standard index reduction techniques, a type of Jacobi–Gauss collocation scheme with N knots is applied to differential part whereas another type of Jacobi–Gauss collocation scheme with N + 1 knots is applied to algebraic part of the equation. Convergence analysis for linear DAEs is performed based upon Lebesgue constant of Lagrange interpolation and orthogonal approximation. In particular, the scheme for nonlinear DAEs can be applied to Hamiltonian systems. Numerical results are performed to demonstrate the effectiveness of the proposed method. Keywords systems

Spectral collocation method · Differential-algebraic equation · Hamiltonian

Mathematics Subject Classification (2000)

Primary: 65L10 · Secondary: 60N20

1 Introduction In this paper, we consider the numerical solution of linear differential-algebraic equations (DAEs) with form

C. Huang (B) Department of Mathematics, Michigan State University, East Lansing, MI 48824, USA e-mail: [email protected] Z. Zhang Department of Mathematics, Wayne State University, Detroit, MI 48202, USA e-mail: [email protected] Z. Zhang Beijing Computational Science Research Center, Beijing 100084, China

123

500

J Sci Comput (2014) 58:499–516



E(t)x(t) ˙ = A(t)x(t) + f (t) fall all t ∈ I, Bx(t) + Dx(t) = r,

(1)

where I = [t, t], E, A : I → R n×n and f : I → R n are sufficiently smooth and B, D ∈ R d×n , d ≤ n is the number of differential equations. We also consider nonlinear DAEs of the form  F(t, x, x) ˙ = 0, (2) f (x(t), x(t)) = 0, where F and f are smooth functions. We assume that these equations possesses a unique solution x  . Collocation methods for linear DAEs has been extensively studied, see Radau collocation [15], projected piecewise polynomial collocation [1], perturbed collocation [3] and symmetric collocation [9]. Collocation methods for general nonlinear DAE is explored in [10]. In [9–11], by index reduction technique, one can separate algebraic equations from differential ones. Furthermore, an h-version Legendre–Gauss scheme for differential part with N knots and h-version Legendre–Gauss–Lobatto scheme for algebraic part with N + 1 knots are applied to obtain a symmetric method which guarantees consistent approximations at the mesh points. In this work, however, we apply a p-version Jacobi–Gauss scheme (for differential part) and Jacobi–Gauss–Lobatto scheme (for algebraic part) to solve linear or nonlinear DAEs. Based upon the scheme, a convergence result is established for linear DAEs under standard assumptions and is confirmed by our numerical examples. Furthermore, the scheme for nonlinear DAEs can be applied for numerical solution of Hamiltonian systems. We compare phase plot of some Hamiltonian systems as DAEs with those in [7], in which a spectral collocation method is designed for Hamiltonian systems as ODEs. This paper is organized as follows: In Sect. 2, some preliminary knowledge on the theory of DAEs and Jacobi polynomials are given. In Sect. 3, we formulate our algorithm for linear DAEs and provide a convergence analysis. Two numerical experiments are also included in this section. Sect. 4 is devoted to the algorithm and numerical experiments for nonlinear DAEs. We then give some conclusions in Sect. 5. Throughout the paper, C stands for a generic constant that is independent of the number of collocation points N but may depend on the length of time interval t − t and the dimension n.

2 Preliminaries Application of index reduction techniques on the linear DAEs (1) and nonlinear DAEs (2), one obtain ˆ x(t) ˆ E(t) ˙ = A(t)x(t) + fˆ(t), t ∈ [t, t]

(3)

Eˆ = [ Eˆ 1 , 0]T , Aˆ = [ Aˆ 1 , Aˆ 2 ]T , fˆ = [ fˆ1 , fˆ2 ]T .

(4)

with

and

123



˙ = 0, Fˆ1 (t, x, x) Fˆ2 (t, x) = 0, t ∈ [t, t].

(5)

J Sci Comput (2014) 58:499–516

501

Since solutions of (1) and (3), (2) and (5) are equivalent respectively, we assume that both the linear and nonlinear DAE that we work on is of the index reduced form and without causing any confusion, we keep the same notation as those in (1) and (2). We denote a and d the size of algebraic and di f f er ential par t of (3) and (5). Interested readers are referred to [9,10] for more details. For the linear DAEs, we have Lemma 2.1 ([9]) For E, A ∈ C k (I, R n×n ), there exist point-wise nonsingular P ∈ C k−1 (I, R n×n ), Q ∈ C k (I, R n×n ) such that     0 0 Id 0 ˙ , P AQ − P E Q = . (6) PEQ = 0 0 0 Ia In particular, P has the special structure   P11 P12 , with P11 (t) ∈ R d×d , P12 ∈ R d×a , P22 (t) ∈ R a×a . P= 0 P22

(7)

In addition, if f ∈ C k−1 (I, R n ), then x ∈ C k−1 (I, R n ) for every solution x of (1). (α,β)

(x), which plays a center role throughout Next, we introduce Jacobi polynomials Pn (α,β) the paper. It is well-known that Pn (x) is a class of orthogonal polynomials associate with k + α (α,β) (1) = , weight ω(x) = (1−x)α (1+x)β , α, β > −1. Under the normalization Pk k one has the expression, (α,β)

Pk

(x) =

k  1  k+α

k + βl (x − 1)l (x + 1)k−l . k k −l 2 l=0

Jacobi polynomials satisfy the three-term recursive relations: 1 [(α − β) + (α + β + 2)x], 2 (α,β) (α,β) (α,β) (x) − a3,k Pk−1 (x), a1,k Pk+1 (x) = a2,k Pk (α,β)

P0

(α,β)

(x) = 1, P1

(x) =

where a1,k = 2(k + 1)(k + α + β + 1)(2k + α + β),

a2,k = (2k + α + β + 1) α 2 − β 2 +x(2k + α + β + 3)/ (2k + α + β), a3,k = 2(k + α)(k + β)(2k + α + β + 2). Especially, Legendre polynomial is exactly a class of Jacobi polynomial with α = β = 0 and Chebyshev polynomials of the first kind is another class with α = β = −1/2 up to a (α,β) constant. It is clear that Pn (x) forms a complete orthogonal system associate with the norm  1 vωα,β =

2 α,β

|v(x)| ω

1/2 (x)d x

.

−1

123

502

J Sci Comput (2014) 58:499–516

Denote ω(x) = ω−1/2,−1/2 (x) the Chebyshev weight function and introduce a semi-norm for the simplicity of analysis 1/2  m  |v| H m,N (−1,1) = |∂xk v|2L 2 (−1,1) . ω

ω

k=min(m,N +1)

Let I Nc denote the interpolation operator on Chebyshev points, then we have [4] u − I Nc u∞ ≤ C N 1/2−m |u| H m,N (−1,1) .

(8)

ω

t−t (α,β) t+t  be Let h(t) ∈ C k (I, R n ) and write u(x) = h 2 (1 + x) + 2 , x ∈ [−1, 1]. Let PN the Jacobi polynomial with degree N and I N u ∈ PN [−1, 1] interpolate u at N + 1 Jacobi– Gauss points, Jacobi–Gauss–Radau points or Jacobi–Gauss–Lobatto points, then we have the following lemma on the Legesgue constant, see [12]. Lemma 2.2 Let {l j (x)} Nj=0 be the Lagrange interpolation polynomials at Jacobi–Gauss points, then N 

α,β

I N ∞ := max

x∈[−1,1]

 =

|l j (x)|

j=0

O(log N ), −1 < α, β ≤ − 21 , O(N γ +1/2 ), γ = max(α, β), otherwise.

(9)

The remainder of the interpolation is u(x) − I N u(x) = u[x0 , x1 , . . . , x N , x]ν(x), where ν(x) = (x −x0 )(x −x1 ) . . . (x −x N ) and u[x0 , x1 , . . . , x N , x] is the divided difference of u. Hence, u(x) − I N u(x) =

u[x0 , x1 , . . . , x N , x] (α,β) PN +1 (x), L N +1 α+β

(α,β)

(2N +α+β+3) 2 where L N +1 = 2 N +1 (α+β+N ≈ √ 2 N +1 is the leading coefficient of PN +1 (x). +2)(N +1)! πN Moreover, if u is sufficiently smooth, then the divided difference

u (N +1) (ξx ) , ξx ∈ (−1, 1), (N + 1)!

u[x0 , x1 , . . . , x N , x] = which implies

√ u(x) − I N u(x) L ∞ ≤ C

N +1 u (N +1) (ξx ) L ∞ . + 1)!

2 N +1 (N

(10)

For the sake of analysis, we define the Lagrange interpolation at (N + 1) interpolation points, i.e., I N u(xi ) =

N 

u(xi )li (x),

i=0

where li (x) is the Lagrange interpolation basis function at these points. It is obvious that for all t ∈ [t, t] and x ∈ [−1, 1] h(t) = u(x), h N (t) = u N (x),

123

(11)

J Sci Comput (2014) 58:499–516

503

Therefore, (h − h N )(t) = (u − u N )(x) := e(x).

(12)

3 Linear Differential-Algebraic Equations This section is devoted to the symmetric Jacobi collocation methods for linear DAEs and its convergence analysis. Firstly, we transform the problem (3) onto an equivalent problem on interval [−1, 1], 2 E(ξ )x(ξ ˙ ) = A1 (ξ )x(ξ ) + f 1 (ξ ) b−a 0 = A2 (ξ )x(ξ ) + f 2 (ξ ), ξ ∈ [−1, 1].

(13)

Here, for simplicity of notation, the hats are omitted and subindex of E is suppressed. 3.1 Formulation of Algorithm (α,β)

On the interval [−1, 1], let ρ j ’s be the zeros of Jacobi polynomial PN associated Jacobi–Gauss–Lobatto points.

(x), and σi ’s be the

− 1 ≤ ρ0 < · · · < ρ N −1 ≤ 1, −1 = σ0 < · · · < σ N = 1.

(14)

Then, we have the interlacing property [6,13], − 1 = σ0 < ρ0 < σ1 < · · · < ρ N −1 < σ N = 1.

(15)

In order to fix the idea, we use Tk , the Chebyshev polynomial of the first kind in algorithms. Nevertheless, our method is applicable to all Jacobi polynomials. Approximate the true solution of (13) by x Nm (ξ ) =

N 

Ckm Tk (ξ ), m = 1, . . . , n.

(16)

k=0

The Jacobi coefficients Ckm ∈ R (N +1)×1 is determined by the following set of conditions: r = Bx N (−1) + Dx N (1), 2 E(ρi )x˙ N (ρi ) = A1 (ρi )x N (ρi ) + f 1 (ρi ), i = 0, . . . , N − 1, b−a 0 = A2 (σ j )x N (σ j ) + f 2 (σ j ), j = 0, . . . , N .

(17)

Note that the above system has exactly (N +1)n unknowns and d +N d +(N +1)a = (N +1)n equations. By the fact that Tk (ξ ) = kUk−1 (ξ ), where Uk (ξ ) is the Chebyshev polynomial of the second kind and denoting for all i = 1, . . . , n, j = 1, . . . , a and k = 1, . . . , d 

W1 = 1, −1, . . . , (−1) N , W2 = [1, 1, . . . , 1 N ],



 f 1,k = f 1,k (ρ0 ), . . . , f 1,k (ρ N −1 ) , f 2, j = f 2, j (σ0 ), . . . , f 2, j (σ N ) , T T

f 1 = f 1,1 , . . . , f 1,d , f 2 = f 2,1 , . . . , f 2,a .

123

504

J Sci Comput (2014) 58:499–516

⎤ 0 1 · · · NU N −1 (ρ0 ) ⎢ 0 1 · · · NU N −1 (ρ1 ) ⎥ ⎥ ⎢ U =⎢. . . ⎥, .. ⎦ ⎣ .. .. . . . 0 1 · · · NU N −1 (ρ N −1 ) ⎡ ⎡ ⎤ 1 ρ0 · · · TN (ρ0 ) 1 σ0 ⎢ 1 ρ1 · · · TN (ρ1 ) ⎥ ⎢ 1 σ1 ⎢ ⎢ ⎥ T =⎢. . . ⎥ , T˜ = ⎢ .. .. .. .. ⎣ .. .. ⎣. . ⎦ . 1 ρ N −1 · · · TN (ρ N −1 ) 1 σN ⎡

⎤ · · · TN (σ0 ) · · · TN (σ1 ) ⎥ ⎥ ⎥, .. .. ⎦ . . · · · TN (σ N )

(18)

we have a system AC = F, where T

C = C11 , . . . , C N1 , . . . , C1n , . . . , C Nn ,  ⎡  B W1 + D W2 ⎢ 2 E 11 U − A1,11 T · · · 2 E 1n U − A1,1n T ⎢ b−a b−a ⎢ .. .. .. ⎢ . . . ⎢ ⎢ 2 2 E d1 U − A1,d1 T · · · b−a E dn U − A1,dn T A = ⎢ b−a ⎢ ⎢ −A2,11 T˜ ··· −A2,1n T˜ ⎢ ⎢ .. .. .. ⎣ . . . ··· −A2,an T˜ −A2,a1 T˜



⎡ ⎤ r ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ f1 ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥, , F = ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⎥ ⎣ f2 ⎦ ⎦

(19)

 and denotes the Kronecker product. Once C is determined, we plug it back to (16) to obtain x N . 3.2 Convergence Results We try to derive an error estimate in the L ∞ -norm of the collocation scheme (17). Since N -point Jacobi–Gauss–Lobatto points with parameters (α, β) are zeros of (α+1,β+1) PN −2 (t) (±1 excluded) [14], throughout the paper we only need to consider the case when both ρi ’s and σ j ’s are zeros of certain type of Jacobi polynomials. Moreover, it is well-known that both ρ j ’s and σ j ’s are dense in [−1, 1] as N → ∞. Note that the distance between any two consecutive zeros of any type of Jacobi polynomials √ 2 is bound by 1−t N , t ∈ [−1, 1] up to a constant independent of N and t [8]. We derive that ρi − σi = O(N −1 ), i = 1, . . . , N − 1. To obtain the solvability of our algorithm, let us rewrite our algorithm in its equivalent form. For each component of x m , its approximation x Nm =

N  k=0

Ckm Tk (ξ ) =

N 

N xk,m lk (ξ ),

(20)

k=0

where lk (ξ ) is the Lagrange interpolation polynomial on point set σ j ’s. Denote vki = li (ρk ), u ki = li (ρk ), E i = E(ρi ), A1i = A1 (ρi ), A2 j = A2 (σ j ), and T  N N N , x0,2 , . . . , x0,n , . . . , x NN,1 , . . . , x NN,n , x N = x0,1

123

J Sci Comput (2014) 58:499–516

505

for k = 1, . . . , N , i = 1, . . . , N . Plugging (20) into (13) yields a system A x N = F , where ⎤ ⎡ 2v 2v0N 00 ··· b−a E 0 − u 00 A10 · · · b−a E 0 − u 0N A10 ⎥ ⎢ −A20 ··· ··· 0 ⎥ ⎢ ⎥ ⎢ . . . ⎥ ⎢ . . . . . ··· . ⎥ ⎢ ⎥ ⎢ 2v N −1,0 2v N −1,N −1 2v N −1,N ⎥ ⎢ E · · · E E N −1 N −1 N −1 b−a b−a b−a ⎥ (21) A = ⎢ ⎢ −u N −1,0 A1,N −1 · · · −u N −1,N −1 A1,N −1 −u N −1,N A1,N −1 ⎥ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 0 · · · −A 0 2,N −1 ⎥ ⎢ ⎦ ⎣ C D −A2 (1) F = [ f 1 (ρ0 ) f 2 (σ0 ) . . . f 1 (ρ N −1 ) f 2 (σ N −1 ) r f 2 (1)]T . Here, a missing condition −A2 (1)x N (1) = f 2 (1) is used. Hence, if A is regular, our collocation algorithm is stable. To reorder rows and columns, we define ⎡ ⎤ Id 0 0 0 ⎢0 0 ⎥ Ia 0 ⎢ ⎥ ⎢ Id 0 ⎥ 0 0 ⎢ ⎥ ⎢ ⎥ 0 0 I 0 a ⎢ ⎥ ⎢ ⎥ . . .. .. (22) UN = ⎢ ⎥ ∈ R (N +1)n×(N +1)n . ⎢ ⎥ ⎢ ⎥ 0 Id ⎢ ⎥ ⎢ ⎥ 0 Ia ⎢ ⎥ ⎣ Id 0 ⎦ 0 Ia Remark 1 As is well-known, Lagrange interpolation is not stable for large N . Moreover, it requires a large computational cost to find the base functions. Hence, the equivalent algorithm is exhibited only for a theoretical purpose. Lemma 3.1 For N sufficiently large,  O(N −1 ), i = j and i = j − 1, l j (ρi ) = O(1), otherwise. Proof Let δ be a fixed number such that δ < 1 − |ρi |. By the interlacing property, we can choose δ so small that B(σ j , δ) ∩ ρ = {ρ j−1 , ρ j }. From [15] (pp. 336), if σ j − ρi > δ,

(α,β) l j (ρi ) = O N −1/2 |PN +1 (σ j )|−1 ,



= O N −1/2 j α+3/2 N −α−2 + j β+3/2 N −β−2 ,

≤ O N −1 , (23) otherwise,

l j (ρi ) = O N

−1/2

(α,β) (α,β) PN +1 σ j − PN +1 (ρi )

σ j − ρi

= O(1).

(24)



As an illustration, we plot an l12 (x) for N = 25 and (α, β) = (1/2, 2/3), see Fig. 1. It is clear that l12 (ρ j ) has the largest modulus at ρ11 and ρ12 .

123

506

J Sci Comput (2014) 58:499–516 1.2 l (ρ ) 12

i

σj

1

l12([−1,1])

0.8

0.6

0.4

0.2

0

−0.2

−0.4 −1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

Fig. 1 A plot of l12 (x) for N = 25 and (α, β) = (1/2, 2/3)

Next, we prove the invertibility of A by multiplying it from the left and from the right, respectively, by     P11 (ρi ) P12 (σi ) I 0 TP = diag diag , , 0 P22 (σi ) i=0,...,N −1 0 P22 (1)  (25) TQ = diag Q(σ0 ), . . . , Q(σ N −1 ), Q(1) . Lemma 3.2 Assume A2 , Q ∈ C 2 . Then A is invertible for sufficiently large N . Proof Since li (x) =

PN +1 (x) , PN +1 (σi )(x−σi )

after a simple calculation, we have

vi j = li (ρ j ) = −

li (ρ j ) . |ρ j − σi |

(26)

Clearly, from Lemma (3.1), ⎧ ⎨ O(N ), j = i, or i − 1; vi j = O(1), j = i, or i − 1 and |σ j − ρi | = O(N −1 ); ⎩ o(1), otherwise. Hence, for j = i or i − 1, I1 = [P11 (ρi ) P12 (σi )]



2vi j b−a

E i − u i j A1i 0

 Q(σ j )

2vi j (P11 E)(ρi )Q(σ j ) − u i j (P11 A1 )(ρi )Q(σ j ) b−a 2vi j (P11 E Q)(ρi ) − u i j (P11 A1 )(ρi )Q(σ j ) + e1 , = b−a =

123

(27)

(28)

J Sci Comput (2014) 58:499–516

where e1 = and Q,

507

2vi j b−a (P11 E)(ρi )(Q(σ j )

− Q(ρi )). Apply the smoothness assumption of P, E

2li (ρ j ) ˙ )(ρ j − σi ), (P11 E)(ρi ) Q(ξ b−a ˙ ), = −li (ρ j )(P11 E)(ρi ) Q(ξ

e1 =

= O(1)li (ρ j ).

(29)

However, in this case, li (ρ j )/li (ρ j ) ≈ 0 by the L’Hopital’s rule. Therefore, (29) and the definition of u i j yield I1 = Similarly, if j = i − 1, I1 = If j = i,

2vi j b−a [I



I2 = [P11 (ρi ) P12 (σi )]

2vi j [I 0] + o(vi j ). b−a

(30)

0] + O(1). 2vi j b−a

E i − u i j A1i −A2i

 Q(σi )

2vii (P11 E)(ρi )Q(σi ) − u ii (P11 A1 )(ρi )Q(σi ) − (P12 A2 Q)(σi ) b−a 2vii = (P11 E Q)(ρi ) − u ii (P11 A1 )(ρi )Q(σi ) − (P12 A2 Q)(σi ) + e2 , b−a 2vii = [I 0] + O(1). b−a =

(31)

At last,   B11 B12 Q(1) = , 0 0      I 0 D D11 D12 Q(1) = . 0 P22 (1) −A2 (1) 0 −I 

I 0 0 P22 (1)



B 0



Hence, we have M = T P A TQ = ⎡ 2v 00 [Id×d 0] + O(1) ⎢ b−a −I a×a ⎢ ⎢ .. ⎢ . ⎢ ⎢ 2v N −1,0 1 ⎢ ⎢ b−a [Id×d 0] + O( N ) ⎢ 0 ⎢ ⎣ B11 B12 0 0

⎤ [Id×d 0] + O( N1 ) ⎥ 0 0 ⎥ ⎥ .. .. ⎥ . . ⎥ ⎥ 2v N −1,N −1 2v N −1,N ⎥ ··· [I 0] + O (1) [I 0] + O (1) d×d d×d b−a b−a ⎥ ⎥ 0 ··· −Ia×a ⎥ ⎦ D11 D12 0 − Ia×a (32)

··· ···

2v0,N −1 b−a [Id×d

Rewrite the above matrix as

 M=

A˜ C˜

0] + O( N1 )

2v0N b−a

 B˜ . D˜

123

508

J Sci Comput (2014) 58:499–516

−1 Clearly, if D11 exists,

D˜ −1 = Note that



A˜ B˜ C˜ D˜





 −1 −1 D11 D12 D11 . 0 −I

I 0 − D˜ −1 C˜ I



 =

 A˜ − B˜ D˜ −1 C˜ B˜ . 0 D˜

Therefore, the invertibility of A˜ − B˜ D˜ −1 C˜ implies the invertibility of A . By a simple matrix manipulation, A˜ − B˜ D˜ −1 C˜ = ⎡ 2v00 −1 0N [Id×d 0] − 2v b−a D11 B11 + O(1) ⎢ b−a −Ia×a ⎢ ⎢ .. ⎢ . ⎢ ⎢ 2v N −1,0 2v −1 N −1,N ⎣ b−a [Id×d 0] − b−a D11 B11 + O(1) 0

··· ··· .. . ··· ···

2v0,N −1 b−a [Id×d

0] + O( N1 )

0



⎥ ⎥ ⎥ ⎥ ⎥ ⎥ 0] + O(1) ⎦

2v N −1,N −1 [Id×d b−a −Ia×a

It is clear that the matrix is diagonal dominant, hence invertible.



This result indicates that our algorithm is well-posed. In the following, we find the error estimates for the algorithm. Theorem 3.3 Let x(ξ ) be the true solution of transformed DAE (13) and x N (ξ ) be the approximation given by (17) based upon our collocation method. If the given data E(ξ ), A(ξ ) ∈ C m+1 ([−1, 1], R n×n ), and f ∈ C m ([−1, 1], R n ), then for sufficiently large N ,  (log N )N 3/2−m , −1 < α, β < −1/2, (33) x − x N ∞ ≤ C N γ +2−m , γ = max(α, β), otherwise. Proof Let I N be the interpolation operator on σ0 , . . . , σ N and I˜N −1 be the one on ρ0 , . . . , ρ N −1 . Clearly, the true solution satisfies r = Bx(−1) + Dx(1), 2 ˙ i ) = A1 (ρi )x(ρi ) + f 1 (ρi ), i = 0, . . . , N − 1, E(ρi )x(ρ b−a 0 = A2 (σ j )x(σ j ) + f 2 (σ j ), j = 0, . . . , N .

(34)

Multiplying both sides of the first and the third equation of (34) by l j (ξ ), the second equation by l˜i (ξ ), respectively, and summing over i, j yield r = B I N x(−1) + D I N x(1), 2 ˜ ˙ = I˜N −1 (A1 x) + I˜N −1 f 1 , I N −1 (E x) b−a 0 = I N (A2 x) + I N f 2 .

(35)

We follow the same fashion for (17) to obtain a system for x N , then subtract the system obtained from (35), 0 = B I N (x(−1) − x N (−1)) + D I N (x(1) − x N (1)), 2 ˜ 0= I N −1 (E 1 x˙ − E x˙ N ) − I˜N −1 (A1 x − A1 x N ), b−a 0 = I N (A2 x − A2 x N ).

123

(36)

J Sci Comput (2014) 58:499–516

509

Recall the definition of I Nc . Since I N A2 and I N x are polynomials, We have the following estimate from (5.5.28) of [4], I N (A2 x) − (I N A2 )(I N x)∞ = I Nc (A2 x) − (I Nc A2 )(I Nc x)∞ = I Nc ((I Nc A2 )(I Nc x)) − (I Nc A2 )(I Nc x)∞ ≤ C N 1/2−2m |I Nc A2 · I Nc x| H m,N (−1,1) .

(37)

ω

Similar estimation can be obtained for I N (A2 x N ) − (I N A2 )(I N x N )∞ ,  I˜N −1 (E x) ˙ − ( I˜N −1 E)( I˜N −1 x) ˙ ∞ ,  I˜N −1 (E x˙N ) − ( I˜N −1 E)( I˜N −1 x˙N )∞ ,  I˜N −1 (A1 x) − ( I˜N −1 A1 ) ( I˜N −1 x)∞ and  I˜N −1 (A1 x N ) − ( I˜N −1 A1 )( I˜N −1 x N )∞ . However, all these terms are highorder terms. Combine all these estimates, (36) can be written as ⎧ ⎨ 0 = B I N (x(−1) − x N (−1)) + D I N (x(1) − x N (1)), 2 O(N 1/2−2m ) = b−a (I N −1 E 1 )[ I˜N −1 x˙ − I˜N −1 x˙ N ] − ( I˜N −1 A1 )[ I˜N −1 x − I˜N −1 x N ], ⎩ O(N 1/2−2m ) = (I N A2 )(I N x − I N x N ). (38) Also, by simple calculation,  I˜N −1 x˙ − I˜N −1 x˙ N − (I N˙ x) + (I N˙x N )∞ =  I˜N −1 x˙ − (I N˙ x)∞ ≤ C N 3/2−m .

(39)

We obtain ⎧ ⎨ 0 = B I N (x(−1) − x N (−1)) + D I N (x(1) − x N (1)), 2 O(N 3/2−m I N ∞ ) = b−a (I N E 1 )[(I N˙ x) − x˙ N ] − (I N A1 )[I N x − x N ], ⎩ O(N 1/2−2m ) = (I N A2 )(I N x − x N ). Writing the right hand side of the last two groups of equations as w and applying the transformation in Lemma 2.1 yields that         Id 0 y˙1 0 0 y1 g = + 1 (40) 0 0 y˙2 y2 g2 0 Ia     y (−1) y (1) + [D1 D2 ] 1 = 0, (41) [B1 B2 ] 1 y2 (−1) y2 (1) where IN x − x N

 y1 , =Q y2





Pw =

 g1 , g2

B Q(−1) = [B1 B2 ],

D Q(1) = [D1 , D2 ].

Matrix functions P and Q are given in Lemma 2.1. The differences P(E − I N E)Q = O(N −m−1 ) and P(A − I N A)Q = O(N −m−1 ) are absorbed into functions g. Clearly, ξ y1 (ξ ) = y1 (−1) +

g1 (s)ds, y2 (ξ ) = −g2 (ξ ).

(42)

−1

The equation is equivalent to [11]  y˙1 = g1 (ξ ), 1 y1 (−1) = −(B1 + D1 )−1 −1 g1 (s)ds. y2 (ξ ) = −g2 (ξ ).

(43)

123

510

J Sci Comput (2014) 58:499–516

Hence, it is enough for us to consider the corresponding initial value condition for our problem. Obviously, y ≤ Cg, which implies I N x − x N ∞ ≤ CI N ∞ N 3/2−m .

(44)

Therefore, x − x N ∞ ≤ x − I N x∞ + I N x − x N ∞  (log N )N 3/2−m , −1 < α, β < −1/2, ≤C N γ +2−m , γ = max(α, β), otherwise.

(45)



3.3 Numerical Experiments We present two examples here to illustrate the effectiveness of our algorithm. Both examples are from [9]. Unconfined to the type of points in our theory, we use three different types of collocation points, which is presented in Table 1. Example 1 Consider the DAE ⎡ t/2 ⎤ ⎤ ⎡ ⎤ ⎡ −1 t 0 0 0 0 e ⎣ 1 −t 0 ⎦ x˙ = ⎣ 0 0 0 ⎦ x + ⎣ 0 ⎦ , t ∈ [−5, 0] −1 t 1 0 0 t2 1 [1 7 0] x(−5) + [0 4 1] x(0) = 6. This is an index-two problem with solution  t 1 x(t) = et/2 1 − , − , t 2 + 4t + 8 . 2 2 Since the solution is smooth, from Table 2 and Fig. 2, we actually observe a super geometric

σ N ), where γ , σ are some constants [16]. rate of convergence (O Nγ

Table 1 Three sets of collocation points

ρ Set 1

Gauss–Legendre points

Gauss–Legendre–Lobatto points

Set 2

Gauss–Legendre–Lobatto points Gauss–Legendre points

Gauss–Legendre–Radau points

Set 3

Table 2 Errors for Example 1

123

σ

Number of points

Gauss–Legendre points

Set 1

Set 2

Set 3

5

5.7025e−2

8.2836e−2

5.9604e−2

10

9.7657e−6

2.2007e−5

9.9000e−6

15

1.8526e−10

5.3087e−10

1.8701e−10

20

6.9944e−15

7.9936e−15

1.3323e−14

J Sci Comput (2014) 58:499–516

511

0

10

−5

10

−5

10

−5

10

−10

10

−10

10

−10

10

−15

10

0

0

10

10

−15

5

10

15

20

Set 1

10

−15

5

10

15

20

10

Set 2

5

10

15

20

Set 3

Fig. 2 Numerical errors for Example 1

Example 2 Consider the problem of form (1) with ⎤ ⎡ 1 t 0 t 1 −t ⎦ , E(t) = ⎣ p(t) − 2 −t ( p(t) − 2) 0 ⎤ ⎡ 2 1 (2 − t)κ κ − 2−t 2−t − κt ⎥ ⎢ p(t) κ−1 −t κ−1 t + κ − κ2+t A(t) = ⎣ ⎦, 2−t − t − 1 2−t − 1 p(t)−2 3 + 6t − 4) κt (t 2 − 3) − p(t)−2 2 − 4κ κ( p(t)(2 − t) − t 2−t 2−t ⎤ ⎡ 3−t 2−t

⎥ t ⎢ (κ+2) p(t)+ p(t) ˙ − 2 (tt2p(t) e, f (t) = ⎣ 2 + t 2 −4 −4)2 ⎦ 3−t ( p(t) − 2) 2−t − κ(t 2 + t − 2)

(46)

where t ∈ [0, 1], parameter κ ∈ R and a smooth function p is a C 1 smooth function. The boundary condition is x1 (0) = 1. We choose κ = 20 and   t − 1/3 p(t) = − 1 + erf √ , ε = 10−2 2ε There exists an inner layer at t = 1/3 in p and also in the solution ⎤ ⎡ t2 + tt 2p(t) 1 + t − 2−t t −4 e ⎥ ⎢ t x(t) = 2 + tp(t) ⎣ 1 − t − 2−t 2 −4 ⎦ . t +1 2 +1 − t2−t If ε is too small, the solution is not smooth. Hence, it is not advantageous to use the p-version method. For the choice of ε = 10−2 , Table 3 records the numerical errors and Fig. 3 shows the rate of convergence as desired.

123

512

J Sci Comput (2014) 58:499–516

Table 3 Errors for Example 2

Number of points

Set 1

Set 2

Set 3

10

1.0926e−2

1.0902e−2

1.9384e−2

20

1.0531e−5

4.5635e−5

9.6400e−5

30

6.3180e−9

1.1820e−8

6.5315e−8

40

7.0655e−13

5.3695e−12

7.9923e−12

0

0

10

−2

10

−2

10

−2

10

−4

10

−4

10

−4

10

−6

10

−6

10

−6

10

−8

10

−8

10

−8

10

−10

10

−10

10

−10

10

−12

10

−12

10

−12

10

−14

10

0

10

10

−14

0

20

40

60

Set 1

10

−14

0

20

40

60

10

0

Set 2

20

40

60

Set 3

Fig. 3 Numerical errors for Example 2

4 Nonlinear Differential-Algebraic Equations Similar as linear DAEs, we first transform (5) into its canonical form, ⎧ 2 x) ˙ = 0, ⎨ F1 (ξ, x, b−a F2 (ξ, x) = 0, ξ ∈ [−1, 1], ⎩ f (x(−1), x(1)) = 0.

(47)

4.1 Formulation of Algorithm The collocation points that we use are exactly the same as those in (14), where ρ is for differential part and σ is for algebraic part. N Denote x Nm (ξ ) = k=0 Ckm Tk (ξ ), m = 1, . . . , n the approximation of x in (47). We have the following set of conditions nonlinear equations: f (x N (−1), x N (1)) = 0, 2 F1 (ρi , x N (ρi ), x˙ N (ρi )) = 0, i = 0, . . . , N − 1, b−a F2 (σ j , x N (σ j )) = 0, j = 0, . . . , N .

123

(48)

J Sci Comput (2014) 58:499–516

513

Now we convert it into a nonlinear equation of C = (C 1 , . . . , C n )T . ⎧  ⎪ 1 n T 1 n T ⎪ = 0, ⎪ f [W1 C , . . . , W1 C ] , [W2 C , . . . , W2 C ] ⎪ ⎪ ⎪ ⎨  2 [U C 1 , . . . , U C n ]T = 0, F1 ρ, [T C 1 , . . . , T C n ]T , b−a ⎪ ⎪  ⎪ ⎪ ⎪ ⎪ ⎩ F2 σ, [T˜ C 1 , . . . , T˜ C n ]T = 0,

(49)

where T, U and T˜ are defined in (18). We use Newton-iteration to solve the above system. 4.2 Numerical Experiments for Nonlinear DAEs We present four examples in this section to illustrate the application of spectral collocation method for nonlinear DAEs. One important field of application is to solve Hamiltonian systems [5]. Given a Hamiltonian system: " d p(t) ∂H dt = − ∂q , p(0) = p0 , (50) dq(t) ∂H dt = ∂ p , q(0) = q0 , where p(t), q(t) ∈ R n . Setting (x1 , . . . , x2n ) = ( p, q)T , x2n+1 = H , we obtain a nonlinear DAE on the interval [0, T ] ⎧ d x (t) ∂H i ⎪ dt = − ∂qi , i = 1, . . . , n (Fr ee) ⎪ ⎪ ⎪ d x j (t) ∂H ⎪ ⎪ ⎪ dt = ∂ p , j = n + 1, . . . 2n (Fr ee) ⎨ d x2n+1 (t) = 0, (51) dt ⎪ ⎪ H (x1 , . . . , xn , xn+1 , . . . , x2n ) − x2n+1 = 0, ⎪ ⎪ ⎪ ⎪ x (0) = x0 , i = 1, . . . , 2n, ⎪ ⎩ i x2n+1 (0) = H0 . It should be pointed out that the system above is overdetermined and in practice, one need to abandon one equation among all free equations. Throughout this subsection, we choose ρ as Legendre–Gauss points and σ as Legendre–Gauss–Lobatto points. Remark 2 On the interval [nT, (n+1)T ], taking the transform t = 2nT2+T + T2 ξ, ξ ∈ [−1, 1], we can obtain the same system as (51) except that xi (−1) = xˆ0 , x2n+1 (−1) = Hˆ 0 , where xˆ0 and Hˆ 0 are the value of xi (1) and x2n+1 (1) obtained from the preceding interval, respectively. To better approximate energy, we may specify initial condition as xi (0) = x0 , i = 1, . . . , 2n and take a poststablization process [2] at the end of each step: x˜i (−1) = xˆ0 , xi (−1) = x˜i − F(x)h( ˜ x), ˜ where h = Hx and F =

H T (H H T )−1 .

Example 3 We first consider an example from [10]. ⎧ x˙1 = ( + x2 − p2 (t))x4 + p˙ 1 (t), ⎪ ⎪ ⎨ x˙2 = p˙ 2 (t), x˙3 = x4 , ⎪ ⎪ ⎩ 0 = (x1 − p1 (t))(x4 − et ).

123

514

J Sci Comput (2014) 58:499–516

Table 4 Errors for Example 3 Number of points max x(σi ) − xi 

1≤i≤4

5

10

20

30

1.9566e0

2.6436e−3

1.1258e−10

4.2188e−15

2

0.6

10

0

10

0.4

−2

10

0.2

−6

0

10

q

L ∞ norm

−4

10

−8

10

−0.2

−10

10

−0.4 −12

10

−0.6

−14

10

−16

10

5

10

15

20

25

30

−0.8 −1.5

−1

−0.5

number of points

0

0.5

1

1.5

p

Fig. 4 (Left) numerical errors for example 3; (Right) a phase plot of ( p, q) on [0, 104 ]—for Example 4

Choosing the boundary condition x1 (0) = P1 (0) + , x3 (0) = 1, x2 (1) = p2 (1), the exact solution of the problem is  x ∗ (t) = et + p1 (t), p2 (t), et , et . We choose p1 (t) = sin(4πt), p2 (t) = sin(t), and  = 1/2 as parameters. Using our algorithm, we obtain Table 4 and Fig. 4(Left). Clearly, the convergence rate is geometric. Example 4 Consider a simple linear Hamiltonian system [7]:  p (t) = −4q(t), q (t) = p(t). with initial condition p(0) = 0, q(0) = 0.6 and Hamiltonian H ( p, q) = 1/2 p 2 + 2q 2 = 0.72. Although the Hamiltonian system itself is linear, if we consider the Hamiltonian as a variable and apply our algorithm, we obtain a nonlinear DAE. In [7], the system is treated as ODEs and numerically solved by spectral collocation method. On [0, 105 ] , their algorithm has an energy error at the terminal point 2.2949 × 10−10 whereas our algorithm has an error 3.2968 × 10−11 . Furthermore, applying the poststablization approach mentioned above, we can reduce the error to machine epsilon. Hence, our algorithm is much more accurate from this point of view. Figure 4(Right) shows that our algorithm keeps the symplectic structure of the system also. However, our algorithm takes longer CPU time to obtain the result, which is 1, 142 s while theirs takes only 621 s for 20 collocation points.

123

J Sci Comput (2014) 58:499–516

515

0.74

2 Prey x

1

Predator x

2

1.8

0.73

1.6

0.72

q

1.4

0.71

1.2 1

0.7

0.8

0.69 0.6

0.68

−0.04 −0.03 −0.02 −0.01

0

0.01

0.02

0.03

p

0.04

0.4

0

0.1

0.2 0.3

0.4

0.5 0.6

0.7 0.8

0.9

1

Fig. 5 (Left) a phase plot of ( p, q) on [0, 5000]—for Example 6; (Right) prey/predator interaction in one cycle—for Example 5

Example 5 Consider the Lotka–Volterra system for a predator/prey interaction, which consists of two equations [10].  x˙1 = x1 (1 − x2 ), (52) x˙2 = −cx2 (1 − x1 ), where c > 0. In the system, the quantity, H = c(x1 − log x1 ) + (x2 − log x2 ) remains constant along time, which forces solutions x 1 and x2 to be periodic. But the period is unknown. As in [10], we introduce new variables x3 = H and x4 = T and transform the equation into the interval [0, 1]. ⎧ ⎪ ⎪ x˙1 = x1 (1 − x2 )x4 , ⎨ x˙3 = 0, (53) x˙4 = 0, ⎪ ⎪ ⎩ c(x1 − log x1 ) + (x2 − log x2 ) − x3 = 0, t ∈ [0, 1] with initial conditions x1 (0) = 1, x1 (0) = x1 (1), and x3 (0) = 2.2. For the choice of c = 1, we obtain T converges to 6.4943297198 as the number of collocation points increases. Figure 5(Right) represents the computed interaction between prey and predator in one cycle for 30 collocation points. Example 6 Consider a system with Hamiltonian H ( p, q) = p 2 − q 2 + q 4 [7]. The corresponding system of nonlinear ODEs is  p˙ = 2q − 4q 3 , q˙ = 2 p with initial condition p(0) = 0, q(0) = 0.73. Hence, the Hamiltonian is −0.24891759. Our DAE algorithm takes only 17s to obtain a result on [0, 5000], with an energy error 4.72 × 10−13 . It can be further reduced to machine epsilon by applying the poststablization process. A phase plot can be found in Fig. 5(Left).

123

516

J Sci Comput (2014) 58:499–516

5 Conclusion In this work, a Jacobi spectral collocation method is applied to solve both linear and nonlinear DAE with arbitrary index. We apply a type of Jacobi–Gauss collocation scheme with N knots to differential part of DAEs whereas another type of Jacobi–Gauss collocation scheme with N + 1 knots to algebraic part of the equation. Convergence analysis for linear DAEs shows that the spectral collocation method works efficiently if the solution itself is smooth enough. In particular, the scheme for nonlinear DAEs can be applied to solve Hamiltonian systems and it keeps the symplectic structure of the system. However, it may take more CPU seconds to obtain a result compared with the method in [7] since we enhance the dimension of the problems.

References 1. Ascher, U., Petzold, L.: Projected collocation for higher-order higher-index differential-algebraic equations. J. Comput. Appl. Math. 43, 243–259 (1992) 2. Ascher, U., Petzold, L.: Computer methods for ordinary differential equations and differential-algebraic equations. SIAM, Philadelphia (1998) 3. Bai, Y.: A perturbed collocation method for boundary value problems in differential-algebraic equations. Appl. Math. Comput. 45, 269–291 (1991) 4. Canuto, C., Hussaini, M., Quarteroni, A., Zang, T.: Spectral Methods: Fundamentals in Single Domains. Springer, Berlin (2006) 5. Cherry, T.: On periodic solutions of Hamiltonian systems of differential equations. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character 227, 137–221 (1928) 6. Cimwanga, N.M.: Interlacing zeros of linear combinations of classical orthogonal polynomials. Thesis, University of Pretoria (2009) 7. Kanyamee, N., Zhang, Z.: Comparison of a spectral collocation method and symplectic methods for Hamiltonian systems. Int. J. Numer. Anal. Mod. 8, 86–104 (2011) 8. Krasovsky, I.V.: Asymptotic distribution of zeros of polynomials satisfying difference equations. J. Comput. Appl. Math. 150, 57–70 (2003) 9. Kunkel, P., Stöver, R.: Symmetric collocation methods for linear differential-algebraic boundary problems. Numer. Math. 91, 475–501 (2002) 10. Kunkel, P., Mehrmann, V., Stöver, R.: Symmetric collocation for unstructured nonlinear differentialalgebraic equations of arbitrary index. Numer. Math. 98, 277–304 (2004) 11. Kunkel, P., Mehrmann, V.: Differential-Algebraic Equations: Analysis and Numerical Solution. European Mathematical Society, Zürich (2006) 12. Mastroianni, G., Occorsio, D.: Optimal systems of nodes for Lagrange interpolation on bounded intervals: a survey. J. Comput. Appl. Math. 134, 325–341 (2001) 13. Shen, J., Tao, T., Wang, L.L.: Spectral Methods: Algorithms, Analysis and Applications. Springer, New York (2011) 14. Stancu, D.D., Coman, G., Blaga, P.: Numerical Analysis and Approximation theory (in Romanian), vol. II. Cluj University Press, Cluj-Napoca (2002) 15. Szegö, G.: Orthogonal Polynomials, vol. XXIII. American Mathematical Society, Providence (1939) 16. Zhang, Z.: Superconvergece of spectral collocation and p-version methods in one dimensional problems. Math. Comput. 74, 1621–1636 (2005)

123