Calculating Orbits: Finding Satellite Distance from Earth

In summary, this program accepts inputs of theta and e and outputs the distance of the satellite from the center of the earth.
  • #1
kathrynag
598
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
  • #2
r=p/(1-e*cos(theta))
can you try to write this in fortran and print r as your result?
 
  • #3
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
 
  • #4
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)
 
  • #5
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
 

1. How do you calculate the distance between a satellite and Earth?

To calculate the distance between a satellite and Earth, you will need to know the satellite's orbital parameters, such as its altitude, inclination, and eccentricity. Using Kepler's Laws and the satellite's orbital parameters, you can calculate the satellite's distance from Earth.

2. What is the formula for calculating a satellite's orbital distance from Earth?

The formula for calculating a satellite's orbital distance from Earth is d = a(1 - e^2) / (1 + e cosθ), where d is the satellite's distance from Earth, a is the semimajor axis, e is the eccentricity, and θ is the true anomaly.

3. Can you calculate the distance between a satellite and Earth without knowing its orbital parameters?

No, it is not possible to accurately calculate the distance between a satellite and Earth without knowing its orbital parameters. These parameters determine the shape and size of the satellite's orbit, which directly affects its distance from Earth.

4. How does the altitude of a satellite's orbit affect its distance from Earth?

The altitude of a satellite's orbit is directly related to its distance from Earth. The higher the altitude, the farther the satellite is from Earth. On the other hand, a lower altitude means the satellite is closer to Earth.

5. Are there any factors that can cause the distance between a satellite and Earth to change?

Yes, there are several factors that can cause the distance between a satellite and Earth to change. These include atmospheric drag, gravitational pull from other celestial bodies, and orbital maneuvers performed by the satellite.

Similar threads

  • Introductory Physics Homework Help
Replies
5
Views
1K
Replies
13
Views
2K
  • Programming and Computer Science
Replies
8
Views
1K
Replies
1
Views
899
  • Introductory Physics Homework Help
Replies
1
Views
760
  • Astronomy and Astrophysics
Replies
5
Views
2K
  • Introductory Physics Homework Help
Replies
1
Views
771
  • Programming and Computer Science
Replies
4
Views
463
  • Astronomy and Astrophysics
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
1K
Back
Top