Ruvysta tu Matumatysa: duora y Aplysasyonus 20A5 22(A9 : 2A{30 sympa { usr yssn: AD09-2D33 (Prynt9, 22A5-3373 (Onlynu9 spusyal sovtwaru vor somputynw thu spusyal vunstyons ov wavu satastrophus sovtwaru uspusyal para salsular las vunsyonus uspusyalus tu satastrovus tu olas Antruw c. Kryukovsky∗ Tmytry c. Lukyn† curwuy f. Rowashuv‡ gexeiveyO FAaiAP geviseyO FAaiAP AxxepteyO FAaiA Snpuyty os Insormntvon Systrms nnq Pomputrr arpunoyoty9 Russvnn Nrw bnvvrrsvty9 Rnqvo st.9 229 105005 Mospow9 Russvn. R:mnvy: kryukovskyMrnmoyrr.ru yMospow Instvtutr os Puysvps nnq arpunoyoty 5Stntr bnvvrrsvty)9 Instvtutskvy ynnr F9 1A1D00 Doytopruqny9 Mospow Rrtvon9 Russvn. R:mnvy: yukvnMmnvy.mvpt.ru zMvsmn qvrrppvon qur/same address as N.S. Kryukovsky. R:mnvy: rotnpurvsrrtrvMtmnvy.pom 21 22 a.s. kryukovsky { t.s. lukyn { s.v. rowashuv Avstruwt The method of ordinary differential equations in the context of calculating the special functions of wave catastrophes is considered. Complementary numerical methods and algorithms are described. The paper shows approaches to accelerate such calculations using capabilities of modern computing systems. Methods for calculat- ing the special functions of wave catastrophes are considered in the framework of parallel computing and distributed systems. The pa- per covers the development process of special software for calculating of special functions, questions of portability, extensibility and inter- operability. Kyywords: ODE method; special functions of wave catastrophes; nu- merical methods; algorithms; parallel computing; distributed computing. fysumyn Se considera el me´todo de ecuaciones diferenciales ordinarias or- dinarias en el contexto de calcular funciones especiales de cata´stro- fes de olas. Se describen me´todos y algoritmos nume´ricos comple- mentarios. El art´ıculo muestra enfoques para acelerar tales ca´lculos usando capacidades modernas de sistemas de ca´lculo. Se conside- ran me´todos para calcular funciones especiales de cata´strofes de olas en el marco de computacio´n en paralelo y sistemas distribuidos. El art´ıculo cubre el proceso de desarrollo de software especial para cal- cular funciones especiales, as´ı como asuntos de portabilidad, exten- sibilidad e interoperabilidad. duluvrus wluvy: me´todos de EDO; funciones especiales de cata´strofes de olas; me´todos nume´ricos; algoritmos; computacio´n en paralelo; com- putacio´n distribuida. authymutiws guvjywt Clussi wution: 78A99. 1 IncaoddRcion The theory of wave catastrophes is an important field, which has a direct practical importance in areas such as radiolocation, formation of direc- tional beams in plasma, transfer of data over fiber-optic lines, etc. Meth- ods of the theory of wave catastrophes allow to go beyond the boundaries of the known asymptotic methods in the study of electromagnetic wave propagation. This article describes approaches to numerical calculation of special functions using modern computing systems. The software product based Rev.Mate.Tear.Aplic. ISSN )4(1-2433 (Prinl) 22)--3373 (Online) Vol. 22())2 2){+(, Jan 2()5 somputynw thu spusyal vunstyons ov wavu satastrophus 23 on these methods is planned to be embedded to the information system ”Wave catastrophes in radio physics, acoustics, and quantum mechanics.” 2 O34 mechod Known methods of the theory of wave catastrophes (for example, the con- tour method, summing the Taylor series) are difficult to apply for multi- parameter catastrophes as their complexity increases with the number of parameters [3, 5]. The method of ordinary differential equations is free from these disadvantages [4]. ODEs for a rather small number of catastrophes are derived by hand [7], but, in theory, this can be done automatically. The algorithm can be implemented quite simply using one of the modern packages of symbolic computation (Maxima or Wolfram Mathematica, for example). Dy nition 1 A vextor xonsisting of v fivve xvtvstrophe spexivl funxtion vny v pvrt of its rst yirevvtives is v funyvmentvl vextor of this spexivl funxtion =for exvmpleA funyvmentvl vextor of A+ xvtvstrophe is =F))O W⃗ = (k; k ); k 2); = 3O (1) ihe other yerivvtives of v spexivl funxtion vre uniquely expressey in terms of the funyvmentvl vextor's xomponents fiith the help of linevr vlgewrvix relvtions resulting from the xvnonixvl system of yifferentivl equvtionsC Argues that for calculation of the fundamental vector’s components a system of ordinary differential equations can be derived from the system of canonical equations. The resulting system can be easy calculated by numerical methods like Runge-Kutta or Kutta-Merson. For example, consider the V+ catastrophe (2): kA3(⃗) = ∫ +∞ −∞ zxp(i(x+ + 2x 2 + )x)) yxO (2) The following system of canonical equations corresponds to the catas- trophe described above [4]: () − 4 U 2 U2U) − 2i2 U U) )I = 0; ( U2 U2) − i U U2 )I = 0O (3) Rev.Mate.Tear.Aplic. ISSN )4(1-2433 (Prinl) 22)--3373 (Online) Vol. 22())2 2){+(, Jan 2()5 24 a.s. kryukovsky { t.s. lukyn { s.v. rowashuv The system of ODEs (4) can be derived from the system of canonical equations [4, 2]: yk y) = k ); yk y2 = k 2; yk ) y) = ik 2; yk 2 y) = 1 4 ()k − 2i2k )) ≡ U2); yk ) y2 = U2); yk 2 y2 = − i 4 (k + )k ) + 22k 2)O (4) The set of initial conditions (5) supplements the system: k (0) = 1 2 Γ( 1 4 )zxp( i. 8 ); k )(0) = 0; k 2(0) = i 2 Γ( 3 4 )zxp( i3. 8 )O (5) The method of deriving a system of ODEs can be described by the following steps [4, 6]: • First of all, it is necessary to select the starting point. It may be 2 = 0 and 2 = 0, for example (for V+). • After the selection of the starting point for a future system of ODEs it is needed to determine the components of the vector W⃗ and its length. This can be done by drawing up a table, each row of which corresponds to the function itself or one of its first derivatives, and the columns correspond to the derivatives with respect to each pa- rameter (the table corresponding to the V+ catastrophe (Table 1)). • All components of the table are derivable from the system of canon- ical equations. The table also helps to determine the amount of fundamental vector’s components. 3 NdmeaiRPl mechodb Pnd Plgoaichmb The software solution uses the Kutta-Merson method to calculate special functions with different sets of parameters. This is a method with fourth- order accuracy and step autocorrection [8]. Rev.Mate.Tear.Aplic. ISSN )4(1-2433 (Prinl) 22)--3373 (Online) Vol. 22())2 2){+(, Jan 2()5 somputynw thu spusyal vunstyons ov wavu satastrophus 25 K K) K K2 k (I, I) (I, II) k) (II, I) (II, II) k2 (III, I) (III, II) huvly 1: Table corresponding to the V3 catastrophe. . Consider a system of the form: x˙ = f(t; x)O (6) To integrate the system following formulas can be applied: xn+) = xn + 1 2 (k) + 4k, + k5) +d(h 5); k) = 1 3 hf(tn; xn); k2 = 1 3 hf(tn + 1 3 h; yn + k)); k+ = 1 3 hf(tn + 1 3 h; yn + 1 2 k) + 1 2 k2); k, = 1 3 hf(tn + 1 2 h; yn + 3 8 k) + 9 8 k+); k5 = 1 3 hf(tn + h; yn + 3 2 k) − 9 2 k+ + 6k,)O (7) The local truncation error is expressed by the following formula:  ∼ k) − 9 2 k+ + 4k, − 1 2 k5O (8) There are several criteria to determine how to change the integration step. In the current implementation the step is multiplied by 2 if the local truncation error is less than 5+2E (the specified accuracy of calculation). If the local truncation error exceeds 5E the step must be devided by 2. In the other cases the step is not changed. Studied catastrophes are complex multi-variable systems; to calculate their special functions and visualize the result as a 3D plot it is needed to choose parameters which will be changed discretely, other parameters are assigned to some fixed values. Rev.Mate.Tear.Aplic. ISSN )4(1-2433 (Prinl) 22)--3373 (Online) Vol. 22())2 2){+(, Jan 2()5 26 a.s. kryukovsky { t.s. lukyn { s.v. rowashuv Dutu: Initial parameters of SODE fysult: Set of SODE solutions initialization; for Firsevrvm OR binFirstevrvm C C CbvxFirstevrvmA Firstevrvmhtep do for hexonyevrvm OR binhexonyevrvm C C CbvxhexonyevrvmA hexonyevrvmhtep do prepare the initial vector; ResultVector := KuttaMersonMethod(InitialVector); save the resulting vector for future use; ynd ynd Algorithm 1: Sequential special wave function calculation. The generic sequential algorithm for calculation special functions of wave catastrophes can be expressed with the simple enough pseudocode (Algorithm 1). Usually it is enough to integrate the system from 0.0 to 1.0. It is easy to note that the system can be integrated in the parallel environment by the devision of the set containing descrete parameters’ values to a number of subsets. Integration in these parameter spaces can be performed independently and the results can be merged after the calculation. Thus, the algorithm showed above fits the parallel solution, and does not require any change. On the contrary, the set of input values must be prepared, and each thread in the system must get a separate part of this set. The performance gain can be calculated using the formula (9). Assume c is a number of independent calculating units (cores, processors, network nodes, etc), time of calculation is proportional to )N : iplrlllpl = C ispqupnttll c O (9) 4 PoacPbilich Pnd egcenbibilich One of the main requirements to the software developed in this work is portability and this requirement is refracted in some design solutions assumed in the project. C++ is used as a main programming language: it helps to develop very portable solutions which can be built for many modern architectures like x86, ARM, MIPS, etc. Graphical interface and Rev.Mate.Tear.Aplic. ISSN )4(1-2433 (Prinl) 22)--3373 (Online) Vol. 22())2 2){+(, Jan 2()5 somputynw thu spusyal vunstyons ov wavu satastrophus 27 OpenGL graphics are drown through the FLTK library (very portable and tiny GUI toolkit), network communication and multithreading are based on small self-developed libraries (MS Windows, GNU/Linux and many other Unixes are supported). The software uses a common intermediate representation of float point numbers to communicate between network nodes. Thus, these nodes can use different internal representations and work together in one computing network. To simplify development of extensions the software supports a special domain specific language. ODEs of wave catastrophes can be described in the language and used to calculate these catastrophes. A part of this functionality is still under development. 5 4gPmpleb of eibdPliiPcion The equation of the catastrophe V+ is already described above (2), Figure 1 shows its module. Figury 1: V3, module. 1 = −15 O O O+ 15, 2 = −10 O O O+ 10. Rev.Mate.Tear.Aplic. ISSN )4(1-2433 (Prinl) 22)--3373 (Online) Vol. 22())2 2){+(, Jan 2()5 28 a.s. kryukovsky { t.s. lukyn { s.v. rowashuv Consider the graphical representation of the corner catastrophe V,) (see Figure 2): kA4)(); 2; a) = ∫ +∞ ( ∫ +∞ ( zxp(i(k)z 2 + ayz + k2y 2 + )y + 2z))yy yzO (10) Figury F: V41, phase. 1 = −10 O O O + 10, 2 = −15 O O O + 5, 1 = −1, 2 = 1, = 2xos(4 ). The edge catastrophe K,;2 described by the equation 11 is shown on figures 3 and 4: kK4;2(); O O O ; ,; ) = = ∫ +∞ ( yz ∫ +∞ −∞ yx(i(z2 + x2z + x, + )x+ 2x 2 + +z + ,zx))O (11) Rev.Mate.Tear.Aplic. ISSN )4(1-2433 (Prinl) 22)--3373 (Online) Vol. 22())2 2){+(, Jan 2()5 somputynw thu spusyal vunstyons ov wavu satastrophus 29 Figury 3: K4;2, module. 1 = −8 O O O + 8, 2 = −7 O O O + 7, 3 = −2, 4 = −2, = −1. Figury 4: K4;2, phase. 1 = −8 O O O + 8, 2 = −7 O O O + 7, 3 = −2, 4 = −2, = −1. Rev.Mate.Tear.Aplic. ISSN )4(1-2433 (Prinl) 22)--3373 (Online) Vol. 22())2 2){+(, Jan 2()5 30 a.s. kryukovsky { t.s. lukyn { s.v. rowashuv RefeaenReb [1] Arnold, V.I. (1992) Cvtvstrophe iheory, 3rd edition. Springer, Berlin. [2] Dorokhina, T.V.; Kryukovsky, A.S.; Malyshenko, A.B. (2008) “Devel- opment of numerical algorithms for the calculation and visualization of wave catastrophes”, goscdU WulletinC bvnvgementA Computing vny Informvtixs 3 Russian New University, Moscow: 25–47. [3] Ipatov, E.B.; Kryukovsky, A.S.; Lukin, D.S.; Palkin, E.A. (1986)“Edge catastrophes and asymptotics”, geports of the Axvyemy of hxienxes, USSR, FM1(4): 823–827. [4] Kryukovsky, A.S. (1992)“Method of ordinary differential equations for computing the special functions of wave catastrophes (SWC)”, DiffrvxB tion vny eropvgvtion of Elextromvgnetix lvvesO Intervgenxy CollexB tion of hxienti x evpers, Moscow: MIPT: 29–48. [5] Kryukovsky, A.S.; Lukin, D.S.; Palkin, E.A. (1995) “Uniform asymp- totics and corner catastrophes”, geports of the gussivn Axvyemy of hxienxes 341(4): 456–459. [6] Kryukovsky, A.S. (2013) “The uniform asymptotic theory of edge and corner wave catastrophes”, Monograph, Russian New University, Moscow. [7] Kryukovsky, A.S.; Lukin, D.S. (2003) “The theory of calculating the reference focal and diffraction electromagnetic fields on the basis of special functions of wave catastrophes”, iexhnology vny Elextronixs 48(8), Moscow (in Russian): 912–921. [8] Shampine, L.F. (2005) “Error estimation and control for ODEs”, JourB nvl of hxienti x Computing F5(1): 3–16. Rev.Mate.Tear.Aplic. ISSN )4(1-2433 (Prinl) 22)--3373 (Online) Vol. 22())2 2){+(, Jan 2()5