Orbital simulation - Calculate object position over time in a 2d plane

Click For Summary
SUMMARY

The discussion focuses on simulating a rocket's orbit in a 2D plane, where the user encounters inaccuracies in the calculated orbital parameters. The method employed includes calculating gravitational force using the Universal Law of Gravitation and updating velocity and position based on acceleration. However, the user’s results indicate a need for a higher velocity than expected for a circular orbit at 420 km altitude. Recommendations include switching from the Euler method to more stable numerical integration techniques such as Verlet integration or Runge-Kutta methods to improve simulation accuracy.

PREREQUISITES
  • Understanding of the Universal Law of Gravitation
  • Familiarity with basic physics concepts such as force, mass, and acceleration
  • Knowledge of numerical integration methods, specifically Euler method
  • Proficiency in programming for simulation development
NEXT STEPS
  • Learn about Verlet integration and its application in orbital simulations
  • Study Runge-Kutta methods for improved numerical stability
  • Explore the Leapfrog method for simulating motion in physics
  • Investigate the limitations of the Euler method in dynamic systems
USEFUL FOR

Software developers, physicists, and engineers involved in simulation modeling, particularly those working on orbital mechanics and numerical methods for motion analysis.

ryanie
Messages
9
Reaction score
0
Hi

Im busy creating an application to simulation a rocket in orbit. I am having trouble as the results I am getting are incorrect. Could someone please check if I am using the correct method as stated below.

Everything works on a 2d plane, and has a x and y coordinate and a x and y velocity and a mass
coordinates are in meters and the mass is in kg.

Method:
Calculate the distance between the rocket and the planet using the distance formula
distance = sqrt[ ( x2 - x1)^2 - (y2 - y1)^2 ]

calculate the force Earth exerts on the rocket using the The Universal Law of Gravitation where G is the Gravitational constant m is the mass of an object and r is the distance between them
force = (G*m1*m2) / distance^2

Using the inverse of tan get the angle to calculate the the x and y components ( I know for a fact I am getting this is correct, its a bit tricky to explain) I calculate the angle for each quadrant going from the x-axis to the y axis

Calculate the acceleration of the rocket
acceleration = force / mass

Calculate velocity change over timer ( this is usually 0.01 seconds )
deltaVelocity = acceleration * time

Calculate the x velocity component
deltaXvelocity = deltaVelocity * cos(angle)

Calculate the y velocity component
deltaYvelocity = deltaVelocity * sin(angle)

Calculate the new x velocity
newXvelocity = currentXvelocity + deltaXvelocity

Calculate the new y velocity
newYvelocity = currentYvelocity + deltaYvelocity

set the new position of the rocket
newXposition = currentXposition + ( newXvelocity * time )
newYposition = currentYposition + ( newYvelocity * time )

Something is wrong with this method and i do know what.
I know for a fact that a an object in orbit round about 420km traveling at round about 7700 m/s should be in a roughly circular orbit and one that has a high eccentricity.

Currently with the results I am getting to obtain a roughly circular orbit at 420km i need to have a velocity of round about 5500m/s

Thanks for taking the time
 
Physics news on Phys.org

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K