Split gravitational force into x, y, and z componenets

Click For Summary

Homework Help Overview

The discussion revolves around splitting gravitational force into its x, y, and z components in the context of an n-body simulation in three-dimensional space. The original poster is attempting to understand how to apply vector mechanics to decompose a force vector derived from gravitational interactions.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning

Approaches and Questions Raised

  • The original poster describes their understanding of force calculations in two dimensions and attempts to extend this to three dimensions. They express uncertainty about how to derive the z component of the force vector. Other participants inquire about the original poster's background in vector mechanics and suggest seeking assistance from someone knowledgeable in physics.

Discussion Status

Participants are exploring various approaches to the problem, with some suggesting that the original poster consider the orientation of the coordinate system. The original poster acknowledges the complexity of their static coordinate system and seeks clarification on how to adapt their calculations accordingly. There is no explicit consensus yet, but multiple lines of reasoning are being discussed.

Contextual Notes

The original poster mentions having a background in linear algebra and computer science, but limited knowledge of physics, which may affect their understanding of the problem. They also note the dynamic nature of forces in their simulation, which complicates the mathematical approach.

RossH
Messages
74
Reaction score
0
Hi. I'm not really all that knowledgeable about physics, so I'm sorry if the answer to this is obvious.

Homework Statement


I am writing a program for a computer science class in which I am doing an n-body simulation in 3-dimensional space. Currently, I have figured out the gravitational force along the hypotenuse between two bodies. Now I have to split these up into the x, y, and z components, and this is where I am having trouble.

Homework Equations


Force between two objects (force_t)=G*m1*m2/r^2
Typically, force_x=force_t*cos(angle between x-axis and hypotenuse)
force_y=force_t*sin(angle between x-axis and hypotenuse)

The Attempt at a Solution



So, I can figure out my triangle. I know that my two bodies are located at (x1, y1, z1) and (x2, y2, z2), so I have my triangle. And I am fairly certain that the above equations will hold for x and y, even though I'm in three dimensions, but I'm just not sure what the corresponding equation for the z component will be. My thought was that the combination of the three forces has to equal the total force, so perhaps I solve for the z component algebraically using the pythagorean theorem, but I have no way to check whether or not this is true.

Anyway, any help would be appreciated. Thanks!
 
Physics news on Phys.org
How much vector mechanics have you studied?
 
SteamKing said:
How much vector mechanics have you studied?

None. I've had a little linear algebra if that's related. I'm a computer science major with a minor in math.
 
It's difficult to explain so much in a forum like this. Have you sought assistance from someone studying physics?
 
SteamKing said:
It's difficult to explain so much in a forum like this. Have you sought assistance from someone studying physics?

That's a good idea. I'll look into it. Do you know of any site that explains this? I've been googling for a site that explains the math in-depth, but have had no success.
 
If I am not mistaking I think you can just orient the coordinate system so the force is along one axis. I don't know any CS though.
 
khemist said:
If I am not mistaking I think you can just orient the coordinate system so the force is along one axis. I don't know any CS though.

That would be problematic because in the libraries that I am using to write this program I have a static coordinate system, and the forces and direction of forces are dynamic, since I'm doing an n-body simulation. Unless you know of a way that I can recalculate the coordinate system? The programming isn't a problem; it's just the math that's giving me grief.
 
Here's how I think I might be able to solve it (keep in mind that this is based on a decent amount of math but only one year of high-school level physics).

I am trying to split up a force vector in a 3-dimensional space into three components, and I definitely have enough information to solve for all triangle side lengths with no trouble.

I already know how to solve for the force in 2-dimensions. Fx=cos(theta)*F_total and Fy=sin(theta)*F_total, where theta is the angle of incidence with the x-axis.

Therefore, I can split this into two triangles. One will be a triangle in the x-y plane and one will be a triangle in the x-y-z space. The hypotenuse of the triangle in the x-y plane will be one leg of the triangle in x-y-z space.

To picture this: a square room. One triangle is made by the line from one corner on the floor of the room to the corner farthest from it on the ceiling. Another triangle is the half of the room that is on the floor, connecting to the third side of the first triangle.


Then, I can easily solve for the leg lengths of the second triangle. Therefore, if I use the typical math described above to find the force on each of the legs of the original triangle, I can use this information to find the force in one direction and then a second force, which will be the combination of the x-y force.

I can use x-y force with the second triangle described above and split it up into its components to find the individual forces that are in this triangle.

I think that this should work, but obviously I have no means to test it. Does this sound alright to you? Obviously it's rough. Sorry, I couldn't find a good picture online to describe what I mean by two triangles.
 

Similar threads

Replies
2
Views
2K
Replies
5
Views
2K
Replies
4
Views
907
Replies
3
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 28 ·
Replies
28
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K