- #1
ryanie
- 9
- 0
Hello
Firstly i just registered, I am a final year computer science student and I am busy working on my thesis (the deadline is fast approaching) I am working this application of a rocket going into orbit and physics is not my forte. I need some help on converting the gimbal of a rocket engine into angular acceleration. The application I am writing only works on a 2d plane. It doesn't need to be exact but I am really struggling with this problem.
I have a basic rocket.
A rocket has a payload with set dimensions but specified mass.
Then any number of stages below that. A stage has
-mass
-1 to 15 rocket engines each producing a variable amount of thrust in kN
-length
-diameter
The payload is cone shaped and all the stages below that are cylindrical and all can be thought of as uniformly solid (except each stage can have different dimensions)
A rocket engine can be gimballed either left or right by a certain number of degrees.
This is the piece of code I have at the moment but it wrong because the rocket spins about to about half the speed of light immediatley when the simulation starts.
Basically what this code does is calculates the torque the engine are producing by multiplying the thrust the engine are producing perpedicular to the rocket (i just did some trigonometry to figure that out) by the center of mass (i could also be calculating that wrong) this is spiting out and extremely large amount of torque and i just don't know if its correct.
then its works out moments of interia which i use the method from this paper - http://www.philsrockets.org.uk/forces.pdf
I take the payload and each stage and multiply its mass from the distance from the center of mass then divide the torque by the final moment of inertia.
Theres a lot more code i can supply if you need to see where I am going wrong
Forgive me if I seem lazy but I afford to spend anymore time research physics, i feel i have bitten off more than i can chew with my dissertation and I am getting desperate to figure this out
Firstly i just registered, I am a final year computer science student and I am busy working on my thesis (the deadline is fast approaching) I am working this application of a rocket going into orbit and physics is not my forte. I need some help on converting the gimbal of a rocket engine into angular acceleration. The application I am writing only works on a 2d plane. It doesn't need to be exact but I am really struggling with this problem.
I have a basic rocket.
A rocket has a payload with set dimensions but specified mass.
Then any number of stages below that. A stage has
-mass
-1 to 15 rocket engines each producing a variable amount of thrust in kN
-length
-diameter
The payload is cone shaped and all the stages below that are cylindrical and all can be thought of as uniformly solid (except each stage can have different dimensions)
A rocket engine can be gimballed either left or right by a certain number of degrees.
This is the piece of code I have at the moment but it wrong because the rocket spins about to about half the speed of light immediatley when the simulation starts.
Code:
private void updateRocketRotation(double deltaT) {
double totalLength = 750;
for (Stage stage : stages) {
totalLength += stage.getLength();
}
System.out.println("adjacent thrust = " + stages.get(stages.size() - 1).getAdjacentThrust() + " kN");
double torque = (stages.get(stages.size() - 1).getAdjacentThrust() * 1000) * (totalLength - centerOfMass / 100);
System.out.println("torque = " + torque + " kN");
//payload distance from center of mass, payload has constant dimensions
double distCenterOfMass = centerOfMass - 375;
double momentOfIntertia = payload.mass * (distCenterOfMass / 100);
double distanceFromTop = 375;
for (Stage stage : stages) {
distanceFromTop += stage.getLength();
distCenterOfMass = centerOfMass - distanceFromTop;
if (distCenterOfMass < 0) {
distCenterOfMass = distanceFromTop - centerOfMass;
}
momentOfIntertia += payload.mass * (distCenterOfMass / 100);
}
System.out.println("final moment of intertia = " + momentOfIntertia + " kg/m^2");
double angularAcceleration = torque / momentOfIntertia;
rotation += angularAcceleration * deltaT;
System.out.println("set rocket rotation = " + rotation + " °");
}
Basically what this code does is calculates the torque the engine are producing by multiplying the thrust the engine are producing perpedicular to the rocket (i just did some trigonometry to figure that out) by the center of mass (i could also be calculating that wrong) this is spiting out and extremely large amount of torque and i just don't know if its correct.
then its works out moments of interia which i use the method from this paper - http://www.philsrockets.org.uk/forces.pdf
I take the payload and each stage and multiply its mass from the distance from the center of mass then divide the torque by the final moment of inertia.
Theres a lot more code i can supply if you need to see where I am going wrong
Forgive me if I seem lazy but I afford to spend anymore time research physics, i feel i have bitten off more than i can chew with my dissertation and I am getting desperate to figure this out
Last edited: