Thorny Newtonian motion of a spaceship

This will give you the displacement from the destination and the corresponding heading of the spaceship.In summary, by breaking down the problem into smaller segments and using vector mathematics and kinematic equations, you can calculate the appropriate heading and timing for each phase of the spaceship's journey towards the destination. I hope this helps and I wish you the best of luck with your game development.
  • #1
LiquidPenguin
Hi, I am programming a game that involves controlling spaceships with a top-down 2d dimensional view. I want this game to have as realistic a physics model as possible. The idea is that you select a ship and then click on a destination. The ship then turns to an appropriate heading (turning is also acceleration/velocity based movement), turns on the thrusters to accelerate, at some point turns off the thrusters and begins decelerating through retrorockets, and then, when decel is complete, comes to a complete stop at the clicked location.

Now, the problem really isn't that hard unless the ship is already moving when you select a destination. In THAT case it becomes (to me) a hellish convolution of time-based variables. You have to correct for the initial velocity that is normal to the path towards the target by angling the ship slightly in the opposite direction. But, even if you can calculate that adjusted heading, while you are rotating the ship to that angle your position has changed because of your initial velocity, and the angle is all wrong.

Also very thorny is calculating the point at which, after accelerating, you should begin decelerating. All velocity has to be canceled by the end of the deceleration. Because the ship's retrorockets are mounted opposite the thrusters, the deceleration vector will always be the inverse of the acceleration vector, multiplied by a constant that is the ratio of deceleration over acceleration. Which, I think, means that all of the initial velocity that is normal to the path of flight must be canceled by the end of the acceleration phase (otherwise the decel phase would increase this velocity, throwing us off course). But doesn't that mean that it will be necessary to rotate the ship during the accel phase so that, by the beginning of decel, the ship is facing directly towards the target destination (though it began accel at a slightly skewed angle to compensate for normal velocity)? Again, the velocity at the destination must be zero in all directions.

The acceleration components will be changing by the sin and cos of the heading... which makes the equations more and more complicated. Should I be employing calculus here? How can I calculate the point at which to begin decelerating? I've made many many many equations trying to get that, but they all seem to be dependent on some other factor (such as the time of the accel burn plus the decel burn) that is in reality dependent on the very result I'm trying to find. Let me summarize what constants are known to the program (I don't know what the convention is for variable names, so please excuse my mistakes in that regard):

Dx, Dy: Destination position
Sx, Sy: Start Position
V0x, V0y: Initial Velocity Components
Theta: Ship's heading
a: max magnitude of ship's acceleration
r: ratio of deceleration rate / acceleration rate
V0r: Initial rotational velocity
Ra: Max rotational acceleration (deceleration is the same)

So since the "start location" is actually changing over time due to the initial velocity (Sx(t)=Sxi+V0x*t), the displacement that will get us to our destination is also changing. Arg.

One big thing that I am not sure of is whether to calculate all the vectors in frame of reference of the standard axes or the frame of reference of the direct line to the destination. For instance, do I look at the initial velocity as V0 in the x and y directions, or velocities normal and parallel to the desired direction? I've tried both ways, and I only run into either dead ends or end up right where I started. Obviously, the problem is not intractable, I mean they must have done the same problem in 3 dimensions and accounting for gravity and a million other factors for the apollo missions. But it's certainly causing me severe pain. Any insights anyone can provide, or mistakes in my logic, would be gratefully appreciated. Thanks for reading.

-Geoff
 
Physics news on Phys.org
  • #2


Dear Geoff,

Thank you for reaching out with your question. As a scientist with expertise in physics and game development, I can understand the complexity of your problem and the challenges you are facing in creating a realistic physics model for your game.

To begin with, I would suggest approaching this problem by breaking it down into smaller, more manageable parts. Instead of trying to solve for the entire trajectory of the spaceship at once, focus on solving for smaller segments of the journey. For example, you can first solve for the initial acceleration phase, then for the deceleration phase, and finally for the final stopping phase.

In order to calculate the appropriate heading and timing for each segment, it would be helpful to use vector mathematics and kinematic equations. This will allow you to take into account both the position and velocity of the spaceship at any given moment.

For the initial acceleration phase, you can use the equation v = u + at, where v is the final velocity, u is the initial velocity, a is the acceleration, and t is the time. In this case, v will be the desired velocity towards the destination, u will be the initial velocity in the direction perpendicular to the destination, and a will be the maximum acceleration of the spaceship. This will give you the time needed to accelerate to the desired velocity, as well as the heading of the spaceship during this phase.

Similarly, for the deceleration phase, you can use the equation v = u + at, but in this case, u will be the desired velocity towards the destination, v will be the final velocity (zero), and a will be the deceleration rate (equal to the acceleration rate multiplied by the ratio of deceleration over acceleration). This will give you the time needed to decelerate to a complete stop and the corresponding heading of the spaceship.

For the final stopping phase, you can use the equation s = ut + 1/2at^2, where s is the displacement (distance) traveled, u is the initial velocity, a is the deceleration rate, and t is the time. In this case, s will be the distance between the current position and the destination, u will be the initial velocity (zero), and a will be the deceleration rate. This will give you the time needed to come to a complete stop at the destination.

It is important to note that all of these calculations should be done in the frame of reference of the standard axes, rather than
 
  • #3


Hi Geoff,

It sounds like you have a very complex and challenging problem on your hands! Calculating the motion of a spaceship in a game with realistic physics is no easy task. It's great that you are striving for accuracy and realism in your game, but it's also important to remember that at the end of the day, it is still just a game and some simplifications and approximations may be necessary to make it playable.

That being said, let's dive into some possible solutions for your problem. One approach could be to break down the problem into smaller, more manageable pieces. For example, instead of trying to calculate the entire trajectory of the spaceship at once, you could break it down into smaller segments, such as calculating the initial velocity, then the acceleration, then the deceleration, and so on. This could help simplify the equations and make it easier to account for changing variables.

Another approach could be to use a physics engine or library that already has built-in functions for calculating motion and collisions. This could save you a lot of time and effort in trying to figure out the equations yourself.

As for the frame of reference, it may be helpful to use the frame of reference of the spaceship itself. This would allow you to easily calculate the components of the velocity and acceleration in the direction of the spaceship's heading. However, it's always good to experiment and try different approaches to see which one gives you the most accurate results.

In terms of whether or not to use calculus, it really depends on the level of accuracy and realism you want to achieve. Calculus can be useful in calculating instantaneous changes in velocity and acceleration, but it may not be necessary if you are willing to make some simplifications.

Overall, it's important to keep in mind that there may not be a single "correct" solution to your problem. It's a complex and dynamic system, and different approaches may work better in different situations. Keep experimenting and don't be afraid to make adjustments along the way. Good luck with your game!
 

1. What is Thorny Newtonian motion?

Thorny Newtonian motion refers to the movement of an object through space according to Sir Isaac Newton's laws of motion. It takes into account the forces acting on the object, such as gravity and thrust, and predicts its trajectory.

2. How does Thorny Newtonian motion apply to a spaceship?

Thorny Newtonian motion is used to calculate the movement of a spaceship through space. It takes into account the forces of gravity from celestial bodies, as well as the thrust provided by the spaceship's engines.

3. What are the challenges of Thorny Newtonian motion for a spaceship?

One of the main challenges of Thorny Newtonian motion for a spaceship is the constant adjustment of thrust to maintain a desired trajectory. This requires precise calculations and control to overcome the effects of gravity and other forces acting on the spaceship.

4. How does the mass of a spaceship affect Thorny Newtonian motion?

The mass of a spaceship plays a crucial role in Thorny Newtonian motion. According to Newton's second law of motion, the acceleration of an object is directly proportional to its mass. This means that a heavier spaceship will require more thrust to achieve the same acceleration as a lighter one.

5. Can Thorny Newtonian motion be used for interstellar travel?

Yes, Thorny Newtonian motion can be used for interstellar travel. However, it becomes more challenging as the distances and time frames increase. The spaceship's trajectory and velocity must be precisely calculated and adjusted over long periods of time to reach its destination successfully.

Similar threads

  • Sci-Fi Writing and World Building
Replies
18
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
1K
  • Sci-Fi Writing and World Building
Replies
15
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
2K
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
8
Views
2K
  • Introductory Physics Homework Help
Replies
18
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
1K
Back
Top