Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need this to be coded in C++ or fortran please solve it perfectly, I really ne

ID: 1862312 • Letter: I

Question




I need this to be coded in C++ or fortran please solve it perfectly, I really need this.

The geographic location of a radar tracking site on the surface of the earth is known. Its geodetic latitude, longitude, and altitude above mean sea level are specified. Observations of a satellite are made by a radar at this site at a specified date and universal time. The radar determines rho, , El, Az, from its tracking and Doppler capability. Write a computer code to compute the geocentric-equatorial components of position and velocity of the radar site (rs and vs) and of the satellite (r and v). To accomplish this, it will also be necessary to write into your code a conversion from universal time to local sidereal time. For 2013 1, theta g, = 1.739307098 rad = 99.654956 Degree. Remember that the computer natively uses units of radians and you will have to make allowances for this. It may also be convenient to convert all length and time units into DU and TU units. Provide the requested solution (with proper units) for the following input data: You should be able to match my answers for all data sets out to at least 4 decimal places. To validate your code, the answers for the first data set are rs = (0.19703228 I, -0.75301748 J, 0.62624838 K) DU vs = (0.04430277 I, 0.01159213 J, 0.00000000 K) DU/TU r = (0.27129021 I, -0.77793960 J, 0.63745750 K) DU v = (0.26196268 I, -0.15187039 J, 0.05195245 K) DU/TU Use the following constant values: a e =1.0DU, omega = 0.0588336565 rad/TU, e = 0.08182 Also: a value of 3.14 or even 3.141592654 is a poor value forpi when writing a computer program. I strongly recommend you use the following expression for pi: pi = 4.0 * atan(l.0) I also strongly recommend using double precision variables (instead of Afloat" or "real") for greater accuracy. You may choose any computer language you prefer provided you are not using a commercial or other pre-written application to do the work for you (MATLAB, Mathematica. Excel., and other available software are not acceptable). While working in small groups to set up the problem and determine how to solve it is acceptable, all code must be original work. To complete this project, you must turn in the code listing and the solutions to each data set. Your solutions should be appropriately formatted and include all proper units. 1 foot = 4.77881892 times 10 -8 DU 1 DU = 6378.145 km 1 km s = 0.1264963205 DU TU

Explanation / Answer

#include"stdio.h"
#include"stdlib.h"
#include"math.h"

int main()
{
double ae=1, w=0.0588336565, e=0.08182;
double pi=4*atan(1);

double latitude, longitude, altitude, days, min,sec,time,theta=0 , theta_g=1.739307098;

double r,rd,az,azd,el,H,eld;

double minutes, hours, seconds;

printf("Enter the values for Latitude ");
scanf("%lf",&latitude);
printf("Enter the values for Longitude ");
scanf("%lf",&longitude);
printf("Enter the values for Altitude ");
scanf("%lf",&H);
printf("Enter the values for Hours ");
scanf("%lf",&hours);
printf("Enter the values for Minutes ");
scanf("%lf",&minutes);
printf("Enter the values for Secs ");
scanf("%lf",&seconds);
printf("Enter the values for Day ");
scanf("%lf",&days);
printf("Enter the values for Rho ");
scanf("%lf",&r);
printf("Enter the values for Rho dot ");
scanf("%lf",&rd);
printf("Enter the values for EL ");
scanf("%lf",&el);
printf("Enter the values for El dot ");
scanf("%lf",&eld);
printf("Enter the values for Az ");
scanf("%lf",&az);
printf("Enter the values for Az dot ");
scanf("%lf",&azd);

double alt_conv=4.77881892e-8;
double rho_conv=6378.145;
double rho_dot_conv=0.1264963205;
double time_conv=806.8119;

// Unit conversions from degree to radian
    latitude = latitude * pi / 180;
    longitude = longitude * pi / 180;
    el = el * pi / 180;
    eld = eld * pi / 180 * time_conv;
    az = az * pi / 180;
    azd = azd * pi / 180 * time_conv;
    H = H * alt_conv;
    r = r / rho_conv;
    rd = rd * rho_dot_conv;
  
    // Real time
    days = days + hours / 24 + minutes / 1440 + seconds / 86400;
    time = 2 * pi * 1.0027379093 * days;
    theta = theta_g + longitude + time;

    // Find r_station vector components
    double x = fabs(ae / sqrt(1 - pow(e,2) * pow(sin(latitude),2)) + H) * cos(latitude);
    double z = fabs(ae * (1 - pow(e,2)) / sqrt(1 - pow(e,2) * pow(sin(latitude),2)) + H) * sin(latitude);

   double r_station_i = x * cos(theta);
   double r_station_j = x * sin(theta);
   double r_station_k = z;

    // Find radar station velocity
   double v_station_i = -w * r_station_j;
   double v_station_j = w * r_station_i;
   double v_station_k = w * 0;

    // Convert rho into S,E,Z
    double rho_s = -r * cos(el) * cos(az);
    double rho_e = r * cos(el) * sin(az);
    double rho_z = r * sin(el);

    // Convert rho_dot into S,E,Z
     double rho_dot_s = -rd * cos(el) * cos(az)
            + r * eld * sin(el) * cos(az)
            + r * azd * cos(el) * sin(az);
    double rho_dot_e = rd * cos(el) * sin(az)
            - r * eld * sin(el) * sin(az)
            + r * azd * cos(el) * cos(az);
    double rho_dot_z = rd * sin(el) + r * eld * cos(el);

    // Find r satellite components
   double r_sat_i = sin(latitude) * cos(theta) * rho_s - sin(theta) * rho_e
            + cos(latitude) * cos(theta) * rho_z + r_station_i;
    double r_sat_j = sin(latitude) * sin(theta) * rho_s + cos(theta) * rho_e
            + cos(latitude) * sin(theta) * rho_z + r_station_j;
    double r_sat_k = -cos(latitude) * rho_s + sin(latitude) * rho_z + r_station_k;

    // Find velocity of satellite components
    double v_sat_i = sin(latitude) * cos(theta) * rho_dot_s - sin(theta) * rho_dot_e
            + cos(latitude) * cos(theta) * rho_dot_z + v_station_i;
      double   v_sat_j = sin(latitude) * sin(theta) * rho_dot_s + cos(theta) * rho_dot_e
            + cos(latitude) * sin(theta) * rho_dot_z + v_station_j;
    double v_sat_k = -cos(latitude) * rho_dot_s + sin(latitude) * rho_dot_z + v_station_k;

//Printing the values
printf("rs=%lf I, %lf J, %lf K DU ",r_station_i,r_station_j,r_station_k);
printf("vs=%lf I, %lf J, %lf K DU ",v_station_i,v_station_j,v_station_k);
printf("r=%lf I, %lf J, %lf K DU ",r_sat_i,r_sat_j,r_sat_k);
printf("v=%lf I, %lf J, %lf K DU ",v_sat_i,v_sat_j,v_sat_k);
return(0);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote