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;
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
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;
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)