A tau method for nonlinear dynamical systems

18
Numer Algor (2013) 62:583–600 DOI 10.1007/s11075-012-9663-x ORIGINAL PAPER A tau method for nonlinear dynamical systems Maria Jo˜ ao Rodrigues · Jos´ e Matos Received: 15 December 2011 / Accepted: 29 October 2012 / Published online: 28 November 2012 © Springer Science+Business Media New York 2012 Abstract In this work we present a new Tau method for the solution of nonlinear systems of differential equations which are linear in the derivative of highest order and polynomial in the remaining. We avoid the linearization of the problem by asso- ciating to it a nonlinear algebraic system and combine a forward substitution with the Tau method. We develop an adaptive step by step version of this alternative nonlinear tau method and we apply it to several nonlinear dynamical systems. Keywords Tau method · Nonlinear differential equations · Dynamical systems 1 Introduction Originally, the Tau method introduced by Lanczos [3, 4] was proposed to approxi- mate the solution of a linear ordinary differential equation. The operational version Research funded by the European Regional Development Fund through the program COMPETE and by the Portuguese Government through the FCT—Fundac ¸˜ ao para a Ciˆ encia e a Tecnologia under the project PEst-C/MAT/UI0144/2011. M. J. Rodrigues · J. Matos CMUP, Porto, Portugal M. J. Rodrigues () Faculdade de Ciˆ encias, Universidade do Porto, Porto, Portugal e-mail: [email protected] J. Matos Instituto Superior de Engenharia, Instituto Polit´ ecnico do Porto, Porto, Portugal e-mail: [email protected]

Transcript of A tau method for nonlinear dynamical systems

Page 1: A tau method for nonlinear dynamical systems

Numer Algor (2013) 62:583–600DOI 10.1007/s11075-012-9663-x

ORIGINAL PAPER

A tau method for nonlinear dynamical systems

Maria Joao Rodrigues · Jose Matos

Received: 15 December 2011 / Accepted: 29 October 2012 /Published online: 28 November 2012© Springer Science+Business Media New York 2012

Abstract In this work we present a new Tau method for the solution of nonlinearsystems of differential equations which are linear in the derivative of highest orderand polynomial in the remaining. We avoid the linearization of the problem by asso-ciating to it a nonlinear algebraic system and combine a forward substitution with theTau method. We develop an adaptive step by step version of this alternative nonlineartau method and we apply it to several nonlinear dynamical systems.

Keywords Tau method · Nonlinear differential equations · Dynamical systems

1 Introduction

Originally, the Tau method introduced by Lanczos [3, 4] was proposed to approxi-mate the solution of a linear ordinary differential equation. The operational version

Research funded by the European Regional Development Fund through the program COMPETEand by the Portuguese Government through the FCT—Fundacao para a Ciencia e a Tecnologiaunder the project PEst-C/MAT/UI0144/2011.

M. J. Rodrigues · J. MatosCMUP, Porto, Portugal

M. J. Rodrigues (�)Faculdade de Ciencias, Universidade do Porto, Porto, Portugale-mail: [email protected]

J. MatosInstituto Superior de Engenharia, Instituto Politecnico do Porto,Porto, Portugale-mail: [email protected]

Page 2: A tau method for nonlinear dynamical systems

584 Numer Algor (2013) 62:583–600

of the method, as in other methods of weighted residuals, or in other spectral meth-ods, is based on solving a system of linear algebraic equations, obtained by imposingcertain conditions for the minimization of the residual. We review briefly the Taumethod for a linear differential problem in Section 2.

The generalization of the Tau method for solving nonlinear differential equationsusually involves some kind of linearization of the problem and the subsequent useof the method’s version for linear problems. However if the differential equation islinear in the derivative of highest order and polynomial in the other derivatives and ifwe represent the residual in the standard basis then the nonlinear system of equationscan be easily solved. In this work we propose the use of the standard basis for somecomponents of the residual and the use of an orthogonal basis for the remaining. Wedevelop this technique for the solution of one differential equation in Section 3 andpresent the study of the error in Section 4.

In Section 5 we present the application of an adaptive step by step version of thisalternative nonlinear Tau method to several nonlinear dynamical systems problems,including to the Lorenz equations where we verify that the method is sufficientlystable to recover the known attractor.

2 Classical formulation of the Tau method

Given a differential problem{Dy(t) = 0, t ∈ � ⊂ IRDjy(t) = σj , j = 1 : ν

(1)

where D is a linear differential operator of order ν, Dj, j = 1 : ν, are linear func-tionals representing the supplementary conditions, a tau approximant y to y is theunique polynomial solution of the perturbed problem{

Dy(t) = τ(t), t ∈ �

Dj y(t) = σj , j = 1 : ν

where τ is a polynomial perturbation close to zero in � [6], or, equivalently, y is thepolynomial that satisfies the supplementary conditions and Dy coincides with Dy

as far as possible, i.e., the principal components of the residual, τ = Dy − Dy, arenull as far as possible [8]. From this formulation it follows that, if y is a n degreepolynomial then the residual has the form, either

τ(t) =n+h∑

i=n+1−ν

τi ti (2)

or

τ(t) =n+h∑

i=n+1−ν

τiPi(t) (3)

where h is the height of the differential operator D and {Pi}i≥0 is an orthogonalpolynomial basis. Under the hypothesis that the properties of the residual will be

Page 3: A tau method for nonlinear dynamical systems

Numer Algor (2013) 62:583–600 585

transferred to the error, with a residual like (2) we obtain, in general, a very smallerror near t = 0 but increasing like a power of t . However with a residual like (3) weobtain, in general, an error with an oscillatory behaviour miming an uniform error.

For linear problems we associate to the differential problem an algebraic equiv-alent involving the algebraic representation of the differential operators obtaininga doubly infinite system of linear equations (operational tau method) [7–9] and toconstruct the Tau approximant y we truncate that system conveniently and solve theresulting system of linear equations.

For nonlinear differential problems the Tau approximation of the solution is usu-ally obtained using a sequence of tau approximants of a linearized version of thenonlinear differential equations [7, 8].

In this work we present an alternative way to this linearization. In the next chapterwe will see that applying the Tau method to an initial value problem, we can obtaina residual like (2), which, for that kind of problems and with that formulation, givesnothing but the Taylor series of the solution. Instead, if we rewrite the residual in anorthogonal basis, like in (3) we obtain a set of nonlinear algebraic equations, involv-ing the unknown coefficients of y. Our implementation of the method presents acompromise between (2) and (3), rewriting in the orthogonal basis some componentsof the residual and letting others components remaining in powers basis.

In addition to the choice of n, the degree of the polynomial approximation, wewill choose a positive integer k < n − ν, and we evaluate the unknown coefficientsaν, . . . , an−k , imposing a residual of Taylor kind approximation

τ(t) =l∑

i=n+1−k−ν

τi ti (4)

where l, depending on n and on the operator D, is the degree of Dyn. We remem-ber that ν is the order of the differential equation and that the first ν coefficientsa0, . . . , aν−1 have been determined by initial conditions.

The residual (4) is appropriate if we intend to approximate y(t) for some t ≈ 0. Inorder to improve the approximation of y(t) in a interval of values for t , we do betterrewriting τ in a polynomial basis, orthogonal in the same interval. We rewrite (4) inthe form

τ(t) = tn−k+ν−1l−n+k−ν+1∑

i=0

τiPi(t) (5)

remarking that the τi in (4) and (5) are not the same, but generic coefficients. Infact those coefficients are associated with distinct functions of the ai coefficients ofyn. The unknown coefficients an−k+1, . . . , an appear in linear expressions for lowdegree coefficients τi , but they appear in nonlinear expressions for higher degreecoefficients τi , say for i > r , with r depending on D and on n. So, writing

τ(t) = tn−k+ν−1r∑

i=0

τiPi(t) + R(t) (6)

Page 4: A tau method for nonlinear dynamical systems

586 Numer Algor (2013) 62:583–600

where R is the remaining part of the residual, representing all the high degree terms,with nonlinear expressions. Imposing τi = 0, i = 0, . . . , k − 1, we obtain a linearalgebraic system to solve and the corresponding residual is

τ(t) = tn−k+ν−1r∑

i=k

τiPi(t) + R(t) (7)

Since R(t) = O(tn−k+ν+r ) we claim that our method is suitable for initial valueproblems of the form (1).

3 A Tau method for one nonlinear differential equation

The method that we develop in this work is suitable for any system of nonlinear dif-ferential equations which is linear in the derivative of highest order and a polynomialin the remaining. Having chosen a pair of integers [n, k], we compute the first n − k

coefficients of the solution, imposing n − k null coefficients in the residual τ , like in(2), and we compute the remaining k unknown coefficients of the solution, imposingk null coefficients in the residual, like in (7).

In this chapter, for the sake of clarity of the method’s construction, we begin byapplying the method to an example of one scalar differential equation.

3.1 Residual representation

Given the following nonlinear differential problem{y = y2, 0 < t < 1y(0) = a0

(8)

our purpose is to construct a Tau method polynomial approximation yn =n∑

i=0

aiti

of y. For this yn we have

y2n =

n∑i=0

⎛⎝ i∑

j=0

ajai−j

⎞⎠ t i +

2n∑i=n+1

⎛⎝ n∑

j=i−n

ajai−j

⎞⎠ t i and yn =

n−1∑i=0

(i + 1)ai+1ti

Canceling the first n coefficients of the residual yn − y2n leads to

ai+1 = 1

i + 1

i∑j=0

ajai−j , i = 0 : n − 1 =⇒ ai = ai+10 , i = 1 : n.

We remark that, in this case, the Tau method produces the Taylor polynomial ofthe exact solution of the differential equation. In fact the recurrence relation thatwe obtained corresponds to a method introduced by Newton and rediscovered bySteffensen [2].

The approximant yn obtained produces in the differential equation a residual

yn − y2n = τ

Page 5: A tau method for nonlinear dynamical systems

Numer Algor (2013) 62:583–600 587

corresponding to the coefficients that were not considered in the recurrence relation

τ =⎛⎝ n∑

j=0

ajan−j

⎞⎠ tn +

2n∑i=n+1

⎛⎝ n∑

j=i−n

ajai−j

⎞⎠ t i .

Lanczos proposal, for the case of a linear differential equation, consists in rewritingthe residual in a basis of orthogonal polynomials and annihilating the first coefficientsin the representation of the residual on such a basis. When we use this method tononlinear differential equations we obtain a system of nonlinear equations.

The alternative that we present here consists in rewriting, in a system of orthogonalpolynomials {Pi}∞i=0, only a part of the residual, in such a way that the resultingsystem of nonlinear equations can be solved by forward substitution.

Next we apply this method to example (8) for cases k = 1 and k > 1 in separatesections.

3.2 Tau approximants with k = 1

If we choose k = 1, that is, we only annihilate the coefficient of P0 in the residual(5), then

yn − y2n = tn−1

n+1∑i=1

τiPi(t)

and we obtain 3 sets of coefficients in the expression of the residual

τ =⎛⎝nan −

n−1∑j=0

ajan−1−j

⎞⎠ tn−1 −

2n−1∑i=n

⎛⎝2ai−nan +

n−1∑j=i−n+1

ajai−j

⎞⎠ t i − a2

nt2n.

The last term, a2nt

2n, which will not be considered because it is nonlinear in theunknown an and is negligible in relation to the others, when we approximate nearzero; the first n − 1 terms provided by the Newton–Steffensen method

ai+1 = 1

i + 1

i∑j=0

ajai−j , i = 0 : n − 2

resulting in ai = ai+10 , i = 1 : n − 1; and a set with the remaining terms which

produces the equation corresponding to impose that the coefficient of P0 in theexpression of the residual is null, allowing the determination of an in terms of thealready known ai, i = 0 : n − 1. Using

t i =i∑

j=0

wi,jPj (t), i = 0 : 2n − 1

Page 6: A tau method for nonlinear dynamical systems

588 Numer Algor (2013) 62:583–600

the expression of t i on a basis of orthogonal polynomials, wi,j being the connectioncoefficients, and replacing those expressions in the definition of the residual we get

τ = tn−1

⎡⎣w00 (nan − c0) −

n∑i=1

(2ai

0an + ci

)⎛⎝ i∑j=0

wi,jPj

⎞⎠− a2

n

n+1∑j=0

wn+1,jPj

⎤⎦

with

ci =n−1∑j=i

aj an+i−1−j = (n − i)an+i+10 , i = 0 : n − 1.

Annihilating the coefficient of P0 results in a quadratic equation for an[w00n − 2

n∑i=1

wi,0ai0

]an − wn+1,0a

2n =

n−1∑i=0

wi,0ci .

The reason why we choose to not include the term t2n of the residual expression inthe system of orthogonal polynomials, is to avoid that quadratic equation. Thereforewe write, like in (7),

τ = tn−1n∑

i=1

τiPi(t) + τn+1t2n

and we obtain

an =

n−1∑i=0

wi,0ci

w00n − 2n∑

i=1

ai0wi,0

, if w00 �= 2

n

n∑i=1

ai0wi,0

3.3 Tau approximants with k > 1

In order to improve the error behaviour, we choose a greater number k, 1 < k < n,ofcoefficients to be determined by the residual expression in the orthogonal polyno-mials set. In this case we have a lesser number of coefficients to be determined byforward substitution, by annihilation of the first coefficients,

ai+1 = 1

i + 1

i∑j=0

ajai−j , i = 0 : n − k − 1

and we reserve the remaining k unknowns to annihilate the residual coefficients inthe orthogonal basis. Since the k coefficients of greater degree ai, i = n − k + 1 : n

appear in a nonlinear way in the 2k−1 coefficients τi of greater order in the residual,we impose a residual of the form

yn − y2n = tn−k

⎡⎣n+1−k∑

i=k

τiPi(t) +n+k∑

i=n+2−k

τi ti

⎤⎦ (9)

Page 7: A tau method for nonlinear dynamical systems

Numer Algor (2013) 62:583–600 589

From this expression we see that k must be at most n/2 in order to obtain a linearsystem to determine the last k coefficients. We could, as an alternative to this, repre-sent the residual only on the orthogonal basis, but we would not be able to separatethe linear terms from the nonlinear ones, and so we would obtain a nonlinear systemto solve.

We proceed in a similar way as in the case k = 1. We separate the terms involvingai for i = n − k + 1 : n, not yet determined, and impose that τ/tn−k is orthogonalto Pi, i = 0 : k − 1, by annihilation of the respective coefficients according to (9).We obtain the following linear system, that determines ai, i = n − k + 1 : n

n∑i=n−k+1

⎛⎝iwi−n+k−1,l − 2an−i−k+1

0

n−k+1∑j=i−n+k

aj

0wj,l

⎞⎠ ai

=2n−2k+1∑i=n−k

(2n − i − 2k + 1)ai+20 wi−n+k,l, l = 0 : k − 1

In conclusion, the Tau approximants y[n,k] obtained are indexed by two integers:n, the degree of the polynomial approximation and k, the dimension of the subspaceorthogonal to the remaining of the residual τ/tn−k . These approximants have corre-sponding residuals of O(tn−kPk) and a computational cost of a linear system of orderk to solve.

In the case k = 2 we compute an−1 and an solving the linear system

(an−1, an)G = b

where

G =[

n − 1 −2a0 −2a20 · · · −2an−1

00 n −2a0 · · · −2an−2

0

]⎡⎢⎢⎣

w0,0 0w1,0 w1,1· · ·wn−1,0 wn−1,1

⎤⎥⎥⎦

and

b = an0

[n − 1 (n − 2)a0 (n − 3)a2

0 · · · 2an−30 an−2

0

]⎡⎢⎢⎣

w0,0 0w1,0 w1,1· · ·wn−2,0 wn−2,1

⎤⎥⎥⎦

We compute the coefficients wi,j by recurrence, using the three term recurrencerelation characteristic of the family of orthogonal polynomials [1]. In the numericalexamples presented we consider the Chebyshev polynomials orthogonal on [0, 1], toavoid fast increasing errors with t . In this case, since

⎧⎪⎪⎨⎪⎪⎩

T0(t) = 1

T1(t) = 2t − 1

tTj (t) = 1

4Tj−1 + 1

2Tj + 1

4Tj+1, j > 0

Page 8: A tau method for nonlinear dynamical systems

590 Numer Algor (2013) 62:583–600

we have ⎧⎨⎩

w0,0 = 1

w1,0 = 1

2w1,1 = 1

2

,

wi+1,j =

⎧⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎩

1

2wi,0 + 1

4wi,1 j = 0

1

4wi,j−1 + 1

2wi,j + 1

4wi,j+1 j = 1 : i − 1

1

4wi,i−1 + 1

2wi,i j = i

1

4wi,i j = i + 1

, i > 1

3.4 Numerical results

In Fig. 1, we plot, for problem (8) with a0 = 0.50, the error between the exact solu-tion y and the Taylor solution of order n, Taylorn and the error between the exactsolution and the Tau approximants y[n,k], for k = 1, . . . , [n/2]. On the left, for n = 4we plot the absolute errors in logarithmic scale. On the middle, for n = 10, we plotthe errors and we zoom in logarithmic scale the absolute errors for t in [0.5, 1]. Wesee that, as we move away from zero, where the Taylor approximation is better, weget more accurate approximations with the generalized Tau method even for smalldegrees. Also we get a gain in the accuracy of the Tau approximation increasing n

and k. Because the error in the mixed basis oscillates around zero, for some valuesof the domain the error vanishes introducing some discontinuities in the logarithmicsof the absolute error curves. On the right, for n = 10, we compare the errors for theTau approximants y[n,k], for k = 1 and k = [n/2], for the approximant linT aun

Fig. 1 Errors |y − Taylorn|, |y − y[n,k]|, |y − nonlinTaun| and |y − linTaun| for problem (8)

Page 9: A tau method for nonlinear dynamical systems

Numer Algor (2013) 62:583–600 591

Fig. 2 Run times for the construction of the approximants for problem (8)

obtained using the iterated linearized version of the Tau method and for the approx-imant nonlinTaun obtained by solving the full non-linear system with the routinefsolve of Matlab. In Fig. 2 we compare, for increasing values of n, the run times, inseconds, for the construction of the new Tau approximants for k = 1 and k = [n/2]with the run times for the construction of the other two approximations. We see thatthe new Tau approximant construction is always faster, taking between 0.1 % and1 % of the time spent by the other constructions.

These results suggest that our new Tau method, without the loss of much precision,wins in simplicity and speed when compared with other implementations of the Taumethod for nonlinear problems.

4 Error in the Tau approximation

The application of the Tau method to solve the differential problem{y = f (y), t > 0y(0) = y0

produces an approximant u ≈ y that is the solution of the perturbed problem{u = f (u) + τ(u), t > 0u(0) = y0

The error function e(t) = y(t) − u(t) satisfies{e = f (y) − f (u) − τ(u), t > 0e(0) = 0

If f is sufficiently regular and if, at least for values of t close to 0, |y(t)−u(t)| << 1,we have

de

dt≈ e(t)fu(t) − τ(u(t))

Page 10: A tau method for nonlinear dynamical systems

592 Numer Algor (2013) 62:583–600

where fu(t) = dfdu

|u=u(t) and we obtain an expression for e(t):

e(t) = −e−F(t)

∫ t

0eF(x)τ (u(x))dx, with F(x) =

∫ 1

x

fu(y)dy

In the case of our Tau approximation y ≈ y[n,k] rewriting the expression of theresidual (7) in the canonical basis

τ(u) = tn−kl−n+k∑i=0

τi ti (10)

we get the following expression for the error:

e(t) ≈ −e−F(t)

l−n+k∑i=0

τi

∫ t

0eF(x)xn−k+idx

Admitting that fu(u(t)) ≈ M ≡ fu(u(0)) for t in the neighbourhood of 0, thenF(x) = (1 − x)M and we get for the error approximation the expression

e(t) ≈ −eMt

l−n+k∑i=0

τi

∫ t

0e−Mxxn−k+idx

that we solve in order to get

e(t) ≈ −l∑

m=n−k

m!Mm+1

τm−n+k

(eMt −

m∑r=0

(Mt)r

r!

)

Using the Taylor formula for the remainder

eMt −m∑

r=0

(Mt)r

r! = hm+1m

(m + 1)! , for some hm ∈ [0, Mt]

we obtain

e(t) ≈ −l∑

m=n−k

τm−n+k

m + 1

(hm

M

)m+1

, hm ∈ [0, Mt]

or

e(t) ≈ −l∑

m=n−k

τm−n+k

m + 1hm+1

m , hm ∈ [0, t]

From this expression we obtain for hm ≈ t , the following approximation

e(t) ≈ −tn−k+1l−n+k∑i=0

τi

n − k + i + 1t i , t ≥ 0 (11)

For our example (8), f (u) = u2, so l = 2n and �e(t) = tn−k+1∑n+ki=0

|τi |n−k+i+1 t i is

an upper bound for |e(t)|. In Fig. 3 we plot the curves for the absolute error |y(t) −y[n,k]|, our estimative e(t) and the upper bound �e(t). As we see the estimated errorfollows the exact error.

Page 11: A tau method for nonlinear dynamical systems

Numer Algor (2013) 62:583–600 593

Fig. 3 Error curves for problem (8)

5 Application to dynamical systems

We can generalize these strategies to nonlinear systems of differential equationsobtaining similar formulas. In such a case, problem (1) represents a system of m dif-ferential equations, where y and f are m-dimensional vector functions. We constructa m-dimensional Tau approximant of y annihilating the first n − k coefficients ineach component of the residual (2), and computing the remaining k unknown coef-ficients of each component of the solution, annihilating the first k coefficients in theresidual (6).

We present here the results of the application of this Tau method approximation tosome dynamical systems.

5.1 Tau error for dynamical systems

In the case of the application of the proposed Tau method to dynamical systems theerror satisfies a system of differential equations

e(t) ≈ df

dy(u(t))e(t) − τ(u(t)), e(0) = 0

where dfdy

(u(t)) = J (t) is the Jacobian of f . As in the unidimensional case, admittingthat the derivatives do not vary much with t , J (t) ≈ J ≡ J (0), we obtain for theerror the following system of linear differential equations

e(t) ≈ Je(t) − τ(u(t)), e(0) = 0.

The solution of this system is a linear combination of

zj,i(t) = −eλj t

∫ t

0e−λj xxidx, j = 1 : m, i = n − k : l

where λj , j = 1 : m are the eigenvalues of J . As in the case of one equation, weobtain

ej (t) = −tn−k+1l−n+k∑i=0

τj,i

n − k + i + 1t i , t ≥ 0, j = 1 : m

Page 12: A tau method for nonlinear dynamical systems

594 Numer Algor (2013) 62:583–600

5.2 Adaptive step algorithm

Using the expressions obtained we implemented the computation of the generalizedTau approximants for dynamical systems described by m differential equations. Inorder to approximate the solution for large periods of time we developed a step bystep strategy solving in each step a tau problem with the same operator. The stepsizeis recomputed in each step in such a way that the error ej (t) in each of the m differ-ential equations is approximately less than an error tolerance fixed a priori, that is,we choose h such that

hn−k+1 τj,0

n − k + 1≤ tol, j = 1 . . . m, or

h = minj

((n − k + 1)

tol

τj,0

) 1n−k+1

(12)

where, from (7) and (10),

τj,0 =r∑

i=k

τj,iPi(0).

In the following algorithm we summarize the main steps of the procedure:

1. Assign

tol error tolerancey0 initial conditions[n, k] order of the tau approximanttend time interval

2. while t < tend

(a) compute the first n − k coefficients of each component of the solution,annihilating the first n − k coefficients in the residual τ , like in (2)

(b) compute the remaining k unknown coefficients of each component ofthe solution, annihilating the first k coefficients in the residual, likein (7)

(c) compute the stepsize h using (12)(d) update t = t + h, y0 = y[n,k](h)

5.3 Lotka–Volterra problem

For the Lotka–Volterra equations{Y1(t) = Y1(t)(Y2(t) − α)

Y2(t) = Y2(t)(β − Y1(t)), t > 0 , with

{Y1(0) = y1,0Y2(0) = y2,0

we consider a Tau approximant of the form

yj ≡ yj (t) =n∑

i=0

yj,i t i , t ≥ 0, j = 1, 2

Page 13: A tau method for nonlinear dynamical systems

Numer Algor (2013) 62:583–600 595

In this case the algebraic equations that result from the substitution of the polynomi-als in the differential problem arise from

yj (t) =n−1∑i=0

(i + 1)yj,i+1 t i , t > 0, j = 1, 2

and

y1(t)y2(t) =n−1∑i=0

⎛⎝ i∑

j=0

y1,j y2,i−j

⎞⎠ t i +

2n∑i=n

⎛⎝ n∑

j=i−n

y1,j y2,i−j

⎞⎠ t i

Annihilating the first n − k coefficients of the residual in each of the differentialequations we get the first coefficients of the polynomial approximations⎧⎨⎩

y1,i+1 =(∑i

j=0 y1,j y2,i−j − αy1,i

)/(i + 1)

y2,i+1 =(βy2,i −∑i

j=0 y1,j y2,i−j

)/(i + 1)

, i = 0 : n − k − 1 (13)

The remaining k coefficients of each polynomial are determined by annihilating thefirst k coefficients in the residual expression in the Chebyshev basis in each equation,or equivalently, imposing a residual of the form{

τ1 ≡ y1 − y1(y2 − α) = tn−k∑n−k−1

i=k τ1,iTi(t) + O(t2n−2k

)τ2 ≡ y2 − y2(β − y1) = tn−k

∑n−k−1i=k τ2,iTi(t) + O

(t2n−2k

)We get a system of 2k linear equations in the 2k unknowns y1,i and y2,i , i = n−k+1 :n that can be written as

aG = b (14)

where a = [y1,n−k+1, . . . , y1,n, y2,n−k+1, . . . , y2,n], G is the 2k × 2k matrix

G =[

A(α) − B(y2) B(y2)

−B(y1) A(−β) + B(y1)

]

and A and B are the blocks of order k × k

A(α) =

⎡⎢⎢⎣

n − k + 1 α

n − k + 2 α

· · ·n α

⎤⎥⎥⎦⎡⎢⎢⎣

w0,0w1,0 w1,1· · ·wk,0 wk,1 · · · wk,k

⎤⎥⎥⎦

representing the terms y1 − αy1 in the residual,

B(y1) =

⎡⎢⎢⎢⎣

y1,0 y1,1 · · · y1,n−k−2y1,0 · · · y1,n−k−3

. . ....

y1,0 · · · y1,n−2k−1

⎤⎥⎥⎥⎦

×⎡⎣ w1,0 w1,1

· · ·wn−k−1,0 wn−k−1,1 · · · wn−k−1,k−1

⎤⎦

Page 14: A tau method for nonlinear dynamical systems

596 Numer Algor (2013) 62:583–600

representing the terms y1y2 in the residual corresponding to the coefficients y1,i , i =0 : n− k −2 already known and y2,i , i = n− k +1 : n unknown, and b is the 2k ×1vector

b =[

b(y1y2)T

−b(y1y2)T

]

where

b(y1y2) = [ y1,0 y1,1 · · · y1,n−k

]⎡⎢⎢⎢⎣

y2,n−k

y2,n−k−1 y2,n−k

· · · . . .

y2,0 y2,1 · · · y2,n−k

⎤⎥⎥⎥⎦

×

⎡⎢⎢⎣

w0,0w1,0 w1,1· · ·

wn−k,0 wn−k,1 · · · wn−k,k−1

⎤⎥⎥⎦

5.4 Numerical results for Lotka–Volterra problem

We consider the Lotka–Volterra equations for α = 2, β = 1 and y1,0 = 4, y2,0 = 4.As an explicit expression for the solution is not known for this problem, we com-pare our computed orbits with the curve log(y1) − y1 + 2 log(y2) − y2 = C withC = log(y1(0)) − y1(0) + 2 log(y2(0)) − y2(0), which is a property of the exactsolution [10].

In Fig. 4 we plot this curve and the orbits computed using Tau approximants oforder [10, 4] for each of the functions, for several values of the error tolerance tol.

Fig. 4 Orbits for Lotka–Volterra problem

Page 15: A tau method for nonlinear dynamical systems

Numer Algor (2013) 62:583–600 597

Fig. 5 Errors for Lotka–Volterra problem

On the right we present a zoom of the plot on the left, for better understanding ofthe orbits. We remark that for lower values of tol we get better stability, as we seethat the orbit moves away from the exact orbit much slower than for higher values oftol.

In Fig. 5 we plot the estimates |ei(t)| for the error function and |Yi − yi | usingcircles. We used in all the results nit = 10 iterations and a fixed stepsize h = 0.1.We see that our error estimator agrees with the error provided by Ode45 and so thatthe computed orbit is close to the exact orbit within an error less than tol.

In Fig. 6 we plot the deviation log10(| log(y1)−y1 + 2 log(y2)−y2 −C|), for twovalues of [n, k], with variable stepsize for selected values for tol, for 50 steps. Weremark the gain of accuracy with decreasing values for tol.

Fig. 6 Deviations for Lotka–Volterra problem

Page 16: A tau method for nonlinear dynamical systems

598 Numer Algor (2013) 62:583–600

5.5 Lorenz equations

We applied our method to a dynamical system involving three unknown functionsand three differential equations, the well known Lorenz equations [5]

⎧⎪⎨⎪⎩

Y1 = σ(Y2 − Y1),

Y2 = Y1(ρ − Y3) − Y2,

Y3 = Y1Y2 − βY3,

t > 0, with

⎧⎨⎩

Y1(0) = y1,0

Y2(0) = y2,0

Y3(0) = y3,0

where σ represents the Prandtl number and ρ the Rayleigh number. The systempresents a chaotic behaviour for ρ = 28. We choose σ = 10 and β = 8/3.

In this case, to construct Tau approximants of order [n, k] to each of the functions,we obtain a system of 3k linear algebraic equations in the 3k unknowns y1,i , y2,i andy3,i , i = n − k : n that can be written as aG = b with

G =⎡⎣ A(σ) −ρW + B(y3) −B(y2)

−σW A(1) −B(y1)

B(y1) A(β)

⎤⎦ and b =

⎡⎣ 0

−b(y1y3)T

b(y1y2)T

⎤⎦

where A, B and b are defined as in the previous example and W = (wij ).In Fig. 7 we see that, if we choose a sufficiently small tolerance for the error,

the method is sufficiently stable to recover the known attractor for a large period oftime.

In Fig. 8 we zoom out a section of the phase plane emphasizing that our solu-tion, with smaller number of iterations, follows the Ode45 solution much closer thanOde23 solution.

Fig. 7 Orbit for Lorenz equations

Page 17: A tau method for nonlinear dynamical systems

Numer Algor (2013) 62:583–600 599

Fig. 8 Comparison of Tau, Ode23 and Ode45 solutions for Lorenz equations

6 Conclusions

We developed a new Tau method technique that allows the approximation of nonlin-ear systems of differential equations without performing any kind of linearization andwith a computational cost of the solution of a linear systems of very low dimension.

Our technique allows the resolution of any initial value differential problem, linearin the derivative of highest order and a polynomial in the remaining, by imposingan hybrid kind of residual: first we impose an O(tn−k) residual and afterwards werewrite the principal part of this residual on an orthogonal polynomial basis, obtainingan O(tn−kPk−ν(t)) residual.

We developed a special adaptive step by step version of this generalization of theTau method that allows stable approximations of the solution of dynamical systemsfor large periods of time. This step by step method is based on an error estimationthat seems to be very effective in our experiments. We obtain similar results to thoseusing Ode45 with considerably less number of iterations.

Our results suggest that for increasing values of n and k we reach G matrices withincreasing condition numbers, but for small values of n and k the method seems tobe very stable.

In the examples we chose the same orders n and k in all the components of thevector residual but, if there is a reason to do so, we can choose distinct values indistinct components.

References

1. Abramowitz, M., Stegun, I.A. (eds.): Handbook of Mathematical Functions with Formulas, Graphs,and Mathematical Tables. Dover, New York (1970)

2. Hairer, E., Nørsett, S.P., Wanner, G.: Solving Ordinary Differential Equations I: Nonstiff Problems.Springer, Berlin (1987)

Page 18: A tau method for nonlinear dynamical systems

600 Numer Algor (2013) 62:583–600

3. Lanczos, C.: Trigonometric interpolation of empirical and analytical functions. J. Math. Phys. 17,123–199 (1938)

4. Lanczos, C.: Applied Analysis. Pitman, London (1957)5. Lorenz, E.N.: Deterministic nonperiodic flow. J. Atmos. Sci. 20(2), 131–141 (1963)6. Ortiz, E.L.: The Tau method. SIAM J. Numer. Anal. Optim. 6, 480–492 (1969)7. Ortiz, E.L., Samara, H.: An operational approach to the Tau method for the numerical solution of

nonlinear differential equations. Computing 27(4), 15–21 (1981)8. da Silva, M.R.: Numerical treatment of differential equations with the Tau method. J. Comput. Appl.

Math. 20, 167–173 (1987)9. da Silva, M.R., Rodrigues, M.J.: A simple alternative principle for rational τ -method approximation.

In: Cuyt, A. (ed.) Nonlinear Numerical Methods and Rational Approximation, pp. 427–434. Reidel,Dordrecht (1988)

10. Strang, G.: Computation Science and Engineering. Wellesley-Cambridge Press, Wellesley, MA (2007)