Internal G=1 unit conversion/systems for simulation timestepping

In summary: Now I can go to bed happy. In summary, the conversation reveals that the speaker is struggling to determine the correct timestep for their N-body simulation, which uses an internal gravitational constant of 1. They are unsure of the relation that allows them to solve for the timestep, specifically in a system of unit mass, length, and velocity. After some discussion and clarification, it is determined that the time unit must equal 3.09e14 seconds or 9.78 Myr in order for G to equal 1. The conversation also highlights the importance of correctly setting and converting units in scientific calculations.
  • #1
mdemone
5
0
Hey everyone,

I'm knocking my head against something and for some reason I can't get it to work out -- I'm running an N-body simulation which uses an internal gravitational constant of 1, meaning that the timestep used is a function of the units of mass, length, and velocity.

But I don't know the relation that allows me to solve for the timestep, e.g. if I am working in a system of unit mass M = 2.3e9 M_sol = 4.6e39 kg, and unit length L = 1 kpc, and unit velocity V = 100 km/s, what is my unit of time for G = 1?

Can anybody help me out real quick? This is a very *duh* moment for me...
 
Last edited:
Space news on Phys.org
  • #2
mdemone said:
Hey everyone,

I'm knocking my head against something and for some reason I can't get it to work out -- I'm running an N-body simulation which uses an internal gravitational constant of 1, meaning that the timestep used is a function of the units of mass, length, and velocity.

But I don't know the relation that allows me to solve for the timestep, e.g. if I am working in a system of unit mass M = 2.3e9 M_sol = 4.6e33 kg, and unit length L = 1 kpc, and unit velocity V = 100 km/s, what is my unit of time for G = 1?

Can anybody help me out real quick? This is a very *duh* moment for me...

It looks to me as if you have two contradictory solutions.
On the one hand, if you have a mass unit and a length unit, then setting G = 1 will immediately determine a time unit!

but on the other hand, if you have a length unit and a speed unit THIS will automatically determine a time unit. The two time units will be in conflct.

To make it worse, If you ignore your length unit, then your speed unit together with mass and G = 1 will determine a time unit. And this will not agree with the other two.

=============
first of all, check that you have your mass unit right.

You claim that 2.3E9 solar masses = 4.6 E33 kilogram
but I think you are off by 6 orders of magnitude.
==============
once you have your mass unit correct, multiply it by G and you will get
3.05257453 E20 m^3 / s^2

THIS MUST EQUAL ONE IN YOUR UNITS

but you have declared that the speed of E5 meter/second also equals one!

therefore you can divide the above expression by the square of that speed and get

3.05257... E10 meters this must also equal one in your units, to be consistent

If you divide this length unit by the speed unit of E5 meter/second, you will get the time unit.

In other words your time unit must equal 3.05...E5 seconds
this is about 1/100 of a year.
=======================

now this is just as I understand what you are saying. Maybe I don't understand what you are doing.
But you said you want your mass unit to be that huge mass M
and you want your speed unit to be E5 m/s
As I understand units, if you then say that G = 1 you have no more choice.
You length and time units are then locked in.
 
Last edited:
  • #3
I should have better said: my set units are velocity and length (100 km/s and 1 kpc, respectively), as drawn from Widrow et al. 2003's disk/bulge/halo models for M31 (see note A on pg.22 here). The authors state that setting G=1 implies a mass unit of 2.3e9 M_sol (though there is an unfortunate typo in that number's exponent).

So how did they come to that conclusion and what was the timestep that must have been used?

Also, my solar mass-in-kilograms reference was wrong (how terrible!), although the one right next to it in grams was correct (it is of course 2e30 kg = 2e33 g). Thanks for pointing that out.

Edit: You added more while I was posting. Let me fiddle with it and see what I get...
 
Last edited:
  • #4
So obviously if Widrow et al. have V = 100 km/s and L = 1 kpc, then the time unit is T = 3.09e19/1e5 = 3.09e14 seconds = 9.78 Myr.

Then that gives us GM/V^2 = (6.67e-11 * 4.6e39) / (1e5)^2 = 3e19 meters =1 kpc, if we are given our mass unit first, and rearranging solves for the mass unit if necessary.

Okay, excellent. I gotcha now...thanks for the pointer! I hate it when I can't do something I feel is so simple, then I just get frustrated and it makes the mental block worse.

marcus said:
It looks to me as if you have two contradictory solutions.
But you said you want your mass unit to be that huge mass M
and you want your speed unit to be E5 m/s
As I understand units, if you then say that G = 1 you have no more choice.
You length and time units are then locked in.

Of course they are. I just wasn't thinking. This is what happens when I'm doing unit conversion on a Saturday night!
 
Last edited:
  • #5
Good! I am glad it is straightened out.
 

FAQ: Internal G=1 unit conversion/systems for simulation timestepping

What is an internal G=1 unit conversion?

An internal G=1 unit conversion is a method used in computer simulations to convert the units of time into a dimensionless form. This allows for easier calculation and comparison of different timescales within the simulation.

How does the G=1 unit conversion work?

The G=1 unit conversion is based on the gravitational constant, G, which is a fundamental constant in physics. By setting G=1, all units of time become dimensionless and can be easily converted and compared.

Why is the G=1 unit conversion important in simulation timestepping?

The G=1 unit conversion is important in simulation timestepping because it allows for a more accurate and efficient representation of time in computer simulations. It also helps to avoid issues with floating-point arithmetic and improves the stability of the simulation.

Are there any limitations to using the G=1 unit conversion?

While the G=1 unit conversion is a useful tool in simulation timestepping, it does have some limitations. It may not be appropriate for all simulations, especially those involving extremely small or large timescales. Additionally, it may not accurately represent physical units in the real world.

How can I implement the G=1 unit conversion in my simulation?

To implement the G=1 unit conversion in your simulation, you will need to adjust the equations and parameters to use dimensionless time units instead of standard units. This may require some modifications to the code and a thorough understanding of the G=1 unit conversion concept.

Similar threads

Replies
7
Views
1K
Replies
15
Views
2K
Replies
2
Views
2K
Replies
19
Views
2K
Replies
7
Views
3K
Replies
3
Views
4K
Back
Top