Open access peer-reviewed chapter

Simulation of a Mathematical Model of an Aircraft Using Parallel Techniques (MPI and GPU)

Written By

Peter Kvasnica

Submitted: 04 May 2022 Reviewed: 24 May 2022 Published: 13 July 2022

DOI: 10.5772/intechopen.105538

From the Edited Volume

Aeronautics - New Advances

Edited by Zain Anwar Ali and Dragan Cvetković

Chapter metrics overview

104 Chapter Downloads

View Full Metrics

Abstract

This chapter is focused on creation, accuracy, and simulation of two-parameter control of a mathematical model of motion of aircraft in a flying simulator. We are discussing many of the important advances in applied aircraft modeling. Modeling on various computer architectures (central, distributed, parallel) has an impact on a structure of a mathematical model of aircraft. An important part is the way of description of a numerical method and its accuracy, use of distributed memory system, and shared memory system are presented in the chapter. Motivation of this research is implementation of the general-purpose message passing interface and graphics processing units as inexpensive arithmetic-processing units bring a relevant amount of computing power to desktop personal computers. The chapter is focused on exploitation of parallel techniques of simulation features, computation time of parallel methods of implementation, and improved simulation of a continuous mathematical model of aircraft motion in a flying simulator. The use and application of modeling methods and parallel simulation techniques determine the structure of the mathematical model used in the flying simulator. The effectiveness of our solution is confirmed by providing simulation results obtained by two-parameter control of the mathematical model of aircraft motion.

Keywords

  • mathematical model
  • block structured model
  • message passing interface
  • parallel architecture of modeling
  • graphics processing unit

1. Introduction

Mathematical models are mostly used in natural sciences (physics, chemistry, earth science) and engineering disciplines (computer science, biological science, genetic engineering), as well as in social sciences. Substantial stages of implementation (creation, design, simulation, and visualization) of a continuous mathematical model of aircraft motion in a flying simulator were described in many papers. The one-parameter control of a distributed mathematical model of motion of aircraft with all phases of implementation in a flying simulator was described in the published paper [1, 2].

Motivation of this research is using a mathematical model of an object, which in practice and the real world often can be determined analytical otherwise. For this reason, it is necessary to design mathematical models characterized for this problem statement. The more accurate the mathematical model of the object we create, the more accurate the results of its simulation.

The mathematical model of motion of aircraft can be simulated using central computer architecture, which can be based on single-processor systems. The simulation of structured mathematical model of an aircraft can be implemented using central computer architecture, a distributed memory system (DMS) using a message interface (MPI) architecture; they are identified as node computers or shared memory system (SMS) and graphics processing unit (GPU) architectures [3]. The parallel computer architecture may be based on multiprocessors; each processor has a multicore architecture. Multiprocessor systems are computationally more efficient than such systems compared with the central computer architecture, see [4].

As known from specialized literature, creation of mathematical models of motion of aircraft consists of the following phases: definition of a physical base for creation of a mathematical model, selection of notation of a mathematical model, implementation of a mathematical model and others. The Laplace transformation, computation of parameters of aircraft for a selected flight phase, determination and computation of coefficients, numerical integration, programming, and simulation on a computer, etc. are used in our problem statement and proposed solution.

According to current knowledge, the effort made to create mathematical models of motion is aimed at improvement and extension of a field of view of simulation of mathematical models on the different computer architectures. The solution of large and complex mathematical models of aircraft problems leads to considerable demand for parallel computing and strategies [5]. We can confirm the most frequent use of the following phases: creation, design, implementation, and simulation of mathematical models. The parallel computing tools guarantee an impressive reduction of computing time [6].

A block structure mathematical model of motion of aircraft can be integrated numerically using parallel computer architecture. This architecture can be motivation for using a central processing unit (CPU)-based implementation with multiprocessor systems and a graphics processing unit (GPU); see [7]. Likewise, a computer system fitted with a GPU accelerator and a software application designed and created for this architecture is also suitable for simulation of a block mathematical model of aircraft motion. From our point of view, the following three principles are important for proposed solution:

  • representation by solution architecture, i.e., the migration of codes of a mathematical model of motion of aircraft toward parallel computers.

  • low-cost distributed platforms, combined suitable software tools that open very demanding perspectives.

  • use GPU to speed up calculations.

Accordingly, in the chapter, we explain how to implement a compute unified device architecture (CUDA) algorithm of computation of a block structure mathematical model of motion of aircraft so as to achieve peak speed. The efficiency is demonstrated by discussing two-parameter control of aircraft, throttle control stick (fuel supply), and aircraft elevator control stick (angle of attack).

Advertisement

2. Description of aircraft mathematical model

The unstable characteristics such as aero elasticity impact, fuel density, changing geometry of aircraft, and some other parameters support complexity of our design mathematical models in simulation. The mathematical models of motion interact with intervening pilot’s control of aircraft and real equipment respond to the pilot’s interventions, data on equipment the flying aircraft are observed by the pilot. We can use a continuous simulation method to solve differential equations in mathematical models of motion of aircraft created this way. Aerospace engineers often use Newton’s laws of motion in design and creation of a mathematical model of motion of aircraft described by differential operators.

According to Newton’s third law, there is always the same opposite reaction to every action, or the interaction of two bodies on each other always leads to opposite parts. The basic system of equations has the form [8]:

ẋ1+fix1xnu1umξ1ξγ=0,i=01pE1

where x1, …, xn are object coordinates, u1, …, um are elements of control, and ζ1, …, ζγ are failure functions. The problems of simulation and synchronization of mathematical models on computers is know, where the accuracy of a linear motion model is used [9]. The accuracy between the transient response results of nonlinear mathematical models compared with linear mathematical models from in terms of human accuracy can be neglected [10].

2.1 Equations numerical integration of mathematical model

The proposed solution based on the presented analysis of the state model space does not contain any discontinuity in either fi(x, u, t) or in any of higher derivatives, xi(t) itself is a continuous function of time. Currently used methods of numerical integration are used to find numerical approximations to solutions of ordinary differential equations (ODEs). The name, also known as numerical integration, represents a broad family of algorithms for calculating the numerical value of a particular integral. The methods of numerical integration can generally be described as combining evaluations of the integrand to get an approximation to the integral. The integrand is evaluated on a finite set of points called integration points, and the weighted sum of these values is used to approximate the integral [11]. This method of calculation is often used for polynomial functions, and these are suitably used on computers. Our proposed solution deals with creation of such functions, i.e., integration of mathematical models.

Two most basic algorithms, Euler (forward and backward) and Taylor series, are motivation for this research in our solution for numerical integration. A numerical stability domain is introduced as a pillar to characterize an integration algorithm and a general procedure to find the numerical stability domain of any integration scheme, see [11]. The mathematical model in state space has the following form:

ẋt=fxtutt,E2

where x is a state vector, u is an input vector, and t represents time, with a set of initial conditions:

xt=t0=x0.E3

Let xi(t) represents the ith state trajectory as a function of simulated time t. As long as the state-space model does not contain any discontinuity in either fi(x, u, t) or any of higher derivatives, xi(t) is itself a continuous function of time. Such function can be approximated by any desired precision by a Taylor series expansion of any given point along its trajectory. Let t* denote a point in time, about which we wish to approximate the trajectory using Taylor series, and let t* + h be the point in time, at which we wish to evaluate the approximation [11]. The trajectory at that point can then be given as follows:

xit+h=xit+dxitdth+d2xitdt2h22!+.E4

Different integration algorithms differ in how they approximate the higher-order derivatives and in the number of Taylor series members that they take into account in the approximation [10].

If the term n + 1 of the Taylor series is considered, the approximation accuracy of the second derivative d2xi(t*)/d2t = dfi(t*)/dt should be of order n − 2, since this factor is multiplied by h2. The accuracy of the third state derivatives should be of the order n − 3, since this factor is multiplied by h3, etc. In this way, the approximation is correct up to hn. N is therefore called the approximation order of the integration method, see [11].

Many engineering simulation applications require a global relative accuracy of approximately 0.002. If the local integration error is of size el, then the per-unit-step integration error assumes the value of ep.u.s = el/h. The global integration error is proportional to the per-unit-step integration error, as long as the integration error does not accumulate excessively across multiple steps.

In accordance with the previously made observation, this corresponds to an algorithm with an approximation order of h4 for the local integration error. We should require, for example, a local accuracy of 0.0001 [11]. In a digital computer, a real number can only be represented with a finite precision, 32-bit numbers, and double precision for 64-bit numbers. This type of error is called round-off error. It occurs in one of the two main general formats that have become common and called floating point. The most common problems due to a rounding error occur when multiple steps are rounded in each step.

Advertisement

3. An appropriate structured mathematical model of motion in state space

These practical requirements are determined to using linear models in a process of analyzing general processes [12]. For writing of mathematical models of motion of aircraft in a simulator, we can use state-space description. We define a linear controlled unobserved dynamic system based on the current state, see [13]:

ẋt=Axt+But,yt=Cxt,xt=x0E5

where A, B, C, x, u, and y have dimensions (n x n), (r x n), (l x n), (n x l), (m x l), and (r x l) are defined matrices, see the description of items [2]. The task easier that we will focus on the control object, the first and second equation from the system (5) can have a general shape:

ẋ=Ax+Bu,y=Cx.E6

Eq. (6) in matrix form represents a complex aircraft dynamic system of a mathematical model of aircraft motion comprising in a process of simulation of 11 state variable sensors of information, 18 state variables-coordinates of performing elements in the system. These are two parts and the remaining 38 state variables are divided into variables that represent unmeasured noise and sensor disturbances [9]. The differential equations of mathematical model of aircraft motion have two-parameter control the form [14]:

ΔV̇+axVΔV+axαΔα+axθΔθ=axδMΔδMΔθ+ayVΔV+ayαΔα+ayθΔθ=ayδMΔδVΔω̇z+amzVΔV+amzαΔα+amzα̇Δθ+amzωzΔωz=amzδVΔδVΔυ=ωz,Δυ=Δθ+Δα.E7

Four parts represent a state matrix of mathematical models of motion of aircraft expressed by the state vector n = 4. Coefficients ci and ej represent aerodynamic parameters, their computation, in accordance with (Eq. (7)), we get [14]:

ΔV̇+axVΔV+axαΔα+axθΔθ+axHΔH=axδMΔδMΔθ+ayVΔV+ayαΔα+ayθΔθ+ayHΔH=ayδMΔδVΔḢsinθ0ΔVcosθ0ΔV=0;Δυ̇=ωz,Δυ=Δθ+Δα.E8

Items ΔV, Δα, Δθ, ΔH, ΔδM, and ΔδV are defined in [2]. The following items: aVx ΔV, aαx Δα, aθx Δθ, aHx ΔH for flight speed ΔV, aVy ΔV, aαy Δα, aθy Δθ, aHy ΔH for thumb angle, and other parameters of aircraft motion. Transfer functions have the form [14]:

ΔVs=GV/δMsΔδMsGV/δVsΔδVsΔαs=Gα/δMsΔδMsGα/δVsΔδVsGV/δMs=axδMΔ11/Δ;GV/δVs=ayδMΔ21/Δ+amzδVΔ31/Δ;Gα/δMs=axδMΔ12/Δ;Gα/δVs=ayδVΔ22/Δ+amzδVΔ32/Δ.E9

where Δij is the subdeterminant of the ith row and the jth column. Our problem and the proposed solution are described in the following. The first member (Eq. (9)) of the system is employed to describe the change of the aircraft speed ΔV; also the equation describing displacement of the speed aircraft depending on the displacement of throttle engine lever GV/δM (s) and the displacement of elevator angle GV/δV (s) is employed. The items of second (Eq. (9)) describe the change of aircraft attack of angle of the system Gα/δM (s) and Gα/δV (s). The third row of the system (Eq. (9)) defines how to compute these changes of two parameters for a change of aircraft speed, and fourth row of the system (Eq. (9)) defines how to compute these changes of two parameters for a change of an aircraft angle of attack. For the meaning of coefficients aδMx, aδMy, aδVy, aδVmz and ij(s), see the paragraph after (Eq. (20)). In our problem solution, the flight of the aircraft is steady and without any random interferences (wind, storm, or other outer interferences) [12].

3.1 Structure-defined mathematical model of an aircraft motion in a simulator

At present, matrix notation of a mathematical model in the state space, which we mentioned in the previous section, is very often used. We should express the first equation from (Eq. (6)) next [15]:

ẋ1ẋ2ẋ3ẋ4=a11a12a13a14a21a22a23a24a31a32a33a34a41a42a43a44x1x2x3x4.E10

The described solution is relatively simple due to description of the analyzed system using equations (Eq. (10)), see [5] for more. Let us divide the mathematical model of aircraft motion into four subsystems. The first will be a subsystem of state variable sensors, the second and third will be subsystems of power elements (two systems), the fourth will measure noise and system faults. Thus, the subsystems have the order n1 = 1, n2 = 1, n3 = 1, n4 = 1. The state space is divided into four parts:

x=x1x2x3x4T=x1x1x1x2x1x3x4x4,E11

where xixj represent the items of a state vector. If i represents order relevancy n, i.e., the number of the subsystem, then j – stands for sequential number of the item in the given subsystem. The research architecture of the discussed system matrix A in the state space can be formed after multiplying the following shape, see [15]:

ẋ11=a11x1x1+a11x1x2+a11x1x3+a11x1x4,ẋ12=a12x1x1+a12x1x2+a12x1x3+a12x1x4,ẋ44=a44x1x1+a44x1x2+a44x1x3+a44x1x4,E12

Then we divide 16 subsystems into four parts called isolated subsystems. The above decomposition process is performed by matrix and vector operations. The sixteen blocks A11, A12, …, A43, A44 of matrix A are marked in the order, where:

ẋ11=A11x11+A11x12+A11x13+A11x14,ẋ12=A12x11+A12x12+A12x13+A12x14,ẋ44=A44x11+A44x12+A44x13+A44x14.E13

The mathematical description of isolated subsystems has then the following form:

ẋ1=A11'x1,ẋ2=A22'x2,ẋ3=A33'x3,ẋ4=A44'x4,E14

where:

A11'=A11A12A13A14,A22'=A21A22A23A24,A33'=A31A32A33A34,A44'=A41A42A43A44.E15

The mutual relations between the first and second isolated subsystems are described by l12(x) meaning that the equation of the first and second isolated subsystem is:

l12x=A11'x1x200=A11A12A13A14Tx1x200.E16

The state of solution method is known and well described in the reference [5]. The capability of being decomposed can be calculated by means of incidental matrices that can be utilized in cases when the mathematical model of the system is defined. The units in random matrix are positioned as its elements are permuted or transformed so that they can be placed diagonally.

Advertisement

4. Structured mathematical model of speed and angle of attack aircraft in a flight simulator

Current computer technologies allow formulation and solutions to a new intricate problem, which depends on construction of structured mathematical models of aircraft and methods of their solution. Achieving an accurate solution to this problem requires simultaneous solution of the whole complex of physical and geometric problems, which is based on considerable computational resources [16]. Our proposed solution is supported by the above approach, where there are, complex requirements for properties and parameters affecting the design process of a structured mathematical model of aircraft motion on computers.

To create a system of differential equations, it is necessary to know the aerodynamic coefficients, mathematical model of aircraft systems, and other parameters of the aircraft [1, 2]. The contribution in Laplace transform creates a structured mathematical model of aircraft motion in a flight simulator, see [5, 15].

Action of an aircraft elevator control stick angle and throttle control stick displacement on aircraft motion—two control parameters (Figure 1) are discussed below. Figure 1 is a block diagram of already mentioned two-parameter control of a structured mathematical model of motion of aircraft on a flight simulator, which will be the subject of research.

Figure 1.

Block diagram of a structured mathematical model of control of aircraft motion – speed and angle of attack.

The process of simulation experiments requires finding solutions for individual tasks defined at the beginning of the previous subchapter. The simulation program expresses the time factor in the form of an explicit simulation time and changes the state of model. Two opposite methods of working with simulation time are implemented in the programming technique. In the constant time step method, it is necessary to select a constant real-time interval, which is considered as a unit of simulation time. The structured mathematical models of all simulators need to process the simulation run—the simulating step during this time unit (Figure 2).

Figure 2.

Parallel simulation algorithm of simulators’ models.

4.1 Structure-defined mathematical model of the aircraft speed in a flight simulator

The input values are represented by a change of an aircraft elevator control stick angle and a throttle control stick of engine. The values are adjusted as required and forwarded to the input of the structured mathematical model of aircraft motion-speed. The aircraft speed displacement equation ΔV(s) defines a change in fuel supply and the change in the aircraft elevator angle [14]:

ΔVs=GV/δMsΔδMsGV/δVsΔδVs,E17

where GV/δM (s) defines a mathematical model of speed—transfer function for fuel supply, ΔδM (s) is an input function for fuel supply in Laplace transform, GV/δV (s) is a mathematical model of speed—transfer function for an aircraft lift, and ΔδV (s) means the input function of an aircraft pitch angle in the Laplace transform. Derivation of equations of a structured mathematical model of speed increment is a suitable description of the problem. Information about mathematical solution of these equations is known [13]. The expression A=s4+1.134s3+62.798s2+28.659s+4.093, is the same in all equations. The items for l12(x) defined by the Eq. (16) are as follows:

A11=5s3+1.12s2+62.782s+25.32A,x1=ΔδMs.E18
A12=0.119.81s+620.9730.429.81s10.006A,x2=ΔδVs.E19

In Eq. (17), GV/δM (s) is the mathematical model of aircraft speed (a transfer function) depending on the fuel supply, δM(s) is the fuel supply, GV/δV (s) is a mathematical model of aircraft speed depending on the elevator angle, δV(s) is the aircraft elevator angle. The mathematical model of aircraft speed in the longitudinal direction, the fuel supply, and angle of attack can be determined, see [14]:

GV/δMs=axδMΔ11Δ,GV/δVs=ayδVΔ21ΔamzδVΔ31Δ,E20

where aδMx is a speed coefficient with respect to the fuel supply, aδVy is a pitch coefficient with respect to the elevator angle, aδVmz is the coefficient of the speed angle with respect to the elevator angle, (s)—a determinant of the transfer function, ∆11(s), ∆21(s), ∆31(s)—algebraic additions to the determinant ∆(s), see paragraph (Eq. (9)). The fuel supply transfer function (Eq. (17)) can be calculated using the following equation:

ΔVV/δMs=GV/δMsΔδMs=5s3+1.12s2+62.782s+25.32s4+1.1338s3+62.7975s2+28.6585s+4.09291ΔδMs.E21

The transfer function of the elevator (Eq. (17)) is given by:

ΔVV/δVs=GV/δVsΔδVs=0.119.81s+620.9730.429.81s10.0062s4+1.1338s3+62.7975s2+28.6585s+4.09291ΔδVs.E22

4.2 Structure-defined mathematical model of the angle of aircraft attack in a flight simulator

From description angle of aircraft attack Δα(s), we can derive that the equation of angle of aircraft attack displacement defines a change aircraft throttle control (of fuel supply) and a change in the angle of aircraft elevator [10]:

Δαs=Gα/δMsΔδMsGα/δVsΔδVs,E23

where stability determined by zeroes of a characteristic equation is used as a numerator in the structured mathematical model of aircraft motion; see [2]. Next, we define permutation and transformation with regard to (Eq. (16)) and have coefficients for l21(x):

A21=50.002s20.252s0.1A,x1=ΔδMs.E24
A22=0.11s3+0.886s2+0.0124s2.4530.42s20.414s0.025A,x2=ΔδVs.E25

The equations Eq. (18) and Eq. (24) will use a step change of throttle control stick (fuel supply) in Laplace transformation ∆δM (s) = 1/s. Eqs. (19) and (25) will use a step change of aircraft elevator control (angle of attack) in Laplace transform ∆δV (s) = 1/s. The problem statement of a mathematical model of motion in a flying simulator is conditioned by identification of its stability. The roots of the characteristic equation, the denominator equation (Eq. (18)), (Eq. (19)), (Eq. (24)) and equation (Eq. (25)), see [1].

In Eq. (17), Gα/δV (s) is the calculated mathematical model angle of aircraft attack (a transfer function) depending on the fuel supply, δM(s) is the fuel supply, Gα/δV (s) is the calculated mathematical model angle of aircraft attack depending on the angle of the elevator, δV(s) is the angle of the elevator. A mathematical model of an angle of aircraft attack in the longitudinal direction, fuel supply, and the angle of attack can be determined; see [14]:

Gα/δMs=axδMΔ12Δ,Gα/δVs=ayδVΔ22ΔamzδVΔ32Δ.E26

The transfer function of fuel supply (Eq. (23)) can be calculated using the following equation:

Δαα/δMs=Gα/δMsΔδMs=50.002s20.2518s0.1s4+1.1338s3+62.7975s2+28.6585s+4.09291ΔδMs.E27
Δαα/δVs=Gα/δVsΔδVs=0.11s3+0.886s2+0.0124s2.4530.42s20.414s0.025s4+1.1338s3+62.7975s2+28.6585s+4.09291ΔδVs.E28
Advertisement

5. Visualization of results of parallel simulation of mathematical models

Initial or limiting restricting conditions in the given flight phase affect the form of equations of the system depending on which phase of aircraft motion they are calculated [17]. Visualization of results has an impact on quality simulation and simulation tries to obtain the information about the properties of a real system by means of an experiment, the so-called simulation model [18]. “Computer simulation of flying simulator is employed as enlargement or replacement of a structured mathematical model of aircraft motion for which an analytical solution is difficult of even impossible. [19]”.

The sequential program of the mathematical model program is characterized by the equations of simulation of aircraft motion in a single computer time in equidistant moments. The disadvantage of this method is the limitation of the power of the processor, which calculates mathematical models of aircraft motion [20]. For presentation of more accurate simulation results, we need a higher-quality simulation system and a visualization generator providing artificial surrounding of required quality; this surrounding is a three-dimensional scene, see Figure 3.

Figure 3.

Principle of a pilot’s activity and its visualization in a projection system.

The first term according to Eq. (17) or Eq. (23) represents the transfer function (structured mathematical model of aircraft motion) of speed displacement shift depending on the fuel supply of the aircraft and transfer function (structured mathematical model of aircraft motion) of the angle of attack depending on the aircraft fuel supply. In the polynomial expression of the transfer function, we derive the following form for the transfer function of increase in speed calculated from the change in fuel supply in meters per second and calculated displacement angle of attack shift depending on fuel supply in radians:

GV/δMsΔδMs=5s3+1.12s2+62.782s+25.32AMs.E29
Gα/δMsΔδMs=50.002s20.252s0.1AMs.E30

If displacement of the speed is considered in Eqs. (29) and (30) and this is conditioned by the step of change in fuel supply (unit step).

The second member according to Eq. (17) or Eq. (23) represents the transfer function of the speed increment depending on the angle of the aircraft elevator and represents the transfer function of the angle of attack depending on the angle of the aircraft elevator. In polynomial expression of the transfer function, we derive the following form for the transfer function of the increase in speed calculated from the change of aircraft elevator in meters per second and of calculated displacement of angle of attack from the aircraft elevator in radians:

GV/δVsΔδVs=0.119.81s+620.9730.429.81s10.006AVs.E31
Gα/δVsΔδVs=0.11s3+0.886s2+0.0124s2.4530.42s20.414s0.025AVs.E32

The displacement of the elevation is considered in the Eq. (31) or Eq. (32) respectively, and this is conditioned by the step of elevator angle (unit step). The design and compilation of processes of a structured mathematical model of aircraft motion movement in the fuel supply to aircraft engines and angle of the aircraft elevator must be accurate. The simulation in our solution takes 30 s, and the intermediate data is sent in periodical time to the processor’s core or node processing recorded simulated data and creating a graphical form of calculated results after the end of simulation.

5.1 Parallel simulation of a structure-defined mathematical model of an aircraft using MPI

The sequential program of a mathematical model program is characterized by the calculation of equations in a single computer time. The code operations are performed sequentially in that order. The disadvantage of this method is the energy consumption of the processor that counts the models [20]. The state of the art of parallel system based on the standard MPI can be introduced as the first one.

5.1.1 Principle of parallel message passing interface

The simulation parallel program computers in distributed computer systems are referred to as node computers [21]. They usually consist of a primary message input queue, one or more equivalent processors, and necessary equipment for communicate over the interconnectors. The threads operate in either serial or parallel modes.

The MPI facilitates this approach by providing many ways to call open-source industrial MPI implementations such as MPICH and LAM-MPI. The send/receive commands are implemented to change messages in the source code application and are added to run on nodes. We use two basic functions to send and receive messages [22]:

  • MPI_Send (parameters)

  • MPI_Recv (parameters).

5.1.2 The program application created using MPI

There are n nodes, which consist of the processor Pi and the local memory Mj. The nodes communicate with each other using lines and an interconnection network. When executing a given program, the program is divided into concurrent processes, each of which is executed in a separate processor. This simultaneous execution of the same task on multiple processors is used to obtain results faster.

Distributed architecture was realized as connection of five nodes: one is a central computer, and the others are computing nodes (Figure 4). One node (N1) is designed as a central computer, and the others are computational nodes, and each of them computes only one mathematical model. The MPI provides alternative methods for communication and movement of data among multiprocessors. There is no global memory, it is necessary to move data from one local memory to another by means of message passing [23].

Figure 4.

Message passing interface – architecture, Ni – node-computer, Pi – processor, Mi – local memory.

Where the MPI_Send() function on a side of the sender is responsible for sending messages. The corresponding MPI_Recv() function is inserted into a target process to receive messages. The simulation takes 30 seconds, and the intermediate data are sent in periodical time to the node that presents the received data in a graphical form.

5.1.3 The distributed modeling

The implementation MPICH2 is a portable, high-performance implementation of the entire MPI-2 standard and consists of a library of routines that can be called from the program. The TOOLKIT is an integrated set of tools that supports measurement, analysis, assignment, and presentation of application performance for sequential and parallel programs [24].

As follows from the expression, the structured mathematical model of aircraft defined by Eq. (18)A11 *x1 is simulated by the computer N2 on the second node, (Eq. (19)) A12 *x2 is simulated by the computer N3 on the third node, structured mathematical model of aircraft defined by Eq. (24)A21 *x1 is simulated by the computer N4 on the fourth node, and Eq. (25)A22 *x2 is simulated by the computer N5 on the fifth node.

From the graphical output of the central node, we get Figure 5 as a result of the simulation. The simulation of a structured mathematical model of aircraft motion using a flight simulator cluster technology is done according to Eqs. (18) and (19) or Eqs. (24) and (25).

Figure 5.

Simulation results of (Eq. (18)) – upper left, (Eq. (19)) – upper right, (Eq. (24)) – bottom left, (Eq. (25)) – bottom right.

5.1.4 Simulation results from MPI

The simulation results are in Figure 5, the upper left figure shows a graphical presentation of the aircraft speed increase depending on the fuel supply, and it is equal to 31.0192 [m/s], it is identical to the figure in Figure 6. The figure on the top right shows the aircraft speed increment depending on from the elevator, and it is equal to −15.6142 [m/s]. The figure at the bottom left shows a graphical representation of the increment angle of the aircraft attack depending on the fuel supply and is equal to −0.1237 [rad], it is identical to the presentation in Figure 7. The figure at the bottom right shows the increment angle of the pitch depending on the rudder and is equal to −0.0714 [rad]. The simulation time is set depending on the value of the integration error, which is less than 0.002 with these distributed simulation methods.

Figure 6.

A block diagram of simulation of a mathematical model of aircraft motion on the GPU computation.

Figure 7.

GeForce 560 GPU block scheme of Streaming Multiprocessors (SM), Load (LD), Store (ST), Special Function Unit (SFU).

Modeling of the parallel aspect of the decomposed flight simulator subsystems in the form of mathematical notation was performed in accordance with Eqs. (18) and (19) or Eqs. (24) and (25). The strengths of this model are the combination of both the advantages: efficiency (memory savings) and ease of programming of a shared-memory method and scalability of a distributed-memory method.

5.2 Parallel simulation of a structure-defined mathematical model of an aircraft using GPU

Computer simulation a structured mathematical model of aircraft motion is used for modeling of aircraft characteristics in such cases [25]. The numerical integration must be available in real time, in single computer time in equidistant moments. The above, two-parameter control of a block structured mathematical model of motion is performed by controlling the throttle lever of the engine and throttle rudder, which cause a change in the movement of the aircraft and the angle of attack of the aircraft. Parallel codes running on GPU hardware can yield results equivalent to the performance of dozens of traditional CPUs.

Input of block mathematical model represents control values of block structured mathematical model of aircraft motion—the fuel supply or the elevator angle. Output of block mathematical model represents simulated values of block structured mathematical model of aircraft motion—the speed or the attack angle. A given system can simulate multiple computers or processors. When several processors of a simulator system are connected (Block1, Block2, …, Blockn), they communicate with each other via SMS; see Figure 8.

Figure 8.

Outline of a revised host code ComputeFlightGPU ()

Control values of block structured mathematical models of aircraft motion—fuel supply and an aircraft elevator angle represent an input in a block diagram and an output in a block diagram, next figure.

5.2.1 Approach to CPU block mathematical model of an aircraft

The GPU blocks (Block1, Block2, …, Block4) count and each of them numerically counts only one block of the mathematical model of aircraft motion. According to our solution, the algorithm of the block structured mathematical model of aircraft motion is the most suitable for implementation in a GPU-enabled manner [2, 26].

In proposed solution, CPU system communicates with GPU by means of an SMS. The CPU is designed with fewer processor cores that have higher clock speeds, allowing them to complete series of tasks very quickly. The CPU is the brain of operation that is responsible for providing instructions to the rest of system. On the other hand, a GPU has much larger number of cores and is designed for a different purpose; it has parallel processing architecture that allows it to perform multiple calculations across streams of data simultaneously. The GPU has a massive parallel architecture consisting of thousands of smaller, more efficient cores [26].

5.2.2 Achievements of implementation of structure-defined mathematical models of an aircraft using CUDA

In our solution, the user can monitor the simulation process in real time using the GPU (Figure 9). Parallel simulation is one of the areas of simulation optimization and global optimization, which are implemented by the method of estimating the differences between continuous and discrete versions. The division of the structured mathematical model of aircraft motion into blocks is the motivation of this research with the definition of the relationships between the created blocks of the mathematical model.

Figure 9.

The CUDA kernel of BlockSimulationModelGPU() function.

The design of a block structure of mathematical model of aircraft motion is realized by various methods of simulation software systems, and one of them is CUDA computing. The application programming interface (API) improves computing performance with a graphics card for numerical calculation in simulations, and it is standardized layer that allows applications to take advantage of software or hardware services and features. The CUDA includes C/C++ software development tools, function libraries, and a hardware abstraction mechanism that hides the GPU hardware from developers [22].

5.2.3 Basic software solution of computation on the GPU

The ComputeFlightGPU (…) function is essentially an outsourcing agent that sends input data to the device, activates the execution of the simulation on the device, and collects the results from the device [28]. To perform a simulation of a block structure mathematical model of aircraft motion on a GPU core, the programmer musts allocate the required memory by calling the cudaMalloc (…) function on the device. To transfer the relevant data from the host memory to the allocated device memory, we call cudaMemcpy (…) function, see Figure 10—Part 1.

Figure 10.

Screenshot of simulation results based on (Eq. (18)), horizontal axes – time, vertical axes – speed increment.

After completing the simulation, the programmer must transfer results from the device memory back to the host memory by calling function cudaMemcpy (…) and free the device memory by calling function cudaFree (…), see Figure 10 – Part 3. The CUDA kernel provides API simulation functions running as programmer-defined functions [27]. This core function determines the function of the block structure mathematical model of aircraft motion to be performed by all threads during the parallel simulation phase, see Figure 10—Part 2.

Parallel programming in C/C++ supports a CPU computer and the GPU card supports programming in C [28]. The inner loop in the CUDA implementation disappears, because the ComputeFlightGPU calculation is performed in parallel by CUDA threads, see previous figure. Our presented solution was simulated on a personal computer that consists of a CPU Intel Quad Core Q9650 processor with 4 cores, 3.00 GHz each, cache 12 MB L2, bus speed 1333 MHz (FSB), 4GB RAM DDR3, and GPU accelerator NVIDIA GeForce GTX 560 Ti.

The first thing to notice is the __global__ keyword, see Figure 11. This simply means that this function can be called either from host computer or the CUDA device. Each thread runs the same block mathematical model of aircraft motion, so the only way to differentiate yourself from other threads is to use their threadIdx and your blockIdx [29].

Figure 11.

Screenshot of simulation results based on (Eq. (24)), horizontal axes – time, vertical axes – angle of attack increment.

The index in the thread array is calculated and determined by the block and thread ID. Each thread uses its own threadIdx.x and threadIdx.y to identify the elements of a block mathematical model of aircraft motion defined by the system of equations (Eq. (17)) and (Eq. (23)). The expression blockIdx.y ˟ 2 ˟ 2 equals the number of threads in all grid rows above the current thread position. The expression blockIdx.x ˟ 2 equals the number of all columns in the current grid row. Finally, threadIdx.x equals the number of threads above the current block.

The function BlockSimulationModelGPU() calculates a unique ID in the Idx register variable, which is then used as an identifier in the array and in the aircraft motion simulation calculation model.

5.2.4 Simulation results from CUDA

As follows from the expression, the block of the structured mathematical model of the aircraft is defined by Eq. (18)A11 *x1 and is simulated by the GPU block Block1, the block structure of the mathematical model of the aircraft is defined by Eq. (24)A21 *x1 and is simulated by the GPU block Block2. From the obtained graphical output, Figures 6 and 7, which are the results of the numerical integration of the block structure of the mathematical models of aircraft motion.

Graphically, the course of Figure 6 shows the increase in aircraft speed as a function of fuel delivery not exceeding 31.0174 [m/s]. Figure 7 shows the angle of increment of the aircraft attack as a function of the change in the position of the rudder, at which it does not exceed −0.1247 [rad].

The CUDA memory model consists of different memory spaces, which differ significantly in latency times [30]. Results from comparing of the simulation of block structured mathematical model of aircraft motion on the CPU and on the GPU are in Table 1.

Number of block mathematical modelsCPU
Runtime [ms]
GPU
Runtime [ms]
Speed-Up
11,600,0722,72
23,100,1422,01
57,080,3321,74
1013,820,6521,22
2025,371,2420,44
5047,392,3720,02

Table 1.

The performance obtained from simulation different members of the mathematical models of aircraft motion.

In the number of block mathematical models column, the number means the number of block structure of mathematical model of aircraft motion simulated in parallel. The times achieved from the measurement of the simulation of mathematical aircraft models on the CPU are in CPU runtime column and on the GPU in the GPU runtime column. The last column is the acceleration of the calculation on the GPU compared on the CPU.

The table shows the performance acceleration obtained by simulating a different number of block structured mathematical models of motion of aircraft. The columns show the number of block mathematical models, the CPU run time, GPU run time, and acceleration. Decreasing the simulation speed of a block structure of mathematical models of aircraft motion on the GPU with an increasing number of simulated mathematical models is caused by an increasing the time required to read or retrieve data from or to the host computer.

This subchapter presents GPU calculation and CUDA programming with an explanation of how to implement an efficient GPU application. The subchapter aims to offer data obtained by simulating the block structure of a mathematical model of aircraft motion using the GPU. Even a non-optimized parallel implementation of the block structured mathematical model of aircraft motion on the GPU can lead to a significant reduction in computational time compared with the implementation to the CPU.

Advertisement

6. Conclusions

The results from simulation help to overcome the physical and architectural limitations of computational power that can be achieved with a single-processor system. It is then very convenient for the application to use a more powerful processor, a faster cache, and faster access to the RAM with higher transfer capacity. The results obtained in the simulation of structured mathematical models of aircraft motion and the use of this method appear to be effective and pragmatic according to the requirements of the integration algorithm given in the chapter.

In general, in accordance with the proposed solution, it is also possible to run the program faster due to factors such as the availability of better bandwidth for communication within node. Greater bandwidth provides additional communication with the interface to transfer message between nodes and the higher performance of the graphics processing unit.

The described design of a structured mathematical model of aircraft motion to perform simulation on the GPU, this simulation was chosen as an example of an algorithm confirming the proposed solution. The presented problem of simulation methods of block structure of mathematical models of aircraft motion was solved by predetermined known procedures. The advantages of the methods are a combination of both the features: the efficiency of computer system programming and the scalability of a GPU computational method.

Based on knowledge gained in design of the block structure of mathematical models of aircraft motion, we can say that the graphics card can be used in multiple and parallel simulation, which confirms high speed of computations. The advantage of faster simulation can sometimes be obtained at the earliest defined quality. These facts and accuracies are well suited for use in real-time simulation and a virtual reality imaging system. The results of the simulation of such designed structured mathematical model of aircraft motion show very fast calculation and confirm the effectiveness of such a structure of the mathematical model of aircraft for the proposed system of the simulator, which was the motivation of our research.

Advertisement

Acknowledgments

The part of solving the chapter was supported by the Slovak Grant Agency for Science, by the VEGA 4/0330/09 grant.

References

  1. 1. Kvasnica P. Visualization of aircraft longitudinal-axis motion. Computing and Informatics. 2014;33(5):1168-1190
  2. 2. Kvasnica I, Kvasnica P. Accuracy of mathematical models in simulator distributed computing. Computer Modeling in Engineering and Sciences. 2015;107:6
  3. 3. Raeth PG. Parallel MATLAB using standard MPI implementations. In: Proceedings of High Performance Computing Modernization Program Users Group Conference (HPCMP-UGC). 2010. pp. 438-441
  4. 4. Duncan SH, Gordon PL, Zaluska EJ, Edwards SI. Parallel Processing in High Integrity Aircraft Engine Control. Berlin: Springer-Verlag; 1994
  5. 5. Blakelock JH. Automatic Control of Aircraft and Missiles. New York: John Wiley & Sons. Inc; 1991
  6. 6. McCormic BW, Papadakis MP. Aircraft Accident Reconstruction and Litigation. New York: John Wiley & Sons. Inc; 2003
  7. 7. Chapman B, Jost G, Van der Pas R. Using OpenMP - Portable Shared Memory Parallel Programming. Massachusetts, USA: The MIT Press; 2007
  8. 8. Composite authors, Applied mathematics, Part II (in Czech). Praha, Czech Republic: SNTL; 1978. pp. 1158–1161, 1193
  9. 9. Bajborodin JV. Board Systems of Navigation Control (In Russian). Moskva, Russia: Transport; 1975
  10. 10. Rolfe JM, Staples KJ. Flight Simulation. Cambridge, USA: Cambridge University Press; 1986
  11. 11. Cellier FE, Kofman E. Continuous System Simulation. Basic Principles of Numerical Integration. New York: Springer; 2006. pp. 25-32
  12. 12. Driels M. Weaponeering Conventional Weapon System Effectiveness. USA: McGraw-Hill Inc; 2004. p. 155
  13. 13. Clark RN. Control System Dynamics. 2nd ed. New York: Cambridge University Press; 2005
  14. 14. Krasovskij AA. Automatic Systems Control of Flight and Their Analytic Designing (In Russian). Moskva, Russia: Nauka; 1980
  15. 15. Lazar T, Adamčík F, Labún J. Modelling Characteristics of the Aircraft Control (In Slovak). Slovak Republic: University of Technology Košice; 2007
  16. 16. Tereshenko V, One tool for building visual models. Proceedings of Computational Intelligence, Modelling and Simulation, 2009. CSSim '09. International Conference in Brno, Czech Republic; 2009. pp. 59-62
  17. 17. McCormic BW. Aerodynamics, Aeronautics and Flight Mechanics. 2nd ed. New York: John Wiley & Sons, Inc; 1995
  18. 18. Yuan M, Baker J, Brews F, Neiman L, Meilander W. An efficient associative processor solution to a traffic control problem. In: Parallel and Distributed Processing, Workshops and Phd Forum (IPDPSW), 2010 IEEE International Symposium, Atlanta, USA. 2010. pp. 3-8
  19. 19. Stevens BL, Levis FL. Aircraft Control and Simulation. USA: John Wiley & Sons, Inc.; 2003
  20. 20. El-Rewini H, Abd-El-Barr M. Advanced Computer Architecture and Parallel Processing. New York, USA: John Wiley & Sons, Inc.; 2005
  21. 21. Martincová P, Grondžák K, Zábovský M. Programming in Kernel of Operating System Linux. Slovak Republic: University of Žilina; 2008
  22. 22. Huges C, Huges T. Parallel and Distributed Programming Using C++. The Safari Press; 2003
  23. 23. Mmpich2. MPICH2 is a high performance and widely portable implementation of the Message Passing Interface (MPI) standard. [Internet]. 2009. Available from: http://www.mcs.anl.gov/mpi/mpich2 [Accessed: November 08, 2014]
  24. 24. Chevance RJ. Server Architectures: Multiprocessors, Clusters, Parallel Systems, Web Servers and Storage Solution. Burlington, USA: Elsevier; 2005
  25. 25. Adhianto L, Banerjee S, Fagan M, Krentel M, Marin G, Mellor-Crummey J, et al. HPCTOOLKIT: Tools for performance analysis of optimized parallel programs. Concurrency Computatation: Practical Experience. 2010, 2010;22:685-701
  26. 26. Garland M, Le Grand S, Nickolls J, et al. cuda parallel programming model. IEEE Micro. 2008;28:13-27
  27. 27. Kvasnica I, Kvasnica P. Application of CUDA computing principles in automatic flight control simulation. In: Proceeding 8th EUROSIM Congress on Modelling and Simulation, “EUROSIM 2013”. Cardiff, Wales, United Kingdom. 2013. pp. 528-543
  28. 28. Pena AJ, Reano C, Federico S, et al. A complete and efficient CUDA-sharing solution for HPC clusters. Parallel Computing. 2014;40:574-588
  29. 29. Farber R. CUDA Application Design and Development. Elsevier: Morgan Kaufmann; 2011
  30. 30. Kvasnica P. A comparing simulation results of a structure defined mathematical model of aircraft. Archives of Electrical Engineering. 2017;66(4):867-878

Written By

Peter Kvasnica

Submitted: 04 May 2022 Reviewed: 24 May 2022 Published: 13 July 2022