展开全部
function zd503781491
% 求解微分方程
Y0 = [1.2; 0; 0; -1.04935371];
[t,Y] = ode45(@ode, [0 100], Y0);
% 绘制轨迹图
x = Y(:, 1);
y = Y(:, 3);
plot(x,y)
axis equal
function dY = ode(t, Y)
% 阿波罗飞船运动微分方程
mu = 1 / 82.45;
lambda = 1 - mu;
x = Y(1);
dx = Y(2);
y = Y(3);
dy = Y(4);
r1 = sqrt( (x+mu)^2 + y^2 );
r2 = sqrt( (x+lambda)^2 + y^2 );
dY = [
dx;
2*dy + x - lambda*(x+mu) / r1^3 - mu*(x-lambda) / r2^3;
dy;
-2*dx + y - lambda*y / r1^3 - mu*y / r2^3;
];
% 求解微分方程
Y0 = [1.2; 0; 0; -1.04935371];
[t,Y] = ode45(@ode, [0 100], Y0);
% 绘制轨迹图
x = Y(:, 1);
y = Y(:, 3);
plot(x,y)
axis equal
function dY = ode(t, Y)
% 阿波罗飞船运动微分方程
mu = 1 / 82.45;
lambda = 1 - mu;
x = Y(1);
dx = Y(2);
y = Y(3);
dy = Y(4);
r1 = sqrt( (x+mu)^2 + y^2 );
r2 = sqrt( (x+lambda)^2 + y^2 );
dY = [
dx;
2*dy + x - lambda*(x+mu) / r1^3 - mu*(x-lambda) / r2^3;
dy;
-2*dx + y - lambda*y / r1^3 - mu*y / r2^3;
];
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |