Calculating trajectory of spaceship-like object

  • Context: Undergrad 
  • Thread starter Thread starter hospadar
  • Start date Start date
  • Tags Tags
    Trajectory
Click For Summary
SUMMARY

This discussion focuses on calculating the trajectory of a spaceship-like object in a 2D video game environment. Key parameters include a set turning speed, maximum speed, and thrust directionality, with no external forces acting on the ship. The user specifies the desired final position and velocity, necessitating the computation of an effective trajectory through velocity and position math. Recommended resources include "Fundamentals of Astrodynamics and Applications" by David Vallado and MIT's guidance algorithm thesis, which covers Lambert's problem relevant to trajectory calculations.

PREREQUISITES
  • Understanding of 2D vector mathematics
  • Familiarity with spacecraft dynamics and thrust mechanics
  • Knowledge of Lambert's problem in astrodynamics
  • Basic principles of game physics and inertia
NEXT STEPS
  • Study "Fundamentals of Astrodynamics and Applications" by David Vallado for in-depth trajectory calculations
  • Explore MIT's thesis on guidance algorithms for practical applications of Lambert's problem
  • Research instantaneous delta-V maneuvers and their implementation in game physics
  • Investigate the "Space Flight Dynamics" course from the University of Colorado for advanced concepts
USEFUL FOR

Game developers, aerospace engineers, and anyone interested in simulating realistic spacecraft movement and trajectory calculations in video games.

hospadar
Messages
2
Reaction score
0
I want to make a simple little video game with spaceships in it. The game only takes place in 2 dimensions, although I suspect any math would be applicable to more dimensions.

The spaceships:
- Have a set turning speed (radians/sec, different ships may be able to turn faster or slower)
- Have a maximum speed (not realistic for space, but better for video games)
- Have thrusters which only provide thrust in a limited number of fixed directions. Most likely only forwards or only forwards and backwards.
- The spaceships will have inertia, and there will be no friction acting on them
- There will be no (predictable) forces acting on the spaceship other than the thrusters, no gravity, etc.
- The mass/inertia of the ship doesn't change ever


The User will specify where they want their spaceship to end up, and the heading and speed they want to have when their ship arrives at the destination. So I need to take an initial position and velocity, a final position and velocity, and generate a set of turns and thruster firings that will deliver the ship to the final position at the correct velocity.

So what I need to figure out is how to actually compute the best trajectory, when to turn, when to thrust, etc. It may not be possible to guarantee the best possible trajectory, but as long as I can compute a decent, reasonable looking trajectory, the rest can be left up to the user (if a user isn't happy with a trajectory they could plot it in many steps for example).

My quandary really is how to combine the velocity math with the position math. It's easy enough to calculate the turns and thruster firing which will change one velocity to another (simple vector addition/subtraction), and it doesn't seem terribly difficult to figure out how to get a ship with a certain velocity from one point to another (more relatively simple vector math).

Any thoughts/suggestions/references would be much appreciated.

Thanks!
 
Physics news on Phys.org
You are, perhaps innocently, asking us to write a book for you. Multiple books, in fact, and all at the graduate level.

Some refererences:

Fundamentals of Astrodynamics and Applications by David Vallado is an excellent reference. Some of the section regarding Lambert's problem is available at Google books: http://books.google.com/books?id=PJLlWzMBKjkC&pg=RA1-PA448#v=onepage&q=&f=false

Fundamentals of Astrodynamics by Bate, Mueller, and White also covers the topic.

Chapter 2 ("Guidance Algorithm") of http://dspace.mit.edu/bitstream/handle/1721.1/34137/67775726.pdf?sequence=1" does a nice job of describing Lambert's problem.

The graduate level aerospace engineering class "Space Flight Dynamics" at University of Colorado covers this topic (along with many other topics). Home page for ASEN5050: http://ccar.colorado.edu/asen5050/ASEN5050/Overview.html. Click on the "Lectures" button at the top. Lectures 8-12 cover orbital maneuvers. Lecture 11 covers "Lambert's Problem".


Note that all of the above except for the thesis paper assume impulsive delta-Vs (instantaneous changes in velocity). Using finite burns, which is what you are asking about, is beyond the scope of most graduate level textbooks.


To spice things up for your users, you might want to occasionally flash the message "Lambert target algorithm failure" to your users. Seeing that message certainly did spice things up for the astronauts and mission controllers for STS-49 and STS-51. See http://ston.jsc.nasa.gov/collections/TRS/_techrep/CR-2007-213697.pdf for details.
 
Last edited by a moderator:
Thanks for the reply, very helpful.

I would actually be useing instantaneous delta-v "under the hood" although it would appear to the user visually as smooth acceleration.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
6
Views
2K
  • · Replies 74 ·
3
Replies
74
Views
7K