Trajectory in gravitational field

Click For Summary

Discussion Overview

The discussion revolves around the mathematical modeling of trajectories in a gravitational field, specifically focusing on deriving equations for position as functions of time in a programming context using the Unity game engine. Participants explore the integration of gravitational potential and the application of differential equations of motion.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant seeks an equation for r and phi as functions of time, starting from the gravitational potential equation.
  • Another participant suggests that numerical integration of the differential equations of motion is necessary.
  • A question is raised about the form of the differential equations, specifically whether they include gravitational and centrifugal forces.
  • Equations in polar coordinates are provided, indicating the relationship between radial distance and angular motion.
  • One participant asserts that using spherical coordinates is effectively the same as polar coordinates for this problem due to the two-dimensional nature of the orbits.
  • Energy conservation principles are introduced, leading to a differential equation for the orbit in polar coordinates.
  • A participant expresses a need to derive r as a function of time and phi as a function of time, indicating a challenge in obtaining the necessary derivatives.
  • Another participant reassures that the equations provided are suitable for numerical integration without modification.

Areas of Agreement / Disagreement

Participants generally agree on the need for numerical methods to solve the equations of motion, but there is no consensus on the best approach to derive r(t) and phi(t) from the given equations.

Contextual Notes

Some participants mention the need to understand numerical methods for solving differential equations, indicating a potential gap in knowledge regarding these techniques.

GhostLoveScore
Messages
149
Reaction score
9
So, I'm attempting to programm orbit in Unity game engine. So I need equation that shows r and phi depending on time.

Equation for gravitational potential is

U(r)=-k/r+M^2/(2*μ*r^2). Force is -1*derivation of U(r) by r. So I get lots of stupid stuff.

If anybody could help me to integrate this equation to get r(t) I would be grateful.
 
Physics news on Phys.org
It doesn't work that way. You should integrate the differential equations of motion numerically.
 
Can you please explain, what differential equations? Is it m*d^2(x)/dt^2=gravitational force + centrifugal force?
 
If you use polar coordinates [itex](\rho,\varphi)[/itex], then the equations are:

[itex]\rho^3\ddot \rho+GM \rho=R^4 \omega^2[/itex]
and
[itex]\rho^2 \dot\varphi=R^2 \omega[/itex]

where [itex]R[/itex] is the initial distance from the centre of force and [itex]\omega[/itex] is the initial angular speed.
 
Actually I'm using spherical coordinate system
 
GhostLoveScore said:
Actually I'm using spherical coordinate system

Well, there is absolutely no difference. Because the orbits of an inverse-square field lie on a plane and so the problem is two dimensional and spherical coordinates reduce to polar coordinates in two dimensions.
 
Don't forget that
[tex]M=\mu r^2 \dot{\varphi}=\text{const}.[/tex]
Then you can use the energy-conservation Law
[tex]\frac{\mu}{2} \dot{r}^2 +U(r)=E=\text{const}[/tex]
substitute
[tex]\dot{r}=\frac{\mathrm{d}r}{\mathrm{d} \varphi} \dot \varphi=\frac{\mathrm{d}r}{\mathrm{d} \varphi} \frac{M}{\mu r^2}.[/tex]
With this you get a differential equation for the orbit in terms of polar coordinates [itex]r=r(\varphi)[/itex].

To integrate it, just substitute
[tex]s=\frac{1}{r}[/tex]
into this differential equation.

You find the calculation in my mechanics FAQ (which is, however, in German, but with a lot of equations, so that you should be able to follow the arguments with the above given summary).

http://theory.gsi.de/~vanhees/faq/mech/node42.html
 
Thanks guys, that will help.

vanhees71 - in the end I get r=r(phi), but I need r=r(t) and phi=phi(t).

From shyan's equation I get

d[itex]\varphi[/itex]/dt=R^2*[itex]\omega[/itex]/ρ^2. I don't know how to get dρ/dt
 
Last edited:
The equations I gave are already proper for being integrated numerically. You don't need to change them. You only need to learn about some methods of numerically solving differential equations.
 
  • #10
OK, I will look into that. Few years ago we were solving it in Sage (python).
 

Similar threads

  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
6
Views
2K
  • · Replies 21 ·
Replies
21
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K