...Your conclusions about order are also valid. For example, do you take the friction value from the tile you started in or finished in? Do you decrease speed from friction before or after you move? I believe I have all those things done correctly in the python program, as it exactly matches my experimental observations. I do have a spreadsheet of raw results if you want to PM me your email address.
...
As far as the initial push, I used the per-tile delay data on the straight track to solve for the unknowns: starting position, starting velocity, and per-tick friction. I had to try a few different assumptions about order of effects, but eventually it matched exactly. So the reason for 0.5 is because the numbers fit and it made sense. (Speculating about DF's internal implementation, it seems positions are tracked as floating point numbers but tiles are defined at integers, so whenever something gets built or placed it probably gets put at an exact spot "in the middle" of the tile )
I'll send you a pm with my email address, but would you mind explaining the basics about the python program (seeing as you already posted the code anyway), or rather, describe the calculation steps (done per tick?), and their order, so others could understand it better too?
So yup, 2nd minecart science fort: 2x16 embark, forested island, right next to some elves, hopefully no goblins (didn’t remember to check, but most of the island was inhabited by the elven civ). 2x16 means the embark is a bit under 100 tiles wide, but I now have a N/S tunnel 766 tiles long.
Testing #9-10 (down ramps, ramp friction):First off, gonna test 1 ramp down. Drop a feather wood minecart (weighs only 4Γ; nothing but bruises from the 3 first collisions, and quicker to carry) onto lowest rollers, 50 tiles of track, then on the last tile it moves to, a ramp down. Cart moved a further 474 tiles (tested a couple times). A larch minecart (weight 23Γ) went the exact same distance. That’s a net energy gain of 473 Urists, assuming the down ramp still has friction. So let’s have a look at #10.
Deconstructed the ramp, minecart moved 1 tile after falling through the hole on the 51st tile. This was somewhat expected, since it wouldn’t experience friction during the parabolic-path fall. I then replaced one of the 51 NS tracks with a NS track ramp, which functioned exactly like a NS track, as expected (since there was nothing upstairs for it to ramp to, and actually no walls adjacent, so the ramp was unusable). That’s about all I can think of for #10 at the moment: ramp tracks do have the usual 1 friction in addition to their ramp effects, and falling down is well, a parabolic path (no horizontal speed gained or lost, probably – although to be exact, that should be verified with higher speeds and a much longer fall).
Moving back to verifying the 1-ramp-down results, deconstructed a track and built a ramp down right in front of the lowest roller mentioned before. First test killed(!) a cat (due to striking it in the head, bruising the muscle, jamming the skull through the brain and tearing apart the brain). Second test had the cart go 594 tiles after the ramp. That would be a net gain of 543 Urists (removed 50 for the energy gained from the roller and 1 for the ramp friction). Another cat impact (this time with seriousfatal injuries)! And then a dwarf, too (broke his arm)! Finally did manage to repeat and confirm an exact 543 Urist net energy gain. Next up, low rollers (was going to push, but this way I don’t have to fiddle with hauling settings, just switch out the rollers) and ramped it down adjacent to the rollers: the cart traveled 783 tiles, for a net energy gain of of 583 Urists (note that I did have to resort to placing 10 low track stops to stop the cart before the end of the tunnel; the extra friction from those is included in the distance above). Next, continued testing with the low roller, but moving the ramp down further away in increments: 50 tiles (and thus a remaining energy of 150 Urists) gave a net gain of 532 Urists; 100 tiles, 470 Urists; 150 tiles, 545 Urists; 200 tiles (ramp down on last tile cart would move to on flat track), 469 Urists. The last two were expected to be the same as with the lowest-roller tests. Clearly there is at least some sort of rounding issue at play here, but it seems to be that: a) with energies of 50-200 Urists, the cart gains about 560 Urists of energy (ranging from 540ish to 580ish); b) if the cart has almost stopped before ramping down, the kinetic energy gained will be slightly less, about 470 Urists. More testing could be carried out, especially in the 0-50 Urists remaining range. I was expecting some variability, having read reports that it was sometimes* possible to generate speed just be having a cart ramp down and immediately back up again (*depending on where the aforementioned feature was located on the track). But this is just… well, I hesitate to use the word, but ugly :/
Testing #10 (up ramps):Ramping up 1 z-level. I’ll be continuing with low rollers, with a ramp down right after (so kinetic energy of 783 Urists as above, not yet counting the friction from the ramp). Ramp up immediately after ramping down had the cart travel over 250 tiles after ramping back up. Going to save myself the pain of building a hundred or so tiles of tracks on the level above (yes, building, since it’s a soil layer), and just channel out a hole for the cart to drop back down onto the tracks below. Said hole will be on the 250th tile after the roller. By measuring with 1-step, my guess for the horizontal flight time is 3 tiles (±1 tile). With this setup, the cart went all the way up to my u-bend, so over 550 Urists of net gain from the 2-tile channel. To avoid boring people with a list of the further tests in text form, here's a table. The first case (up ramp 1 tile away from down ramp) is the one explained above. ~ and a number means that the tiles traveled has been estimated (i.e. there was some hang time, as above, which has been estimated; the errors possible here are +-1 tile). The N/A for the last two mean that the cart didn't ramp up the tile at all, and thus I don't have any measurements.
distance from down to up ramp: 1 2 3 4 5 6 7 8 9 10 11 50 100 150 200
total tiles traveled: 750+ ~313 203 ~312 118 ~312 120 205 121 206 62 226 ~252 N/A N/A
net gain/loss of energy: 550+ 113 3 112 -82 112 -80 3 -79 6 138 26 52 N/A N/A
So it seems pretty obvious there's some integer rounding going on, as with the small-interval measurements there are 3 clear possible outcomes: a net gain of about 110 Urists, a net loss of about 80 Urists, and breaking almost even (a few Urists worth of net gain). Further away it gets less clear, but in general ramping down, and up again later, will actually give the cart some speed.
I also think it’s noteworthy that due to my impatience and lazyness (to disable the push command for the short while dwarves were doing modifications), at least 4 dwarves have received various fractures and at least as many others some bruises (one got hit 3 times because he took so long to carve tracks). One was unlucky enough to get a piece of skull jammed through his brain, and died. So… feather wood minecarts: maybe safer than iron ones, but don’t bet on it?
For the next update, I think I'll test how much energy highest rollers give (finishing up #13), then maybe continue with the rest of the roller questions. I think I'll try and split up the SCIENCE into smaller chunks from now on (well, this post is already implementing that idea, but the reasoning for the earlier megaposts is I didn't want to just make a post with all the research questions, then have people wait several days before giving any results).