Calculating Orbits: Finding Satellite Distance from Earth

Click For Summary

Discussion Overview

The discussion revolves around calculating the distance of a satellite from Earth using polar coordinates and eccentricity in the context of programming in Fortran. Participants explore coding techniques, plotting tools, and methods for outputting data, particularly in relation to satellite orbits and floating point operations.

Discussion Character

  • Technical explanation
  • Homework-related
  • Debate/contested

Main Points Raised

  • One participant presents a formula for calculating the distance of a satellite from Earth in polar coordinates and seeks assistance with programming this in Fortran.
  • Another participant suggests writing the formula in Fortran and printing the result.
  • A participant raises questions about the best plotting tools in Fortran, outputting data to .dat files, and understanding floating point operations for plotting.
  • A response recommends using XMGRACE for plotting on *NIX systems and mentions writing files for Excel compatibility.
  • Code snippets are provided for writing output to a .dat file, demonstrating how to perform floating point operations in Fortran.
  • A later post inquires about comparing floating point operations between two programs and plotting the results, indicating a need for further clarification on this topic.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and seek clarification on programming and plotting techniques, indicating that there is no consensus on the best methods or tools for these tasks.

Contextual Notes

Participants have not fully resolved the questions regarding the best plotting tools or methods for comparing floating point operations, and there are assumptions about familiarity with Fortran programming that may not be shared by all.

Who May Find This Useful

This discussion may be useful for individuals interested in programming in Fortran, particularly in the context of physics and engineering applications related to satellite orbits and data visualization.

kathrynag
Messages
595
Reaction score
0
I am doing a problem with calculating orbits.
The orbit can be expressed in polar coordinates as r=p/(1-ecos(theta)) where r and theta are the distance and angle of the satellite from the center of the earth, p is a paremter where p=1200 km, and e is a parameter representing eccentricity.
I'm supposed to write a program to calculate the distance of the satellite from the Earth as a function of theta if the satellite has an eccentrity of 0, .25, .5, .75, and 1.
Write the program to input values of e and theta. Here is what I have done:

program calculating_orbits
implicit none
real :: r !distance of the satellite from the center of the earth
real :: theta !angle of the satellite from the center of the earth
real, parameter :: p=1200 !parameter specifying the size of the orbit
real :: e !parameter specifying the eccentricity of the orbit
write (*,*) 'This program accepts inputs of theta and e and outputs the
+ value of r=p/(1-e*cos(theta)).'
write (*,*) 'This program will run until a number not in the domain
+ is inputted.'
do
write (*,*) 'Please input a real number.'
read (*,*) e
read (*,*) theta
Now I get stuck. Any hints?
 
Technology news on Phys.org
r=p/(1-e*cos(theta))
can you try to write this in fortran and print r as your result?
 
Few questions in fortran :)
1. Which is the best plotting tool in fortran
2. How to get out put in form of .dat files in fortran
3. Can anyone post a code for calculating floating point operations and finally plotting it..I read so many papers i never able to understand how they plot those
 
akshaythegeek said:
1. Which is the best plotting tool in fortran
If you're using *NIX, you can use XMGRACE. Typically I just write a file which can be easily read into Excel.

2. How to get out put in form of .dat files in fortran
You can write in any form you want. I don't understand.

3. Can anyone post a code for calculating floating point operations and finally plotting it..I read so many papers i never able to understand how they plot those
Code:
OPEN(11,file='output_file.dat',form='formatted')
DO i=1,10
  x = REAL(i)
  y = x**2
  WRITE(11,*) x,y
END DO
CLOSE(11)
 
What about calculating floating point operation, suppose i have a mac and i am running a program then how to compare two programs ..how to plot graphs between floating point operations ...between these two programs
 

Similar threads

  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
5
Views
3K
Replies
13
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
1
Views
2K
  • · Replies 39 ·
2
Replies
39
Views
4K