Computing trajectories in Schwarzschild spacetime

Click For Summary
SUMMARY

This discussion focuses on computing the spatial trajectories of massive test particles in Schwarzschild spacetime, specifically how to generate (r, φ) pairs for realistic plotting. The initial approach involved numerical integration of the equation of motion (dr/dφ)² = f(r), which presented challenges such as determining the sign of dr/dφ and handling numerical errors. Alternative methods discussed include using elliptic functions for exact solutions and applying the geodesic equation in (t, x, y) coordinates for better numerical stability. Participants shared insights on implementing these strategies using tools like Maxima and Stormer-Verlet integration.

PREREQUISITES
  • Understanding of Schwarzschild geodesics
  • Familiarity with numerical integration techniques
  • Knowledge of elliptic functions and their implementations
  • Experience with programming languages suitable for scientific computing, such as Python or Maxima
NEXT STEPS
  • Research "Schwarzschild geodesics" for theoretical background
  • Learn "numerical integration methods" such as Runge-Kutta or Stormer-Verlet
  • Explore "elliptic functions" and their applications in physics
  • Investigate programming techniques for plotting in Python or Maxima
USEFUL FOR

Physicists, computational scientists, and anyone interested in general relativity and the dynamics of particles in curved spacetime.

  • #31
I saw that but wasn't sure if that was for the orbit model code or just required boilerplate for distributing anything running Java.
 
Physics news on Phys.org
  • #32
Jimster41 said:
I saw that but wasn't sure if that was for the orbit model code or just required boilerplate for distributing anything running Java.

It's an open-source license. There is no such license required for java code in general.
 
  • Like
Likes   Reactions: Jimster41
  • #33
Jimster41 said:
Question about copyright.
I downloaded the source for this simulator from github. Is this code I can play with? I assumed some copyright, yours, by default. But then I've never heard of github, and got the idea it was considered open source. I'm pretty good with C#, and I code with it often (in application/algorithm contexts, not as a pure developer), but I'm pretty new(100%noob) to java. I made some changes and was having no luck saving them. I assumed because I am a doof with java. But then I thought I better check to be sure that I wasn't misunderstanding the copyright context (and my saves weren't working because it was locked).

Actually it is JavaScript, not Java. JavaScript can have objects see here for instance https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript
I downloaded the zip file from github and the code is working locally in FireFox. I'm still impressed.
 
Last edited:
  • #34
Mentz114 said:
Actually it is JavaScript, not Java. JavaScript can have objects see here for instance https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript
I downloaded the zip file from github abd the code is working locally in FireFox. I'm still impressed.

I was able to run it no problem after the download. Just trying to figure out how to monkey around with the pieces. Thank s for the ref. I've got a good book and I'm pretty familiar with OO architecture, just not HTML, or CSS, or .JS. I've been working in a proprietary environment for... Too long. Its all drag and drop, with bits of custom C#. Lost my skillz.
 
  • #35
Jimster41 said:
I was able to run it no problem after the download. Just trying to figure out how to monkey around with the pieces. Thank s for the ref. I've got a good book and I'm pretty familiar with OO architecture, just not HTML, or CSS, or .JS. I've been working in a proprietary environment for... Too long. Its all drag and drop, with bits of custom C#. Lost my skillz.

OK, you'll soon get familiar with Javascript. It's easy and pretty 'fiendly'.

I've changed some colours and I'm going to lay out the screen differently and add a trace list to log (say) the differences between succesive ##\phi_{min}## values to get the precession of the major axis.

All good fun ...
 
  • #36
I was away yesterday, but glad to see you have all got it working. BTW I consider the program finished in terms of what I set out to do, so feel free to fork/fix/improve as you wish, it's GPL after all ;).
 
  • Like
Likes   Reactions: bcrowell

Similar threads

  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 42 ·
2
Replies
42
Views
5K
  • · Replies 9 ·
Replies
9
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
4K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K