Solving odes (restricted 3 body problems)

2 次查看(过去 30 天)
I have been trying to solve these equations -
d2x dt2 = 2 dy dt + x− M(x + E) r3 E − E(x−M) r3 M
d2y dt2 = −2 dx dt + y− My r3 E − Ey r3 M
z1 = x, z2 = dx dt , z3 = y, and z4 = dy dt
but keep getting these errors:-
Unrecognized function or variable 'rE'.
Error in secodef (line 4) zprime=[z(2);2*z(4)+z(1)-((M*(z(1)+E))/rE^3)-((E*(z(1)-M))/rM^3);z(4);-2*z(2)+z(3)-((M*z(3))/rE^3)-((E*z(3))/rM^3)];
Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in trial1 (line 13) [t,z] = ode45(@secodef,tspan,Z);
what do I do?

采纳的回答

darova
darova 2020-3-25
Variables rE and rM should be in the function
  9 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by