不挂科搜题免费

问题:

(ex4)已知Appolo卫星的运动轨迹(x, y)满足下面的方程 其中 试在初值x(0)=1.2,

答案:

%令x(1)=x,x(2)=x',x(3)=y,x(4)=y'将原方程组化为一阶方程组。 %先在Editor窗口建立M函数存为ex6_4fun.m function dx=ex6_4fun(t,x) dx(1)=x(2); dx(2)=2*x(3)+x(1)-((1-1/82.45)*(x(1)+1/82.45))/(sqrt((x(1)+1/82.45)^2+x(3)^2))^3-(1/82.45*(x(1)-1+1/82.45))/(sqrt((x(1)+1-1/82.45)^2+x(3)^2))^3; dx(3)=x(4); dx(4)=-2*x(2)+x(3)-((1-1/82.45)*x(3))/(sqrt((x(1)+1/82.45)^2+x(3)^2))^3-(1/82.45*x(3))/(sqrt((x(1)+1-1/82.45)^2+x(3)^2))^3; dx=dx(:); 再在指令窗口执行 clear;close; [t,x]=ode45(@ex6_4fun,[0 24],[1.2; 0; 0; -1.04935371]); plot(x(:,1),x(:,3));