Help Chloé Plot Rocket Trajectory from Earth to Moon

AI Thread Summary
Chloé is developing a C program to plot a rocket's trajectory from Earth to the Moon, focusing on calculating the acceleration in the x-direction based on gravitational forces. The equation provided involves vectors representing the positions of the rocket and the Moon, and Chloé seeks clarification on how to compute these vectors and their components. It is confirmed that "rr^2" refers to the modulus squared of the vector, and that the y-coordinates do influence the gravitational force in the x-direction. Additionally, while some suggest using angles and cosine for calculations, it is explained that the existing equations already account for these components. The discussion emphasizes understanding vector relationships and ratios to simplify the calculations needed for the program.
Hoofbeat
Messages
48
Reaction score
0
HELP! I'm trying to write a computer program (C) to plot the trajectory of the rocket as it flies from Earth to Moon. In the information sheet it says:

ax = -GMe*(1/rr^2)*(xr/|rr|) - GMm*(1/[rr-rm]^2)*([xr - xm]/[|rr - rm|])

Where:
ax = acceleration in x-direction (we're working in xy coords)
rr = a vector from the Earth to the Rocket
rm = a vectore from the Earth to the Rocket
xr = Rocket's x coordinate
xm = Moon's x coordinate
Me = Earth's Mass
Mm = Moon's Mass

Now, in order to input this acceleration in the x direction into my program I have to resolve the vector's into their x-direction BUT also be aware that their y co-ords will have an effect on the gravitational force felt in the x direction.

Could some-one explain to me what I actually have to compute then? Also, when it says "rr^2" does this mean the modulus squared?!

Please help, I'm really stuck! Thanks
Chloé
xxx
 
Physics news on Phys.org
Hoofbeat said:
HELP! I'm trying to write a computer program (C) to plot the trajectory of the rocket as it flies from Earth to Moon. In the information sheet it says:

ax = -GMe*(1/rr^2)*(xr/|rr|) - GMm*(1/[rr-rm]^2)*([xr - xm]/[|rr - rm|])

Where:
ax = acceleration in x-direction (we're working in xy coords)
rr = a vector from the Earth to the Rocket
rm = a vectore from the Earth to the Rocket
I'm guessing you meant to write "a vector from the Earth to the Moon" here, right?
xr = Rocket's x coordinate
xm = Moon's x coordinate
Me = Earth's Mass
Mm = Moon's Mass

Now, in order to input this acceleration in the x direction into my program I have to resolve the vector's into their x-direction BUT also be aware that their y co-ords will have an effect on the gravitational force felt in the x direction.

Could some-one explain to me what I actually have to compute then? Also, when it says "rr^2" does this mean the modulus squared?!

Please help, I'm really stuck! Thanks
Chloé
xxx
The rocket's position vector rr just has two components, the rocket's x-coordinate and its y-coordinate, or (xr, yr). So if you figure out rr^2 and |rr| as a function of the vector's components, you can see that they will depend on both the x-coordinate and the y-coordinate--that's all they mean when they say "be aware that their y co-ords will have an effect on the gravitational force felt in the x direction".
 
Thanks, yes I did mean that sorry! Was very stressed and panicky as had been trying to write the program all day and was in desperate need to write the msg before I had a Physics tutorial and then a training session straight after.

One more question...I asked someone else for advice on the same problem and they quoted the following:

"Mathemactically, rr^2 = |rr|^2.cos(rr,rr) = |rr|^2.cos0 = |rr|^2. So you're right, it means modulus squared.

xr/|rr| = cos(rr, Ox) where (rr, Ox) is the angle between rr and x positive coordinate.

Therefore, if we consider the force acts on the Rocket by the Earth due to x axis
Fe = [GMem/rr^2] .cos(rr, Ox) = [GMem/rr^2].xr/|rr|
where m is mass of the Rocket"

So obviously, they agree with you (and me!) that rr^2 is the same as the modulus squared. However, they suggest using angles and cosines when considering the force/acceleration! I didn't think this would really be necessay as the vector equations give the directions so surely I don't have to resolve them as well? :rolleyes:
 
Hoofbeat said:
Thanks, yes I did mean that sorry! Was very stressed and panicky as had been trying to write the program all day and was in desperate need to write the msg before I had a Physics tutorial and then a training session straight after.

One more question...I asked someone else for advice on the same problem and they quoted the following:

"Mathemactically, rr^2 = |rr|^2.cos(rr,rr) = |rr|^2.cos0 = |rr|^2. So you're right, it means modulus squared.

xr/|rr| = cos(rr, Ox) where (rr, Ox) is the angle between rr and x positive coordinate.

Therefore, if we consider the force acts on the Rocket by the Earth due to x axis
Fe = [GMem/rr^2] .cos(rr, Ox) = [GMem/rr^2].xr/|rr|
where m is mass of the Rocket"

So obviously, they agree with you (and me!) that rr^2 is the same as the modulus squared. However, they suggest using angles and cosines when considering the force/acceleration! I didn't think this would really be necessay as the vector equations give the directions so surely I don't have to resolve them as well? :rolleyes:
Right, the equation already takes care of resolving the force into components. The idea of the equation is that the ratio (component of total force from Earth along x-axis)/(total force from earth) will be equal to the ratio (distance from Earth along the x-axis)/(total distance from earth)...so, just multiply both sides by the total force from earth, and you get (component of total force from Earth along x-axis) = (total force from earth)*[(distance from Earth along x-axis)/(total distance from earth)], or Fe*(xr/|rr|). You can see that those two ratios must be equal, because the total force vector and the total distance vector are parallel to each other, so if you make a right triange with the total force as the hypotenuse and the x-component and y-component of the force as the other two sides, it will look just like a right triangle with the total distance vector as the hypotenuse and the x-component and y-component of the distance as the other two sides...if two right triangles are similar, the ratio of the hypotenuse and the side along the x-axis will be the same for both. For a right triangle you could also find the length of the side along the x-axis by multiplying the length of the hypotenuse by the cosine of the angle the hypotenuse makes with the x-axis, but if you already know the ratio between xr and |rr| then you can just use the equal-ratio assumption to find the force along the x-axis.
 
I have recently been really interested in the derivation of Hamiltons Principle. On my research I found that with the term ##m \cdot \frac{d}{dt} (\frac{dr}{dt} \cdot \delta r) = 0## (1) one may derivate ##\delta \int (T - V) dt = 0## (2). The derivation itself I understood quiet good, but what I don't understand is where the equation (1) came from, because in my research it was just given and not derived from anywhere. Does anybody know where (1) comes from or why from it the...
Back
Top