# seregheru

Members

7

## Community Reputation

13 Good

• Rank
Bottle Rocketeer

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. ## [1.3.0] Kerbalism v1.2.9

@ShotgunNinja That looks like a pretty neat solution. You'd lose the long tail of rare unexpectedly long-lived parts, but that's possibly a good thing. I can't think of a reason why it won't work. You would have to experiment to see how sudden the onset of wear-out failures feels, but you could always add an extra point or two to the curve to soften it up. Looks promising anyway - would be interested to see how it plays.
2. ## [1.3.0] Kerbalism v1.2.9

Calculating the CDF means you DON'T calculate over and over at 60Hz. Calculating at every time step is much, much simpler but obviously has a huge performance penalty. Calculating the CDF lets you set the lifetime once and then just test "(age>lifetime)" in each step. You are already doing this - the code you have is exactly what you would get if you calculated then inverted the CDF for a uniform probability density function. Age is not on both axes of the CDF. The x-axis is the age and the y-axis is the probability of failure before that time. You generate the y-axis value from random number and then read across to the curve and down to the lifetime on the x-axis.
3. ## [1.3.0] Kerbalism v1.2.9

@ShotgunNinja [Ah, inverted plot in edit is more clear] Approximating the bathtub function still leaves you the survival function to calculate and the integral to do. The cumulative distribution is the important one, as that's the one that gives you the lifetime value. That will start at zero and grow towards 1. The gradient is always non-negative. I'm not totally sure on the exact shape in between - I think its a curve that starts steep, curves off and then straightens slightly.... but I'd need to put some numbers in a spreadsheet to be sure.