I need to know about the ground track coverage of a satellite. The following MATLAB code plots the orbit of a satellite in lat vs long. It also plots a building which we assume is the ground station. Does the building have coverage of the satellite? The plot shows the building is outside of the orbit of the satellite. If it does have coverage, how much time per day does it have coverage. % Initial conditions omega_earth = rad2deg(7.2921151467e-5); % deg/s a = 3096.7363; % km ecc = 0.74; inc = 63.4349; % degrees raan = -86.915798; % degrees argp = 270; % degrees f = linspace(0, 360, 100); % degrees t = 100; % number of points cone_angle = 10; % degrees % Building coordinates building_lat = 40.43094; % degrees building_long = -86.915798; % degrees position = (lla2eci([building_lat building_long 0],[2024 01 24 12 20 0]))/1e3 % Calculate time vector over one orbital period orbital_period = 360 / omega_earth; time_vector = linspace(0, orbital_period, t); % Preallocate arrays for orbital elements long = zeros(1, t); % latitude = zeros(1, n_points); % Calculate orbital elements at each time step for i = 1:t % Call kep2cart for each true anomaly [x(i), y(i), z(i), vx(i), vy(i), vz(i)] = kep2cart(a, ecc, inc, raan, argp, f(i)); % Calculate longitude and latitude long(i) = atan2d(y(i), x(i)); % latitude(i) = asind(sind(inc).*sind(argp+f(i))); end r_mag = length(x); for i = 1:length(x) r_mag(:,i) = norm([x(:,i); y(:,i); z(:,i)]); end lat = asind(z./r_mag) long long(100) = -long(100) % Plot the ground-track figure; plot(long, lat, 'b-', 'LineWidth', 1.5); hold on; % Plot the building location plot(building_long, building_lat, '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; function [x, y, z, vx, vy, vz] = kep2cart(a, ecc, inc, raan, argp, f) % Gravitational parameter mu = 398600.4418; % (km^3/s^2) % Calculate angular momentum h = sqrt(a * (1-ecc^2)*mu); % (km^2/s) % Calculate position and velocity in the periforcal frame r_w = ((h^2 / mu) / (1 + ecc * cosd(f))) .* [cosd(f), sind(f), 0]; v_w = (mu / h) .* [-sind(f), ecc + cosd(f), 0]; % Calculate the Rotational Matrix R1 = [cosd(-argp) -sind(-argp) 0; sind(-argp) cosd(-argp) 0; 0 0 1]; R2 = [1 0 0; 0 cosd(-inc) -sind(-inc); 0 sind(-inc) cosd(-inc)]; R3 = [cosd(-raan) -sind(-raan) 0; sind(-raan) cosd(-raan) 0; 0 0 1]; % Calculate position vector r_rot = r_w * R1 * R2 * R3; % Calculate velocity vector v_rot = v_w * R1 * R2 * R3; % Define the cartesian coordinates x = r_rot(1); y = r_rot(2); z = r_rot(3); vx = v_rot(1); vy = v_rot(2); vz = v_rot(3); end
I need to know about the ground track coverage of a satellite. The following MATLAB code plots the orbit of a satellite in lat vs long. It also plots a building which we assume is the ground station. Does the building have coverage of the satellite? The plot shows the building is outside of the orbit of the satellite. If it does have coverage, how much time per day does it have coverage.
% Initial conditions
omega_earth = rad2deg(7.2921151467e-5); % deg/s
a = 3096.7363; % km
ecc = 0.74;
inc = 63.4349; % degrees
raan = -86.915798; % degrees
argp = 270; % degrees
f = linspace(0, 360, 100); % degrees
t = 100; % number of points
cone_angle = 10; % degrees
% Building coordinates
building_lat = 40.43094; % degrees
building_long = -86.915798; % degrees
position = (lla2eci([building_lat building_long 0],[2024 01 24 12 20 0]))/1e3
% Calculate time
orbital_period = 360 / omega_earth;
time_vector = linspace(0, orbital_period, t);
% Preallocate arrays for orbital elements
long = zeros(1, t);
% latitude = zeros(1, n_points);
% Calculate orbital elements at each time step
for i = 1:t
% Call kep2cart for each true anomaly
[x(i), y(i), z(i), vx(i), vy(i), vz(i)] = kep2cart(a, ecc, inc, raan, argp, f(i));
% Calculate longitude and latitude
long(i) = atan2d(y(i), x(i));
% latitude(i) = asind(sind(inc).*sind(argp+f(i)));
end
r_mag = length(x);
for i = 1:length(x)
r_mag(:,i) = norm([x(:,i); y(:,i); z(:,i)]);
end
lat = asind(z./r_mag)
long
long(100) = -long(100)
% Plot the ground-track
figure;
plot(long, lat, 'b-', 'LineWidth', 1.5);
hold on;
% Plot the building location
plot(building_long, building_lat, '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;
function [x, y, z, vx, vy, vz] = kep2cart(a, ecc, inc, raan, argp, f)
% Gravitational parameter
mu = 398600.4418; % (km^3/s^2)
% Calculate angular momentum
h = sqrt(a * (1-ecc^2)*mu); % (km^2/s)
% Calculate position and velocity in the periforcal frame
r_w = ((h^2 / mu) / (1 + ecc * cosd(f))) .* [cosd(f), sind(f), 0];
v_w = (mu / h) .* [-sind(f), ecc + cosd(f), 0];
% Calculate the Rotational Matrix
R1 = [cosd(-argp) -sind(-argp) 0;
sind(-argp) cosd(-argp) 0;
0 0 1];
R2 = [1 0 0;
0 cosd(-inc) -sind(-inc);
0 sind(-inc) cosd(-inc)];
R3 = [cosd(-raan) -sind(-raan) 0;
sind(-raan) cosd(-raan) 0;
0 0 1];
% Calculate position vector
r_rot = r_w * R1 * R2 * R3;
% Calculate velocity vector
v_rot = v_w * R1 * R2 * R3;
% Define the cartesian coordinates
x = r_rot(1);
y = r_rot(2);
z = r_rot(3);
vx = v_rot(1);
vy = v_rot(2);
vz = v_rot(3);
end
Trending now
This is a popular solution!
Step by step
Solved in 3 steps