Acta Polytechnica doi:10.14311/AP.2013.53.0438 Acta Polytechnica 53(5):438–443, 2013 © Czech Technical University in Prague, 2013 available online at http://ojs.cvut.cz/ojs/index.php/ap LIE GROUPS AND NUMERICAL SOLUTIONS OF DIFFERENTIAL EQUATIONS: INVARIANT DISCRETIZATION VERSUS DIFFERENTIAL APPROXIMATION Decio Levia, Pavel Winternitzb,∗ a Dipartimento di Matematica e Fisica, Universitá degli Studi Roma Tre and INFN, Sezione Roma Tre, Via della Vasca Navale 84, 00184 Roma, Italy b Centre de Recherches Mathématiques, Université de Montréal, C.P. 6128, succ. Centre-ville, Montréal, QC, H3C 3J7, Canada ∗ corresponding author: wintern@crm.umontreal.ca Abstract. We briefly review two different methods of applying Lie group theory in the numerical solution of ordinary differential equations. On specific examples we show how the symmetry preserving discretization provides difference schemes for which the “first differential approximation” is invariant under the same Lie group as the original ordinary differential equation. Keywords: ordinary difference equations, numerical solution, Lie group theory, invariant discretization. Submitted: 25 April 2013. Accepted: 5 May 2013. 1. Introduction Lie group theory provides powerful tools for solving ordinary and partial differential equations, specially nonlinear ones [1–3]. The standard approach is to find the Lie point symmetry group G of the equation and then look for invariant solutions, i.e. solutions that are invariant under some subgroup G0 ⊂ G. For Ordinary Differential Equations (ODEs) this leads to a reduction of the order of the equation (without any loss of information). If the dimension of the symmetry group is large enough (at least equal to the order of the equation) and the group is solvable, then the order of the equation can be reduced to zero. This can be viewed as obtaining the general solution of the equation, explicitly or implicitly. However, for an ODE obtaining an implicit solution is essentially equivalent to replacing the differential equation by an algebraic or a functional one. From the point of view of visualizing the solution, or pre- senting a graph of the solution, it maybe easier to solve the ODE numerically than to do the same for the functional equation. For Partial Differential Equations (PDEs) symme- try reduction reduces the number of independent vari- ables in the equation and leads to particular solutions, rather than the general solution. Both for ODEs and PDEs with nontrivial symmetry groups it may still be necessary to resort to numerical solutions. The question then arises of making good use of the group G. Any numerical method involves replacing the differential equation by a difference one. In standard discretizations no heed is paid to the symmetry group G and some, or all of the symmetries are lost. Since the Lie point symmetry group encodes many of the properties of the solution space of a differential equation, it seems desirable to preserve it, or at least some of its features in the discretization process. Two different methods for incorporating symmetry concepts into the discretization of differential equa- tions exist in the literature. One was proposed and explored by Shokin and Yanenko [4–8] for PDEs and has been implemented in several recent studies [9, 10]. It is called the differential approximation method and the basic idea is the following. A uniform orthog- onal lattice in xi is introduced and the considered differential equation E(~x,u,uxi,uxi,xj , · · ·) = 0, (1) is approximated by some difference equation E∆ = 0. The derivatives are replaced by discrete derivatives. All known and unknown functions in (1) are then expanded in Taylor series about some reference point (~x), in terms of the lattice spacings. In the simplest case of 2 variables, x and t, we have σ = xn+1 − xn, τ = tn+1 − tn E∆(x,t,u, ∆xu, ∆tu, ∆xxu, ∆ttu, ∆xtu, · · ·) = E + σE1 + τE2 + σ2E3 + 2στE4 + τ2E5 + · · · . (2) The expansion on the right hand side of (2) is a “dif- ferential approximation” of the difference equation E∆ = 0. (3) The “zero order differential approximation” of (3) is the original differential equation (1) and hence is invariant under the symmetry group G. Keeping terms of order σ or τ in (2) we obtain the first differential approximation, etc. The idea is to take a higher 438 http://dx.doi.org/10.14311/AP.2013.53.0438 http://ojs.cvut.cz/ojs/index.php/ap vol. 53 no. 5/2013 Lie Groups and Numerical Solutions of Differential Equations order differential approximation, at least the first order one, and require that is also invariant under G, or at least under a subgroup G0 ⊂ G. This is done by constructing different possible difference schemes approximating eq. (1) and choosing among them the one for which the first (or higher) differential approximation has the “best” symmetry properties. The second approach, the invariant discretization method is part of a program devoted to the study of continuous symmetries of discrete equations, i.e. the application of Lie groups to difference equations [11–24]. As far as applications to the numerical solu- tions of differential equations are concerned, the idea, originally due to Dorodnitsyn [12, 13], is to start from the differential equation, its symmetry group G and the Lie algebra L of G, realized by vector fields. The differential equation can then be expressed in terms of differential invariants of G. The differential equation is then approximated by a finite difference scheme that is constructed so as to be invariant under the same group G as the differential equation. The difference scheme will consist of several equations establishing relations between points in the space of independent and dependent variables. These equations determine both the evolution of the dependent variables and the form of the lattice. The equations are written in terms of group invariants of the group G acting via its prolongation to all points on the lattice (rather than to derivatives of the dependent functions). As pointed out by P. Olver, this amounts to prolonging the group action to “multi-space” for difference equations [24] rather than to “jet space” as for differential equations [25]. The purpose of this paper is to compare the two dif- ferent methods of incorporating Lie symmetries into the numerical analysis of differential equations. For simplicity we restrict ourselves to the case of ODEs and analyze difference schemes that were used in re- cent articles [26–28] to solve numerically some third order nonlinear ODEs with three or four dimensional symmetry algebras. In this article we take invariant difference schemes (on symmetry adapted lattices) and construct its first differential approximation. We then verify that in all examples this first differential approximation is invariant under the entire symmetry group G. 2. Differential approximations of ordinary difference equations and invariant discretization of ODEs. Let us consider the case of a third order ODE E ≡ E(x,y,y′,y′′,y′′′) = 0, (4) (the generalization to order n ≥ 3 is straightforward). We can approximate (4) on a 4 point stencil with points (xk,yk), (k = n−1,n,n+ 1,n+ 2). Alternative coordinates on the stencil are the coordinates of one reference point, say (xn,yn), the distances between the points, and the discrete derivatives up to order 3, { xn, yn, hn+k = xn+k −xn+k−1, p (1) n+1 = yn+1 −yn xn+1 −xn , p (2) n+2 = 2 p (1) n+2 −p (1) n+1 xn+2 −xn , p (3) n+3 = 3 p (2) n+3 −p (2) n+2 xn+3 −xn } . (5) The one-dimensional lattice can be chosen to be uni- form and then hn+1 = hn ≡ h, (6) or some other distribution of points can be chosen. The Lie point symmetry group G transforms the variables (x,y) into (x̃, ỹ) = ( Λ(x,y), Ω(x,y) ) and its Lie point symmetry algebra L is represented by vector fields of the form X̂µ = ξµ(x,y)∂x + φµ(x,y)∂y, 1 ≤ µ ≤ dimL. (7) The vector fields must be prolonged in the standard manner [1] to derivatives prX̂µ = X̂µ + φx(x,y,yx)∂yx + φxx(x,y,yx,yxx)∂yxx + · · · , (8) when acting on a differential equation, or to all points when acting on a difference scheme [15, 18, 20] pr∆X̂µ = ∑ i [ ξµ(xi,yi)∂xi + φµ(xi,yi)∂yi ] . (9) In the differential approximation method we start with a difference equation, usually on a uniform lattice (6) E∆(xn,hn+1,hn+2,yn,p (1) n+1,p (2) n+2,p (3) n+3) = 0, (10) and expand it into a Taylor series in the spacing h: E∆ = E0 + hE1 + h2E2 + · · · = 0. (11) For any difference equation approximating the differ- ential equation E0 = 0 the lowest order term will be invariant under the group G. Different schemes (10) can then be compared with respect to the invariance of the first differential approximation E0 + hE1 = 0, (12) or of some higher order differential approximations. Better results can be expected for schemes for which (12) is invariant under all of G or under some subgroup G0 ⊂ G that is relevant for the problem. When studying the invariance of (12) it must be remembered that the prolongations of X̂µ also act on the lattice parameters h. 439 D. Levi, P. Winternitz Acta Polytechnica In the invariant discretization method one con- structs an invariant difference scheme E∆a ( xn,yn,hn,hn+1,hn+2,yn, p (1) n+1,p (2) n+2,p (3) n+3 ) = 0, a = 1, 2 (13) prX̂µE∆a ∣∣ E∆1 =0,E ∆ 2 =0 = 0. (14) The two equations (13) determine both the lattice and the difference equation. Both are constructed out of the invariants of the group G prolonged to the lattice as indicated in eq. (14). Thus, the difference scheme is by construction invariant under the entire group G acting on the equation and lattice. In the continuous limit we have E∆1 = E + hnE (1) 1 + hn+1E (2) 1 + hn+2E (3) 1 + h.o.t., (15) E∆2 = 0 + hnE (1) 2 + hn+1E (2) 2 + hn+2E (3) 2 + h.o.t.. (16) The terms spelled out in (15) correspond to the first differential approximation. Since the left hand side of (15), (16) is invariant under G, the series on the right hand side must also be invariant. This does not guarantee that the first (or n-th) differential approximation will be invariant. In the next three sections we will show on examples that the first differential approximation is indeed in- variant. Thus, choosing an invariant difference scheme guarantees, at least in the considered cases, that the aims of the differential approximation method are fully achieved. The examples are all third order ODEs with 3 or 4 dimensional symmetry groups. In each case we write an invariant difference scheme of the form (13) and its first differential approximation (15). The terms E (k) 1 , (k = 1, 2, 3) in (15) are differential expressions containing y′′′ and y′′′′. These expressions will be simplified by removing y′′′ and y′′′′, using the ODE (4) and its first differential consequence. 3. Equations invariant under the similitude group Sim(2). Let us consider the group of translations, rotations and uniform dilations of an Euclidean plane. Its Lie algebra sim(2) is realized by the vector fields X̂1 = ∂ ∂x , X̂3 = y ∂ ∂x −x ∂ ∂y , X̂2 = ∂ ∂y , X̂4 = x ∂ ∂x + y ∂ ∂y , (17) This group has no second order differential invariant and precisely one third order one, namely[26] I = (1 + y ′2)y′′′ − 3y′y′′2 y′′2 . (18) The expressions I1 = y′′ (1 + y′2)3/2 , I2 = (1 + y ′2)y′′′ − 3y′y′′2 (1 + y′2)3 are invariant under the Euclidean group, with Lie algebra {X̂1, X̂2, X̂3}, but only the ratio I2/I21 = I is invariant under dilations. Thus the lowest order ODE invariant under Sim(2) is (1 + y′2)y′′′ − 3y′y′′2 = Ky′′2 (19) where K is an arbitrary constant. To discretize (19) (or any third order ODE) we need (at least) a four-point stencil. The Euclidean group has 5 independent invariants depending on 4 points (xn+k,yn+k),k = −1, 0, 1, 2 namely [26] ξ1 = hn+2 [ 1 + (yn+2 −yn+1 hn+2 )2]1/2 , ξ2 = hn+1 [ 1 + (yn+1 −yn hn+1 )2]1/2 , ξ3 = hn [ 1 + (yn −yn−1 hn )2]1/2 , ξ4 = (yn+2 −yn+1)hn+1 − (yn+1 −yn)hn+2, ξ5 = (yn+1 −yn)hn − (yn −yn−1)hn+1. (20) Out of them we can construct 4 independent Sim(2) invariants, for instance J1 = 2αξ4 ξ1ξ2(ξ1 + ξ2) + 2βξ5 (ξ2ξ3)(ξ2 + ξ3) , α + β = 1, J2 = 6 ξ1 + ξ2 + ξ3 [ ξ4 ξ1ξ2(ξ1 + ξ2) − ξ5 ξ2ξ3(ξ2 + ξ3) ] , (21) and the two ratios ξ1/ξ2, ξ2/ξ3. To obtain the contin- uous limit we put xn−1 = xn −hn, xn+1 = xn + hn+1, xn+2 = xn + hn+1 + hn+2, yn+k = y(xn+k), hn+k = αk�, αk ∼ 1, (22) and expand yn+k into a Taylor series about xn ≡ x. The invariants J1, J2 where so chosen that their continuous limits are I1 and I2 respectively. The invariant scheme used in [26] to solve the ODE (19) numerically was E∆2 = ξ1ξ3 − ξ 2 2 = 0, (23) E∆1 = J2 −KJ 2 1 = 0. (24) The first differential approximation of (23) is E∆2 ≈ 2(−h 2 n+1 + hnhn+2)(y ′2 + 1) + (2hnhn+1hn+2 − 2h3n+1 −h 2 nhn+2 + hnh2n+2)y ′y′′ = 0 (25) 440 vol. 53 no. 5/2013 Lie Groups and Numerical Solutions of Differential Equations Applying prDX̂i to eq. (25) we find that the equation is invariant under the entire group Sim(2), as are the terms of order �2 and �3 separately. The first order differential approximation of the difference equation (24) is quite complicated. However, if we substitute the ODE (19) and its differential consequences into the first nonvanishing term of the approximation, we obtain a manageable expression E∆1 ≈ (1 + y ′2)y′′′ − 3y′y′′2 −Ky′′2 − 1 24 y′′3 [1 + y′4](hn + hn+1 + hn+2) × { K2 [ 16α(hn + hn+1 + hn+2)2 − 4h2n − 12h 2 n+2 − 8h 2 n+1 − 16hnhn+2 − 20hn+1hn+2 + 12hnhn+1 ] + 9hn+1(hn+2 −hn) } = 0. (26) Expression (26) also satisfies pr∆X̂iE∆1 ∣∣∣ E∆1 =E ∆ 2 =0 = 0, i = 1, · · · , 4 (27) so the first differential approximation of the entire scheme (23), (24) is invariant under Sim(2). 4. Equations invariant under a one-dimensional realization of SL(2, R). Four non-equivalent realizations of sl(2,R) by vector fields in two variables exist [29]. Invariant difference schemes for second and third order ODEs have been constructed and tested for all of them [26–28]. In this section we will consider the first one, called sl 1(2,R), or alternatively sly(2,R), which actually involves one variable only: X̂1 = ∂ ∂y , X̂2 = y ∂ ∂y , X̂3 = y2 ∂ ∂y . (28) The corresponding Lie group acts by Mobius transfor- mations (fractional linear transformations) on y. The third order differential invariants of this action are the Schwarzian derivatives of y and the independent variable x. The most general third order invariant ODE is 1 y ′2 ( y′y′′′ − 3 2 y′′2 ) = F(x). (29) where F(x) is arbitrary. For F(x) = K = const the group is GL(2,R) and (28) is extended by the vector field X̂4 = ∂x. For F(x) = 0 the symmetry group is SLy(2,R) ⊗ SLx(2,R). The difference invariants on a four point stencil are R = (yn+2 −yn)(yn+1 −yn−1) (yn+2 −yn+1)(yn −yn−1) , xn,hn+2,hn+1,hn. (30) The discrete invariant approximating the left hand side of (29) is J1 = 6hn+2hn hn+1(hn+1+hn+2)(hn+hn+1)(hn+2+hn+1+hn) × [ (hn+2+hn+1)(hn+1+hn) hnhn+2 −R ] . (31) Any lattice depending only on xk will be invariant, in particular the lattice equation can be chosen to be xn+1 − 2xn + xn−1 = 0. (32) The general solution of (32) is xn = nh + c0, (33) i.e. a uniform lattice with origin x0 and spacing xn+1 −xn = h. Let us consider the invariant ODE 1 y′2 ( y′y′′′ − 3 2 y′′2 ) = sin(x). (34) and approximate it on an a priori arbitrary lattice. Such a scheme is given by E∆ = J1 − sin(ξ) = 0, (35) ξ = xn + ahn + bhn+1 + chn+2, φ(xn,hn,hn+1,hn+2) = 0, (36) where a, b, c are constants and φ satisfies the condition φ(xn, 0, 0, 0) ≡ 0, (37) (for instance φ can be linear as in (32). The first differential approximation of (35), after the usual sim- plifications, is E0 ≈ 1 y′2 ( y′y′′′ − 3 2 y′′2 ) − sin(x) + cos(x) { hn(1 + 4a) − 2hn+1(1 − 2b) −hn+2(1 − 4c) } . (38) Eq. (38) is invariant under SLy(2,R). Moreover, if we choose a = − 1 4 , b = 1 2 , c = 1 4 , (39) the second term in (38) vanishes completely and E0 = 0 is a second order approximation of the ODE (34). We mention that the uniform lattice (33), used in [26] satisfies (39). 5. Equations invariant under a two-dimensional realization of GL(2, R). A genuinely two-dimensional realization of the algebra gl(2,R) is given by the vector fields X̂1 = ∂ ∂y , X̂2 = x ∂ ∂x + y ∂ ∂y , X̂3 = 2xy ∂ ∂x + y2 ∂ ∂y , X̂4 = x ∂ ∂x . (40) 441 D. Levi, P. Winternitz Acta Polytechnica The SL(2,R) group corresponding to {X̂1,X̂2,X̂3} has two differential invariants of order m ≤ 3: I1 = 2xy′′ + y′ y′3 , I2 = x2(y′y′′′ − 3y′′2) y′5 . (41) The expression I2/I 3 2 1 is also invariant under the di- lations generated by X̂4 and hence under GL(2,R). The corresponding ODE invariant under GL(2,R) is I22 = A 2I31 (42) which is equivalent to E = x4(y′y′′′− 3y′′2)2 −A2y′(2xy′′ + y′)3 = 0. (43) Five independent SL(2,R) difference invariants are ξ1 = 1 √ xn+1xn+2 (yn+2 −yn+1), ξ2 = 1 √ xnxn+1 (yn+1 −yn), ξ3 = 1 √ xn−1xn (yn −yn−1), ξ4 = 1 √ xnxn+2 (yn+2 −yn), ξ5 = 1 √ xn+1xn−1 (yn+1 −yn−1). (44) Any 4 ratios ξi/ξk will be GL(2,R) invariants. The SL(2,R) invariants that have the correct continuous limits are J2 = 12 ξ2(ξ1 + ξ2 + ξ3) [ξ4 − ξ1 − ξ2 ξ1(ξ1 + ξ2) − ξ5 − ξ2 − ξ3 ξ3(ξ2 + ξ3) ] J1 = 8 [ α ξ4 − ξ1 − ξ2 ξ1ξ2(ξ1 + ξ2) + (1 −α) ξ5 − ξ2 − ξ3 ξ2ξ3(ξ2 + ξ3) ] . (45) The difference scheme for the ODE (43) with A = −1 used in Ref. [26] was actually the square root of (42), equivalent to E∆1 = J2 + J 3 2 1 = 0, (46) E∆2 = ξ1 ξ2 = γ = const. (47) The first differential approximation of the lattice equa- tion (47) is E (∆) 1 ≈ (γhn+1 −hn+2)y ′ + 1 2x2 {[ −γh2n+1 + hn+2(hn+2 + 2hn+1) ] y′ + xy′′ [ γh2n+1 −hn+1hn+2 −h 2 n+2 ]} = 0. (48) Both terms in (48) are invariant under GL(2,R). The first differential approximation to the difference equation (46) is E (∆) 1 ≈ E y′10 − √ y′(y′ + 2xy′′) 7 2 16xy′10(hn + hn+1 + hn+2) × [ h2n(32α− 11) + 16h 2 n+1(2α− 1) + h2n+2(32α− 21) + hnhn+1(64α− 21) + 32hnhn+2(2α− 1) + hn+1hn+2(64α− 43) ] . (49) The second term of expression (49) has been simplified using (43) and its differential consequences. Again, (49) is invariant under the entire GL(2,R) group. 6. Conclusions The three examples considered above in Sections 3, 4 and 5 confirm that the method of invariant dis- cretization provides a systematic way of constructing difference schemes for which the first differential ap- proximation is invariant under the entire symmetry group of the original ODE. The two equations (13) determining the invariant difference scheme for an ODE are not unique since there are more difference invariants than differential ones. The differential approximation of an invariant scheme can be used to benefit from this freedom and to choose an invariant scheme with a higher degree of accuracy. An example of this is given in Section 3, eq. (38) where the choice of the parameters (39) assures that the terms of order � in (38) vanish identically. Previous numerical comparisons between invariant discretization and standard noninvariant numerical methods for ODEs [26–28] have shown two features. The first is that the discretization errors for invariant schemes are significantly smaller [26] (by 3 orders of magnitude for eq. (18), 1 order of magnitude for eq. (43)). The second feature is that the qualitative be- haviour of solutions close to singularities is described much more accurately by the invariant schemes [26– 28]. An analysis of the relation between invariant dis- cretization and the differential approximation method for PDEs is in progress. Acknowledgements We thank Alex Bihlo for interesting discussions. The re- search of P.W. was partially supported by a grant from NSERC of Canada. D.L. thanks the CRM for its hospital- ity. The research of D.L. has been partly supported by the Italian Ministry of Education and Research, 2010 PRIN “Teorie geometriche e analitiche dei sistemi Hamiltoniani in dimensioni finite e infinite”. References [1] Peter J. Olver. Applications of Lie Groups to Differential Equations Second Edition, Springer-Verlag, New York, 1993. 442 vol. 53 no. 5/2013 Lie Groups and Numerical Solutions of Differential Equations [2] George W. Bluman, Sukeyuki Kumei, Symmetries and Differential Equations Springer-Verlag New York, Heidelberg, Berlin, 1989, (reprinted with corrections, 1996). [3] Nail H. Ibragimov, Transformation groups applied to mathematical physics Translated from the Russian. D. Reidel Publishing Co., Dordrecht, 1985. [4] Yurii I. Shokin, The method of differential approximation Translated from the Russian by K. G. Roesner. Springer-Verlag, New York-Berlin, 1983 [5] N. N. Yanenko and Yu. I. Shokin First Differential Approximation Method and Approximate Viscosity of Difference Schemes, Phys. Fluids 12(II):28–33,1969. [6] N. N. Yanenko, Z.I. Fedotova, L.A. Tusheva, Yu. I. Shokin, Classification of difference schemes of gas dynamics by the method of differential approximation. I. One-dimensional case. Comput. & Fluids 11 (3):187–206, 1983. [7] N.N. Yanenko and Yu. I. Shokin, Group classification of difference schemes for a system of one dimensional equations of gas dynamics, Some Problems of Mathematics and Mechanics American Mathematical Society Translations Series 2 Volume: 104 pp. 259–265, 1976 [8] Yu.I. Shokin, N.N. Yanenko, The connection between the proper formulation of first differential approximations and the stability of difference schemes for hyperbolic systems of equations. (Russian) Mat. Zametki 4 493–502, 1968. [9] E. Hoarau, C. David, P. Sagaut, T.-H. Lê, Lie group study of finite difference schemes. Discrete Contin. Dyn. Syst., Dynamical Systems and Differential Equations. Proceedings of the 6th AIMS International Conference, suppl., 495–505, 2007. [10] M. Chhay, E. Hoarau, A. Hamdouni, P. Sagaut, Comparison of some Lie-symmetry-based integrators. J. Comput. Phys. 230 (5): 2174–2188, 2011. [11] Shigeru Maeda, Canonical structure and symmetries for discrete systems. Math. Japon. 25 (4): 405–420, 1980. [12] V.A. Dorodnitsyn, Transformation groups in difference spaces. (Russian) Translated in J. Soviet Math. 55 (1): 1490–1517, 1991. [13] V.A. Dorodnitsyn, Finite difference models entirely inheriting continuous symmetry of original differential equations. Internat. J. Modern Phys. C 5 (4): 723–734, 1994. [14] V.A. Dorodnitsyn, R. Kozlov, P. Winternitz, Lie group classification of second-order ordinary difference equations. J. Math. Phys. 41 (1): 480–504, 2000. [15] Vladimir Dorodnitsyn, Applications of Lie groups to difference equations. Differential and Integral Equations and Their Applications, CRC Press, Boca Raton, FL, 2011. [16] D. Levi, P. Winternitz, Continuous symmetries of discrete equations. Phys. Lett. A 152 (7): 335–338, 1991. [17] D. Levi, P. Winternitz, Symmetries and conditional symmetries of differential-difference equations. J. Math. Phys. 34 (8): 3713–3730, 1993. [18] D. Levi, P. Winternitz, Continuous symmetries of difference equations. J. Phys. A 39 (2): R1–R63, 2006. [19] D. Levi, P. Winternitz, R.I. Yamilov, Lie point symmetries of differential-difference equations. J. Phys. A 43 (29): 292002, 14 pp., 2010. [20] P. Winternitz, Symmetry preserving discretization of differential equations and Lie point symmetries of differential-difference equations. Symmetries and integrability of difference equations. Edited by D. Levi, P. Olver, Z. Thomova and P. Winternitz. Cambridge University Press, Cambridge, pp. 292-336, 2011. [21] G. R. W. Quispel, H. W. Capel, R. Sahadevan, Continuous symmetries of differential-difference equations: the Kac-van Moerbeke equation and Painlevé reduction. Phys. Lett. A 170 (5): 379–383, 1992. [22] G. R. W. Quispel, R. Sahadevan, Lie symmetries and the integration of difference equations. Phys. Lett. A 184 (1): 64–70, 1993. [23] P.E. Hydon, Symmetries and first integrals of ordinary difference equations. R. Soc. Lond. Proc. Ser. A Math. Phys. Eng. Sci. 456 (2004): 2835–2855, 2000. [24] P.J. Olver, Geometric foundations of numerical algorithms and symmetry. Special issue “Computational geometry for differential equations”. Appl. Algebra Engrg. Comm. Comput. 11 (2001), no. 5, 417–436. [25] C. Ehresmann, Les prolongements d’une variété différentiable. I. Calcul des jets, prolongement principal. C. R. Acad. Sci. Paris 233 598–600, 1951; Les prolongements d’une variété différentiable. II. L’espace des jets d’ordre r de Vn dans Vm. C. R. Acad. Sci. Paris 233 777–779, 1951; Les prolongements d’une variété différentiable. III. Transitivité des prolongements. C. R. Acad. Sci. Paris 233 1081–1083, 1951; Les prolongements d’une variété différentiable. IV. Éléments de contact et éléments d’enveloppe. C. R. Acad. Sci. Paris 234 1028–1030, 1952; Les prolongements d’une variété différentiable. V. Covariants différentiels et prolongements d’une structure infinitésimale. C. R. Acad. Sci. Paris 234 1424–1425, 1952. [26] A. Bourlioux, C. Cyr-Gagnon, P. Winternitz, Difference schemes with point symmetries and their numerical tests. J. Phys. A 39 (22): 6877–6896, 2006. [27] R. Rebelo, P. Winternitz, Invariant difference schemes and their application to sl(2,R) invariant ordinary differential equations. J. Phys. A 42 (45): 454016, 10 pp., 2009. [28] A. Bourlioux, R. Rebelo, P. Winternitz, Symmetry preserving discretization of SL(2,R) invariant equations. J. Nonlinear Math. Phys. 15(suppl. 3): 362–372, 2008. [29] A. González-López, N. Kamran, P.J. Olver, Lie algebras of vector fields in the real plane. Proc. London Math. Soc. (3) 64 (2): 339–368, 1992. 443 Acta Polytechnica 53(5):438–443, 2013 1 Introduction 2 Differential approximations of ordinary difference equations and invariant discretization of ODEs. 3 Equations invariant under the similitude group Sim(2). 4 Equations invariant under a one-dimensional realization of SL(2,R). 5 Equations invariant under a two-dimensional realization of GL(2,R). 6 Conclusions Acknowledgements References