futureValueSchedule¶
Evaluates the future value of an initial principal taking into consideration a schedule of compound interest rates.
Synopsis¶
futureValueSchedule (principal, count, schedule[])
Required Arguments¶
- float
principal
(Input) - Principal or present value.
- int
count
(Input) - Number of interest rates in
schedule
. - float
schedule[]
(Input) - Array of size
count
of interest rates to apply.
Return Value¶
The future value of an initial principal after applying a schedule of compound interest rates. If no result can be computed, NaN is returned.
Description¶
Function futureValueSchedule
computes the future value of an initial
principal after applying a schedule of compound interest rates.
It is computed using the following:
\[\sum_{i=1}^{\mathit{count}} \left(\mathit{principal} * \mathit{schedule}_i\right)\]
where \(schedule_i\) =interest rate at the i-th period.
Example¶
In this example, futureValueSchedule
computes the value of a $10,000
investment after 5 years with interest rates of 5%, 5.1%, 5.2%, 5.3% and
5.4%, respectively.
from __future__ import print_function
from numpy import *
from pyimsl.math.futureValueSchedule import futureValueSchedule
principal = 10000.00
schedule = [.05, .051, .052, .053, .054]
fvschedule = futureValueSchedule(principal, schedule)
print("After 5 years the $10,000 investment will have grown", end=' ')
print("to $%.2f." % (fvschedule))
Output¶
After 5 years the $10,000 investment will have grown to $12884.77.