[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 17 KB, 831x569, gravity.png [View same] [iqdb] [saucenao] [google]
1761961 No.1761961 [Reply] [Original]

Have a small problem I hope you can help me with /sci/.

Say you have a spaceship with a trajectory given by three parametric equations x(t), y(t) and z(t). I'm trying to incorporate gravity into my model now and the issue is this:

If gravity is given by G * m1 * m2/r^2 then each successive value for gravity feeds back into the distance value. It seems that there is no other way to predict a future position of an object experiencing the force of gravity than working it out iteratively (eg. runge kutta integration) because of the way gravity "feeds back" into the calculation. .

Is there a way to work out the displacement due to gravity over time as an equation that accounts for changing distance?

>> No.1762000

>>1761961

is the spacecraft at constant speed before it comes near the planet?

>> No.1762004

No. There is no closed solution. Runge Kutta that shit.

>> No.1762007

>>1762004
Well... if you only have two bodies there is a solution. But if you want to add a moon or anything it's not. That's called the 3 body problem.

>> No.1762010

>>1761961
just change your coordinate systems and learn to multivariable calculus

you cant use Cartesian coordinates, switch to radial and transverse coordinates

>> No.1762012

Here's the solution to the two body problem. They both form ellipses around their center of mass.

http://en.wikipedia.org/wiki/Two-body_problem

But to do anything interesting... runge kutta.

>> No.1762070

>>1762007
> Well... if you only have two bodies there is a solution.

There is no closed-form solution for position as a function of time. You have to use numerical methods.

This is true even for the simplest case, where a body with negligible mass orbits around a significantly more massive body; see:

http://en.wikipedia.org/wiki/Kepler%27s_laws_of_planetary_motion#Eccentric_anomaly

Kepler's laws can also be used for the slightly more complex case of the two-body problem, where both bodies have non-negligible mass. In this case, both bodies have elliptical orbits with the same period, each with a focus at the barycentre.

However: Kepler's laws conserve energy, which isn't the case e.g. when a spaceship performs a gravitational slingshot around a planet which is orbiting a star.

This is the more general N-body problem, and not only is there no closed-form solution, there isn't actually any kind of solution, as the system is chaotic.

>> No.1762075

>>1762070
You're saying a slingshot maneuver doesn't conserve energy?

>> No.1762086

Euler's restricted 2 body problem (M>>>m) is easier to address with polar coordinates whose origin is in the planets centre, if its not planar movement then use cylindrical coords (includes z(t)). That way is easier because gravity only acts on the radial component and the angular one is free of forces (unless there are more bodies)

>> No.1762107

>>1762075
> time travel
> conserve energy

>> No.1762115

>>1762075
slingshots do, they just don't take the energy away from the planet. It's the third party involved

>> No.1762119

>>1762107

>kepler problem
>relativistic effects

>> No.1762136

>>1762075
> You're saying a slingshot maneuver doesn't conserve energy?

It conserves energy insofar as the energy gained by the spacecraft is lost from the planet (or vice versa for braking). In practice, the energy transferred will be a substantial proportion of the spacecraft's total energy and a negligible proportion of the planet's total energy.

Kepler's laws assume a stationary body and a moving body with no transfer of energy, so the moving body has constant energy: as the potential energy increases, kinetic energy decreases.

If you modify this for a binary system, you have two bodies which each conserve energy if you assume a potential field centred on the barycentre (ultimately, potential energy is stored in the system as a whole; any division of the potential energy amongst the individual bodies is arbitrary).

>> No.1762137

>>1762115
If you slingshot around a planet, I'm pretty sure the energy gets taken from the planet, not the sun.

>> No.1762140
File: 75 KB, 600x720, GENTLEMAN.jpg [View same] [iqdb] [saucenao] [google]
1762140

>>1761961
>Is there a way to work out the displacement due to gravity over time as an equation that accounts for changing distance?

Of course, this is a very very simple problem. You just use Lagrangian Dynamics.

\Thread

>> No.1762141

>>1762136
right, that makes sense.

>> No.1762144
File: 43 KB, 800x600, 634014860607782600-BROFIST.jpg [View same] [iqdb] [saucenao] [google]
1762144

>>1762140
Real Physics in this Bitch

>> No.1762145
File: 9 KB, 251x192, 1274807570460.jpg [View same] [iqdb] [saucenao] [google]
1762145

>>1762140

>> No.1762147

In other words, OP, runge kutta that bitch.

>> No.1762182

If you want the future position when it has passed the planet, this is basically a scattering problem against a potential given by gravity (which obeys the same kind of 1/r^2 law as the electrostatic force). This is rather simple to solve, and is known as Rutherford scattering, see http://en.wikipedia.org/wiki/Rutherford_scattering

>> No.1762193

work around it with a gravity potential,
Write gravity as a field, en discribe the spaceship as a particle moving through it.

This way you can write masses that effect the ship as different strenght point sources

>> No.1762199

>>1762140
Lagrangian dynamics can't handle an n-body problem either

>> No.1762205

>>1762199
Well you can work out the equation.

Now solving it with elemenatry functions... No, that's been proven impossible.

>> No.1762210

The universe manages to solve it.

>> No.1762255

>>1762193
I think I will solve the problem with something like this.

I'll simulate massive objects using Runge Kutta to solve the n-body problem first and for objects of negligible mass (like a spaceship) it should be just a matter of working out the gravitational displacement on the spaceship caused by each massive object and adding the displacements together.

That way I should be able to maintain accuracy in the simulation even if the spaceships are moving very quickly.

Thanks for the help, guys.

>> No.1764005

<span class="math">
v=u+at
[/spoiler]