I just finished the first draft of the fapping algorithm!
I sat down and figured out that fapping has five primary variables: Strokes coefficient, Interest, Effectiveness, Stamina, and Power Level.
Strokes coefficient: Calculated by dividing the number of strokes/sec by the target strokes/sec (which is determined by Power Level, below). If strokes/sec = target strokes/sec, the system should remain stable. The coefficient drops if there aren't enough and rises if there are more than enough.
Effectiveness: The coefficient causes slow rises or drops in Effectiveness. Effectiveness measures how you are doing in the short term.
Interest: Interest measures how you are doing over a longer time span than Effectiveness, and is affected by that and other variables. The Effectiveness causes slow rises or drops in Interest. Interest is also affected by Stamina - for example, if you're hungry or tired, your stamina is lower, and Interest will be harder to keep up. Random events can also effect Interest - the phone rings (decrease), you see a scene you really like on the TV (increase), etc.
Power Level: This is how close you are to completion. Think of it as the strength of that tingly feeling you get. When Interest is less than 40%, power level drops. When Interest is more than 60%, power level increases. The 40-60% range is where Power Level remains stable.
Now, as you probably know from experience, any kind of fuckaroundery (alone or with others) requires an increase in speed as the power level increases. This is what controls the Target Speed.
If the actual speed is less than Target, it will cause Effectiveness to drop, which will drag down Interest. When Interest goes below 40%, Power Level starts to drop. Power Level affects Target, so Target drops as well.
If the actual speed is more than Target, it will cause Effectiveness to rise, which will cause Interest to rise. When Interest goes above 60%, Power Level starts to rise again. Power Level affects Target, so Target rises as well.
If you watch the current version of the movie, you can see this system in action: The user's speed is fixed at 4 (out of 5), and the system oscillates up and down continuously because 4 is enough to make it rise but not enough to maintain Power Level at 100 indefinitely. If it was 5, Power Level would climb to 100 and stay there; and if it was 1, Power Level would drop to zero.