@@ -64,31 +64,38 @@ def series_P ( O , i , n , forward = True ) -> float:
6464
6565def arith_grad_series ( O , i , n , forward = True ) -> float :
6666 """
67- Calculates the worth of n 'payments' of O at some other time, either worth at time of 'payment' (when forward == True, which gives O == P, Z == A);
68- else a present worth - i.e. O == A, Z == P.
67+ TODO (need to think)
6968 INPUT:
7069 O : numerical - the known variable, either G - the gradient factor if forward == True, else A - the worth of each payment at the time of payment
7170 i : numerical - the interest rate
7271 n : int - the number of periods the interest compounds
7372 forward : bool - the direction of worth to be calculated, defaults to True
7473 RETURN:
7574 Z : numerical - G( ( 1 / i ) - n / ( ( 1 + i )^n - 1 ) ), the neccessary value of A
76- else A/( ( 1 / i ) - n / ( ( 1 + i )^n - 1 ) ), the gradient value.
75+ else A/( ( 1 / i ) - n / ( ( 1 + i )^n - 1 ) ), the gradient value G .
7776 """
7877 return O * ( ( 1 / i ) - n / ( ( 1 + i ) ** n - 1 ) ) if forward else O / ( ( 1 / i ) - n / ( ( 1 + i ) ** n - 1 ) )
7978
8079
8180def arith_grad_worth ( O , i , n , forward = True ) -> float :
8281 """
83- Calculates the worth of n 'payments' of O at some other time, either worth at time of 'payment' (when forward == True, which gives O == P, Z == A);
84- else a present worth - i.e. O == A, Z == P.
82+ TODO (need to think)
8583 INPUT:
8684 O : numerical - the known variable, either G - the gradient factor if forward == True, else A - the worth of each payment at the time of payment
8785 i : numerical - the interest rate
8886 n : int - the number of periods the interest compounds
8987 forward : bool - the direction of worth to be calculated, defaults to True
9088 RETURN:
91- Z : numerical - G( ( 1 / i ) - n / ( ( 1 + i )^n - 1 ) ), the neccessary value of A
92- else A /( ( 1 / i ) - n / ( ( 1 + i )^n - 1 ) ), the gradient value.
89+ Z : numerical - G( ( ( 1 + i )^n - i * n - 1 ) / ( ( i^2 ) * ( 1 + i )^n ) ), the present worth P
90+ else P /( ( ( 1 + i )^n - i * n - 1 ) / ( ( i^2 ) * ( 1 + i )^n ) ), the gradient value G .
9391 """
94- return O * ( ( 1 / i ) - n / ( ( 1 + i ) ** n - 1 ) ) if forward else O / ( ( 1 / i ) - n / ( ( 1 + i ) ** n - 1 ) )
92+ return O * ( ( ( 1 + i ) ** n - i * n - 1 ) / ( ( i ** 2 ) * ( 1 + i ) ** n ) ) if forward else O / ( ( ( 1 + i ) ** n - i * n - 1 ) / ( ( i ** 2 ) * ( 1 + i ) ** n ) )
93+
94+
95+
96+
97+
98+
99+
100+
101+
0 commit comments