how to build a hyperbolic orbit and draw it in 3d image parameters, orbital data classics with direction defined by the vector Vinf = [xyz]. hyperbole can 'rotate around this carrier
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
</matlabcentral/answers/uploaded_files/16618/Immagine.jpg> hello, I tried to create a program that could reproduce the picture below, but with little result ... my hyperbole does not revolve around the carrier default. the problem to create the orbit have already calculated all the data that serve as the gravitational parameter, the radius of perigee, eccentricity. I can not get a hyperbola with axis of rotation parallel to the vector Vinf which in my case is: Vinf = [vx vy vz].
if true
% code
%{
this function compute the state vector (r,v) from orbital element (coe).
mu - gravity parameter (km^3;s^2)
coe - orbital element [h e RA incl w TA]dove
h = angoular momentum (km^2/s)
e = eccentricity
RA = right ascension of the ascending node (rad)
incl = inclination of the orbit (rad)
w = argument of perigee (rad)
TA = true anomaly (rad)
R3_w - Rotation matrix about the z-axis through the angle w
R1_i - Rotation matrix about the x-axis through the angle i
Ra3_W - Rotation matrix about the z-axis through the angle RA
Q_pX - Matrix of the transformation from perifocal to geocentric
equatorial frame
rp - position vector in the perifocal frame (km)
vp - velocity vector in the perifocal frame (km/s)
r - position vector in the geocentric equatorial frame (km)
v - velocity vector in the geocentric equatorial frame (km/s)
%}
% ----------------------------------------------
for i=0:0.2:2*pi;
vinf=[-0.796334408804935 -5.011167091347754 0.952548597801488]; %reference vector on which must rotate the hyperbola
mu=2889999;
Mu=mu;%gravitational parameter taken arbitrarily
Rper= 2000; %radius of perigee taken arbitrarily
rap=1500; %radius of planet
vinf=norm(vinf);
e = 1+(Rper*vinf^2)/Mu; %eccentricity of the hyperbola h = (Mu*(sqrt(e^2-1)))/vinf; beta=acos(1/(1+((Rper*vinf^2)/Mu)));
tetainf= acos(-1/e); % angle asymptote
%please need help to make sure that the rotation axis of the hyperbola
%is the vector of reference given by the identification of the angle ....
%RA, angle i and angle w.
RA =0; %?????? RA = right ascension of the ascending node (rad) incl =i; w =0; %?????? w = argument of perigee (rad)
%?????incl = inclination of the orbit (rad)
TA=0:0.001:tetainf;
L=(h^2/mu)./[(1 + e*cos(TA))]; F=[cos(TA);sin(TA);zeros(1,length(sin(TA)))]; %...Equations 4.45 and 4.46 (rp and vp are column vectors): for i=1:1:length(sin(TA)) r_INT(1:3,i) =(L(1,i) * F(1:3,i));%km end;%km v_INT = (mu/h) .* [-sin(TA);e + cos(TA);zeros(1,length(sin(TA)))];% km/s %...Equation 4.34: R3_W = [ cos(RA) sin(RA) 0 -sin(RA) cos(RA) 0 0 0 1]; %...Equation 4.32: R1_i = [1 0 0 0 cos(incl) sin(incl) 0 -sin(incl) cos(incl)]; %...Equation 4.34: R3_w = [ cos(w) sin(w) 0 -sin(w) cos(w) 0 0 0 1]; %...Equation 4.49: Q_pX = (R3_w*R1_i*R3_W)'; %...Equations 4.51 (r and v are column vectors): r_G =Q_pX*r_INT;%raggio da plot v_G= Q_pX*v_INT;%velocita da plot %plottaggio pianeta e orbita iperbolica su grafico a parte centrato nel %pianeta figure(2); [XX, YY, ZZ] = ellipsoid(0,0,0,rap,rap,rap,30); surface(-XX, -YY, -ZZ);
hold on
%plot hyperbola on 3d plot plot3(r_G(1,1:length(sin(TA))),r_G(2,1:length(sin(TA))),r_G(3,1:length(sin(TA))),'r--','linewidth',1.0) axis([-7*Rper 7*Rper -7*Rper 7*Rper -7*Rper 7*Rper]); title('Grafico Pianeta di Partenza') xlabel('x distanza km'); ylabel('y distanza km'); zlabel('z distanza km'); axis([-100000 100000 -100000 100000 -100000 100000]); hold on
semiy=Mu/(vinf^2);% semi-major axis of the hyperbola eccy=e;% eccentricità iperbole
%Velocità perigeo Vperi= sqrt(vinf^2+(2+Mu)/Rper);
TA=-tetainf:0.001:0;
L=(h^2/mu)./[(1 + e*cos(TA))]; F=[cos(TA);sin(TA);zeros(1,length(sin(TA)))]; %...Equations 4.45 and 4.46 (rp and vp are column vectors): for i=1:1:length(sin(TA)) r_INT(1:3,i) =(L(1,i) * F(1:3,i));%km end;%km v_INT = (mu/h) .* [-sin(TA);e + cos(TA);zeros(1,length(sin(TA)))];% km/s %...Equation 4.34: R3_W = [ cos(RA) sin(RA) 0 -sin(RA) cos(RA) 0 0 0 1]; %...Equation 4.32: R1_i = [1 0 0 0 cos(incl) sin(incl) 0 -sin(incl) cos(incl)]; %...Equation 4.34: R3_w = [ cos(w) sin(w) 0 -sin(w) cos(w) 0 0 0 1]; %...Equation 4.49: Q_pX = (R3_w*R1_i*R3_W)'; %...Equations 4.51 (r and v are column vectors): r_G =Q_pX*r_INT;%raggio da plottare v_G= Q_pX*v_INT;%velocita da plottare
plot3(r_G(1,1:length(sin(TA))),r_G(2,1:length(sin(TA))),r_G(3,1:length(sin(TA))),'r-','linewidth',2.0) axis([-5*Rper 5*Rper -5*Rper 5*Rper -5*Rper 5*Rper]); title('Grafico Pianeta di Partenza') xlabel('x distanza km'); ylabel('y distanza km'); zlabel('z distanza km');
hold on end vettore_plot_vel_H(-0.796334408804935,-5.011167091347754,0.952548597801488,[0 0 0 ]);
end

0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Gravitation, Cosmology & Astrophysics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!