[FORTRAN] Determining Apoapsis + Periapsis (Astrophysics)

  • Context: Fortran 
  • Thread starter Thread starter Nicolaus
  • Start date Start date
  • Tags Tags
    Astrophysics Fortran
Click For Summary
SUMMARY

This discussion focuses on calculating the apoapsis and periapsis of an object in orbit around the Sun using FORTRAN. The method involves applying the Pythagorean Theorem to determine the distances of various coordinates from the origin (P(0,0)). An example FORTRAN program is provided, which iterates through an array of coordinates to find the maximum distance for apoapsis and outputs the corresponding coordinates. The program effectively demonstrates the implementation of distance calculations in astrophysics.

PREREQUISITES
  • Understanding of FORTRAN programming language
  • Familiarity with the Pythagorean Theorem
  • Basic knowledge of orbital mechanics
  • Experience with array data structures in programming
NEXT STEPS
  • Explore advanced FORTRAN techniques for numerical methods in astrophysics
  • Learn about orbital elements and their significance in celestial mechanics
  • Investigate the use of FORTRAN for simulating orbital trajectories
  • Research optimization techniques for distance calculations in programming
USEFUL FOR

Astrophysicists, aerospace engineers, and programmers interested in orbital mechanics and FORTRAN programming will benefit from this discussion.

Nicolaus
Messages
73
Reaction score
0
Say the focus point - the Sun - is at P(0,0), would I then determine the apoapsis (periapsis) by implementing the Pythagorean Theorem on each point to determine which point's distance is largest (smallest for periapsis) from the origin, then output the coordinates for each? Each coordinate to be checked is extracted from an array.
Exampled program for computing apoapsis:
apo = 0
do i = 1, lengthAR
d = sqrt((xAR(i)**2) + (yAR(i)**2))
if (d .gt. apo) then
apo = d
x = xAR(i)
y = yAR(i)
end if
end do
print*, "Apoapsis = ", x, y
end
 
Technology news on Phys.org
Your question doesn't seem to be programming related. On top of that, you seem to post the answer to your own question. Can you be a little bit more clear? Is that program what you're looking for or is it your own unfinished program?
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
16K
  • · Replies 4 ·
Replies
4
Views
2K