It looks like I may not be using this invest script correctly. I guess I don't get it.
I copied the formulas from the Black Book and made a Python script and got different results so it looks like your instincts were probably correct.
With the new code I got 13612.27 as the new slider value.
I'll paste the output and attach the code and let you be the judge.
Withdraw Amount: 2000
Investment After Payout of $2000.0
C = float(input("Capital: "))
P = float(input("Profit: "))
W = 0
Balance_on_the_account= C + P - W
Minimum_amount_in_the_account= C * f
Available_for_removal= C + P - W - C * f
Available_for_reinvesting= C * f - W/f
W = float(input("Withdraw Amount: "))
#Previous_margin = 0.5 * OptimalF * $10000
Account_after_profit = C + P-W # $13,000
Growth_factor = 1+P/C # 1.3,
#its_square_root f # 1.14
Account_minimum = C * f # $10,000 * 1.14 # $11,400
Maximum_payout = C + P-W-C * f # $13,000-$11,400 # $1600
#print(#its_square_root f # 1.14 )
Investment_after_Payout = C * f - W/f
print("Investment After Payout of $" + str(W))