- 公開されているTLEデータから適当に2つの衛星を選択しました
- (お手持ちのデータや時間範囲に変更すれば同様に適用可能だと思います)
- for文は不要で、vecnorm関数で相対距離と相対速度を演算しました
計算
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
読み込む軌道要素データ,iss_orbit.tle
・解析条件
startTime = datetime(2022,12,08,00,00,0);
stopTime = startTime + hours(12);
sampleTime = 5;
この時、ISSとFENGYUN 1C DEB が最も接近するとき,その時刻,直線距離,相対速度を求めなさい.
startTime = datetime(2020,6,02,8,23,0);
% stopTime = startTime + days(1);
stopTime = startTime + hours(3);
sampleTime = 5;
sc = satelliteScenario(startTime,stopTime,sampleTime);
sat = satellite(sc,"./iss_orbit.tle");
%show(sat) % 自分で再生ボタンを押してスタートさせる
%地表にfootprintを描く
groundTrack(sat,"Lead Time",12*60*60);
disp("----- start -----");
startTime_1 = datetime(2022,12,08,00,00,0);
stopTime_1 = startTime+ hours(12);
time_step_1 = seconds(5);
time_x_array = [];
distance_array = [];
velocity_array = [];
for time_x = startTime_1 : time_step_1 : stopTime_1
% disp(time_x);
[pos_1, vel_1] = states(sat(1),time_x,"CoordinateFrame","inertial");
[pos_2, vel_2] = states(sat(2),time_x,"CoordinateFrame","inertial");
distance_21 = sqrt( ...
(pos_2(1)-pos_1(1))^2 + ...
(pos_2(2)-pos_1(2))^2 + ...
(pos_2(3)-pos_1(3))^2 ...
);
rel_vel_21 = sqrt( ...
(vel_2(1)-vel_1(1))^2 + ...
(vel_2(2)-vel_1(2))^2 + ...
(vel_2(3)-vel_1(3))^2 ...
);
time_x_array = [time_x_array; time_x];
distance_array = [distance_array distance_21];
velocity_array = [velocity_array rel_vel_21];
end
% disp(size(distance_array));
[M,I] = min(distance_array);
% disp(M);
% disp(I);
disp("----- end -----");
% apple silicon m1, calc time = 3min
% disp(time_x_array(I));
% disp(distance_array(I));
% disp(velocity_array(I));
plot(time_x_array, distance_array);
X = sprintf('Time = %s, Distance(km) = %f, Relative V(km/sec) = %f \n', ...
datetime(time_x_array(I)), distance_array(I)/1000.0, velocity_array(I)/1000.0);
disp(X);
play(sc); % 自動で再生ボタンが押されてスタートする
これを利用して、軌道解説お願いします。
2 commentaires
Atsushi Ueno
le 20 Mar 2023
Déplacé(e) : Atsushi Ueno
le 21 Mar 2023
urlwrite("https://celestrak.org/NORAD/elements/stations.txt","iss_orbit.tle");
startTime = datetime(2023,3,5,22,49,45);
stopTime = startTime + minutes(3);
sampleTime = 5;
sc = satelliteScenario(startTime,stopTime,sampleTime);
sat = satellite(sc,"./iss_orbit.tle");
[pos_1, vel_1] = states(sat( 1),"CoordinateFrame","inertial");
[pos_2, vel_2] = states(sat(10),"CoordinateFrame","inertial");
distance_array = vecnorm(pos_1-pos_2, 3, 1);
velocity_array = vecnorm(vel_1-vel_2, 3, 1);
time_x_array = startTime : seconds(sampleTime) : stopTime;
[M,I] = min(distance_array);
fprintf('Time = %s, Distance(km) = %f, Relative V(km/sec) = %f \n', ...
datetime(time_x_array(I)), distance_array(I)/1000.0, velocity_array(I)/1000.0);
plot(time_x_array, distance_array);
Réponses (0)
Voir également
Catégories
En savoir plus sur Simulation, Tuning, and Visualization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!