Gravity

Computes position of several bodies under the action of gravitatory forces.

You are now following this Submission

% calling sequence commands

%computes the position and velocities of the several bodies under %the action of gravitatory forces.
%The basic strategy is the Newmark method for time integration %and Newton-Raphson method for the non-linearity of the problem

gravity2

% given starting body, launching time and launching direction,
% computes velocity to impact target.
%The basic numerical strategy is the secant method for root
% finding
% SOLUTION MIGHT NOT EXIST
[iniv,iiter,error] = findv(3,7,0.1,0.5,600,[0;-1],1e-5,1e-7,30);

% given starting body, and launching time, computes initial direction so
% that launch velocity is minimal (launch velocity = escape velocity)
% The basic numerical strategy is the secant method for root finding
% SOLUTION MIGHT NOT EXIST
[alpha1, iniv1, error, kiter] = secant1(3,7,0.1,300,0.5,1e-5,1e-7,30,-pi/2);

Cite As

link2358 noname (2026). Gravity (https://www.mathworks.com/matlabcentral/fileexchange/25117-gravity), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0