The following MATLAB code plots the location of a building and the orbit of a satellite. How much time, in hours, does the building have coverage from this satellite every day. % At the initial time, the true anomaly is equal to zero, % and the Greenwich meridian points to the Aries point. % Initial conditions omega_earth = rad2deg(7.2921151467e-5); % deg/s semi_major_axis = 3096.7363; % km eccentricity = 0.74; inclination = 63.4349; % degrees RAAN = -86.915798; % degrees argument_of_perigee = 270; % degrees n_points = 100; % number of points cone_angle = 10; % degrees % Building coordinates building_latitude = 40.43094; % degrees building_longitude = -86.915798; % degrees % Calculate time vector over one orbital period orbital_period = 360 / omega_earth; time_vector = linspace(0, orbital_period, n_points); % Preallocate arrays for orbital elements true_anomaly = zeros(1, n_points); longitude = zeros(1, n_points); latitude = zeros(1, n_points); % Calculate orbital elements at each time step for i = 1:n_points true_anomaly(i) = 2 * atand(sqrt((1 + eccentricity) / (1 - eccentricity)) * tand(0.5 * sqrt(1 - eccentricity) * omega_earth * time_vector(i))); radius = semi_major_axis * (1 - eccentricity^2) / (1 + eccentricity * cosd(true_anomaly(i))); x_orbital_plane = radius * cosd(true_anomaly(i)); y_orbital_plane = radius * sind(true_anomaly(i)); % Transformation to ECI coordinates x_eci = x_orbital_plane * cosd(argument_of_perigee) - y_orbital_plane * sind(argument_of_perigee); y_eci = x_orbital_plane * sind(argument_of_perigee) + y_orbital_plane * cosd(argument_of_perigee); z_eci = y_orbital_plane * sind(inclination); % Calculate longitude and latitude longitude(i) = atan2d(y_eci, x_eci); latitude(i) = asind(z_eci / radius); end % Plot the ground-track figure; plot(longitude, latitude, 'b-', 'LineWidth', 1.5); hold on; % Plot the building location plot(building_longitude, building_latitude, 'ro', 'MarkerSize', 10, 'MarkerFaceColor', 'r'); % Set axis labels and title xlabel('Longitude (degrees)'); ylabel('Latitude (degrees)'); title('Ground-Track of the Orbit'); % Display legend legend('Ground-Track', 'Building Location'); % Set grid grid on; % Show the plot hold off;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

The following MATLAB code plots the location of a building and the orbit of a satellite. 

How much time, in hours, does the building have coverage from this satellite every day.

 

% At the initial time, the true anomaly is equal to zero,
% and the Greenwich meridian points to the Aries point.


% Initial conditions
omega_earth = rad2deg(7.2921151467e-5); % deg/s
semi_major_axis = 3096.7363; % km
eccentricity = 0.74;
inclination = 63.4349; % degrees
RAAN = -86.915798; % degrees
argument_of_perigee = 270; % degrees
n_points = 100; % number of points
cone_angle = 10; % degrees

% Building coordinates
building_latitude = 40.43094; % degrees
building_longitude = -86.915798; % degrees

% Calculate time vector over one orbital period
orbital_period = 360 / omega_earth;
time_vector = linspace(0, orbital_period, n_points);

% Preallocate arrays for orbital elements
true_anomaly = zeros(1, n_points);
longitude = zeros(1, n_points);
latitude = zeros(1, n_points);

% Calculate orbital elements at each time step
for i = 1:n_points
    true_anomaly(i) = 2 * atand(sqrt((1 + eccentricity) / (1 - eccentricity)) * tand(0.5 * sqrt(1 - eccentricity) * omega_earth * time_vector(i)));
    
    radius = semi_major_axis * (1 - eccentricity^2) / (1 + eccentricity * cosd(true_anomaly(i)));
    
    x_orbital_plane = radius * cosd(true_anomaly(i));
    y_orbital_plane = radius * sind(true_anomaly(i));
    
    % Transformation to ECI coordinates
    x_eci = x_orbital_plane * cosd(argument_of_perigee) - y_orbital_plane * sind(argument_of_perigee);
    y_eci = x_orbital_plane * sind(argument_of_perigee) + y_orbital_plane * cosd(argument_of_perigee);
    z_eci = y_orbital_plane * sind(inclination);
    
    % Calculate longitude and latitude
    longitude(i) = atan2d(y_eci, x_eci);
    latitude(i) = asind(z_eci / radius);
end

% Plot the ground-track
figure;
plot(longitude, latitude, 'b-', 'LineWidth', 1.5);
hold on;

% Plot the building location
plot(building_longitude, building_latitude, 'ro', 'MarkerSize', 10, 'MarkerFaceColor', 'r');

% Set axis labels and title
xlabel('Longitude (degrees)');
ylabel('Latitude (degrees)');
title('Ground-Track of the Orbit');

% Display legend
legend('Ground-Track', 'Building Location');

% Set grid
grid on;

% Show the plot
hold off;

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education