- #1
aerospace37
- 1
- 0
MY problom is easy,but i can't get the reasonable answer.problom dipicted:
In the Cartesian coordinates,A satellite'higth is 200KM,and just in two dimensions.the initial position is (-6571KM,0),and initial velocity is (0,-7.8KM/S).I need the final running solution of program.I want to solve the problom in ode45.The result figure just is a circle
program as following:
============================================
function Yd=orbit(t,y)
global u
rx=y(1);
ry=y(2);
vx=y(3);
vy=y(4);
rr=sqrt(rx^2+ry^2);
vxy=[vx;vy];
xy=[rx;ry];
Yd=[vxy;-u*xy/rr^3];
===================================
function wlow3
global u
u=3.986e14;
t0=0;tf=24*60*60;
tspan=[t0,tf]; %
y0=[-6.571e6;0;0;-7.8e3];%
[t,YY]=ode45('orbit',tspan,y0);
X=YY(:,1);
Y=YY(:,2);
plot(X,Y);
xlabel('x')
ylabel('y')
hold on
axis('image')
==========================================================
I hope anyone who researches orbit or others can communicates with me.
thans a lot.
In the Cartesian coordinates,A satellite'higth is 200KM,and just in two dimensions.the initial position is (-6571KM,0),and initial velocity is (0,-7.8KM/S).I need the final running solution of program.I want to solve the problom in ode45.The result figure just is a circle
program as following:
============================================
function Yd=orbit(t,y)
global u
rx=y(1);
ry=y(2);
vx=y(3);
vy=y(4);
rr=sqrt(rx^2+ry^2);
vxy=[vx;vy];
xy=[rx;ry];
Yd=[vxy;-u*xy/rr^3];
===================================
function wlow3
global u
u=3.986e14;
t0=0;tf=24*60*60;
tspan=[t0,tf]; %
y0=[-6.571e6;0;0;-7.8e3];%
[t,YY]=ode45('orbit',tspan,y0);
X=YY(:,1);
Y=YY(:,2);
plot(X,Y);
xlabel('x')
ylabel('y')
hold on
axis('image')
==========================================================
I hope anyone who researches orbit or others can communicates with me.
thans a lot.