MHB Gravity Calculation: Calculate Accel Gravity

AI Thread Summary
The discussion focuses on calculating gravitational acceleration using Newton's laws. The gravitational constant (G) and the mass of the Earth (M) are provided, along with the distance from the Earth's center (distCenter). The relevant equations are outlined: Newton's second law (a = F/m) and the universal law of gravitation (F = G(Mm/r^2)). The derived formula for acceleration due to gravity (a = G(M/r^2)) is emphasized as the basis for implementing the calculation in the provided Java code. The goal is to compute and print the gravitational acceleration (accelGravity) using these principles. Participants are encouraged to wrap their code in appropriate tags for better readability.
dcs1953
Messages
3
Reaction score
0
Code:
public class GravityCalculation {
   public static void main (String [] args) {
      double G            = 6.673e-11;
      double M            = 5.98e24;
      double accelGravity = 0.0;
      double distCenter   = 0.0;

      distCenter = 6.38e6;

      /* Your solution goes here  */

      System.out.println("accelGravity: " + accelGravity);
      return;
   }
}
 
Last edited by a moderator:
Technology news on Phys.org
Please wrap your code in [CODE][/CODE] tags...it will preserve the whitespace and make your code easier to read.

One form of Newton's second Law of Motion is:

$$a=\frac{F}{m}$$

where $a$ is acceleration, $F$is the applied force, and $m$ is the mass of the object in motion.

And, Newton's Universal Law of Gravitation states:

$$F=G\frac{Mm}{r^2}$$

Where $F$ is the resulting force, $G$ is the gravitational constant, $M$ and $m$ are the masses of the two objects attracting one another, and $r$ is the distance separating their centers of mass. And so, we find the resulting acceleration of the object having mass $m$ to be:

$$a=\frac{F}{m}=\frac{G\dfrac{Mm}{r^2}}{m}=G\frac{M}{r^2}$$

Can you now use this to construct the needed statement?
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top