# Introduction to Flight Simulation

Lecture: Tuesday, 16-18, Room 140
Exercise: Tuesday, 18-20, Room 7

## Summary

In the first lectures, I will explain the basics of numerical methods for solving differential equations, and apply this on calculation of orbits and rocket trajectories. We calculate how much fuel a rocket needs to reach orbit, how much fuel is needed to reach the moon. We use Runge-Kutta methods to simulate various exotic types of orbits and Laplace points.

Next topic is mechanics of rigid objects. A rigid object is an object that does not change form in a significant way, when forces are put on it. In addition to position and speed, a rigid object also has an orientation and an angular speed. The origentation of a rigid object can be modelled by a quaternion. Its weight distribution can be represented by an inertia matrix.

Stability and Control: A system is stable when small disturbances converge to zero over time. An unstable airplane is difficult to fly. I will teach techniques for analyzing the stability of a system, and how the increase the stability of a system by automatic control. (Autopilots.)

Detecting contacts with the ground: There exist collisions and there exist controlled ground contacts. In order to be able to simulate landings and take offs, one need to detect when the airplace touches the ground, and in which way it touches the ground, and what forces there exist on the wheels.

Data structures for scenery representation.

Aerodynamic forces are too complex to compute in real time. Because of this, aerodynamic forces are usually put in tables. Splines are used for interpolation. I explain what these are, and how they are constructed.

Aerodynamics: Although one needs to know almost nothing about aerodynamics for building a flight simulator, it is still an interesting topic with some deep insights that I don't want to hide from you. I will explain what potential flows are, prove Bernoulli's law, and explain the Kutta-Joukowski theorem.

## Prerequisites

You should have knowledge of C++, linear algebra, and differential calculus.

## 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.

## Open GL

SFML supports computer graphics through OpenGL. The homepage of Andrzej Lukaszewski contains a lot of pointers to openGL. The Red Book used to be the main source for learning OpenGL. It is outdated, because the standard commands have been replaced by direct programming of the graphics card. (Shading Language). This has the advantage that the user has more flexibility, but unfortunately, the user also has to understand more. Even when the commands in the Red Book are outdated, the algorithms are still valid, so it is still useful to look at the first 5 sections.

## Lectures

• 2.10.2012. Introduction , and an explanation of how to compute trajectories of planets and and rockets . This is the program that I showed in class.
• 9.10.2012. Importance of higher-order methods. Runge-Kutta methods. Application of RK to orbit computation. Slides about Runge-Kutta methods.
• 16.10.2012. I give examples about implementation of Runge-Kutta methods, I show the effect of the order on the equation for the catenoid. Here is an implementation of Runge-Kutta methods. This is the program that we wrote in class.
• 23.10.2012. We simulated rockets, here is the program. It is simple, but it has the same structure as a more serious simulator.
• 30.10.2012. I proved that quaternions represent rotations. I gave examples of their use. The slides are here.
• 06.11.2012. I explained more about coordinate transformations, about rigid speed functions (combinations of linear and angular speed), about how to compute angle of attack from a rigid speed function, and how to estimate aerodynamic forces from angle of attack. The slides are here.

On 13.11.2012 will be no lecture, because it will be thursday in our building.

• 20.11.2012. Proved the three dimensional equivalent of F = m.a, namely that torque = M( alpha ) + omega X M( omega ), where M is the inertia matrix of the object. This is the hand out.
• 27.11.2012. Half way exam. Finally, I will have occassion to find out how much you learnt in the course! You may print out and use all slides that I used in the lectures, and also the four pages from A.C.Kermode, Mechanics of Flight. If you printed slides before, you should check if I didn't change them, because I sometimes correct or extend them after the lectures. No other material is allowed, and also no electronic tools.
• 04.12.2012. Discussion of Exam.
• 11.12.2012. Interpolation, crash course computer graphics and open GL. If you want to learn more about computer graphics, you can read the Red Book is outdated, but still useful. You can also look at the code in th repository .
• 18.12.2012. Collision detection and wheel model. The wheel model was messed up, but the part about collision detection is fine. We heroically decided to implement a flight simulator, and to create some scenery. You should take the code in the repository as starting point. Make sure that you understand the code!
• 08.01.2013. Computation of aerodynamic forces, how to control the airplane, etc.
• 15.01.2013. Modelling of Wheels. (This is as hard as the rest of the plane.)

## Exercises

1. First exercise is on 9.10.12. Here it is. (I improved the layout, and I corrected the mistake with the minus.) We still want to show that that planetary orbits are ellipses. (or hyperboles or paraboles)
2. Exercise number 2 .
3. Exercise number 3 .
4. Exercise number 4 . Ultimate goal of this exercise is to understand the control problem related to orbits. The rocket simulation program is in the repository .

## Project

There is a flying simulator!

## Students' Opinions

Anonymous opinions from System Zapisow.

## Literature

• Mechanics of Flight, A.C. Kermode, 9th Edition, Longman Group UK Limited, UK, 1987.
• Aircraft Control and Simulation, Brian Stevens and Frank Lewis, John Wiley and Sons Inc., 1992.
• Fluid Mechanics DeMYSTiFieD (A Self-Teaching Guide), Merle C. Potter, McGraw Hill, 2009.
• Numerical Methods for Ordinary Differential Equations, J.C. Butcher, Wiley and Sons, 2003.
• Analyse, J.H.J. Almering e.a., VSSD, Delftse Uitgevers Maatschappij, the Netherlands, 1984.