Newtonian Simulation Of Gravity

Click For Summary

Discussion Overview

The discussion revolves around simulating the motion of two point masses in a computer graphics program, focusing on the mathematical challenges of solving for the new velocity vector after a time increment, while ensuring conservation of energy and momentum. Participants explore various approaches to modeling the system, including the treatment of vectors and the implications of quantization in the simulation.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant is attempting to solve for the new velocity vector e' after applying conservation laws, but is unsure how to proceed with the equation.
  • Another participant notes that the equation is quadratic and emphasizes the need to be cautious when dealing with vector division.
  • There is a suggestion to break down the vectors into their components, although some participants believe this may not be necessary.
  • Participants discuss the status of other variables like b' and c', with one asserting they can be calculated based on known values.
  • A participant shares their experience with a simulation of the Earth orbiting the Sun, detailing their method of breaking down vectors into components and updating them after each time step.
  • Concerns are raised about the simulation not conserving energy, with a participant questioning whether angular momentum should also be considered.
  • One participant points out that the system is underconstrained, having one equation for e' but multiple unknowns, suggesting that acceleration should be incorporated.
  • There is a discussion about the concept of a "state system," with participants clarifying their definitions and the implications for the simulation.
  • Another participant expresses skepticism about solving for e' due to the presence of multiple unknowns, while also noting the normalcy of needing three values to describe a 3D vector.
  • One participant proposes that conservation of momentum could help eliminate some variables, but acknowledges that approximations may lead to energy conservation issues.

Areas of Agreement / Disagreement

Participants do not reach a consensus on how to solve for e'. There are multiple competing views on the treatment of vectors, the necessity of breaking them into components, and the implications of approximations on energy conservation.

Contextual Notes

Participants express uncertainty regarding the constraints of their equations and the implications of quantizing time steps on the conservation of energy and momentum. The discussion highlights the complexity of modeling physical systems in simulations.

DavidZuccaro
Messages
15
Reaction score
0
I'm working on a computer graphics program that simulates the motion of two point masses as indicated in this diagram:
b.png

After applying the laws of conservation of momentum and the conservation of energy I am left with the following equation to solve for e':
a.png

Does anyone have any idea how to solve this for e' which is the new velocity vector after a certain delta t?
 
Physics news on Phys.org
It is a quadratic equation. You cannot divide by vectors so you have to be careful while solving it, but there is no magic needed.
 
  • Like
Likes   Reactions: DavidZuccaro
mfb said:
It is a quadratic equation. You cannot divide by vectors so you have to be careful while solving it, but there is no magic needed.
So should I break down e, e' and f into their components?
 
I don't think you have to, apart from the last steps maybe.
 
What about b' and c'? You consider these known?
 
nasu said:
What about b' and c'? You consider these known?

Yes, because they can be calculated according to b' = b + eδt.
 
I've built a small simulation of the Earth orbiting the Sun. My method was to break the force, acceleration, velocity, and position vectors into their components and then calculate each component, updating after each time step. I'm not sure if that helps you or not.
 
Drakkith said:
I've built a small simulation of the Earth orbiting the Sun. My method was to break the force, acceleration, velocity, and position vectors into their components and then calculate each component, updating after each time step. I'm not sure if that helps you or not.

Thanks Drakkith, yes I have done that already but now I would like the simulation to conserve energy.

This simulation does not conserve energy:


This simulation does conserve energy but there is no orthogonal velocity component.

Still not sure how to solve the above equation. Should I look at the equation for angular momentum too?
 
I just noted that your system is underconstrained - you have one equation for e' but two or three unknowns. I guess your acceleration should go in somehow.
 
  • #10
I am treating the two body system as a state system.

b, c, b', c', e, f, mb, mc are all known.

Though b' and c' are calculated by approximation according to the equation b' = b + eδt.

Hope this clarifies what I am trying to achieve. I suspect that by quantizing δt I will not be able to conserve energy and momentum?

EDIT: added e to formula.
 
Last edited:
  • #11
DavidZuccaro said:
I am treating the two body system as a state system.

b, c, b', c', e, f, mb, mc are all known.

Though b' and c' are calculated by approximation according to the equation b' = b + δt.

Hope this clarifies what I am trying to achieve. I suspect that by quantizing δt I will not be able to conserve energy and momentum?
What is a "state system"?
 
  • #12
nasu said:
What is a "state system"?

What I meant by invoking the term "state system" is a system that consists of a set of well defined states. This system consists of the following vector attributes b,c,e,f the components of which may take on the numbers representable by my computer. That is there is no quantum fuzzyness or real numbers with infinite precision in this simulation.

Hope this clarifies what I meant by "state system".

EDIT: of -> or
 
Last edited:
  • #13
DavidZuccaro said:
What I meant by invoking the term "state system" is a system that consists of a set of well defined states. This system consists of the following vector attributes b,c,e,f the components of which may take on the numbers representable by my computer. That is there is no quantum fuzzyness of real numbers with infinite precision in this simulation.

Hope this clarifies what I meant by "state system".
Not really.
Unless you are talking about a physical system whose state is described by the positions and velocities vectors.
Which is how a mechanical system is usually described.

Is you system made from physical objects or from the set of states of a physical system (made from real objects).
 
  • #14
nasu said:
Not really.
Unless you are talking about a physical system whose state is described by the positions and velocities vectors.

Yes that is what I am talking about.

nasu said:
Which is how a mechanical system is usually described.
Is you system made from physical objects or from the set of states of a physical system (made from real objects).
My system is a computer simulation similar to those that I have posted previously; the objects are obviously not actually physical objects but like physical objects . The objects obey Newton's laws of motion and gravitation; if they happen to collide then they will rebound elastically. So your latter description is more appropriate.

Do you have any suggestions as to how this equation my be solved for e' given all of the other variables may be considered as known?:

a.png
 
  • #15
I don't think you can. You have three unknowns in the equation: the magnitude of e' and the projections of e' on e and f.
Which is quite normal, isn't it? e' is a vector in 3D so you need three values to describe it.

But if you assume that you know b', c' and f' by some magic, why not take it one step further and assume e' known as well? :smile:
 
  • #16
nasu said:
I don't think you can. You have three unknowns in the equation: the magnitude of e' and the projections of e' on e and f.
Which is quite normal, isn't it? e' is a vector in 3D so you need three values to describe it.

But if you assume that you know b', c' and f' by some magic, why not take it one step further and assume e' known as well? :smile:

What you say is true, I probably haven't sufficiently explained myself... f' can be eliminated by conservation of momentum as shown above.
b' can be eliminated with this approximation b' = b + eδt. Now I could obtain e' by a similar approximation but that would result in energy not being conserved due to the inherent graininess of the approximation which is the reason why I would like to solve the above equation. I am now looking into the conservation of angular momentum to give additional constraints.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 11 ·
Replies
11
Views
8K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K