Aerospace Simulations in C++
C.1 Introduction
The simulation examples of this book are provided on the CADAC CD-ROM in FORTRAN. This computer language has had a long and illustrious tradition in the engineering sciences. I did all coding starting in the mid 1960s in FORTRAN II, IV, and 77, until the year 2000, when a cadet from the U. S. Air Force Academy convinced me to give C++ a try. After some exploration I set out to upgrade CADAC to C++. It is not a straight conversion, but rather a complete re-write of the executive, modules, and utility functions, taking full advantage of the language’s polymorphism, inheritance, and encapsulation.
Today, CADAC++ as it is called is a mature trajectory simulation in ANSI/ISO 1998 C++. While teaching graduate courses at the University of Florida in modeling and simulation (M&S), I developed three self-study CD-ROMs that complement this textbook with C++ simulations. The first one, entitled “Building Aerospace Simulations in C++,”1 focuses on the architecture of the simulation framework, and uses simple cruise missile and satellite models to illustrate the interplay between the executive and vehicle functions. The second CD lays the foundation for high fidelity simulations and is entitled "Fundamentals of Six Degrees of Freedom Aerospace Simulation and Analysis in FORTRAN and C++."2 As the title implies it juxtaposes FORTRAN with C++ by dealing with missile and aircraft simulations side by side. At the advanced level, the third CD, entitled “Advance Six Degrees of Freedom Aerospace Simulation and Analysis in C++.”3 treats some of the most difficult topics of aerospace vehicle components like modeling of the elliptical Earth, inertial navigation systems, Kalman filters, global positioning systems (GPS), star trackers, and endo – and exo-atmospheric guidance laws. These three progressively more challenging CDs, this textbook, the CADAC Studio plotting programs, and the solutions manual,4 constitute a complete set of instructions for aerospace vehicle modeling and simulation. A more detailed description of each CD follows, with particular emphasis on their computer simulations.
C.2 C++ Architecture and Three-DoF Cruise Missile Simulation
The first CD, “Building Aerospace Simulations in C++,” introduces the application of C++. It assumes that you have taken a C++ language course and have a good understanding of Chapter 8, “Three-Degrees-of-Freedom Simulation." The lesson plan of the 16 labs is given in Table C. l. The labs are grouped into five training units, of which numbers 2-5 lead to four simulations: satellite, target on the ground, cruise missile, and short-range air-to-air missile. The SRAAM6 is a teaser of things to come. It models a missile/target engagement in six DoF without providing much detail. It is left to CD no. 2 to pick up the story from there with more elaborate discussions.
Table C. l Lesson plan of CD-ROM no. 1 “Building Aerospace Simulations in C++”
|
Each lab discusses an aerospace vehicle component and combines it with a particular C++ feature. The topics become progressively more difficult as the simulations are combined to grow to a full engagement model with cruise missiles attacking ground targets, guided by overhead satellites.
More detail is provided in Table C.2 with references to the sections of this book. To build up to the satellite simulation in Lab 3 we need to cover only two modules: “newton” and “propulsion.” The simulation is called Satellite3 and models a satellite orbiting the Earth with optional rocket propulsion to change its orbital parameters. The equations of motion are based on Newton’s law expressed in inertial coordinates.
In Labs 4 and 5 a simulation is built for targets moving on the surface of the Earth, which is called Target3. Here we are especially challenged by having to include Coriolis and centrifugal accelerations to the equations of motions for the vehicles to hug the surface.
The remaining labs, 5-14, build toward the three-DoF cruise missile simulation Cruise3. Such modules like aerodynamics, turbojet propulsion, guidance, control, and seekers are added to create a complete vehicle.
Finally, in Lab 15 all three types of vehicle objects are combined to build the engagement simulation Cruise3S, which consists of cruise missiles flying toward multiple targets while monitored by overhead satellites. The trajectories of these engagements can be displayed by the plot programs of CADAC Studio from the CADAC CD.
C.3 High Fidelity Missile and Aircraft Simulations
The second CD, “Fundamentals of Six Degrees of Freedom Aerospace Simulation and Analysis in FORTRAN and C++,” introduces high fidelity missile and
Table C.2 Simulation and language features of CD-ROM no. 1
|
aircraft simulations in C++. It does this from a FORTRAN vantage point, based on simulations from the CADAC CD. The FORTRAN modules are converted to C++ and incorporated into the CADAC++ architecture of CD no. 1. A particular appeal of CD no. 2 is the dual language track. You can work either in FORTRAN, C++ or both.
Table C.3 provides an overview. Five training modules encompass 13 labs. As you can see, the emphasis is on modeling the components of aerospace vehicles. Because this CD focuses on aircraft and missiles, the Earth can be assumed to be quasiflat, as discussed in Sec. 3.2.2.7, and it can serve as an inertial reference frame. The individual training units have similar titles as those of CD no. 1, but are more elaborate, because of their high fidelity, six-DoF characteristics.
Table C.3 Lesson plan of CD-ROM no. 2 “Fundamentals of Six Degrees of Freedom Aerospace Simulation and Analysis in FORTRAN and C++”
|
The detailed simulation buildup is shown in Table C.4. Both the air intercept missile (AIM) and the Falcon aircraft (FI6) are modeled in FORTRAN (FTN) and in C++. To jump-start your involvement, the primer of Lab 2 helps you, without going into details, to execute and plot the complete missile simulation in FORTRAN and C++. In Lab 3 the computational methods are discussed. Though up to this point the missile is used as illustration, the aircraft follows similar patterns. However, starting with coordinate systems in Lab 4, the aircraft requires separate treatment from the missile. As you proceed, you focus on one module at a time, skipping the nonexistent aircraft seeker module. Eventually in Lab 12 you evaluate the performance of the complete missile and aircraft using the final simulations. In a separate folder you are given the beginning simulations, code additions, and the final completed simulations.
This self-study course touches on all major elements of missile and aircraft simulations in a FORTRAN and C++ environment. Because of the modular structure, you can expand and tailor the simulations to your own needs. If you want to model a cruise missile or unmanned air vehicle you would start with the FI6 simulation and import the seeker module from the missile simulation. You need not worry about violating copyright laws. All source code on the CDs is in the public domain; only the accompanying training charts are restricted by AIAA copyright.
Though this CD is complete in itself, it only deals with the fundamentals of six-DoF simulations. Advanced subjects, like elliptical Earth, inertial navigation systems, GPS, Kalman filters, and exo-atmospheric guidance are reserved for the third CD. Yet, you should first master the fundamentals before approaching these advanced subjects.
Table C.4 Creating aircraft and missile simulations in FORTRAN and C++ of CD-ROM no. 2
|
C.4 Advanced Components of Ascent Vehicles
The third CD, “Advanced Six Degrees of Freedom Aerospace Simulation and Analysis in C++,” presents advanced topics and assumes that you already have a good working knowledge of aerospace simulations, commensurate with CDs 1 and 2. It uses as a prototype a three-stage ascent vehicle, composed of a hypersonic air breather, exo-atmospheric transfer vehicle, and terminal interceptor.
Table C.5 outlines the 12 labs divided into seven training modules. Each lab consists of a training unit that introduces the subject and hands-on exercises using a self-contained simulation. There are 16 simulations, starting with simple orbital trajectories over the elliptical Earth; a hypersonic vehicle with aerodynamics, propulsion, flight controller, inertial navigation, GPS and star tracker; a transfer vehicle; and finally an interceptor. Together they produce the full-up HYPER
Table C.5 Creating a three-stage ascent vehicle simulation with CD-ROM no. 3 “Advanced Six Degrees of Freedom Aerospace Simulation and Analysis in C++”
|
simulation, which consists of three objects: ascent vehicle, satellite, and ground radar. All of them interact with each other and can be multiply instantiated.
The course starts with a review of C++ features and an in-depth discussion of the CADAC architecture. Then, at once, you will execute the complete HYPER simulation in a typical scenario. This should motivate you for the arduous task of building up to the HYPER simulation in 16 labs until in Lab 19 you conduct a complete end-to-end analysis.
Modeling and simulation can only be learned by doing. It requires a great investment of time and resources. The top experts in industry, academia, and government have made mastery of this subject a life-long quest. They combine a broad system engineering knowledge with mathematical modeling skills and computer savvy. Often they are the highest paid, nonsupervisory engineers.
To achieve this expertise in aerospace simulations you should build on a multidiscipline college education in mathematics, flight mechanics, aerodynamics, propulsion, and guidance and control, followed by hands-on training with prototype simulations. Having taught M&S courses for many years, I distilled them into these three CDs. They combine instructions and experimentation with a host of typical aerospace simulations. Everything you need is provided, you only supply the compiler. The one thing I cannot provide is the motivation it takes to plow through the material. That only can come from your commitment to and fondness for aerospace engineering.
References
‘Zipfel, P. H., “Building Aerospace Simulations in C++,” AIAA Self Study Series CD – ROM, 2003.
2Zipfel, P. H., “Fundamentals of Six Degrees of Freedom Aerospace Simulation and Analysis in FORTRAN and C++,” AIAA Self Study Series CD-ROM, 2004.
’Zipfel, P. H., “Advanced Six Degrees of Freedom Aerospace Simulation and Analysis in C++,” AIAA Self Study Series CD-ROM, 2005.
4Zipfel, P. H., “Solution Manual for Modeling and Simulation of Aerospace Vehicles,” AIAA 2000 (instructors can request a free copy from AIAA).
Appendix D