Fast computation of gravitational field level lines

In summary, the author is trying to find a way to compute changes in the level lines as the result of sudden changes in the local gravitational fields. He has an initial point and calculates the level lines by following the gradient of the potential field. If a planet explodes, he needs to redraw a small part of the level line contour plot without freezing the animation.
  • #1
webaba
4
0

Homework Statement



Dear all,

I have to find a fast way to compute changes in the level lines as the result of sudden changes in the local gravitational fields (2D space). (Caused by the destruction of a planet for example). I could recalculate everything but it takes too much time for the device on which the calculation is deployed. The environment has lots of bodies, so an analytical solution is not to consider.

Homework Equations



I compute the level lines, picking a initial point and iterating along the gradient of the potential field.

The Attempt at a Solution



I don't really know where to start, but I'm thinking about a local method that only propagates changes on a limited range around the "explosion". If you want to take a look of the origin of the problem, here is a screenshot of the project, and the link to the related iphone game.

screen-shot-2013-06-20-at-12-12-58-am.png


https://itunes.apple.com/us/app/astro-fight/id653286727?ls=1&mt=8

Thank you for you help,

Seb
 
Physics news on Phys.org
  • #2
I'm not clear on what you mean by "level line" ... the gradient of the gravitational potential would be the gravitational field. If you started at some point and followed the gradient, then you'd end up drawing the path that a ball would roll "downhill".

I suspect you are also modelling the destruction of a planet by simply removing it's entire mass-energy ... this does not happen IRL: the mass of a completely vaporized planet is still there.

But hey ho - you can quickly compute the gravitational potential at each point on your plane (superposition principle) and get equipotential lines from a contour plot - graphics packages usually have the ability to make contours as a built-in function. I think you just need to explore the graphics library.
 
  • #3
Hi,

Thank you a lot for your reply.

Sorry I mixed up the terminology. What I called level lines is equipotential lines, i draw them by following the direction orthogonal to the local gravitational force. (Sorry for the confusion)

That works well (check the pictures, the grey lines in the background) but takes some time ! I don't use any graphic library. So I guess my question is : once I have the contour plot, and when a planet explods (I assume that planet fragments just fly off the screen so the mass disappears), I need to redraw part of it without freezing the animation. I tried to only redraw a small part of it (considering that the gravitationnal influence fades away quadratically but then my lines are obviously not continuous anymore...
 
  • #4
The grey lines in the pic look like trajectories ... but you have described equipotential lines all right.
Basically you should get the libraries for what you want to program, otherwise you will waste a lot of time reinventing the wheel.

IRL - a vaporized planet is an expanding cloud of matter ... the field fades out according to how the matter expands... the long-range field is basically unchanged.

Switch off the gravity at a spot will create a discontinuity that travels outwards at the speed of light. If you accelerate a field source, you get a wave associated with the field ... creates a jagged bit in the field lines. It may be a sensible way to do it on the scale of the pics ... use a rapidly expanding circle around the original location of the planet.

What you want is just t switch from one set of lines to another ... what are the lines used for?
If it is just for display - to make it look cool - then you can just animate the redrawing to work in with what the machine is capable of.
 
  • #5
Thanks for the answer man, the expanding circle is a great idea ! And yes it's really only to make it look cool. And i don't think there are libraries for iphone that draw level sets of an arbitrary function... I'll try to use an animation and compute the new lines in a different thread to not freeze the game on the iphone.
 
  • #6
Sure - since it is mainly for appearance then the answer is to just eat the calculation delay and animate the transition to the result. It's not a hard-physics simulation after all :)

When you program an app, you have to use a programming language and an SDK of some kind. Trust me - libraries have been written for them. Does Apple provide it's own script language or something - I don't have a lot to do with those guys?
 
  • #7
Apple provides a huge SDK for Iphone, with graphics library but Contour Lines of a function is a mathematical concept that is not likely to be integrated in any sdk that has no primary scientific purpose... But this is not really a problem, I also recoded the optimization Simulated Annealing to code the AI of the game (and now it beat me all the time ;) you should try ! ;)
 

Related to Fast computation of gravitational field level lines

1. How does fast computation of gravitational field level lines work?

The fast computation of gravitational field level lines involves using advanced algorithms and mathematical models to calculate the gravitational field strength at different points in space. This is typically done by using the mass and distance of objects in the universe to determine the gravitational force acting on a particular point.

2. What makes fast computation of gravitational field level lines important?

Fast computation of gravitational field level lines is important because it allows scientists to better understand the behavior of celestial bodies and their interactions with each other. This information is crucial for predicting the movement of objects in space and for studying the structure and evolution of the universe.

3. How accurate is the fast computation of gravitational field level lines?

The accuracy of the fast computation of gravitational field level lines depends on the precision of the data used and the complexity of the mathematical models and algorithms involved. Generally, the results are very accurate, but they may contain some margin of error due to uncertainties in the data or simplifications made in the calculations.

4. What are the practical applications of fast computation of gravitational field level lines?

The fast computation of gravitational field level lines has many practical applications, such as in astrophysics, aerospace engineering, and navigation systems. It is used to predict the trajectories of spacecraft, to study the dynamics of galaxies and other celestial objects, and to create accurate maps of the universe.

5. Are there any limitations to fast computation of gravitational field level lines?

While fast computation of gravitational field level lines is a powerful tool, it does have some limitations. It relies heavily on the accuracy and completeness of the data used, and it may not be suitable for very complex systems with multiple interacting objects. In addition, the computational power and resources required to perform fast computation of gravitational field level lines can also be a limiting factor.

Similar threads

  • Introductory Physics Homework Help
Replies
5
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
5K
  • Special and General Relativity
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Astronomy and Astrophysics
Replies
19
Views
4K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
4K
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
9K
Back
Top