# Introduction to Flight Simulation

Lecture: Tuesday, 2-4, Room 25
Exercise: Tuesday, 4-6, Room 7

## Aim of the Course

The course has three goals:
• To get acquainted with some fundamental physics and mathematics. In order to be able to simulate the behavior of airplaines, one needs quite a lot of linear algebra, and of differential calculus. I will introduce Newton mechanics, (using vectors), and derive the laws of motion for rigid, three dimensional objects from first principles. In order to simulate autopilots, instruments, wheels, etc, I will introduce the notion of a circuit, which is used modelling the behavior of systems. Systems can be either stable or unstable. Ingeneers are usually interested in stable systems. The most commonly used tool for analyzing stability is the Laplace transform. I will introduce the Laplace transform and explain how it can be used for predicting the stability of circuits. This is probably the most fundamental part of this course. Even if you will never work in anyhing related to airplain design, stable and unstable systems are everywhere around us. If there is time left, I will also explain some basic fluid dynamics, so that you will understand by the end of the course, why wings of airplanes generate lift. Quite a lot of nonsense has been written about this topic, so it never hurts to give a correct explanation.
• To understand how the air traffic system works. I will explain some of the procedures, explain which tools are used for navigation, and how the air traffic control system works.
• And finally, we want to have some fun. I want to spend the last month of the course to building a working system.

## Prerequisites

You should have knowledge of C++, and of linear algebra. It is good if you know something about differential equations and complex numbers.

## Planned Topics

1. Newton mechanics for point masses. Energy versus impulse. Specific impulse of a rocket engine, the inherent exponential cost of rocket propulsion. We will do some calculations on planets and rockets. The physics of rockets is much easier to understand than the physics of airplanes, so it is a good starting point.
2. Elements of linear algebra, dot and cross products. The notions of torque and moment.
3. Usage of quaternions for the representation of orientations.
4. Laws of motion for rigid, non-point objects. Everyone knows Newton's law, F = m.a, which can be used for determining how a point with mass m reacts to a force with strength F. But what if the object is not a point, and the force does not work in the middle of the object? In that case, the object will start to rotate. We will derive laws that connect eccentric forces and resulting rotation to the mass distribution of an object.
5. Modelling of Wings. Understanding the qualitive relation between angle of attack, drag and lift.
6. How the airplane is flown: Take off, landing, turning, descending, climbing. Importance of stability.
7. Explanation of the causes of some historical accidents that formed modern aviation. (Tenerife collision, Comet accidents, Elektra design flaw, incidents with Airbus 320.)
8. Modelling and designing automatic control. Maintaining a given altitude, maintaining a given heading, maintaining a certain speed. Design of stable circuits using Laplace transform.
9. Navigational aids, VOR, NDB and ILS. Structure of air traffic control. Understanding ATC communication.
10. If there is time for it, some fluid dynamics: Normal flows, which are are flows that have no divergence and no rotation. Normal flows are quite easy to understand mathematically. We will formally derive and numerically simulate the Kutta-Zhukowsky theorem, so that you understand why wings of an airplance generate lift.

## Installing SFML (Simple and Fast Multimedia Library)

SMFL can be obtained from here . I installed it under Debian Linux, and it was quite straightforward. The desription is quite clear.

You have to install a couple of include files (for g++), and a couple of libraries. The simplest way is to download the include files and use the precompiled libraries from the site, but this did not work for me. Linking resulted in a load error: Couldn't load std::ctype < char > :: M_widen_init. In order to solve it, I updated Linux from etch to lenny. This did not solve the problem. After that I compiled the libraries by myself, (it is described on the site how to do that) and this solved the problem. I don't know if updating to lenny played a role in solving the problem, but it was something that needed to be done anyway.

## Open GL

SFML supports computer graphics through openGL. I am sure that everyone in the rooms knows much more about computer graphics than I do, so I will be short on this topic. The homepage of Andrzej Lukaszewski contains a lot of pointers to openGL. This is the homepage of open GL. Try to read the Red Book . A browsable list of commands .

## Lectures

• 5.10.2010. I explained why flight simulation is important, what I want to do with the lecture, how a flight simulator is set up, and I demonstrated Flight Simulator II on the Amiga 2.
• 12.10.2010. I explained numerical methods for solving integrals and solving differential equations. The program that I used for demonstrating rates of convergence.
• 19.10.2010. I proved convergence of Heun's method, and Runge Kutta method. I explained the importance of having better than quadratic methods for higher-order differential equations. We democratically decided to use SFML as multimedia package. Here is a detailed text about numerical methods, which contains all the material that I covered, and a detailed proof of the convergence of the Runge-Kutta method. Try to have at least a glance at it, because it was not easy to write. This is a full proof of the fact that RK4 has convergence O( n^5 ), generated by a C++ program. This is an improved planet simulation program, which uses RK4. I will explain next week how it works.
• 26.10.2010. I will spend maybe 30 minutes about how to obtain good methods for second order equations. The solution is surprisingly easy. Higher-Order differential equations can be replaced by first-order differential equations on tuples. I already tried it out on the planets. After that I start with open GL.
• 2. 11. 2010. No lecture. (Dzien Rektorski)
• 9.11. 2010. More about openGL. The text about openGL that I handed out during the lab.
• 16.11.2010. Introduction to mechanics.
• 23.11.2010. More about mechanics. This is an unfinished text about mechanics for rigid (and non-rigid) objects. I will write the proofs into the text until next week. I also know the solution to the problem that I had in class, in the proof of the connection between torque and change of angular momentum.
• 30.11.2010. Rest of mechanics for rigid objects. Elemantary explanation of gyroscopic effect. The inertia matrix of a rigid object. Demonstration of law of preservation of momentum and preservation of speed from a simple implementation of interacting point masses. The text about mechanics is now more or less complete.
• 7.12.2010. Some practical aspects of implementing mechanics for rigid objects. Representation of rotations (orientations) by quaternions.
• 14.12.2010. More about quaternions. We completed the proof that the operation F_q(x) = q.x.inv(q) is a rotation. In the second part of the lecture I spoke about convex polyhedra for collision and contact detection.
• 21.21.2010. No lecture!
• 4.01.2010. More about collision detection, and polygon clipping. The reason that I am interested in all these transformations on polygons and polyhedra is that the fact that they are needed for the representation of scenery with different levels of refinement dependent on how close or how far you are to an object.
• 11.01.2010. Conversions of coordinates for global naviation. I explained how to transform Geodetic Coordinates to ECEF (Earth-Centered, Earth-Fixed) coordinates and back, and how to obtain the directions of the LENU (Local East North Up) axes at a certain geodetic position. In the second part I explained the notions of lift and drag, and gave the basic formulas for computing lift and drag.