How to add eccentricity to Kepler's Laws in cartesian

In summary, the conversation discusses adding eccentricity to Kepler's Law for a three-body simulator using Newton's Law of Gravitational and coding in Fortran95. The expert suggests avoiding using Fortran and recommends learning Python, Java, or C++ instead. They also mention the possibility of using libraries or programs to live plot the results from a .dat file.
  • #1
Hi,

I'm currently making a three-body simulator and I'm trying to add the eccentricity to Kepler's Law to turn the circular orbits to more of a elliptical orbit? I'm using Newton's Law of Gravitational to plot the new positions. How would I add in the eccentricity to this equation? I'm currently coding it in Fortran95
 
Technology news on Phys.org
  • #2
Kepler's laws do not apply to problems with more than two bodies. They can be some reasonable approximation in some cases but in general they do not work.
AlphaBetaGamma96 said:
I'm using Newton's Law of Gravitational to plot the new positions.
Newton's laws do not have any notion of eccentricity, so where is the problem?
AlphaBetaGamma96 said:
I'm currently coding it in Fortran95
Do you have to use Fortran? If not, try to avoid it.
 
  • Like
Likes AlphaBetaGamma96
  • #3
Do you have to use Fortran? If not, try to avoid it.[/QUOTE]

Thanks for the reply! I'm currently doing a Computational Project at the moment for my degree. We are allowed to use any computational language, but I've only been taught in Fortran95. I'm considering learning another language at some point down the line, any recommendations? I'm trying to live plot the results so it can be seen as more of an animation.

The program writes out the points to a .dat file, could I then call this file to say a program in Python or Java and then live plot it?

(Sorry for kinda sidetracking from the initially stated question)

Thank you for your time! :D
 
  • #4
AlphaBetaGamma96 said:
I'm considering learning another language at some point down the line, any recommendations?
Python is nice, Java is interesting, C++ has some advantages as well.
Fortran is just messy.
AlphaBetaGamma96 said:
The program writes out the points to a .dat file, could I then call this file to say a program in Python or Java and then live plot it?
There should be libraries or even whole programs to do that.
 

1. How do I calculate eccentricity in cartesian coordinates for Kepler's Laws?

To calculate eccentricity in cartesian coordinates, you will need to know the semi-major axis and semi-minor axis of the orbit. Then, you can use the formula: eccentricity = √(1 - (b^2/a^2)) where a is the semi-major axis and b is the semi-minor axis.

2. What does eccentricity represent in Kepler's Laws?

Eccentricity represents the shape of an orbit in Kepler's Laws. It is a measure of how elongated or circular an orbit is. An eccentricity of 0 indicates a perfect circular orbit, while an eccentricity of 1 represents a parabolic orbit.

3. How does eccentricity affect the speed of an object in orbit?

Eccentricity affects the speed of an object in orbit by changing the distance between the object and the central body at different points in the orbit. When an object is closer to the central body, it will move faster due to the stronger gravitational pull. As the object moves further away, it will slow down.

4. Can eccentricity change over time in an orbit?

Yes, eccentricity can change over time in an orbit. This is known as orbital perturbation and can be caused by external forces such as gravitational interactions with other objects or atmospheric drag. However, in a two-body system, the eccentricity will remain constant unless there is an external force acting on the orbit.

5. How does eccentricity impact the stability of an orbit?

The higher the eccentricity of an orbit, the less stable it is. This is because a higher eccentricity means the orbit is more elongated and the object will spend more time further away from the central body where the gravitational force is weaker. This can lead to changes in the orbit and potential collisions with other objects. A circular orbit with an eccentricity of 0 is the most stable.

Suggested for: How to add eccentricity to Kepler's Laws in cartesian

Replies
13
Views
3K
Replies
0
Views
489
Replies
5
Views
1K
Replies
1
Views
1K
Replies
14
Views
4K
Back
Top