Coverage for eng_econ/factors.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from eng_econ import generate_dcostring
4@generate_dcostring("F", "P", "Single payment compound amount")
5def single_payment_compound_amount_factor(i, n):
6 return (1 + i) ** n
9@generate_dcostring("P", "F", "Single payment present worth")
10def single_payment_present_worth_factor(i, n):
11 return (1 + i) ** (-n)
14@generate_dcostring("A", "F", "Uniform series sinking fund")
15def uniform_series_sinking_fund_factor(i, n):
16 return i / ((1 + i) ** n - 1)
19@generate_dcostring("A", "P", "Capital recovery")
20def capital_recovery_factor(i, n):
21 temporary = (1 + i) ** n
22 return i * temporary / (temporary - 1)
25@generate_dcostring("F", "A", "Uniform series compound amount")
26def uniform_series_compound_amount_factor(i, n):
27 return ((1 + i) ** n - 1) / i
30@generate_dcostring("P", "A", "Uniform series present worth")
31def uniform_series_present_wortht_factor(i, n):
32 temporary = (1 + i) ** n
33 return (temporary - 1) / (i * temporary)
36@generate_dcostring("P", "G", "uniform gradient present worth")
37def uniform_gradient_present_worth_factor(i, n):
38 temporary = (1 + i) ** n
39 return (temporary - 1) / (i ** 2 * temporary) - (n / (i * temporary))
42@generate_dcostring("F", "G", "uniform gradient future worth")
43def uniform_gradient_future_worth_factor(i, n):
44 return ((1 + i) ** n - 1) / (i ** 2) - (n / i)
47@generate_dcostring("A", "G", "Uniform gradient uniform series")
48def uniform_gradient_uniform_series_factor(i, n):
49 return 1 / i - (n / ((1 + i) ** n - 1))