Rocket engine gimballing - torque and angular acceleration question

Click For Summary

Discussion Overview

The discussion revolves around the calculation of angular acceleration for a rocket engine's gimbal system within a 2D simulation. Participants explore the physics involved in torque, moment of inertia, and the integration of angular motion, while addressing coding issues related to these calculations.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • The original poster (ryanie) describes a simulation involving a rocket with multiple stages and gimballed engines, seeking help with converting gimbal movement into angular acceleration.
  • ryanie provides a code snippet that calculates torque based on thrust and center of mass, but expresses concern over the resulting angular acceleration being excessively high.
  • Bandersnatch requests clarification on the equations used for torque calculation, the units and values for mass and thrust, and the output range for torque.
  • Another participant points out potential errors in the moment of inertia calculation, suggesting that the distance to the center of mass should be squared and that the mass of the stages should be used instead of the payload mass.
  • This participant also notes that the integration method used for angular motion may be incorrect, recommending a two-step integration process to obtain angular rotation.
  • ryanie acknowledges the feedback but indicates a lack of time to address the issues, stating that the current implementation will suffice for the thesis requirements.

Areas of Agreement / Disagreement

Participants express differing views on the correctness of the calculations and coding approach, with some identifying potential errors while others suggest that the current implementation may be acceptable given the time constraints. No consensus is reached on the specific solutions to the problems raised.

Contextual Notes

Limitations include potential misunderstandings of the physics involved, assumptions about the uniformity of the rocket's structure, and the need for clearer definitions of variables and units in the calculations.

ryanie
Messages
9
Reaction score
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.

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:
Science news on Phys.org
Hi ryanie,

It's hard to identify the problem just from that piece of code(not to mention programming is not my forte ;) ).

Can you give us
1. the equations you used to calculate the torque
2. the units and range of values for mass, thrust and the dimensions of the rocket/stages that you use
3. the range of values for the torque that the program is outputting(that you say are too high)?
 
Hi Bandersnatch

Thanks for the reply. Unfortunatley i don't have time at the moment to give an in depth reply. The solution I am using seems be working but its almost undoubtly incorrect.

I will be in touch later tonight
 
A few things I noticed at first glance:

Moment of inertia has units of mass times length squared. So this line:

momentOfIntertia += payload.mass * (distCenterOfMass / 100);

is wrong, you probably want to be squaring the distance to the centre of mass. Also in your debug text you might want to change the units displayed to kg.m^2.

Why are you adding the payload mass to the moment of inertia for every stage, you only have one payload right? I think you want to be adding the mass of the stage rather than the mass of the payload in that line.

And this line:

rotation += angularAcceleration * deltaT;

You are doing a simple numerical integration of the angular acceleration, which will give you angular velocity. You need to integrate again to get the angular rotation, something like this:

angularVelocity += angularAcceleration * deltaT;
angularRotation += angularVelocity * deltaT;
 
sjb27 and Bandersnatch.

I do really appreciate you guys taking the effort to help, alas I have run out of time and cannot afford to work on the problem any longer.

My thesis is not graded on the 'correctness' of the application rather the things you learned along the way kinda thing.

I want to focus my attention else where on the application, the current implementation will suffice. Maybe in a couple of week ill come back and correct it and share my lovely little simulation with you...and then you can scoff...

:) Thanks again
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 42 ·
2
Replies
42
Views
6K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 18 ·
Replies
18
Views
7K
  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 7 ·
Replies
7
Views
7K
  • · Replies 5 ·
Replies
5
Views
4K