Gravity

Computes position of several bodies under the action of gravitatory forces.
841 Downloads
Updated 24 Aug 2009

View License

% 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 (2024). Gravity (https://www.mathworks.com/matlabcentral/fileexchange/25117-gravity), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Environmental Models in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0