Rocket science, thrusters and spin

AI Thread Summary
The discussion revolves around unexpected behavior in a game using the Box2D physics library, particularly regarding the simulation of a spaceship's thruster effects. When the spaceship rotates while traveling, the expected curved path does not occur; instead, it stabilizes back to its original velocity direction. The issue was traced to incorrect calculations of the thrust vector, which were adjusted to account for the spaceship's speed and direction. The conversation also touches on the implications of thrust direction and mass flow in relation to the rocket's velocity, emphasizing that thrust remains constant regardless of the ship's speed. Ultimately, the adjustments made to the thrust calculations resulted in more realistic behavior in the game simulation.
Zoomulator
Messages
3
Reaction score
0
I'm currently developing a game using a pre-existing physics library called Box2D and I've stumbled into some unexpected behavior that I can't pinpoint being actual physics or an artifact of the programming.

My spaceship is traveling through a 2D vacuum facing straight along it's velocity vector. If I apply a force right behind it to simulate a thruster, it accelerates and continues on the same path.
Now, say I rotate the spaceship 90deg while it's still traveling in the same direction. I fire the thruster and expect it to keep facing 90deg off it's former course and make a curved path, but instead it rotates back toward it's velocity's direction.
I would also expect that if the spaceship was spinning, that it'd keep spinning if I fired the back thruster and that it'd expand out into a spiral path. Instead it stabilizes the spin and runs off straight.

So basically the question is, will a thruster being the only force and pointed right at the center of mass cancel out spin?
 
Physics news on Phys.org
You are correct. A force acting through the center of mass of a body with only alter its linear momentum (that is, velocity when mass is constant), there will be no torque from the the force around the center of mass and therefore no change to the object speed of rotation.

Looks like the library perhaps either is assuming some modeling elements by itself or is not made for physical realistic simulations.
 
Thank you for your reply.
I found the cause and it was in my own calculation of the thrust's vector.

I was trying to make an accurate thruster which generates less force the higher speed the speed of the spaceship is. I thought simply subracting the velocity vector of the thruster with the velocity of the ship times the thrust's mass would be enough, but it resulted in rotation of the thrust vector, so it affected the rotation.

Now instead, I calculate the speed of the craft in the direction of the thruster by a dot product between the normalized thrust vector and the ship's velocity vector. ( nthrustX*svX + nthrustY*svY). And then do thrustNormalVector * speedDifference * exhaustMass

The result may have flaws, but it's a lot more believable!
 
Be aware, that a rocket thruster working on a body in free fall will generate more thrust over time (due to less reaction mass left in the body), not less. Perhaps [1] can provide you with some useful background information.

[1] http://en.wikipedia.org/wiki/Spacecraft_propulsion
 
From a pilot's perspective, Zoomie, I have to ask something that is so rudimentary as to appear stupid. Are your rocket motors both balanced and ignited at precisely the same time? Are their burn rates and durations equal? Is thrust equal from one side to the other? There are several other questions which can help to narrow things down.
 
@Filip Larsen
That will actually be handled automatically since I only apply forces and let the physics engine simulate the movement of the object. What I was trying to calculate was the force of which the exhaust leaves the nozzle, so that I can put the same opposite force against the ship. So if I chose to change the ships mass when it burns fuel, it will result in more efficient thrust.

I've got another question on that subject, just to see if my assumption is correct. If friction is completely neglected, will a rocket's maximum velocity be equal to the exhaust's velocity? I.e if a ship is traveling at 10'000kmph and it's exhaust leaves the ship at 10'000kmph, will it have no affect on the ships velocity or will it exert the same force as if the ship was standing still?

Danger said:
From a pilot's perspective, Zoomie, I have to ask something that is so rudimentary as to appear stupid. Are your rocket motors both balanced and ignited at precisely the same time? Are their burn rates and durations equal? Is thrust equal from one side to the other? There are several other questions which can help to narrow things down.

@Danger
When testing I only used one engine aimed towards the center of mass, though they had a bug resulting in the exhaust force vector getting skewed in a way that stabilized the ship's flypath. The buggy code has been replaced.
All forces are calculated and added up before a physics simulation step, so the motors can be fired exactly at the same time with my precise input.
 
Okay, then... that pretty much ends my involvement in this thread. What I posted about was the only thought that I had on the matter. I'll continue to monitor, and hope that you find your answers soon.
 
Zoomulator said:
That will actually be handled automatically since I only apply forces and let the physics engine simulate the movement of the object. What I was trying to calculate was the force of which the exhaust leaves the nozzle, so that I can put the same opposite force against the ship. So if I chose to change the ships mass when it burns fuel, it will result in more efficient thrust.

OK. Just to make sure, my comment was to your remark
I was trying to make an accurate thruster which generates less force the higher speed the speed of the spaceship is
which is not correct. By the way, thrust force from a rocket engine is usually calculated as \dot{m}v_e where \dot{m} is the mass flow rate and v_e is the exhaust velocity of the propellants or reaction mass. Since both are often constant, the thrust force of a rocket is constant no matter what speed it has.

I've got another question on that subject, just to see if my assumption is correct. If friction is completely neglected, will a rocket's maximum velocity be equal to the exhaust's velocity? I.e if a ship is traveling at 10'000kmph and it's exhaust leaves the ship at 10'000kmph, will it have no affect on the ships velocity or will it exert the same force as if the ship was standing still?
In accordance with the constant thrust mentioned above the rocket engine will (as long as it operates in the same environment with the same mass flow and exhaust velocity as before) provide the same thrust force as if the ship was standing still. If you wonder how velocity then relates to such a constant thrust rocket, you may want to read a bit about the rocket equation [1].

[1] http://en.wikipedia.org/wiki/Tsiolkovsky_rocket_equation
 
If a rocket is rotating, then the internal fuel experiences a tangental component of acceeleratoin as it travels towards and enters the rocket engine, which could (and apparently) have a corrective effect as shown by the results of your experiment.

Zoomulator said:
Will a rocket's maximum velocity be equal to the exhaust's velocity?
It can be faster given sufficient exhaust velocity and a very large fuel to payload ratio. Multiple stages can help increae the fuel to payload ratio.

http://en.wikipedia.org/wiki/Tsiolkovsky_rocket_equation
 
  • #10
rcgldr said:
If a rocket is rotating, then the internal fuel experiences a tangental component of acceeleratoin as it travels towards and enters the rocket engine, which could (and apparently) have a corrective effect as shown by the results of your experiment.

If you mean to imply that propellant flow in a rotating rocket somehow result in a lateral (sideway) thrust component when the non-rotating rocket does not, then that is not true. In addition, I doubt that the simulation in question simulates the actual flow of propellants.
 
  • #11
Filip Larsen said:
If you mean to imply that propellant flow in a rotating rocket somehow result in a lateral (sideway) thrust component ...
Not a thrust component, a reaction force related to tangental acceleration as the fluid flows from a somewhat centrally located postion on a rotating rocket to the engine end of the rocket. It would be the coriolis force on the fluid as observed from within the rocket. I'm not sure how this would affect the direction of thrust.
 
  • #12
rcgldr said:
Not a thrust component, a reaction force related to tangental acceleration as the fluid flows from a somewhat centrally located postion on a rotating rocket to the engine end of the rocket. It would be the coriolis force on the fluid as observed from within the rocket. I'm not sure how this would affect the direction of thrust.

To me that seems a bit hypothetical. The only way I can see that the mass flow of propellants could give a resulting torque on the rocket would be if the flow somehow left the rocket with net angular momentum or if the flow path was highly asymmetric along the thrust axis, neither of which seems likely in normal designs. In any case a practical rocket needs to have some control of thrust direction anyway which should cancel any unwanted torquing.

Though, you may be right that if someone were to just stick some tanks and pipes together without consideration to angular momentum (and a million other effects and constrains) you would most likely end up with a rocket that, failing to explode, spins vigorously during "fixed direction" thrusting.
 
Back
Top