Development of an automated satellite network management system Iasonas Kytros Christos Porios Nikitas Terzoudis Varvara Chatzipavlou Coach: Sitsanlis Ilias February 2013 Abstract In this paper we present the process of designing and developing an artificial satellite simulation system and discuss the challenges we faced. We first examine the motion of small objects around planets and the physics laws that describe it. Further, we study the physical quantities that define the orbit of a satellite and its position in it. Based on these, we analyse the different ways a satellite s motion can be simulated in a computer providing key points of the source code of the simulation. Finally, we deal with the orbital manoeuvres and further develop our application so as to calculate and make the energy changes necessary for the vehicle s orbital transition. KEYWORDS: Satellites, management system, simulation, orbital manoeuvres 1
1 Introduction 1.1 Motivation Άνθρωπος... Άνω θρώσκω... Κοιτώ ψηλά... κοιτάμε ψηλά απ'την ώρα που πατάμε στα δυο μας πόδια, παρατηρούμε, ανυσηχούμε, ψάχνουμε. Nowadays, some tens of kilometres outside the earth s atmosphere, hundreds of satellites on which various human rely on are in orbit [?]. Artificial satellites assist us with various tasks, ranging from our everyday communications to the national defence of great powers and the exploration of space. Their management, though, is far from easy. Herein he term management system of artificial satellites denotes the software systems employed to simulate the flight of a range of artificial satellites in orbit around a planet and manage their conduct. The Systems Tool Kit (STK)[?], is such a system, which is under development for the past twenty years and has been used globally for a number of space missions. In this paper, we describe the development of such a software system which could be useful for real missions. Our system will predict precisely the orbit of the satellites it manages, provide information for their state and orbit and have the capability to receive and execute commands to change a satellite s orbit by calculating the combustions necessary for the transition to a new orbit with minimal fuel consumption. Our application is available at http://satsim.eu. The source code of the application we developed is open source and available at https://github.com/tech_no_crat/satsim/. Thus, anybody can contribute to our codebase to improve and expand our application. 1.2 Specifications Before we begin the development of the system, let us briefly describe the application we aim to create. The main screen of the application will present a planet three-dimensionally with some initial satellites in orbit around it. The satellites appear as spheres big enough to be visible by the user. In essence, though, the application internally considers them as points in 3D space. Satellite orbits will be drawn on screen as ellipses. The user will be able to move and rotate the camera in order to receive various images of the planet as in many 3D video games. The application enables the user to accelerate the flow of simulation time. By increasing the flow of time the satellites will move faster and the user can get a more comprehensive view of their orbital situation. On the screen there is a list which comprises the satellites currently being managed by the application. By choosing one of the satellites, data for its current state and for its orbit appear at the bottom of the screen. This data is continuously updated as the satellite moves. The user will be able to add or delete satellites. The addition of new satellites can be achieved by specifying the orbital data defined at 2.3. While the user changes the orbit s data, the application will continuously draw the desirable orbit on screen. This way, the user will also gain an intuitive understanding of how each orbital parameter affects the satellite's orbit. The user will also be able to apply a change in the orbit of a particular satellite. In this case, the system calculates the necessary manoeuvres, presents them visually on the screen and simulates the burns required for the satellite to reach the target orbit. 2
Finally, the graphical user interface will also allow for the tweaking of various settings and application parameters. it should also be possible to display information and user guidelines. 1.3 Aims Accuracy: Our application has to be accurate enough to calculate and simulate orbits of known satellites. Usability: Our application has to be as simple in use as possible, in spite of being addressed to two kinds of users: To professionals knowledgable in the fields of astrophysics and astronomy and to individuals who just want to experiment. Extensibility: The source code should be well structured and easily readable so that both we, the original developers, and others will be able add additional features in the future. Open source software: We will be using entirely open-source software; the final application and its source code is available under an open-source software license. 1.4 Notations All the vectors used are relative to the planet s position; therefore, we will assume that the planet is at the point O(0, 0, 0), i.e. the origin. x denotes the first derivative of x with respect to time, x denotes the second derivative etc. ˆx denotes the unitary vector with the same direction as x, i.e.: ˆx = x x ˆ Finally, ( α, β)denotes the angle formed by two vectors α and β. (1) 2 Satellite Movements 2.1 Assumptions To simplify the application we will make some assumptions. We will present but not implement solutions for some of these assumptions in the unit Suggestions for improvement. 2.1.1 Bodies The only body of a measurable mass that will be of any concern to us will be the planet around which the satellites will be orbiting. We will, therefore, assume that all other bodies of a measurable mass are far enough to either cause very small accelerations, or to cause to the satellites accelerations that are roughly equal in measure to the ones they cause to the planet. In addition, we will assume that the artificial satellites we are working with are of negligible mass in order not to cause any acceleration to planet or the other satellites. This assumption is also applicable to the real world. Furthermore, we will assume that all the satellites we are working with perform elliptical or circular orbits. 3
2.1.2 Speeds In order for Newton s Laws to be considered precise and accurate approaches to the physical behaviours observed in the real world, we are bound to assume that the respective speeds satellites travel at are extremely small compared to the speed of light. 2.1.3 Atmospheric Friction and Solar Radiation We will not take atmospheric friction and solar radiation into account. Therefore, the simulation will be less accurate as far as smaller altitude orbits are concerned. 2.1.4 Planet We will assume that the planet around which the satellites are orbiting is perfectly spherical, with equal density everywhere. Therefore, the planet s centre of mass will be in the centre of the sphere, allowing us to easily measure the satellites altitudes from the sea level. 2.2 Newton s Laws and Cartesian Vectors A satellite of mass m is located in the position r and has an initial velocity vector r. From the Universal Law of Gravitation [?] the force F applied to the satellite is equal to: F = ˆr G mm r 2 (2) By applying Newton's 2nd law to the above formula we get for the acceleration r caused by the gravitational force F on the satellite: F r = GM = ˆr = ˆr µ (3) m r 2 r 2 According to the assumptions we made in the last unit, satellite orbits can be either circular or elliptical. And since, according to our assumptions, no other forces are applied on the satellite, every future position of the satellite, i.e. it's orbit, are entirely dependant on the vectors r and r. Summarizing: The position and velocity vectors r and r are sufficient to define a satellite's orbit 2.3 Kepler Orbits If we assume that a satellite s orbit around a planet is either elliptical or circular (i.e. it has not reached its escape velocity), to describe the satellite s orbit we can use an equation that gives us the body s distance from the planet r(ν) as a function of to the angle ν that it forms with the closest distance to the planet, i.e. its periapsis. Because in a circular orbit the distance between the points of the orbit and the planet is the same everywhere we can arbitrarily choose a point relative to which we will measure the angle ν. In 1609 this equation was conceived by Johannes Kepler: r(ν) = a(1 e2 ) 1 + e cos(ν) (4) 4
Where: a is the orbit's semi-major axis that also defines its size. e is the orbit's eccentricity(0 < e < 1 for elliptical obits). These two elements are sufficient for shape and size of the orbit to be defined. Although all orbits are level, the plane on which they are formed can differ. Because we are working on the 3-dimensional space, we will need to use three angles in order to fully describe the orbital plane s rotation in space. Inclination (i), the angle between the orbital plane and the reference plane. Longitude of the ascending node (Ω), the angle between the reference direction and the upward crossing of the orbit on the reference plane (the ascending node). Argument of periapsis (ω), the angle between the ascending node and the periapsis. By ascending node we refer to the upward crossing of the orbit on the reference plane. The choice of the reference plane and the reference orbit is not important, as long as they are the same for every orbit we will examine. Practically, the orbital plane is usually the equatorial plane. With those five parameters and the ν angle we can define any circular or elliptical orbit in the 3-dimensional space. We will, from now on, refer to these parameters as orbital elements. 2.4 From Cartesian State Vectors to Kepler's Orbital Elements Knowing the initial position r and velocity r of a body, it is essential to be able to define the 5
Kepler Orbit the body is going to follow which will enable us to predict each of the satellite s future positions, as we will see in the next unit. A simple algorithm for this transition from the vectors r and r to the six orbital elements is described in Memorandum 2 by René Schwarz [?]. A slightly simplified version of the algorithm is used in our application and is presented below: First of all we are going to calculate the body s specific relative angular momentum which is simply the cross product of the position and speed vectors and the vector n which is directed towards the ascending node for use in the following calculations: h = r r (5) n = ( h y, h x, 0) (6) The orbit s semi-axis is calculated directly using the position and velocity of the body: a = 1 2 r 2 r µ (7) where µ = GM and M is the mass of the planet. We will find the eccentricity vector, which originates from the body and is directed towards the periapsis and its measure is equal to the eccentricity e of the body: e = r h µ ˆr (8) e = e (9) Having defined the orbit on the plane, we will define the plane from the formulas for the i, Ω and ω angles: i = arccos h z h { arccos n x για n n y 0 Ω = 2π arccos n x αλλιώς n { ( n, e) ˆ για e z 0 ω = 2π ( n, e) ˆ αλλιώς The true anomaly of the orbit is given by the formula: { ( e, r) ˆ για ( e, r) ˆ π 2 ν = 2π ( e, r) ˆ αλλιώς We only have the secondary elements of the eccentric and mean anomaly left to find: (10) (11) (12) (13) 6
E = 2 arctan tan ν 2 1+e 1 e (14) M = E e sin E (15) 2.5 From Kepler's Orbirtal Elements the Keplerian State Vectors Equally important is the transition from the orbital elements to the Cartesian vectors of position and speed. The algorithm presented below derives from Memorandum 1 by René Schwarz [?] and is implemented on our application. We will describe a process of transiting from the orbital elements (the semi-axis, eccentricity and the angles i, ω and Ω) and the mean anomaly M 0 at a certain moment in time t 0 to the position and velocity vectors at a moment t t 0. At the beginning we will calculate the mean anomaly M at the time point t as described: µ M = M 0 + t (16) a 3 where Δt is the time difference between t and t 0 in seconds. Although the equation (15) correlates the eccentric and mean anomaly, it is impossible to solve for E. We therefore have to approximate the value of E numerically as following: The distance from the planet will be: For the true anomaly we have: E i+1 = E i E i e sin E i M 1 e cos E i, E 0 = M (17) d = a(1 e cos E) (18) ν = 2atan2( 1 + e sin E 2, 1 e cos E 2 ) (19) Now we can find the position r and the velocity r on the orbital plane (we will assume that that the z z axis is perpendicular to the orbital plane): r = d(cos ν, sin ν, 0) (20) µa r = d ( sin E, 1 e 2 cos E, 0) (21) We now only have to use the angles i, ω και Ω to rotate the vectors we have found to correct plane. These angles are the euler angles that define a plane s orientation in the 3-dimensional space. For this rotation of the r and r vectors we will apply the formula from step 6 of Memorandum 1 by Rene Schwarz [?] 7
3 Orbital Manoeuvers During the operation of several satellites, an orbital change may be necessary for technical or service purposes. In order to achieve the satellite s transition from one orbit to another, the velocity vector has to change by using the satellite s thrusters at some point of the orbit. The orbital maneuver has to be done at the point where the current orbit is intersected by the desired one. If the two orbits don t intersect, then the satellite has to first enter a transit orbit that intersects both of them. We expand our application so as to calculate and perform orbital maneuvers for satellites. We assume that the satellites being managed have the ability to change their speed instantly and that the combustions don t change the vehicle s mass (due to decrease of the fuels amount). 3.1 Orbit circularization A satellite often needs to circularize its orbit, i.e. to null its eccentricity. We describe a simple way for the calculation of the velocity change required to circularize the orbit at its lowest point. In other words, we desire to enter a new orbit with e = 0 which is contiguous with the old orbit at the periapsis. In every elliptical orbit the satellite s maximum velocity is observed at the periapsis [?], and its magnitude V i = rp er is given by the formula: (1 + e)µ V i = (22) (1 e)a i Where e and a i are the eccentricity and the semi-axis of the initial orbit respectively. In the new circular orbit, the satellite s V f velocity magnitude will be the same at every point of the orbit and since e = 0 it is given by the formula: µ V f = (23) a f Where a f is the semi-axis and the radius of the new orbit. As mentioned at 2.2, the position vectors will define the future satellite s orbit. Since the two orbits are contiguous at the periapsis, we just need to change the velocity vector at that point in the velocity of the new orbit. So: V = V f V a = µ a f (1 + e)µ (1 e)a i (24) Since the velocity change will happen instantly, only the velocity s magnitude will change. In a similar way the orbit circularization at the highest point of the orbit can be achieved. 4 Development of the Application 4.1 Choosing technologies Our application should be built on open-source technologies and work on as many different platforms as possible. Therefore ti makes sense to build our simulation as a website, using modern 8
web technologies: HTML5, CSS and Javascript. This way our application will run on any modern browser, regardless of the underlying operating system. To make the development process easier, however, we will write all of our code in HAML, SASS and Coffeescript, languages that are compiled into HTML, CSS and Javascript respectively and make our code much easier to write and maintain. We will also use some additional javascript libraries: jquery for the graphical user interface and Three.js for rendering graphics in 3D. 4.2 Simulating satellite motion To create the illusion of motion on a computer screen, we have to render our scene many times per second (practically, at least 30). To do that, we must first find a way to calculate the satellites' positions in each frame as accurately as possible. In this section we will present two different ways of calculating positions in 3D space from Kepler's Orbit Elements, and the reasons for choosing the second approach. 4.2.1 First idea: Approximation of the orbital position by means of the cartesian state vectors. The simplest way of simulating satellite motion is to completely ignore the orbital elements described in section 2.3, and to simply use equation (3) from section 2.2. The process goes as following: We will maintain the two state vectors r and r, the position and velocity vectors respectively. C times per second, we will recalculate the velocity vector r to derive the new velocity by using equation (3) as following: Knowing the current velocity of the body, we will make the assumption that the body's velocity will remain constant until the next update cycle, i.e. for C 1 seconds. We will then update the position vector by adding to it the velocity vector, as described in section 2.1. Although this method works, it is inaccurate since we only update the velocity and acceleration in update cycles of a certain frequency, and we assume that the velocity and acceleration vectors remain constant in the time interval between two consecutive updates. This assumption is obviously false. Even though this method can never be practically used to accurately predict a body's orbit, we can theoretically approximate the real orbit as accurately as we want by using a large enough C. Practically, though, a C greater than a few hundred units will significantly affect the performance of our application on any modern computer. 4.2.2 Second idea: Using the Mean Anomaly for correlating time, position and velocity. In the unit 2.3 the secondary quantities ν, M and E, i.e. the true, mean and eccentric anomaly respectively were mentioned. In the unit 2.5 we saw how by means of knowing M and the orbital elements we can transit to the angles ν and E and then to the cartesian state vectors of position and velocity. And since M has the property of increasing steadily during the whole duration of the orbit, we can easily calculate its value for any future point in time by using equation (16). For our simulation we opt for using the algorithm given in section 2.5 for the transition from the Kepler Orbital Elements to cartesian state vectors for any time point. This will allow us to easily implement the time acceleration feature in our application. 9
Knowing the orbital elements and the mean anomaly M at a certain point in time t, we will update the satellite's position many times per second and will then draw it in its new position. To update the satellite's position we will use the algorithm from unit 2.5 with t = t real A, where t real the actual time since the last update cycle and A the time acceleration parameter, i.e. how many times faster the simulation time will flow. Our algorithm will also output, among other quantities, the vector r, i.e. the new position of the satellite in 3 dimensional speed which is exactly what we need to draw the satellite on the screen. 4.3 Key source code sections The most interesting part of the code is surely the class Orbit in the file orbit.coffee, which manages a satellite's orbit and defines methods for the calculation of various orbital quantities. The class maintains both the orbital elements as well as the current state of the satellite in the cartesian state vectors and in the physical quantities M, e and ν that change as the satellite progresses in its orbit. The following step method presented below is the implementation of the algorithm described in the section 2.5. The method updates the satellite's state to its future state after dt seconds: 1 2 step: (dt, iterations = 100) -> 3 @m += dt * Math.sqrt(@gm/Math.pow(@a, 3)) 4 @m -= 2 * Math.PI if @m > 2 * Math.PI 5 6 @ea = @m 7 for i in [1..iterations] 8 @ea -= (@ea - @e.length() * Math.sin(@ea) - @m)/(1 - @e.length() * Math.cos(@ea)) 9 10 @nu = 2 * Math.atan2(Math.sqrt(1+@e.length()) * Math.sin(@ea/2), Math. sqrt(1-@e.length()) * Math.cos(@ea/2)) 11 @d = @a * (1 - @e.length() * Math.cos(@ea)) 12 @r = new THREE.Vector3(Math.cos(@nu) * @d, Math.sin(@nu) * @d, 0) 13 @v = new THREE.Vector3(-Math.sin(@ea), Math.sqrt(1-Math.pow(@e.length(), 2)) * Math.cos(@ea), 0).multiplyScalar(Math.sqrt(@a * @gm)/@d) 14 15 x1 = Math.cos(@omega) * Math.cos(@o) - Math.sin(@omega) * Math.cos(@i) * Math.sin(@o) 16 x2 = Math.sin(@omega) * Math.cos(@o) + Math.cos(@omega) * Math.cos(@i) * Math.sin(@o) 17 y1 = - Math.cos(@omega) * Math.sin(@o) - Math.sin(@omega) * Math.cos(@i) * Math.cos(@o) 18 y2 = - Math.sin(@omega) * Math.sin(@o) + Math.cos(@omega) * Math.cos(@i) * Math.cos(@o) 19 z1 = Math.sin(@i) * Math.sin(@omega) 20 z2 = - Math.sin(@i) * Math.cos(@omega) 21 @r = new THREE.Vector3( 10
22 x1 * @r.x + x2 * @r.y, 23 y1 * @r.x + y2 * @r.y, 24 z1 * @r.x + z2 * @r.y 25 ) In lines 3 and 4 the new mean anomaly M is calculated. In lines 6-8 the eccentric anomaly is approximated numerically. In lines 10-13 the true anomaly, position and velocity on the reference plane are calculated. Finally, in lines 15-24 the calculated vectors are rotated from the reference plane to the correct orbital plane. 5 Use cases 5.1 International Space station As an experiment we inserted the orbital data of the International Space Station into our application in order to examine the deviation from the real facts. We found the semi-axis, the eccentricity and the angles i, ω, Ω on the internet [?] and added the specific orbit to the simulation. The orbit that was calculated along with its data is shown in the next image: 5.2 Hubble Telescope We repeated the experiment this time adding Hubble Telescope s orbital data. [?]. The results can be seen in the image: 11
6 Conclusions During the two weeks we were busy with the contest, we initially worked on understanding the satellites motion and the natural laws governing this motion. We put our knowledge in practice by developing the application, which we tried to perfect to the fullest taking into consideration our cognitive and time limitations. Our simulation is as accurate as possible, but most importantly, it is easily expandable by others since its code is available on the Internet. During our research, we didn t come across any other significant open-source simulation software. This contest constituted our springboard to pore over a subject, which turned out to be a very interesting one. Therefore, we are planning on continuing the development of our application even after the completion of the Odysseus Contest. 6.1 Suggestions for improvement Ideas for additional application features are: Calculation of orbital rendezvous points, and the calculation of the necessary orbital manoeuvres to achieve or avoid such events. Calculation of the network's coverage on the Earth's surface and the projection of the orbital ellipses on the earth's 2 dimensional map. More orbital maneuvers. Calculation of orbital deflections due to atmospheric drag, solar radiation and the moon's gravitational attraction for better accuracy. 12
A better graphical user interface. Some of these ideas wouldn't be difficult to implement, but unfortunately, we did not have the time to implement them during the two weeks we were occupied with Odysseus contest We urge anyone who is interested to contribute to our effort after the completion of the contest, by implementing either some of the aforementioned ideas or some of their own. This could be achieved by using the open-source collaboration software platform github, where the application s code is available. The final application: http://satsim.eu References [1] US Space Objects Registry: http://usspaceobjectsregistry.state.gov/ [2] The STK homepage: http://www.agi.com/products/stk/modules/default.aspx/id/ stk-free 13
[3] Isaac Newton, The mathematical principles of Natural Philosophy [4] René Schwarz, Memorandum 1, Keplerian Orbit Elements Cartesian State Vectors [5] René Schwarz, Memorandum 2, Cartesian State Vectors Keplerian Orbit Elements [6] http://www.heavens-above.com/orbit.aspx?satid=25544 [7] http://www.spacetelescope.org/about/general/fact_sheet/ [8] Robert A. Braeunig, Orbital Mechanics: http://www.braeunig.us/space/orbmech.htm 14