| User | Post |
|
1:05 am December 5, 2009
| brmj
| | Rochester, New York, United States | |
| Member | posts 352 |
|
|
I've been working on designing what's bassically software to numerically solve the n-body problem, for use in designing and simulating trajectories and orbits, as well as functioning as part of our guidance system. So far, I have not a line of code, but I've got a decent idea of how to solve the problem. The particular way of solving it I chose isn't very efficient, but it should be very easy to program and very powerful. I've been designing it at least partially with haskell in mind, but there's no reason this couldn't work in other lamguages.
Here it is.
A position is three fractionals: an x position, a y position, and a z position.
A velocity is three fractionals: an x velocity, a y velocity and a z velocity.
A body (provisionally named) has a position, a velocity a fractioanl called "mass" and a string called "name"
An acceleration is three fractionals: an x acceleration, a y acceleration, and a z acceleration.
A timeslice is a fractional that repressents a slice of time in seconds.
A timestamp is a fractional that represents a time in seconds.
An instant is a list of bodies, a timeslice, and a timestamp.
calcDistance takes two positions and returns a fractional. It calculates and returns the euclidean distance in three dimensions between the positions.
addAcellerations takes a list of accelerations and returns an acceleration; It adds the components of the individual accelerations and creates a new acceleration with the result.
updateBody takes an instant and a body and returns a body; It creates a list of accelerations in the instant by running calcGravity on the body and each body in the list of bodies. It then calls addAcelerations on the list of accelerations, and then figures out and returns an updated version of the body, one timeslice latter (or earlier, if the timeslice is negative). The exact way it does this ought to be figured out by someone with a better math background than mine, since I'm not confident I could pick the ideal aproximation for this.
calcGravity takes two bodies and returns an acceleration. It calls calcDistance to find the distance between the bodies and uses the law of universal gravitation to find and return the acceleration the first body induces in the second body.
nextSlice takes an instant and returns an instant. It returns a new instant created by running updateBody on each body in the instant and then incrementing timestamp one timeslice.
With this set of tools, doing interesting simulations and such ought to be easy. You can probably imaginr how an orbit simulating program would be constructed with this, for example. This is just a first rough sketch of what it could look like, so there are probably better ways to do some of this and I haven't yet figured out a really elligant way to add engine burns. What does everyone think? do you like where this is headed?
|
Main work groups: Propulsion (booster), Spacecraft Engineering, Computer Systems, Navigation and Guidance (software)
|
|
|
2:27 am December 5, 2009
| Luke Maurits
| | Adelaide, Australia | |
| Admin
| posts 1089 |
|
|
I am pleased to see this subject getting more detailed consideration. Your basic outline here seems entirely sound.
A few quick thoughts:
- I like the use of a Cartesian x-y-z coordinate scheme. I wondered about this for a while myself, since spherical coordinates feel a little more natural for orbit simulations. However, what really pushed me in this direction was the realisation that inertial measurement units invariable use Cartesian coordinates. The spaceship's navigation computer is going to think in Cartesian terms, so it makes sense that our planning software should too.
- I think the coordinate scheme should be centred on the sun rather than on Earth. For CLLARE it would feel a little more natural to centre things on Earth, but by using a heliocentric system we make it easier to extend things to solar system wide missions later. Also, this approach will make it easier to include solar radiation pressure (which varies with inverse square distance from the sun) – this would require adding surface area and reflectivity variables to bodies.
- While the cordinate system used for the internal calculations of the software should be a heliocentric Cartesian solution, the user should be able to define their own coordinate systems almost arbitrarily and have the results displayed in that system. Setting up a spherical coordinate system centred on the Earth and aligned with the Earth-Moon orbital plane should be particularly easy to do.
- I would love to see some sensible automated scaling of timeslice length and perhaps even included factors. Obviously we would always want a "full accuracy" option which uses a fixed, small timeslice and includes gravity from every body in the solar system, solar radiation pressure, etc., but for exploratory analysis we don't need quite that much accuracy – our system should take larger timesteps during the "boring" parts of the trajectory and only include gravity from say the sun and the 2 nearest non-sun bodies.
I will probably have more to say on this either later tonight or tomorrow.
|
Starting a new TA job next week, might be busy for a while! Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.
|
|
|
9:44 am December 5, 2009
| Rocket-To-The-Moon
| | Grand Forks, North Dakota, USA | |
| Member | posts 579 |
|
|
I think that developing our own software is the way to go. The simulator can be the foundation of the navigation software. Just substitute the simulated conditions with inputs from the inertial sensors.
I searched for some "orbital trajectory simulation software" on Google and came up with a few. So far I've only tried this one. This software might be useful for some basic stuff but it isn't very good for more detailed information. We need software that can spit out raw data in tabular and graphic format down to the millisecond.
|
Main Workgroups: Propulsion & Spacecraft Engineering
|
|
|
11:50 am December 23, 2009
| Jasper
| | Eindhoven, The Netherlands | |
| Member | posts 3 |
|
|
Post edited 8:41 pm – December 23, 2009 by Jasper
To be honest, we don't really want to solve the n-body problem.(It is a good exercise though) I am sure there already are 'solutions' that specify the orbit of the planets to desired precision(upto what is known) and don't require recalculating from some point in time. We want the solution of a trajectory of an object with relatively neglible mass within that. Likely only large and near bodies like Earth, Moon, Sol and Jupiter matter much.
Not sure how to get that, Celestia should have fairly accurate trajectories.(for starters.) Was always a little disappointed that Celestia doesn't allow you to simulate your own trajectories.(at least, easily enough) Of course Celestia gets the orbit data from other places.. I searched the web on orbit-algorithms and data a little, and often it is just the parameters of the elipse and perhaps how this elipse changes over time a little, but i think there are better models then that. (Though just those elipse-parameters might be good enough for a lot of things.)
Also, simulations can be done wrong, something to watch for. For instance, watch out with order-of operations issues. I made that mistake once, doing the position and speed operation at once, and it screwed up conservation of impulse.(Hmm, now i think about it, perhaps particles should simply store the speed/pos of previous iteration.)
Having seen some rocket-straight-up code and simulation results on this forum, perhaps the next step is to try figure out what sort of trajectories are effective at going to some orbit, avoiding air drag, and how this relates to latitude. (But, of course, do whatever you want.)
Btw, design before coding? You're not building a bridge!
Edit: Edited the text for clarity.. It was horrible!
|
|
|
8:06 pm February 11, 2010
| KellyJ
| | Australia | |
| New Member | posts 1 |
|
|
Post edited 8:07 pm – February 11, 2010 by KellyJ
Hi guys,
Have been browsing the site for a few days, and looking to see what you guys have been up to as far as the trajectory calculation goes. I am very curious that you decided to write your own code to solve this, since it is a common problem. I know this is an open source project, but I think that the problem has been well solved by NASA with a couple of their programs, specifically OTIS4. This is an award winning program which is available with a small catch. The only issue is that it is export controlled software so only a US citizen can get/run a copy of it, presumable after demonstrating some sort of research/developement use for it.
Since Rocket-To-The-Moon and brmj are both in the US, is it possible for either of you to check this out and maybe put in a request for a copy of this software? I imagine it would be enourmously useful for generating the basic trajectory, and also for optimising as more details become available. The home page is at http://otis.grc.nasa.gov/index.html, and to request a copy go to http://otis.grc.nasa.gov/request.html.
Doing this would save a lot of time in just writing and debugging code since the algorithms are verified already, and enable us to get onto more detailed design.
Regards
Kelly
|
|
|
8:28 pm February 11, 2010
| Luke Maurits
| | Adelaide, Australia | |
| Admin
| posts 1089 |
|
|
Hi Kelly,
Thanks for your comment and the link to OTIS4. It does look like a useful program.
My main concern with using OTIS4 is the export restriction. If only US citizens may get a copy, then that means only US citizens may participate in planning our trajectories, which is contrary to the open and collaborative spirit of CSTART.
It also seems like OTIS4 is not available under an open source license. While our Social Contract does not obligate us to only use open source software, we are supposed to do so wherever we can. I like to think that a secondary goal of CSTART is to increase the amount of open source software out there which can be used to plan space missions.
If the problem were a lot more difficult I would be more inclined to put aside these problems and just use OTIS4, but as it stands, the problems we actually have to solve (it looks like OTIS4 contains a lot of stuff above and beyond this) are not really all that difficult and I think it is well within our means to produce a simple program for our trajectory planning. There is not really an urgent need to get this ready quickly in order to facilitate more detailed design, since the delta-v requirements can easily be found without this sort of software and they are the only figures needed to determine the extremely basic stuff that needs to be known before any work can begin. More detailed trajectories are not really needed until we start thinking about guidance software, and that ideally shouldn't be until more work has been done on the RCS stuff.
The other big advantage to rolling our own is that we can absolutely make sure it is applicable to whatever design we may come up with, even if it is a little unconventional and not something NASA has ever done before.
All that said, it's very useful for us to know that OTIS4 is out there and I thank you for bringing it up. If it turns out that we do have a harder time than expected on this project, or we find that we do need detailed trajectories sooner than expected, we can always jump to OTIS4 as a fallback. We shouldn't let our ideology get in the way of success if it ever comes down to that.
Changing topic slightly, speaking particularly to brmj, are you interested in starting work on this fairly soon? After SpaceUp, say?
|
Starting a new TA job next week, might be busy for a while! Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.
|
|
|
9:47 pm February 11, 2010
| Rocket-To-The-Moon
| | Grand Forks, North Dakota, USA | |
| Member | posts 579 |
|
|
I would be concerned about holding a copy of this software because it would be hard to insulate its data from countries other than the US. I really don't want to get in trouble for arm trafficking.
If we could somehow ensure that nobody outside the US has access to the data then it may work. I think this is unrealistic.
|
Main Workgroups: Propulsion & Spacecraft Engineering
|
|
|
10:07 pm February 11, 2010
| Luke Maurits
| | Adelaide, Australia | |
| Admin
| posts 1089 |
|
|
Not only unrealistic, but if the very data itself could not be exported it would basically mean that our trajectories would be "semi-secret", which is not very open.
It really is unfortunate that arms trafficking laws apply to so many exciting, positive dual use technologies. It isn't only space launch vehicles which suffer from this problem, it has historically been quite a bad problem for cryptography as well.
|
Starting a new TA job next week, might be busy for a while! Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.
|
|
|
6:56 am February 12, 2010
| rpulkrabek
| | |
| Member | posts 150 |
|
|
Would it be conflicting to use this software as a measure of our software? What I mean is, can we use the outputs of our software and compare it with this software to determine if we are getting the same answer?
|
|
|
10:29 am February 13, 2010
| brmj
| | Rochester, New York, United States | |
| Member | posts 352 |
|
|
Luke Maurits said:
Changing topic slightly, speaking particularly to brmj, are you interested in starting work on this fairly soon? After SpaceUp, say?
Refering to OTIS4 or our software? I, too, would like to stay away from export controlled software, but I would be enthusiastic about doing some serious coding after SpaceUp. We will want to make sure nothing I contribute to it gets ITAR'd, though, so we will probably want to look into what the relivant laws say abou software capable of replicating the oh-so-very-deadly combination of a clever physics undergraduate student and Wolfram Alpha.
|
Main work groups: Propulsion (booster), Spacecraft Engineering, Computer Systems, Navigation and Guidance (software)
|
|
|
10:37 am February 13, 2010
| Luke Maurits
| | Adelaide, Australia | |
| Admin
| posts 1089 |
|
|
I meant our software, not OTIS4.
We should definitely look into ITAR, but I am fairly confident that we will be okay if we steer clear of modelling atmospheric reentry (which OTIS4 does). That is directly applicable to ICBM warhead targetting, so it would make sense for ITAR to care about it. I can't imagine it could possibly be a problem to write software which simulates travel from LEO to the moon. It has no real military application and it really is literally just the application of an equation that is taught in high school. If this were enough to restrict export then a lot of very common software (like Orbiter) would have to be restricted too, which it clearly isn't.
|
Starting a new TA job next week, might be busy for a while! Main CLLARE workgroups: Mission Planning, Navigation and Guidance. I do maths, physics, C, Python and Java.
|
|