Jump to content

Gravity equation question.


Thorham

Recommended Posts

Hi,

 

My question should be simple enough: If (G*m1*m2)/distance^2 gives you the total amount of gravitational force, then how can I calculate the acceleration for each individual mass? I'm trying to write a simple simulation program, but I can't read some of the math that I've looked up.

 

Any help is appreciated :)

Link to comment
Share on other sites

You'd get the acceleration from F=ma => a=F/m. But I have the feeling your problem rather is to find the gravitational force.

Thanks :)

 

Didn't think it would be that easy, because I was reading the Wikipedia article about this equation, and I was looking at it's vector form (which I can't read completely). Anyway, getting the force seems easy enough. 

Link to comment
Share on other sites

Well, force and acceleration are vectors, I merely didn't write down the arrows over the letters. I could also write it as [math] \vec F = m\vec a \Rightarrow \vec a = \vec F / m[/math]. Like I said, I'd rather expect you to have problem finding the force, i.e. the force vector. It's not that hard, but if you get stuck, you're welcome to ask for more help here. For question about forces and working with vectors there should be plenty of people in this forum that can and will gladly help you.

Link to comment
Share on other sites

The only problem with the main formula is the gravitational constant:

 

08d1d0734a57cadf71b2f884186ab674.png

 

Where I don't know how to read this part: m^3 kg^-1 s^-2 and N(m/kg)^2

 

For the rest my program simply does this:

 

xd=(x(t1)-x(t))
yd=(y(t1)-y(t))

pd1=xd*xd+yd*yd
pd=Sqr(pd1)

f=(m(t)*m(t1))/pd1
a1=f/m(t)
a2=f/m(t1)

xpd=xd/pd
ypd=yd/pd

xv(t)=xv(t)+xpd*a1
yv(t)=yv(t)+ypd*a1
xv(t1)=xv(t1)-xpd*a2
yv(t1)=yv(t1)-ypd*a2

This seems to work quite well, but may still be wrong.

Link to comment
Share on other sites

The only problem with the main formula is the gravitational constant:

 

08d1d0734a57cadf71b2f884186ab674.png

 

Where I don't know how to read this part: m^3 kg^-1 s^-2 and N(m/kg)^2

 

Those are the units in the SI system. Force is in Newtons (N), which is kg-m/s^2, because F=ma. m has units of kg, a has units of m/s^2

 

Negative exponents mean they are in the denominator

 

Since you have GMm/r^2, those are he units you need to make the force come out in N

Link to comment
Share on other sites

Those are the units in the SI system. Force is in Newtons (N), which is kg-m/s^2, because F=ma. m has units of kg, a has units of m/s^2 Negative exponents mean they are in the denominatorSince you have GMm/r^2, those are he units you need to make the force come out in N
Thanks :)

 

Yeah, of course, the SI units. I was reading m^3 kg^-1 s^-2 as mass^3*kilogram^-1*whatever^-2, should be length^3*mass^-1*time^-2.

Link to comment
Share on other sites

  • 2 weeks later...

Well, force and acceleration are vectors, I merely didn't write down the arrows over the letters.

It's easier to bold the letters. That's what I do. It's soooo much simpler for me and I'm soooo lazy. It looks more like what appears in texts too. E.g.

 

P = m0U

 

p= mv

Edited by pmb
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.