Previous ToC Up Next

10. World Input and Output

10.1. A Bad Thing

Alice: It's great to have such a well structured code now, and I'm especially happy that output issues are now much better decoupled from running the orbit integrator.

Bob: I thought you'd like that kind of modularity!

Alice: Indeed. And not only that, we are now guaranteed that orbit integration will not be affected at all by any type of diagnostics output. In contrast, in the earlier code nbody_ind1.rb, we had to synchronize all particles in order to do any type of output. That meant that a change of diagnostics affected the actual outcome of the code. Here is an example, starting again from our standard input choice:

 |gravity> kali mkplummer.rb -n 4 -s 1 | kali nbody_set_id.rb > test.in
 ==> Plummer's Model Builder <==
 Number of particles            : N = 4
 pseudorandom number seed given : 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
              actual seed used  : 1
 ==> Takes an N-body system, and gives each body a unique ID <==
 value of @body_id for 1st body : n = 1
 Floating point precision       : precision = 16
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
We will run the code first with two energy reports, only at the beginning and the end:

 |gravity> kali nbody_ind1.rb -t 1 -d 1 < test.in > test1.out
 ==> Individual Time Step Hermite Code <==
 Parameter to determine time step size: dt_param = 0.01
 Interval between diagnostics output: dt_dia = 1.0
 Time interval between snapshot output: dt_out = 1.0
 Duration of the integration    : t = 1.0
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 0, after 0 steps :
   E_kin = 0.25 , E_pot =  -0.5 , E_tot = -0.25
              E_tot - E_init = 0
   (E_tot - E_init) / E_init = -0
 at time t = 1, after 4257 steps :
   E_kin = 0.313 , E_pot =  -0.563 , E_tot = -0.25
              E_tot - E_init = 7.24e-10
   (E_tot - E_init) / E_init = -2.9e-09
and then with three reports:

 |gravity> kali nbody_ind1.rb -t 1 -d 0.5 < test.in > test2.out
 ==> Individual Time Step Hermite Code <==
 Parameter to determine time step size: dt_param = 0.01
 Interval between diagnostics output: dt_dia = 0.5
 Time interval between snapshot output: dt_out = 1.0
 Duration of the integration    : t = 1.0
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 0, after 0 steps :
   E_kin = 0.25 , E_pot =  -0.5 , E_tot = -0.25
              E_tot - E_init = 0
   (E_tot - E_init) / E_init = -0
 at time t = 0.5, after 2021 steps :
   E_kin = 0.241 , E_pot =  -0.491 , E_tot = -0.25
              E_tot - E_init = 3.54e-10
   (E_tot - E_init) / E_init = -1.42e-09
 at time t = 1, after 4261 steps :
   E_kin = 0.313 , E_pot =  -0.563 , E_tot = -0.25
              E_tot - E_init = -5.01e-10
   (E_tot - E_init) / E_init = 2e-09
Note, first of all, that the total number of steps is different, which is a dead giveaway that something has changed. And indeed, we can check directly that the particles have not landed at exactly the same place.

 |gravity> cat test[12].out | kali nbody_diff.rb
 ==> 6N-dimensional phase space distance between two N-body systems <==
 Floating point precision       : precision = 2
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 6N-dim. phase space dist. for two 4-body systems:   1.1238501517441471e-08
This is definitely a bad thing. Unlike in quantum mechanics, a classical mechanics system should not be influenced by a measurement!

10.2. Modularity in Practice

Bob: And the claim is that this problem does not occur for our new code, since we evolve all particles one era at a time, and then do the diagnostics off-line, so to speak. Well, we'd better check:

 |gravity> kali world1.rb -t 1 -d 1 < test.in > test1.out
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 1.0
 Duration of the integration    : t = 1.0
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 0 (from interpolation after 0 steps to time 0):
     E_kin = 0.25 ,     E_pot =  -0.5 ,      E_tot = -0.25
        E_tot - E_init = 0
         (E_tot - E_init) / E_init = -0
 at time t = 1 (from interpolation after 4291 steps to time 1):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = -1.98e-10
         (E_tot - E_init) / E_init = 7.92e-10
 |gravity> kali world1.rb -t 1 -d 0.5 < test.in > test2.out
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 0.5
 Snapshot output interval       : dt_out = 1.0
 Duration of the integration    : t = 1.0
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 0 (from interpolation after 0 steps to time 0):
     E_kin = 0.25 ,     E_pot =  -0.5 ,      E_tot = -0.25
        E_tot - E_init = 0
         (E_tot - E_init) / E_init = -0
 at time t = 0.5 (from interpolation after 2033 steps to time 0.5):
     E_kin = 0.241 ,     E_pot =  -0.491 ,      E_tot = -0.25
        E_tot - E_init = -2.44e-10
         (E_tot - E_init) / E_init = 9.74e-10
 at time t = 1 (from interpolation after 4291 steps to time 1):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = -1.98e-10
         (E_tot - E_init) / E_init = 7.92e-10
Alice: At least the number of steps has not been changed.

Bob: A good sign already! Let's inspect the phase space distance:

 |gravity> cat test[12].out | kali nbody_diff.rb
 ==> 6N-dimensional phase space distance between two N-body systems <==
 Floating point precision       : precision = 2
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 6N-dim. phase space dist. for two 4-body systems:   0.0000000000000000e+00
Alice: Perfect. Modularity in practice, not only in theory!

10.3. A Test Suite

Bob: Ah, but there is more! Not only can we safely put our a report about energy conservation, any time we want, but we can even do a full output, and then restart from that output, as often as we want, without affecting the trajectories of any of the particles in the slightest.

Alice: Again, that is the claim. We'd better test that, too! Of course, this idea only works for a full output, one that dumps the whole internal data structure, for which we had the command line option -r. Without that option, you get a synchronized snapshot, and changing the frequency of synchronization will lead to the same problem we saw above with the previous code.

Bob: Let's build a little test suite. We'll create an input file, and then ask for output in different ways.

To start with, let's compare a run that directly integrates for two time units with a run that restarts from a dump halfway. We can do that comparison in two ways: compare a dump for each type of run, direcly and in stages, and compare a snapshot output for each type of run, where in the latter case of course the intermediate output still has to be a dump.

Then, for good measure, let's integrate till three time units. We can then compare a run that goes there non-stop with a run that makes one stop, and with a run that makes two stops along the way. We'll make those two comparisons on the dump level.

And since we require that everything should be unchanged, I want to do more than measuring phase space distances: I'll do a diff on the whole output file, to check whether any variable, important or not, has any change whatsoever. Here is the test suite:

 |gravity> kali mkplummer.rb -n 4 -s 1 | kali nbody_set_id.rb > tmp0
 ==> Plummer's Model Builder <==
 Number of particles            : N = 4
 pseudorandom number seed given : 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Takes an N-body system, and gives each body a unique ID <==
 value of @body_id for 1st body : n = 1
 Floating point precision       : precision = 16
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
              actual seed used  : 1
 |gravity> kali world1.rb -t 1 -r < tmp0 | kali acstail.rb > tmp1w
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 1.0
 Duration of the integration    : t = 1.0
 World output format, instead of snapshot
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 0 (from interpolation after 0 steps to time 0):
     E_kin = 0.25 ,     E_pot =  -0.5 ,      E_tot = -0.25
        E_tot - E_init = 0
         (E_tot - E_init) / E_init = -0
 at time t = 1 (from interpolation after 4291 steps to time 1):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = -1.98e-10
         (E_tot - E_init) / E_init = 7.92e-10
 |gravity> kali world1.rb -t 1 -r < tmp1w | kali acstail.rb > tmp2ww
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 1.0
 Duration of the integration    : t = 1.0
 World output format, instead of snapshot
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 1 (from interpolation after 4291 steps to time 0.99):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = -1.98e-10
         (E_tot - E_init) / E_init = 7.92e-10
 at time t = 2 (from interpolation after 6995 steps to time 2):
     E_kin = 0.171 ,     E_pot =  -0.421 ,      E_tot = -0.25
        E_tot - E_init = -6.5e-11
         (E_tot - E_init) / E_init = 2.6e-10
 |gravity> kali world1.rb -t 2 -o 2 -r < tmp0 | kali acstail.rb > tmp2w
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 2.0
 Duration of the integration    : t = 2.0
 World output format, instead of snapshot
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 0 (from interpolation after 0 steps to time 0):
     E_kin = 0.25 ,     E_pot =  -0.5 ,      E_tot = -0.25
        E_tot - E_init = 0
         (E_tot - E_init) / E_init = -0
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 1 (from interpolation after 4291 steps to time 1):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = -1.98e-10
         (E_tot - E_init) / E_init = 7.92e-10
 at time t = 2 (from interpolation after 6995 steps to time 2):
     E_kin = 0.171 ,     E_pot =  -0.421 ,      E_tot = -0.25
        E_tot - E_init = -6.5e-11
         (E_tot - E_init) / E_init = 2.6e-10
 |gravity> kali world1.rb -t 2 -o 2 < tmp0 | kali acstail.rb > tmp2s
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 2.0
 Duration of the integration    : t = 2.0
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 0 (from interpolation after 0 steps to time 0):
     E_kin = 0.25 ,     E_pot =  -0.5 ,      E_tot = -0.25
        E_tot - E_init = 0
         (E_tot - E_init) / E_init = -0
 at time t = 1 (from interpolation after 4291 steps to time 1):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = -1.98e-10
         (E_tot - E_init) / E_init = 7.92e-10
 at time t = 2 (from interpolation after 6995 steps to time 2):
     E_kin = 0.171 ,     E_pot =  -0.421 ,      E_tot = -0.25
        E_tot - E_init = -6.5e-11
         (E_tot - E_init) / E_init = 2.6e-10
 |gravity> kali world1.rb -t 1 < tmp1w | kali acstail.rb > tmp2ws
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 1.0
 Duration of the integration    : t = 1.0
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 1 (from interpolation after 4291 steps to time 0.99):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = -1.98e-10
         (E_tot - E_init) / E_init = 7.92e-10
 at time t = 2 (from interpolation after 6995 steps to time 2):
     E_kin = 0.171 ,     E_pot =  -0.421 ,      E_tot = -0.25
        E_tot - E_init = -6.5e-11
         (E_tot - E_init) / E_init = 2.6e-10
 |gravity> kali world1.rb -t 1 -r < tmp2w | kali acstail.rb > tmp3ww
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 1.0
 Duration of the integration    : t = 1.0
 World output format, instead of snapshot
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 2 (from interpolation after 6995 steps to time 1.99):
     E_kin = 0.171 ,     E_pot =  -0.421 ,      E_tot = -0.25
        E_tot - E_init = -6.5e-11
         (E_tot - E_init) / E_init = 2.6e-10
 at time t = 3 (from interpolation after 11014 steps to time 3.01):
     E_kin = 0.506 ,     E_pot =  -0.756 ,      E_tot = -0.25
        E_tot - E_init = -2.81e-09
         (E_tot - E_init) / E_init = 1.13e-08
 |gravity> kali world1.rb -t 3 -o 3 -r < tmp0 | kali acstail.rb > tmp3w
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 3.0
 Duration of the integration    : t = 3.0
 World output format, instead of snapshot
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 0 (from interpolation after 0 steps to time 0):
     E_kin = 0.25 ,     E_pot =  -0.5 ,      E_tot = -0.25
        E_tot - E_init = 0
         (E_tot - E_init) / E_init = -0
 at time t = 1 (from interpolation after 4291 steps to time 1):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = -1.98e-10
         (E_tot - E_init) / E_init = 7.92e-10
 at time t = 2 (from interpolation after 6995 steps to time 2):
     E_kin = 0.171 ,     E_pot =  -0.421 ,      E_tot = -0.25
        E_tot - E_init = -6.5e-11
         (E_tot - E_init) / E_init = 2.6e-10
 at time t = 3 (from interpolation after 11014 steps to time 3.01):
     E_kin = 0.506 ,     E_pot =  -0.756 ,      E_tot = -0.25
        E_tot - E_init = -2.81e-09
         (E_tot - E_init) / E_init = 1.13e-08
 |gravity> kali world1.rb -t 1 -r < tmp2ww | kali acstail.rb > tmp3www
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 1.0
 Duration of the integration    : t = 1.0
 World output format, instead of snapshot
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 2 (from interpolation after 6995 steps to time 1.99):
     E_kin = 0.171 ,     E_pot =  -0.421 ,      E_tot = -0.25
        E_tot - E_init = -6.5e-11
         (E_tot - E_init) / E_init = 2.6e-10
 at time t = 3 (from interpolation after 11014 steps to time 3.01):
     E_kin = 0.506 ,     E_pot =  -0.756 ,      E_tot = -0.25
        E_tot - E_init = -2.81e-09
         (E_tot - E_init) / E_init = 1.13e-08
 |gravity> diff tmp2w tmp2ww | wc
       0       0       0
 |gravity> diff tmp2s tmp2ws | wc
       0       0       0
 |gravity> diff tmp3w tmp3ww | wc
       0       0       0
 |gravity> diff tmp3w tmp3www | wc
       0       0       0

10.4. Using Snapshots Instead

Alice: Wonderful. That gives you confidence! We really seem to have things under control now. But wouldn't it be nice to check that there are still differences when you do not use a full dump at intermediate times, but use snapshots instead?

Bob: Sure. Easy to add. And since we now expect differences, let me do a phase space distance measurement at the end as well. Here you are:

 |gravity> kali world1.rb -t 1 < tmp0 | kali acstail.rb > tmp1s
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 1.0
 Duration of the integration    : t = 1.0
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 0 (from interpolation after 0 steps to time 0):
     E_kin = 0.25 ,     E_pot =  -0.5 ,      E_tot = -0.25
        E_tot - E_init = 0
         (E_tot - E_init) / E_init = -0
 at time t = 1 (from interpolation after 4291 steps to time 1):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = -1.98e-10
         (E_tot - E_init) / E_init = 7.92e-10
 |gravity> kali world1.rb -t 1 < tmp1s | kali acstail.rb > tmp2ss
 ==> Returns the last n chunks of ACS data <==
 Number of last ACS data chunks returned: n = 1
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 ==> Individual Time Step, Individual Integration Scheme Code <==
 Determines the time step size  : dt_param = 0.01
 Duration of an era             : dt_era = 0.01
 Maximum time step (units dt_era): dt_max_param = 1.0
 Diagnostics output interval    : dt_dia = 1.0
 Snapshot output interval       : dt_out = 1.0
 Duration of the integration    : t = 1.0
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 at time t = 1 (from interpolation after 0 steps to time 1):
     E_kin = 0.313 ,     E_pot =  -0.563 ,      E_tot = -0.25
        E_tot - E_init = 0
         (E_tot - E_init) / E_init = -0
 at time t = 2 (from interpolation after 2713 steps to time 2):
     E_kin = 0.171 ,     E_pot =  -0.421 ,      E_tot = -0.25
        E_tot - E_init = -2.8e-10
         (E_tot - E_init) / E_init = 1.12e-09
 |gravity> diff tmp2ss tmp2s | wc
      76     146    2262
 |gravity> cat tmp2s | wc
      74     128    2185
 |gravity> cat tmp2ss tmp2s | kali nbody_diff.rb
 ==> 6N-dimensional phase space distance between two N-body systems <==
 Floating point precision       : precision = 2
 Screen Output Verbosity Level  : verbosity = 1
 ACS Output Verbosity Level     : acs_verbosity = 1
 Floating point precision       : precision = 16
 Incremental indentation                : add_indent = 2
 6N-dim. phase space dist. for two 4-body systems:   2.2390038382354583e-08
Alice: As we expected, many lines are different, as you can see from the wordcount wc after the diff, which is comparable in size to the file itself. And in phase space there is a definite distance between the two types of runs as well.
Previous ToC Up Next