The gravitational force F between two bodies of masses m1 and m2 is given by the
ID: 3636511 • Letter: T
Question
The gravitational force F between two bodies of masses m1 and m2 is given by the equation F = Gm1m2/r2 where G is the gravitation constant (6.672 times 10-11 N m2/kg2), m1 and m2 are the masses of the bodies in kilograms, and r is the distance between the two bodies. Write a function to calculate the gravitational force between two bodies given their masses and the distance between them. Test you function by determining the force on an 800 kg satellite in orbit 38,000 km above the Earth. (The mass of the Earth is 5.98 times 1024 kg.)Explanation / Answer
Create the file grav.m and insert the following: function [force] = grav(m1, m2, r) G = 6.672E-11; force = G * m1 * m2 / r^2; end From the matlab command line: >>> grav(800,5.98E24,38000) ans = 2.2104e+08
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.