Calculating trajectory of spaceship-like object

  • Thread starter hospadar
  • Start date
  • Tags
    Trajectory
In summary: My goal would be to make the user feel like they are in control, even if they are not actually controlling the ship directly.In summary, you are asking us to create a 2D video game with spaceships where the user can specify the heading and speed they want the ship to arrive at. You need to combine math to create a decent looking trajectory.
  • #1
hospadar
2
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
  • #2
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:
  • #3
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.
 

What is the formula for calculating the trajectory of a spaceship-like object?

The formula for calculating the trajectory of a spaceship-like object is F = m x a , where F is the force acting on the object, m is the mass of the object, and a is the acceleration. This formula is based on Newton's Second Law of Motion.

What factors affect the trajectory of a spaceship-like object?

Several factors can affect the trajectory of a spaceship-like object, including the initial velocity, mass of the object, and the force of gravity. The shape and angle of the object can also play a role, as well as any external forces acting on the object, such as air resistance or gravitational pull from other celestial bodies.

How do you account for gravitational pull when calculating trajectory?

To account for gravitational pull, the formula becomes F = (G x m1 x m2)/r² , where G is the gravitational constant, m1 and m2 are the masses of the objects, and r is the distance between them. This formula is based on Newton's Law of Universal Gravitation.

Can the trajectory of a spaceship-like object be altered during flight?

Yes, the trajectory of a spaceship-like object can be altered during flight. This can be done by adjusting the force applied to the object, changing its direction or speed, or by using the gravitational pull of other celestial bodies to change its path.

How do you calculate the landing point of a spaceship-like object?

To calculate the landing point of a spaceship-like object, you will need to consider the initial velocity, mass, and any external forces acting on the object. You will also need to take into account the shape and angle of the object, as well as any changes in trajectory during flight. Using these factors, you can use mathematical equations to predict the landing point of the object.

Similar threads

Replies
1
Views
772
Replies
8
Views
6K
Replies
3
Views
2K
Replies
3
Views
4K
  • Mechanics
Replies
4
Views
3K
Replies
3
Views
901
Writing: Input Wanted Number of Androids on Spaceships
  • Sci-Fi Writing and World Building
Replies
9
Views
442
  • Special and General Relativity
3
Replies
98
Views
2K
Replies
15
Views
2K
  • Aerospace Engineering
Replies
5
Views
1K
Back
Top