Solving 12 Simultaneous, Coupled second order differential equations

1 次查看(过去 30 天)
I need help writing a program to simulate the motion of 2 bodies in space under the influence of the force of gravitation of the other. I intend to give the program the initial conditions R1,R2,V1, and V2 (position and velocity of each body) in x, y, z components. The general form of the ODEs that I need to solve are: dR/dt = V
dV/dt = Gmr/magnitude(r)^3 Where r = R2 - R1 (in component form) So I need to figure out a way to plug 12 of these in (6 dRs and 6 dVs where R1 and R2 are broken into x, y, z components) and solve for the new R1, R2, V1, and V2 so that the process can be iterated.
I've spent some time away from MATLAB so I'm quite rusty on how to do something like this. I think I can use ode 45 but I'm not entirely sure.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by