필터 지우기
필터 지우기

I want to plot graph for my intersatellite range rate. How can i do that

조회 수: 5 (최근 30일)
Toshi
Toshi 2024년 1월 12일
댓글: Sam Chak 2024년 2월 25일
here is the given code :
recPos = [-7500 12500 15000];
recVel = [112.5 100.66 -50];
transPos = [-8337.5 7330.13 -12000];
transVel = [112.5 100.66 -40];
startTime = datetime(2021,4,25);
stopTime = datetime(2021,4,26);
sampleTime = 60;
sc = satelliteScenario(startTime,stopTime,sampleTime);
gs = groundStation(sc);
[p,pdot] = pseudoranges(recPos,transPos,recVel,transVel);
disp('Range between Satellites:');
disp(pseudoranges(recPos,transPos));
plot(pdot);
  댓글 수: 1
Sam Chak
Sam Chak 2024년 2월 25일
Hey @Toshi, I wanted to inquire if the issue regarding plotting the intersatellite range rate has been resolved. It's an intriguing problem, and I'm curious to know if there have been any recent developments or breakthroughs.

댓글을 달려면 로그인하십시오.

채택된 답변

Hassaan
Hassaan 2024년 1월 12일
% Define the initial positions and velocities
recPos = [-7500, 12500, 15000];
recVel = [112.5, 100.66, -50] / 3600; % Convert to km/s
transPos = [-8337.5, 7330.13, -12000];
transVel = [112.5, 100.66, -40] / 3600; % Convert to km/s
% Define the time parameters
startTime = datetime(2021, 4, 25);
stopTime = datetime(2021, 4, 26);
sampleTime = 60; % Sampling time in seconds
% Calculate the number of samples
numSamples = hours(stopTime - startTime) * (3600 / sampleTime);
% Initialize arrays to store the range rate and time vector
rangeRates = zeros(numSamples, 1);
timeVec = startTime:seconds(sampleTime):stopTime - seconds(sampleTime);
% Calculate the range rate at each sample
for i = 1:numSamples
% Update the positions based on the velocities
recPos = recPos + recVel * sampleTime;
transPos = transPos + transVel * sampleTime;
% Calculate the range as the Euclidean distance between recPos and transPos
range = norm(recPos - transPos);
% Calculate the range rate as the dot product of the relative velocity
% and the unit vector in the direction from recPos to transPos
relativeVelocity = recVel - transVel;
rangeRates(i) = dot(relativeVelocity, (transPos - recPos) / range);
end
% Plot the range rate
figure;
plot(timeVec, rangeRates);
title('Intersatellite Range Rate Over Time');
xlabel('Time');
ylabel('Range Rate (km/s)');
grid on;
This script calculates the range rate at each time step and then plots it. It assumes a linear motion model for the satellites, which might not be accurate in a real-world scenario, but it's sufficient for demonstrating the concept with dummy data.
Make sure to replace the pseudoranges function call with actual code to compute the range and range rate, as the provided snippet is just a placeholder based on a simplified model. If you have a more accurate way to calculate the range and range rate, use that instead.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
Feel free to contact me.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 CubeSat and Satellites에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by