Particle/planetary simulation with spacecraft

In summary: Runge-Kutta is more computationally expensive than Euler, but it also provides more accurate results. It ultimately depends on how accurate you need your simulation to be and how much extra computation time you are willing to sacrifice for that accuracy. It may be worth trying out both methods and comparing the results to see which one works best for your specific scenario.
  • #1
darkdave
24
0
I am building a spacecraft simulator in a realistic planetary environment. At the moment it uses very simple Newtonian equations of motion. Each object has displacement, velocity and acceleration vectors. Each time the computer does a loop: 0.1 seconds pass and in each loop each object (planet, spacecraft , moon etc) moves along it's displacement vector (in 3D space) by exactly 0.1 seconds. The velocity vector adds the acceleration vector to it self multiplied by the time 0.1 seconds. The acceleration vector is then adjusted for all objects according to the new Center of Gravity of the entire simulation.

The problem with this is that its not too accurate especially when you accelerate time in which case 0.1 seconds per time loop can be as large as 1 hour! Then errors will show up because the center of gravity changes every hour in a dynamic system and therefore the acceleration vector for each object should also change during that 1 hour time frame. The redisplacement of objects will also be in a straight line and they should be in a curve!

I played with Newton's Gm1m2/rsquared force equation and extracted the acceleration equation Gm2/rsquared equation for m1's acceleration toward m2 assuming m2 is a larger body like Earth. Now I did some calculus and integrated that equation to find a way to extract the change in velocity (average acceleration) by substituting different values of "r" (distance between m1 and m2). In this case I can have an equation that tells me the change in velocity in a straight line between the rocket and Earth if the rocket was falling to the Earth vertically. This is a start but not useful enough for a dynamic simulator where the rocket might have a path beyond just falling straight down. Also this equation gives the change in velocity per unit distance and I need it per unit time. It also does not give me the gradual change in the acceleration vector in a dynamic situation such as a spacecraft flying pass a planet at high speed in which case it will be attracted toward the planet's center that will constantly change relative position to it.

Is there a formula I can use in my computer simulator to calculate position, velocities and acceleration of N body problem with the passage of accelerated time without losing accuracy of the simulation? Or do I just have to run many 0.1 second loops more quickly in order to accelerate time or predict the future paths of all objects?

The problem is that each of my computer loops displaces the objects linearly by assuming the accleration vector does not change in strength nor direction during that straight line transition. A more realistic loop should displace the object via a curve that anticipates the change in acceleration's magntitude and direction pull on the object during the transition from time zero to time 0.1s.

However the simulation is reasonably accurate as long as each iteration is about 0.1 seconds, meaning that many many inferior discrete linear predictions over a short time simulates curve paths over many seconds. But that still leaves me with the problem of predicting future paths or time acceleration in my simulation.
 
Last edited:
Physics news on Phys.org
  • #2
You could use ##s = vt + \frac12 at^2## instead of ##s = vt## for the displacement in a time interval. If acceleration is large, but the rate of change of acceleration is not, then that should improve the model. Especially if ##t## is not "small".
 
Last edited:
  • #3
darkdave said:
ach object has displacement, velocity and acceleration vectors. Each time the computer does a loop: 0.1 seconds pass and in each loop each object (planet, spacecraft , moon etc) moves along it's displacement vector (in 3D space) by exactly 0.1 seconds. The velocity vector adds the acceleration vector to it self multiplied by the time 0.1 seconds. The acceleration vector is then adjusted for all objects according to the new Center of Gravity of the entire simulation.
This is called Euler integration. There are higher order numerical integration methods:
https://en.wikipedia.org/wiki/Runge–Kutta_methods
 
  • #4
PeroK said:
You could use ##s = vt + \frac12 at^2## instead of ##s = vt## for the displacement in a time interval. If acceleration is large, but the rate of change of acceleration is not, then that should improve the model. Especially if ##t## is not "small".
Hi thanks for this, I was about to make the changes as you proposed and it turned out I was already using what you proposed. It's old code from over ten years ago so I guess I forgot that I already used the half acceleration time squared function.

But thanks for reminding me that this is how my program indeed works, that it does use AT SQUARED. As you correctly pointed out this is only good in an environment where the acceleration doesn't change much, what would you suggest I do to compensate for changing direction and magnitude of the acceleration vector?
 
  • #5
A.T. said:
This is called Euler integration. There are higher order numerical integration methods:
https://en.wikipedia.org/wiki/Runge–Kutta_methods

I think youre on to something here, could you help me make sense of the material in the link provided? I have to brush up on my maths. So for example displacement(t)= vt * at^2, how could I improve upon that using the wisdom provided in the link? Do I integrate the function and then substitute?
 
  • #6
darkdave3000 said:
I think youre on to something here, could you help me make sense of the material in the link provided? I have to brush up on my maths. So for example displacement(t)= vt * at^2, how could I improve upon that using the wisdom provided in the link? Do I integrate the function and then substitute?
Google for code examples in your preferred language.
 
  • #7
Is Runge Kutta more or less computationally expensive per iteration compared to Euler?

In otherwords, is it worth doing it? Or maybe its easier to just do more iterations of Euler
 

1. What is particle/planetary simulation with spacecraft?

Particle/planetary simulation with spacecraft is a scientific method used to model and study the behavior and movement of particles and planetary bodies in space using spacecraft data. It involves creating computer simulations based on real-world data gathered by spacecraft to better understand the dynamics of particles and planetary bodies in space.

2. How is particle/planetary simulation with spacecraft different from other simulation methods?

Particle/planetary simulation with spacecraft is unique because it uses real-world data collected by spacecraft, such as satellite imagery and telemetry, to create accurate and detailed simulations. This makes it a more reliable and precise method compared to other simulations that rely on theoretical assumptions.

3. What are the practical applications of particle/planetary simulation with spacecraft?

Particle/planetary simulation with spacecraft has many practical applications, including predicting the movement of particles and planets, studying the effects of gravitational forces on space objects, and developing strategies for space missions. It is also used in fields such as astrophysics, astronomy, and planetary science to gain a better understanding of the universe.

4. What are the challenges of conducting particle/planetary simulation with spacecraft?

One of the main challenges of particle/planetary simulation with spacecraft is obtaining accurate and reliable data from spacecraft. This can be difficult due to technical limitations, such as faulty sensors or data transmission issues. Another challenge is the complexity of the simulations, which require advanced mathematical and computational techniques.

5. How can particle/planetary simulation with spacecraft benefit scientific research?

Particle/planetary simulation with spacecraft has the potential to greatly advance scientific research by providing valuable insights into the behavior and movement of particles and planetary bodies in space. It can also help scientists make accurate predictions and develop new theories about the universe. Additionally, the data collected and analyzed during these simulations can lead to new discoveries and advancements in various fields of study.

Similar threads

Replies
4
Views
894
  • Special and General Relativity
Replies
7
Views
985
  • High Energy, Nuclear, Particle Physics
Replies
3
Views
2K
  • Classical Physics
Replies
15
Views
2K
  • Science Fiction and Fantasy Media
Replies
4
Views
2K
  • Special and General Relativity
Replies
1
Views
1K
Replies
5
Views
2K
  • Introductory Physics Homework Help
2
Replies
38
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
  • Special and General Relativity
Replies
27
Views
4K
Back
Top